dogmaAttributes.jsonl
Schema
_key
(required): integer
Range: 2 .. 5964attributeID
(required): integer
Range: 2 .. 5964categoryID
: integer
Range: 1 .. 52chargeRechargeTimeID
: integer
Range: 55 .. 479dataType
(required): integer
Range: 0 .. 13defaultValue
(required): number
Range: -1000 .. 2147483648000description
: string-
displayName
: objectde
: stringen
(required): stringes
: stringfr
: stringja
: stringko
: stringru
: stringzh
: string
-
displayWhenZero
: boolean highIsGood
(required): booleaniconID
: integer
Range: 0 .. 25874maxAttributeID
: integer
Range: 263 .. 5732minAttributeID
: integer
Range: 2266 .. 2266name
(required): stringpublished
(required): booleanstackable
(required): boolean-
tooltipDescription
: objectde
: stringen
(required): stringes
: stringfr
: stringja
: stringko
: stringru
: stringzh
: string
-
tooltipTitle
: objectde
: stringen
(required): stringes
: stringfr
: stringja
: stringko
: stringru
: stringzh
: string
-
unitID
: integer
Range: 1 .. 205
Code snippets
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using QuickType;
//
// var dogmaAttribute = DogmaAttribute.FromJson(jsonString);
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public partial class DogmaAttribute
{
[JsonProperty("_key")]
public long Key { get; set; }
[JsonProperty("attributeID")]
public long AttributeId { get; set; }
[JsonProperty("categoryID", NullValueHandling = NullValueHandling.Ignore)]
public long? CategoryId { get; set; }
[JsonProperty("chargeRechargeTimeID", NullValueHandling = NullValueHandling.Ignore)]
public long? ChargeRechargeTimeId { get; set; }
[JsonProperty("dataType")]
public long DataType { get; set; }
[JsonProperty("defaultValue")]
[JsonConverter(typeof(MinMaxValueCheckConverter))]
public double DefaultValue { get; set; }
[JsonProperty("description", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
public string Description { get; set; }
[JsonProperty("displayName", NullValueHandling = NullValueHandling.Ignore)]
public DisplayName DisplayName { get; set; }
[JsonProperty("displayWhenZero", NullValueHandling = NullValueHandling.Ignore)]
public bool? DisplayWhenZero { get; set; }
[JsonProperty("highIsGood")]
public bool HighIsGood { get; set; }
[JsonProperty("iconID", NullValueHandling = NullValueHandling.Ignore)]
public long? IconId { get; set; }
[JsonProperty("maxAttributeID", NullValueHandling = NullValueHandling.Ignore)]
public long? MaxAttributeId { get; set; }
[JsonProperty("minAttributeID", NullValueHandling = NullValueHandling.Ignore)]
public long? MinAttributeId { get; set; }
[JsonProperty("name")]
[JsonConverter(typeof(MagentaMinMaxLengthCheckConverter))]
public string Name { get; set; }
[JsonProperty("published")]
public bool Published { get; set; }
[JsonProperty("stackable")]
public bool Stackable { get; set; }
[JsonProperty("tooltipDescription", NullValueHandling = NullValueHandling.Ignore)]
public TooltipDescription TooltipDescription { get; set; }
[JsonProperty("tooltipTitle", NullValueHandling = NullValueHandling.Ignore)]
public TooltipTitle TooltipTitle { get; set; }
[JsonProperty("unitID", NullValueHandling = NullValueHandling.Ignore)]
public long? UnitId { get; set; }
}
public partial class DisplayName
{
[JsonProperty("de", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(FluffyMinMaxLengthCheckConverter))]
public string De { get; set; }
[JsonProperty("en")]
[JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
public string En { get; set; }
[JsonProperty("es", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StickyMinMaxLengthCheckConverter))]
public string Es { get; set; }
[JsonProperty("fr", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(IndigoMinMaxLengthCheckConverter))]
public string Fr { get; set; }
[JsonProperty("ja", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(IndecentMinMaxLengthCheckConverter))]
public string Ja { get; set; }
[JsonProperty("ko", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(HilariousMinMaxLengthCheckConverter))]
public string Ko { get; set; }
[JsonProperty("ru", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(AmbitiousMinMaxLengthCheckConverter))]
public string Ru { get; set; }
[JsonProperty("zh", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(CunningMinMaxLengthCheckConverter))]
public string Zh { get; set; }
}
public partial class TooltipDescription
{
[JsonProperty("de", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(FriskyMinMaxLengthCheckConverter))]
public string De { get; set; }
[JsonProperty("en")]
[JsonConverter(typeof(MischievousMinMaxLengthCheckConverter))]
public string En { get; set; }
[JsonProperty("es", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(BraggadociousMinMaxLengthCheckConverter))]
public string Es { get; set; }
[JsonProperty("fr", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter1))]
public string Fr { get; set; }
[JsonProperty("ja", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter2))]
public string Ja { get; set; }
[JsonProperty("ko", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter3))]
public string Ko { get; set; }
[JsonProperty("ru", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter4))]
public string Ru { get; set; }
[JsonProperty("zh", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter5))]
public string Zh { get; set; }
}
public partial class TooltipTitle
{
[JsonProperty("de", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter6))]
public string De { get; set; }
[JsonProperty("en")]
[JsonConverter(typeof(MinMaxLengthCheckConverter7))]
public string En { get; set; }
[JsonProperty("es", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter8))]
public string Es { get; set; }
[JsonProperty("fr", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter9))]
public string Fr { get; set; }
[JsonProperty("ja", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter10))]
public string Ja { get; set; }
[JsonProperty("ko", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter11))]
public string Ko { get; set; }
[JsonProperty("ru", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter12))]
public string Ru { get; set; }
[JsonProperty("zh", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter13))]
public string Zh { get; set; }
}
public partial class DogmaAttribute
{
public static DogmaAttribute FromJson(string json) => JsonConvert.DeserializeObject<DogmaAttribute>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this DogmaAttribute self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
internal class MinMaxValueCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<double>(reader);
if (value >= -1000 && value <= 2147483648000)
{
return value;
}
throw new Exception("Cannot unmarshal type double");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (double)untypedValue;
if (value >= -1000 && value <= 2147483648000)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type double");
}
public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
}
internal class PurpleMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 0 && value.Length <= 304)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 0 && value.Length <= 304)
{
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 >= 5 && 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 >= 5 && value.Length <= 86)
{
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 >= 4 && value.Length <= 72)
{
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 <= 72)
{
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 >= 4 && value.Length <= 101)
{
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 <= 101)
{
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 >= 4 && value.Length <= 122)
{
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 <= 122)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly IndigoMinMaxLengthCheckConverter Singleton = new IndigoMinMaxLengthCheckConverter();
}
internal class IndecentMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 78)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 78)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly IndecentMinMaxLengthCheckConverter Singleton = new IndecentMinMaxLengthCheckConverter();
}
internal class HilariousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 39)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 39)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly HilariousMinMaxLengthCheckConverter Singleton = new HilariousMinMaxLengthCheckConverter();
}
internal class AmbitiousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 128)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 128)
{
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 >= 2 && value.Length <= 28)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 28)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly CunningMinMaxLengthCheckConverter Singleton = new CunningMinMaxLengthCheckConverter();
}
internal class MagentaMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 57)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 57)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MagentaMinMaxLengthCheckConverter Singleton = new MagentaMinMaxLengthCheckConverter();
}
internal class FriskyMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 12 && value.Length <= 457)
{
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 <= 457)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly FriskyMinMaxLengthCheckConverter Singleton = new FriskyMinMaxLengthCheckConverter();
}
internal class MischievousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 13 && value.Length <= 411)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 13 && value.Length <= 411)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MischievousMinMaxLengthCheckConverter Singleton = new MischievousMinMaxLengthCheckConverter();
}
internal class BraggadociousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 15 && value.Length <= 487)
{
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 <= 487)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly BraggadociousMinMaxLengthCheckConverter Singleton = new BraggadociousMinMaxLengthCheckConverter();
}
internal class MinMaxLengthCheckConverter1 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 20 && value.Length <= 524)
{
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 >= 20 && value.Length <= 524)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter1 Singleton = new MinMaxLengthCheckConverter1();
}
internal class MinMaxLengthCheckConverter2 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 194)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 194)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter2 Singleton = new MinMaxLengthCheckConverter2();
}
internal class MinMaxLengthCheckConverter3 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 6 && value.Length <= 188)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 6 && value.Length <= 188)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter3 Singleton = new MinMaxLengthCheckConverter3();
}
internal class MinMaxLengthCheckConverter4 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 15 && value.Length <= 478)
{
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 <= 478)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter4 Singleton = new MinMaxLengthCheckConverter4();
}
internal class MinMaxLengthCheckConverter5 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 4 && value.Length <= 126)
{
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 <= 126)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter5 Singleton = new MinMaxLengthCheckConverter5();
}
internal class MinMaxLengthCheckConverter6 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 5 && value.Length <= 109)
{
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 <= 109)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter6 Singleton = new MinMaxLengthCheckConverter6();
}
internal class MinMaxLengthCheckConverter7 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 4 && value.Length <= 94)
{
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 <= 94)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter7 Singleton = new MinMaxLengthCheckConverter7();
}
internal class MinMaxLengthCheckConverter8 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 4 && value.Length <= 119)
{
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 <= 119)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter8 Singleton = new MinMaxLengthCheckConverter8();
}
internal class MinMaxLengthCheckConverter9 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 5 && value.Length <= 127)
{
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 <= 127)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter9 Singleton = new MinMaxLengthCheckConverter9();
}
internal class MinMaxLengthCheckConverter10 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 56)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 56)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter10 Singleton = new MinMaxLengthCheckConverter10();
}
internal class MinMaxLengthCheckConverter11 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 44)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 44)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter11 Singleton = new MinMaxLengthCheckConverter11();
}
internal class MinMaxLengthCheckConverter12 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 123)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 123)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter12 Singleton = new MinMaxLengthCheckConverter12();
}
internal class MinMaxLengthCheckConverter13 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 38)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 38)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter13 Singleton = new MinMaxLengthCheckConverter13();
}
}
// 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:
//
// dogmaAttribute, err := UnmarshalDogmaAttribute(bytes)
// bytes, err = dogmaAttribute.Marshal()
package model
import "encoding/json"
func UnmarshalDogmaAttribute(data []byte) (DogmaAttribute, error) {
var r DogmaAttribute
err := json.Unmarshal(data, &r)
return r, err
}
func (r *DogmaAttribute) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type DogmaAttribute struct {
Key int64 `json:"_key"`
AttributeID int64 `json:"attributeID"`
CategoryID *int64 `json:"categoryID,omitempty"`
ChargeRechargeTimeID *int64 `json:"chargeRechargeTimeID,omitempty"`
DataType int64 `json:"dataType"`
DefaultValue float64 `json:"defaultValue"`
Description *string `json:"description,omitempty"`
DisplayName *DisplayName `json:"displayName,omitempty"`
DisplayWhenZero *bool `json:"displayWhenZero,omitempty"`
HighIsGood bool `json:"highIsGood"`
IconID *int64 `json:"iconID,omitempty"`
MaxAttributeID *int64 `json:"maxAttributeID,omitempty"`
MinAttributeID *int64 `json:"minAttributeID,omitempty"`
Name string `json:"name"`
Published bool `json:"published"`
Stackable bool `json:"stackable"`
TooltipDescription *TooltipDescription `json:"tooltipDescription,omitempty"`
TooltipTitle *TooltipTitle `json:"tooltipTitle,omitempty"`
UnitID *int64 `json:"unitID,omitempty"`
}
type DisplayName struct {
De *string `json:"de,omitempty"`
En string `json:"en"`
Es *string `json:"es,omitempty"`
Fr *string `json:"fr,omitempty"`
Ja *string `json:"ja,omitempty"`
Ko *string `json:"ko,omitempty"`
Ru *string `json:"ru,omitempty"`
Zh *string `json:"zh,omitempty"`
}
type TooltipDescription struct {
De *string `json:"de,omitempty"`
En string `json:"en"`
Es *string `json:"es,omitempty"`
Fr *string `json:"fr,omitempty"`
Ja *string `json:"ja,omitempty"`
Ko *string `json:"ko,omitempty"`
Ru *string `json:"ru,omitempty"`
Zh *string `json:"zh,omitempty"`
}
type TooltipTitle struct {
De *string `json:"de,omitempty"`
En string `json:"en"`
Es *string `json:"es,omitempty"`
Fr *string `json:"fr,omitempty"`
Ja *string `json:"ja,omitempty"`
Ko *string `json:"ko,omitempty"`
Ru *string `json:"ru,omitempty"`
Zh *string `json:"zh,omitempty"`
}
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"_key": {
"type": "integer",
"minimum": 2,
"maximum": 5964
},
"attributeID": {
"type": "integer",
"minimum": 2,
"maximum": 5964
},
"categoryID": {
"type": "integer",
"minimum": 1,
"maximum": 52
},
"chargeRechargeTimeID": {
"type": "integer",
"minimum": 55,
"maximum": 479
},
"dataType": {
"type": "integer",
"minimum": 0,
"maximum": 13
},
"defaultValue": {
"type": "number",
"minimum": -1000.0,
"maximum": 2.147483648E12
},
"description": {
"type": "string",
"minLength": 0,
"maxLength": 304
},
"displayName": {
"type": "object",
"properties": {
"de": {
"type": "string",
"minLength": 5,
"maxLength": 86
},
"en": {
"type": "string",
"minLength": 4,
"maxLength": 72
},
"es": {
"type": "string",
"minLength": 4,
"maxLength": 101
},
"fr": {
"type": "string",
"minLength": 4,
"maxLength": 122
},
"ja": {
"type": "string",
"minLength": 2,
"maxLength": 78
},
"ko": {
"type": "string",
"minLength": 2,
"maxLength": 39
},
"ru": {
"type": "string",
"minLength": 3,
"maxLength": 128
},
"zh": {
"type": "string",
"minLength": 2,
"maxLength": 28
}
},
"required": [
"en"
]
},
"displayWhenZero": {
"type": "boolean"
},
"highIsGood": {
"type": "boolean"
},
"iconID": {
"type": "integer",
"minimum": 0,
"maximum": 25874
},
"maxAttributeID": {
"type": "integer",
"minimum": 263,
"maximum": 5732
},
"minAttributeID": {
"type": "integer",
"minimum": 2266,
"maximum": 2266
},
"name": {
"type": "string",
"minLength": 2,
"maxLength": 57
},
"published": {
"type": "boolean"
},
"stackable": {
"type": "boolean"
},
"tooltipDescription": {
"type": "object",
"properties": {
"de": {
"type": "string",
"minLength": 12,
"maxLength": 457
},
"en": {
"type": "string",
"minLength": 13,
"maxLength": 411
},
"es": {
"type": "string",
"minLength": 15,
"maxLength": 487
},
"fr": {
"type": "string",
"minLength": 20,
"maxLength": 524
},
"ja": {
"type": "string",
"minLength": 3,
"maxLength": 194
},
"ko": {
"type": "string",
"minLength": 6,
"maxLength": 188
},
"ru": {
"type": "string",
"minLength": 15,
"maxLength": 478
},
"zh": {
"type": "string",
"minLength": 4,
"maxLength": 126
}
},
"required": [
"en"
]
},
"tooltipTitle": {
"type": "object",
"properties": {
"de": {
"type": "string",
"minLength": 5,
"maxLength": 109
},
"en": {
"type": "string",
"minLength": 4,
"maxLength": 94
},
"es": {
"type": "string",
"minLength": 4,
"maxLength": 119
},
"fr": {
"type": "string",
"minLength": 5,
"maxLength": 127
},
"ja": {
"type": "string",
"minLength": 2,
"maxLength": 56
},
"ko": {
"type": "string",
"minLength": 2,
"maxLength": 44
},
"ru": {
"type": "string",
"minLength": 3,
"maxLength": 123
},
"zh": {
"type": "string",
"minLength": 2,
"maxLength": 38
}
},
"required": [
"en"
]
},
"unitID": {
"type": "integer",
"minimum": 1,
"maximum": 205
}
},
"required": [
"_key",
"attributeID",
"dataType",
"defaultValue",
"highIsGood",
"name",
"published",
"stackable"
]
}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json = Json { allowStructuredMapKeys = true }
// val dogmaAttribute = json.parse(DogmaAttribute.serializer(), jsonString)
package model
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
@Serializable
data class DogmaAttribute (
@SerialName("_key")
val key: Long,
@SerialName("attributeID")
val attributeId: Long,
@SerialName("categoryID")
val categoryId: Long? = null,
@SerialName("chargeRechargeTimeID")
val chargeRechargeTimeId: Long? = null,
val dataType: Long,
val defaultValue: Double,
val description: String? = null,
val displayName: DisplayName? = null,
val displayWhenZero: Boolean? = null,
val highIsGood: Boolean,
@SerialName("iconID")
val iconId: Long? = null,
@SerialName("maxAttributeID")
val maxAttributeId: Long? = null,
@SerialName("minAttributeID")
val minAttributeId: Long? = null,
val name: String,
val published: Boolean,
val stackable: Boolean,
val tooltipDescription: TooltipDescription? = null,
val tooltipTitle: TooltipTitle? = null,
@SerialName("unitID")
val unitId: Long? = null
)
@Serializable
data class DisplayName (
val de: String? = null,
val en: String,
val es: String? = null,
val fr: String? = null,
val ja: String? = null,
val ko: String? = null,
val ru: String? = null,
val zh: String? = null
)
@Serializable
data class TooltipDescription (
val de: String? = null,
val en: String,
val es: String? = null,
val fr: String? = null,
val ja: String? = null,
val ko: String? = null,
val ru: String? = null,
val zh: String? = null
)
@Serializable
data class TooltipTitle (
val de: String? = null,
val en: String,
val es: String? = null,
val fr: String? = null,
val ja: String? = null,
val ko: String? = null,
val ru: String? = null,
val zh: String? = null
)
<?php
// This is a autogenerated file:DogmaAttribute
class DogmaAttribute {
private int $key; // json:_key Required
private int $attributeId; // json:attributeID Required
private ?int $categoryId; // json:categoryID Optional
private ?int $chargeRechargeTimeId; // json:chargeRechargeTimeID Optional
private int $dataType; // json:dataType Required
private float $defaultValue; // json:defaultValue Required
private ?string $description; // json:description Optional
private ?DisplayName $displayName; // json:displayName Optional
private ?bool $displayWhenZero; // json:displayWhenZero Optional
private bool $highIsGood; // json:highIsGood Required
private ?int $iconId; // json:iconID Optional
private ?int $maxAttributeId; // json:maxAttributeID Optional
private ?int $minAttributeId; // json:minAttributeID Optional
private string $name; // json:name Required
private bool $published; // json:published Required
private bool $stackable; // json:stackable Required
private ?TooltipDescription $tooltipDescription; // json:tooltipDescription Optional
private ?TooltipTitle $tooltipTitle; // json:tooltipTitle Optional
private ?int $unitId; // json:unitID Optional
/**
* @param int $key
* @param int $attributeId
* @param int|null $categoryId
* @param int|null $chargeRechargeTimeId
* @param int $dataType
* @param float $defaultValue
* @param string|null $description
* @param DisplayName|null $displayName
* @param bool|null $displayWhenZero
* @param bool $highIsGood
* @param int|null $iconId
* @param int|null $maxAttributeId
* @param int|null $minAttributeId
* @param string $name
* @param bool $published
* @param bool $stackable
* @param TooltipDescription|null $tooltipDescription
* @param TooltipTitle|null $tooltipTitle
* @param int|null $unitId
*/
public function __construct(int $key, int $attributeId, ?int $categoryId, ?int $chargeRechargeTimeId, int $dataType, float $defaultValue, ?string $description, ?DisplayName $displayName, ?bool $displayWhenZero, bool $highIsGood, ?int $iconId, ?int $maxAttributeId, ?int $minAttributeId, string $name, bool $published, bool $stackable, ?TooltipDescription $tooltipDescription, ?TooltipTitle $tooltipTitle, ?int $unitId) {
$this->key = $key;
$this->attributeId = $attributeId;
$this->categoryId = $categoryId;
$this->chargeRechargeTimeId = $chargeRechargeTimeId;
$this->dataType = $dataType;
$this->defaultValue = $defaultValue;
$this->description = $description;
$this->displayName = $displayName;
$this->displayWhenZero = $displayWhenZero;
$this->highIsGood = $highIsGood;
$this->iconId = $iconId;
$this->maxAttributeId = $maxAttributeId;
$this->minAttributeId = $minAttributeId;
$this->name = $name;
$this->published = $published;
$this->stackable = $stackable;
$this->tooltipDescription = $tooltipDescription;
$this->tooltipTitle = $tooltipTitle;
$this->unitId = $unitId;
}
/**
* @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 (DogmaAttribute::validateKey($this->key)) {
return $this->key; /*int*/
}
throw new Exception('never get to this DogmaAttribute::key');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateKey(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::key");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getKey(): int {
if (DogmaAttribute::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey DogmaAttribute::key');
}
/**
* @return int
*/
public static function sampleKey(): int {
return 31; /*31:key*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toAttributeId(): int {
if (DogmaAttribute::validateAttributeId($this->attributeId)) {
return $this->attributeId; /*int*/
}
throw new Exception('never get to this DogmaAttribute::attributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::attributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getAttributeId(): int {
if (DogmaAttribute::validateAttributeId($this->attributeId)) {
return $this->attributeId;
}
throw new Exception('never get to getAttributeId DogmaAttribute::attributeId');
}
/**
* @return int
*/
public static function sampleAttributeId(): int {
return 32; /*32:attributeId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromCategoryId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toCategoryId(): ?int {
if (DogmaAttribute::validateCategoryId($this->categoryId)) {
if (!is_null($this->categoryId)) {
return $this->categoryId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::categoryId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateCategoryId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::categoryId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getCategoryId(): ?int {
if (DogmaAttribute::validateCategoryId($this->categoryId)) {
return $this->categoryId;
}
throw new Exception('never get to getCategoryId DogmaAttribute::categoryId');
}
/**
* @return ?int
*/
public static function sampleCategoryId(): ?int {
return 33; /*33:categoryId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromChargeRechargeTimeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toChargeRechargeTimeId(): ?int {
if (DogmaAttribute::validateChargeRechargeTimeId($this->chargeRechargeTimeId)) {
if (!is_null($this->chargeRechargeTimeId)) {
return $this->chargeRechargeTimeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::chargeRechargeTimeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateChargeRechargeTimeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::chargeRechargeTimeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getChargeRechargeTimeId(): ?int {
if (DogmaAttribute::validateChargeRechargeTimeId($this->chargeRechargeTimeId)) {
return $this->chargeRechargeTimeId;
}
throw new Exception('never get to getChargeRechargeTimeId DogmaAttribute::chargeRechargeTimeId');
}
/**
* @return ?int
*/
public static function sampleChargeRechargeTimeId(): ?int {
return 34; /*34:chargeRechargeTimeId*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDataType(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDataType(): int {
if (DogmaAttribute::validateDataType($this->dataType)) {
return $this->dataType; /*int*/
}
throw new Exception('never get to this DogmaAttribute::dataType');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDataType(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::dataType");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDataType(): int {
if (DogmaAttribute::validateDataType($this->dataType)) {
return $this->dataType;
}
throw new Exception('never get to getDataType DogmaAttribute::dataType');
}
/**
* @return int
*/
public static function sampleDataType(): int {
return 35; /*35:dataType*/
}
/**
* @param float $value
* @throws Exception
* @return float
*/
public static function fromDefaultValue(float $value): float {
return $value; /*float*/
}
/**
* @throws Exception
* @return float
*/
public function toDefaultValue(): float {
if (DogmaAttribute::validateDefaultValue($this->defaultValue)) {
return $this->defaultValue; /*float*/
}
throw new Exception('never get to this DogmaAttribute::defaultValue');
}
/**
* @param float
* @return bool
* @throws Exception
*/
public static function validateDefaultValue(float $value): bool {
if (!is_float($value)) {
throw new Exception("Attribute Error:DogmaAttribute::defaultValue");
}
return true;
}
/**
* @throws Exception
* @return float
*/
public function getDefaultValue(): float {
if (DogmaAttribute::validateDefaultValue($this->defaultValue)) {
return $this->defaultValue;
}
throw new Exception('never get to getDefaultValue DogmaAttribute::defaultValue');
}
/**
* @return float
*/
public static function sampleDefaultValue(): float {
return 36.036; /*36:defaultValue*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromDescription(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toDescription(): ?string {
if (DogmaAttribute::validateDescription($this->description)) {
if (!is_null($this->description)) {
return $this->description; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::description');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateDescription(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DogmaAttribute::description");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDescription(): ?string {
if (DogmaAttribute::validateDescription($this->description)) {
return $this->description;
}
throw new Exception('never get to getDescription DogmaAttribute::description');
}
/**
* @return ?string
*/
public static function sampleDescription(): ?string {
return 'DogmaAttribute::description::37'; /*37:description*/
}
/**
* @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 (DogmaAttribute::validateDisplayName($this->displayName)) {
if (!is_null($this->displayName)) {
return $this->displayName->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::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 (DogmaAttribute::validateDisplayName($this->displayName)) {
return $this->displayName;
}
throw new Exception('never get to getDisplayName DogmaAttribute::displayName');
}
/**
* @return ?DisplayName
*/
public static function sampleDisplayName(): ?DisplayName {
return DisplayName::sample(); /*38:displayName*/
}
/**
* @param ?bool $value
* @throws Exception
* @return ?bool
*/
public static function fromDisplayWhenZero(?bool $value): ?bool {
if (!is_null($value)) {
return $value; /*bool*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?bool
*/
public function toDisplayWhenZero(): ?bool {
if (DogmaAttribute::validateDisplayWhenZero($this->displayWhenZero)) {
if (!is_null($this->displayWhenZero)) {
return $this->displayWhenZero; /*bool*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::displayWhenZero');
}
/**
* @param bool|null
* @return bool
* @throws Exception
*/
public static function validateDisplayWhenZero(?bool $value): bool {
if (!is_null($value)) {
if (!is_bool($value)) {
throw new Exception("Attribute Error:DogmaAttribute::displayWhenZero");
}
}
return true;
}
/**
* @throws Exception
* @return ?bool
*/
public function getDisplayWhenZero(): ?bool {
if (DogmaAttribute::validateDisplayWhenZero($this->displayWhenZero)) {
return $this->displayWhenZero;
}
throw new Exception('never get to getDisplayWhenZero DogmaAttribute::displayWhenZero');
}
/**
* @return ?bool
*/
public static function sampleDisplayWhenZero(): ?bool {
return true; /*39:displayWhenZero*/
}
/**
* @param bool $value
* @throws Exception
* @return bool
*/
public static function fromHighIsGood(bool $value): bool {
return $value; /*bool*/
}
/**
* @throws Exception
* @return bool
*/
public function toHighIsGood(): bool {
if (DogmaAttribute::validateHighIsGood($this->highIsGood)) {
return $this->highIsGood; /*bool*/
}
throw new Exception('never get to this DogmaAttribute::highIsGood');
}
/**
* @param bool
* @return bool
* @throws Exception
*/
public static function validateHighIsGood(bool $value): bool {
if (!is_bool($value)) {
throw new Exception("Attribute Error:DogmaAttribute::highIsGood");
}
return true;
}
/**
* @throws Exception
* @return bool
*/
public function getHighIsGood(): bool {
if (DogmaAttribute::validateHighIsGood($this->highIsGood)) {
return $this->highIsGood;
}
throw new Exception('never get to getHighIsGood DogmaAttribute::highIsGood');
}
/**
* @return bool
*/
public static function sampleHighIsGood(): bool {
return true; /*40:highIsGood*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromIconId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toIconId(): ?int {
if (DogmaAttribute::validateIconId($this->iconId)) {
if (!is_null($this->iconId)) {
return $this->iconId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::iconId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateIconId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::iconId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getIconId(): ?int {
if (DogmaAttribute::validateIconId($this->iconId)) {
return $this->iconId;
}
throw new Exception('never get to getIconId DogmaAttribute::iconId');
}
/**
* @return ?int
*/
public static function sampleIconId(): ?int {
return 41; /*41:iconId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromMaxAttributeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toMaxAttributeId(): ?int {
if (DogmaAttribute::validateMaxAttributeId($this->maxAttributeId)) {
if (!is_null($this->maxAttributeId)) {
return $this->maxAttributeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::maxAttributeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateMaxAttributeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::maxAttributeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getMaxAttributeId(): ?int {
if (DogmaAttribute::validateMaxAttributeId($this->maxAttributeId)) {
return $this->maxAttributeId;
}
throw new Exception('never get to getMaxAttributeId DogmaAttribute::maxAttributeId');
}
/**
* @return ?int
*/
public static function sampleMaxAttributeId(): ?int {
return 42; /*42:maxAttributeId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromMinAttributeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toMinAttributeId(): ?int {
if (DogmaAttribute::validateMinAttributeId($this->minAttributeId)) {
if (!is_null($this->minAttributeId)) {
return $this->minAttributeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::minAttributeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateMinAttributeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::minAttributeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getMinAttributeId(): ?int {
if (DogmaAttribute::validateMinAttributeId($this->minAttributeId)) {
return $this->minAttributeId;
}
throw new Exception('never get to getMinAttributeId DogmaAttribute::minAttributeId');
}
/**
* @return ?int
*/
public static function sampleMinAttributeId(): ?int {
return 43; /*43:minAttributeId*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromName(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toName(): string {
if (DogmaAttribute::validateName($this->name)) {
return $this->name; /*string*/
}
throw new Exception('never get to this DogmaAttribute::name');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateName(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:DogmaAttribute::name");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getName(): string {
if (DogmaAttribute::validateName($this->name)) {
return $this->name;
}
throw new Exception('never get to getName DogmaAttribute::name');
}
/**
* @return string
*/
public static function sampleName(): string {
return 'DogmaAttribute::name::44'; /*44:name*/
}
/**
* @param bool $value
* @throws Exception
* @return bool
*/
public static function fromPublished(bool $value): bool {
return $value; /*bool*/
}
/**
* @throws Exception
* @return bool
*/
public function toPublished(): bool {
if (DogmaAttribute::validatePublished($this->published)) {
return $this->published; /*bool*/
}
throw new Exception('never get to this DogmaAttribute::published');
}
/**
* @param bool
* @return bool
* @throws Exception
*/
public static function validatePublished(bool $value): bool {
if (!is_bool($value)) {
throw new Exception("Attribute Error:DogmaAttribute::published");
}
return true;
}
/**
* @throws Exception
* @return bool
*/
public function getPublished(): bool {
if (DogmaAttribute::validatePublished($this->published)) {
return $this->published;
}
throw new Exception('never get to getPublished DogmaAttribute::published');
}
/**
* @return bool
*/
public static function samplePublished(): bool {
return true; /*45:published*/
}
/**
* @param bool $value
* @throws Exception
* @return bool
*/
public static function fromStackable(bool $value): bool {
return $value; /*bool*/
}
/**
* @throws Exception
* @return bool
*/
public function toStackable(): bool {
if (DogmaAttribute::validateStackable($this->stackable)) {
return $this->stackable; /*bool*/
}
throw new Exception('never get to this DogmaAttribute::stackable');
}
/**
* @param bool
* @return bool
* @throws Exception
*/
public static function validateStackable(bool $value): bool {
if (!is_bool($value)) {
throw new Exception("Attribute Error:DogmaAttribute::stackable");
}
return true;
}
/**
* @throws Exception
* @return bool
*/
public function getStackable(): bool {
if (DogmaAttribute::validateStackable($this->stackable)) {
return $this->stackable;
}
throw new Exception('never get to getStackable DogmaAttribute::stackable');
}
/**
* @return bool
*/
public static function sampleStackable(): bool {
return true; /*46:stackable*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?TooltipDescription
*/
public static function fromTooltipDescription(?stdClass $value): ?TooltipDescription {
if (!is_null($value)) {
return TooltipDescription::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toTooltipDescription(): ?stdClass {
if (DogmaAttribute::validateTooltipDescription($this->tooltipDescription)) {
if (!is_null($this->tooltipDescription)) {
return $this->tooltipDescription->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::tooltipDescription');
}
/**
* @param TooltipDescription|null
* @return bool
* @throws Exception
*/
public static function validateTooltipDescription(?TooltipDescription $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?TooltipDescription
*/
public function getTooltipDescription(): ?TooltipDescription {
if (DogmaAttribute::validateTooltipDescription($this->tooltipDescription)) {
return $this->tooltipDescription;
}
throw new Exception('never get to getTooltipDescription DogmaAttribute::tooltipDescription');
}
/**
* @return ?TooltipDescription
*/
public static function sampleTooltipDescription(): ?TooltipDescription {
return TooltipDescription::sample(); /*47:tooltipDescription*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?TooltipTitle
*/
public static function fromTooltipTitle(?stdClass $value): ?TooltipTitle {
if (!is_null($value)) {
return TooltipTitle::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toTooltipTitle(): ?stdClass {
if (DogmaAttribute::validateTooltipTitle($this->tooltipTitle)) {
if (!is_null($this->tooltipTitle)) {
return $this->tooltipTitle->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::tooltipTitle');
}
/**
* @param TooltipTitle|null
* @return bool
* @throws Exception
*/
public static function validateTooltipTitle(?TooltipTitle $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?TooltipTitle
*/
public function getTooltipTitle(): ?TooltipTitle {
if (DogmaAttribute::validateTooltipTitle($this->tooltipTitle)) {
return $this->tooltipTitle;
}
throw new Exception('never get to getTooltipTitle DogmaAttribute::tooltipTitle');
}
/**
* @return ?TooltipTitle
*/
public static function sampleTooltipTitle(): ?TooltipTitle {
return TooltipTitle::sample(); /*48:tooltipTitle*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromUnitId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toUnitId(): ?int {
if (DogmaAttribute::validateUnitId($this->unitId)) {
if (!is_null($this->unitId)) {
return $this->unitId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this DogmaAttribute::unitId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateUnitId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:DogmaAttribute::unitId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getUnitId(): ?int {
if (DogmaAttribute::validateUnitId($this->unitId)) {
return $this->unitId;
}
throw new Exception('never get to getUnitId DogmaAttribute::unitId');
}
/**
* @return ?int
*/
public static function sampleUnitId(): ?int {
return 49; /*49:unitId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return DogmaAttribute::validateKey($this->key)
|| DogmaAttribute::validateAttributeId($this->attributeId)
|| DogmaAttribute::validateCategoryId($this->categoryId)
|| DogmaAttribute::validateChargeRechargeTimeId($this->chargeRechargeTimeId)
|| DogmaAttribute::validateDataType($this->dataType)
|| DogmaAttribute::validateDefaultValue($this->defaultValue)
|| DogmaAttribute::validateDescription($this->description)
|| DogmaAttribute::validateDisplayName($this->displayName)
|| DogmaAttribute::validateDisplayWhenZero($this->displayWhenZero)
|| DogmaAttribute::validateHighIsGood($this->highIsGood)
|| DogmaAttribute::validateIconId($this->iconId)
|| DogmaAttribute::validateMaxAttributeId($this->maxAttributeId)
|| DogmaAttribute::validateMinAttributeId($this->minAttributeId)
|| DogmaAttribute::validateName($this->name)
|| DogmaAttribute::validatePublished($this->published)
|| DogmaAttribute::validateStackable($this->stackable)
|| DogmaAttribute::validateTooltipDescription($this->tooltipDescription)
|| DogmaAttribute::validateTooltipTitle($this->tooltipTitle)
|| DogmaAttribute::validateUnitId($this->unitId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'attributeID'} = $this->toAttributeId();
$out->{'categoryID'} = $this->toCategoryId();
$out->{'chargeRechargeTimeID'} = $this->toChargeRechargeTimeId();
$out->{'dataType'} = $this->toDataType();
$out->{'defaultValue'} = $this->toDefaultValue();
$out->{'description'} = $this->toDescription();
$out->{'displayName'} = $this->toDisplayName();
$out->{'displayWhenZero'} = $this->toDisplayWhenZero();
$out->{'highIsGood'} = $this->toHighIsGood();
$out->{'iconID'} = $this->toIconId();
$out->{'maxAttributeID'} = $this->toMaxAttributeId();
$out->{'minAttributeID'} = $this->toMinAttributeId();
$out->{'name'} = $this->toName();
$out->{'published'} = $this->toPublished();
$out->{'stackable'} = $this->toStackable();
$out->{'tooltipDescription'} = $this->toTooltipDescription();
$out->{'tooltipTitle'} = $this->toTooltipTitle();
$out->{'unitID'} = $this->toUnitId();
return $out;
}
/**
* @param stdClass $obj
* @return DogmaAttribute
* @throws Exception
*/
public static function from(stdClass $obj): DogmaAttribute {
return new DogmaAttribute(
DogmaAttribute::fromKey($obj->{'_key'})
,DogmaAttribute::fromAttributeId($obj->{'attributeID'})
,DogmaAttribute::fromCategoryId($obj->{'categoryID'})
,DogmaAttribute::fromChargeRechargeTimeId($obj->{'chargeRechargeTimeID'})
,DogmaAttribute::fromDataType($obj->{'dataType'})
,DogmaAttribute::fromDefaultValue($obj->{'defaultValue'})
,DogmaAttribute::fromDescription($obj->{'description'})
,DogmaAttribute::fromDisplayName($obj->{'displayName'})
,DogmaAttribute::fromDisplayWhenZero($obj->{'displayWhenZero'})
,DogmaAttribute::fromHighIsGood($obj->{'highIsGood'})
,DogmaAttribute::fromIconId($obj->{'iconID'})
,DogmaAttribute::fromMaxAttributeId($obj->{'maxAttributeID'})
,DogmaAttribute::fromMinAttributeId($obj->{'minAttributeID'})
,DogmaAttribute::fromName($obj->{'name'})
,DogmaAttribute::fromPublished($obj->{'published'})
,DogmaAttribute::fromStackable($obj->{'stackable'})
,DogmaAttribute::fromTooltipDescription($obj->{'tooltipDescription'})
,DogmaAttribute::fromTooltipTitle($obj->{'tooltipTitle'})
,DogmaAttribute::fromUnitId($obj->{'unitID'})
);
}
/**
* @return DogmaAttribute
*/
public static function sample(): DogmaAttribute {
return new DogmaAttribute(
DogmaAttribute::sampleKey()
,DogmaAttribute::sampleAttributeId()
,DogmaAttribute::sampleCategoryId()
,DogmaAttribute::sampleChargeRechargeTimeId()
,DogmaAttribute::sampleDataType()
,DogmaAttribute::sampleDefaultValue()
,DogmaAttribute::sampleDescription()
,DogmaAttribute::sampleDisplayName()
,DogmaAttribute::sampleDisplayWhenZero()
,DogmaAttribute::sampleHighIsGood()
,DogmaAttribute::sampleIconId()
,DogmaAttribute::sampleMaxAttributeId()
,DogmaAttribute::sampleMinAttributeId()
,DogmaAttribute::sampleName()
,DogmaAttribute::samplePublished()
,DogmaAttribute::sampleStackable()
,DogmaAttribute::sampleTooltipDescription()
,DogmaAttribute::sampleTooltipTitle()
,DogmaAttribute::sampleUnitId()
);
}
}
// This is a autogenerated file:DisplayName
class DisplayName {
private ?string $de; // json:de Optional
private string $en; // json:en Required
private ?string $es; // json:es Optional
private ?string $fr; // json:fr Optional
private ?string $ja; // json:ja Optional
private ?string $ko; // json:ko Optional
private ?string $ru; // json:ru Optional
private ?string $zh; // json:zh Optional
/**
* @param string|null $de
* @param string $en
* @param string|null $es
* @param string|null $fr
* @param string|null $ja
* @param string|null $ko
* @param string|null $ru
* @param string|null $zh
*/
public function __construct(?string $de, string $en, ?string $es, ?string $fr, ?string $ja, ?string $ko, ?string $ru, ?string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromDe(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toDe(): ?string {
if (DisplayName::validateDe($this->de)) {
if (!is_null($this->de)) {
return $this->de; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::de');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateDe(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::de");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDe(): ?string {
if (DisplayName::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe DisplayName::de');
}
/**
* @return ?string
*/
public static function sampleDe(): ?string {
return 'DisplayName::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (DisplayName::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this DisplayName::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (DisplayName::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn DisplayName::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'DisplayName::en::32'; /*32:en*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromEs(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toEs(): ?string {
if (DisplayName::validateEs($this->es)) {
if (!is_null($this->es)) {
return $this->es; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::es');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateEs(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::es");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getEs(): ?string {
if (DisplayName::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs DisplayName::es');
}
/**
* @return ?string
*/
public static function sampleEs(): ?string {
return 'DisplayName::es::33'; /*33:es*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromFr(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toFr(): ?string {
if (DisplayName::validateFr($this->fr)) {
if (!is_null($this->fr)) {
return $this->fr; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::fr');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateFr(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::fr");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getFr(): ?string {
if (DisplayName::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr DisplayName::fr');
}
/**
* @return ?string
*/
public static function sampleFr(): ?string {
return 'DisplayName::fr::34'; /*34:fr*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromJa(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toJa(): ?string {
if (DisplayName::validateJa($this->ja)) {
if (!is_null($this->ja)) {
return $this->ja; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::ja');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateJa(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::ja");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getJa(): ?string {
if (DisplayName::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa DisplayName::ja');
}
/**
* @return ?string
*/
public static function sampleJa(): ?string {
return 'DisplayName::ja::35'; /*35:ja*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromKo(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toKo(): ?string {
if (DisplayName::validateKo($this->ko)) {
if (!is_null($this->ko)) {
return $this->ko; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::ko');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateKo(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::ko");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getKo(): ?string {
if (DisplayName::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo DisplayName::ko');
}
/**
* @return ?string
*/
public static function sampleKo(): ?string {
return 'DisplayName::ko::36'; /*36:ko*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromRu(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toRu(): ?string {
if (DisplayName::validateRu($this->ru)) {
if (!is_null($this->ru)) {
return $this->ru; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::ru');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateRu(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::ru");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getRu(): ?string {
if (DisplayName::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu DisplayName::ru');
}
/**
* @return ?string
*/
public static function sampleRu(): ?string {
return 'DisplayName::ru::37'; /*37:ru*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromZh(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toZh(): ?string {
if (DisplayName::validateZh($this->zh)) {
if (!is_null($this->zh)) {
return $this->zh; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this DisplayName::zh');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateZh(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:DisplayName::zh");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getZh(): ?string {
if (DisplayName::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh DisplayName::zh');
}
/**
* @return ?string
*/
public static function sampleZh(): ?string {
return 'DisplayName::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return DisplayName::validateDe($this->de)
|| DisplayName::validateEn($this->en)
|| DisplayName::validateEs($this->es)
|| DisplayName::validateFr($this->fr)
|| DisplayName::validateJa($this->ja)
|| DisplayName::validateKo($this->ko)
|| DisplayName::validateRu($this->ru)
|| DisplayName::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return DisplayName
* @throws Exception
*/
public static function from(stdClass $obj): DisplayName {
return new DisplayName(
DisplayName::fromDe($obj->{'de'})
,DisplayName::fromEn($obj->{'en'})
,DisplayName::fromEs($obj->{'es'})
,DisplayName::fromFr($obj->{'fr'})
,DisplayName::fromJa($obj->{'ja'})
,DisplayName::fromKo($obj->{'ko'})
,DisplayName::fromRu($obj->{'ru'})
,DisplayName::fromZh($obj->{'zh'})
);
}
/**
* @return DisplayName
*/
public static function sample(): DisplayName {
return new DisplayName(
DisplayName::sampleDe()
,DisplayName::sampleEn()
,DisplayName::sampleEs()
,DisplayName::sampleFr()
,DisplayName::sampleJa()
,DisplayName::sampleKo()
,DisplayName::sampleRu()
,DisplayName::sampleZh()
);
}
}
// This is a autogenerated file:TooltipDescription
class TooltipDescription {
private ?string $de; // json:de Optional
private string $en; // json:en Required
private ?string $es; // json:es Optional
private ?string $fr; // json:fr Optional
private ?string $ja; // json:ja Optional
private ?string $ko; // json:ko Optional
private ?string $ru; // json:ru Optional
private ?string $zh; // json:zh Optional
/**
* @param string|null $de
* @param string $en
* @param string|null $es
* @param string|null $fr
* @param string|null $ja
* @param string|null $ko
* @param string|null $ru
* @param string|null $zh
*/
public function __construct(?string $de, string $en, ?string $es, ?string $fr, ?string $ja, ?string $ko, ?string $ru, ?string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromDe(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toDe(): ?string {
if (TooltipDescription::validateDe($this->de)) {
if (!is_null($this->de)) {
return $this->de; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::de');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateDe(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::de");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDe(): ?string {
if (TooltipDescription::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe TooltipDescription::de');
}
/**
* @return ?string
*/
public static function sampleDe(): ?string {
return 'TooltipDescription::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 (TooltipDescription::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this TooltipDescription::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (TooltipDescription::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn TooltipDescription::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'TooltipDescription::en::32'; /*32:en*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromEs(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toEs(): ?string {
if (TooltipDescription::validateEs($this->es)) {
if (!is_null($this->es)) {
return $this->es; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::es');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateEs(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::es");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getEs(): ?string {
if (TooltipDescription::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs TooltipDescription::es');
}
/**
* @return ?string
*/
public static function sampleEs(): ?string {
return 'TooltipDescription::es::33'; /*33:es*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromFr(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toFr(): ?string {
if (TooltipDescription::validateFr($this->fr)) {
if (!is_null($this->fr)) {
return $this->fr; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::fr');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateFr(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::fr");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getFr(): ?string {
if (TooltipDescription::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr TooltipDescription::fr');
}
/**
* @return ?string
*/
public static function sampleFr(): ?string {
return 'TooltipDescription::fr::34'; /*34:fr*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromJa(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toJa(): ?string {
if (TooltipDescription::validateJa($this->ja)) {
if (!is_null($this->ja)) {
return $this->ja; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::ja');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateJa(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::ja");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getJa(): ?string {
if (TooltipDescription::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa TooltipDescription::ja');
}
/**
* @return ?string
*/
public static function sampleJa(): ?string {
return 'TooltipDescription::ja::35'; /*35:ja*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromKo(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toKo(): ?string {
if (TooltipDescription::validateKo($this->ko)) {
if (!is_null($this->ko)) {
return $this->ko; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::ko');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateKo(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::ko");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getKo(): ?string {
if (TooltipDescription::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo TooltipDescription::ko');
}
/**
* @return ?string
*/
public static function sampleKo(): ?string {
return 'TooltipDescription::ko::36'; /*36:ko*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromRu(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toRu(): ?string {
if (TooltipDescription::validateRu($this->ru)) {
if (!is_null($this->ru)) {
return $this->ru; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::ru');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateRu(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::ru");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getRu(): ?string {
if (TooltipDescription::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu TooltipDescription::ru');
}
/**
* @return ?string
*/
public static function sampleRu(): ?string {
return 'TooltipDescription::ru::37'; /*37:ru*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromZh(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toZh(): ?string {
if (TooltipDescription::validateZh($this->zh)) {
if (!is_null($this->zh)) {
return $this->zh; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipDescription::zh');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateZh(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipDescription::zh");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getZh(): ?string {
if (TooltipDescription::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh TooltipDescription::zh');
}
/**
* @return ?string
*/
public static function sampleZh(): ?string {
return 'TooltipDescription::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return TooltipDescription::validateDe($this->de)
|| TooltipDescription::validateEn($this->en)
|| TooltipDescription::validateEs($this->es)
|| TooltipDescription::validateFr($this->fr)
|| TooltipDescription::validateJa($this->ja)
|| TooltipDescription::validateKo($this->ko)
|| TooltipDescription::validateRu($this->ru)
|| TooltipDescription::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 TooltipDescription
* @throws Exception
*/
public static function from(stdClass $obj): TooltipDescription {
return new TooltipDescription(
TooltipDescription::fromDe($obj->{'de'})
,TooltipDescription::fromEn($obj->{'en'})
,TooltipDescription::fromEs($obj->{'es'})
,TooltipDescription::fromFr($obj->{'fr'})
,TooltipDescription::fromJa($obj->{'ja'})
,TooltipDescription::fromKo($obj->{'ko'})
,TooltipDescription::fromRu($obj->{'ru'})
,TooltipDescription::fromZh($obj->{'zh'})
);
}
/**
* @return TooltipDescription
*/
public static function sample(): TooltipDescription {
return new TooltipDescription(
TooltipDescription::sampleDe()
,TooltipDescription::sampleEn()
,TooltipDescription::sampleEs()
,TooltipDescription::sampleFr()
,TooltipDescription::sampleJa()
,TooltipDescription::sampleKo()
,TooltipDescription::sampleRu()
,TooltipDescription::sampleZh()
);
}
}
// This is a autogenerated file:TooltipTitle
class TooltipTitle {
private ?string $de; // json:de Optional
private string $en; // json:en Required
private ?string $es; // json:es Optional
private ?string $fr; // json:fr Optional
private ?string $ja; // json:ja Optional
private ?string $ko; // json:ko Optional
private ?string $ru; // json:ru Optional
private ?string $zh; // json:zh Optional
/**
* @param string|null $de
* @param string $en
* @param string|null $es
* @param string|null $fr
* @param string|null $ja
* @param string|null $ko
* @param string|null $ru
* @param string|null $zh
*/
public function __construct(?string $de, string $en, ?string $es, ?string $fr, ?string $ja, ?string $ko, ?string $ru, ?string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromDe(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toDe(): ?string {
if (TooltipTitle::validateDe($this->de)) {
if (!is_null($this->de)) {
return $this->de; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::de');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateDe(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::de");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDe(): ?string {
if (TooltipTitle::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe TooltipTitle::de');
}
/**
* @return ?string
*/
public static function sampleDe(): ?string {
return 'TooltipTitle::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 (TooltipTitle::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this TooltipTitle::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (TooltipTitle::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn TooltipTitle::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'TooltipTitle::en::32'; /*32:en*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromEs(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toEs(): ?string {
if (TooltipTitle::validateEs($this->es)) {
if (!is_null($this->es)) {
return $this->es; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::es');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateEs(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::es");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getEs(): ?string {
if (TooltipTitle::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs TooltipTitle::es');
}
/**
* @return ?string
*/
public static function sampleEs(): ?string {
return 'TooltipTitle::es::33'; /*33:es*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromFr(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toFr(): ?string {
if (TooltipTitle::validateFr($this->fr)) {
if (!is_null($this->fr)) {
return $this->fr; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::fr');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateFr(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::fr");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getFr(): ?string {
if (TooltipTitle::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr TooltipTitle::fr');
}
/**
* @return ?string
*/
public static function sampleFr(): ?string {
return 'TooltipTitle::fr::34'; /*34:fr*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromJa(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toJa(): ?string {
if (TooltipTitle::validateJa($this->ja)) {
if (!is_null($this->ja)) {
return $this->ja; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::ja');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateJa(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::ja");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getJa(): ?string {
if (TooltipTitle::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa TooltipTitle::ja');
}
/**
* @return ?string
*/
public static function sampleJa(): ?string {
return 'TooltipTitle::ja::35'; /*35:ja*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromKo(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toKo(): ?string {
if (TooltipTitle::validateKo($this->ko)) {
if (!is_null($this->ko)) {
return $this->ko; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::ko');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateKo(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::ko");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getKo(): ?string {
if (TooltipTitle::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo TooltipTitle::ko');
}
/**
* @return ?string
*/
public static function sampleKo(): ?string {
return 'TooltipTitle::ko::36'; /*36:ko*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromRu(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toRu(): ?string {
if (TooltipTitle::validateRu($this->ru)) {
if (!is_null($this->ru)) {
return $this->ru; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::ru');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateRu(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::ru");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getRu(): ?string {
if (TooltipTitle::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu TooltipTitle::ru');
}
/**
* @return ?string
*/
public static function sampleRu(): ?string {
return 'TooltipTitle::ru::37'; /*37:ru*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromZh(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toZh(): ?string {
if (TooltipTitle::validateZh($this->zh)) {
if (!is_null($this->zh)) {
return $this->zh; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this TooltipTitle::zh');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateZh(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:TooltipTitle::zh");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getZh(): ?string {
if (TooltipTitle::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh TooltipTitle::zh');
}
/**
* @return ?string
*/
public static function sampleZh(): ?string {
return 'TooltipTitle::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return TooltipTitle::validateDe($this->de)
|| TooltipTitle::validateEn($this->en)
|| TooltipTitle::validateEs($this->es)
|| TooltipTitle::validateFr($this->fr)
|| TooltipTitle::validateJa($this->ja)
|| TooltipTitle::validateKo($this->ko)
|| TooltipTitle::validateRu($this->ru)
|| TooltipTitle::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 TooltipTitle
* @throws Exception
*/
public static function from(stdClass $obj): TooltipTitle {
return new TooltipTitle(
TooltipTitle::fromDe($obj->{'de'})
,TooltipTitle::fromEn($obj->{'en'})
,TooltipTitle::fromEs($obj->{'es'})
,TooltipTitle::fromFr($obj->{'fr'})
,TooltipTitle::fromJa($obj->{'ja'})
,TooltipTitle::fromKo($obj->{'ko'})
,TooltipTitle::fromRu($obj->{'ru'})
,TooltipTitle::fromZh($obj->{'zh'})
);
}
/**
* @return TooltipTitle
*/
public static function sample(): TooltipTitle {
return new TooltipTitle(
TooltipTitle::sampleDe()
,TooltipTitle::sampleEn()
,TooltipTitle::sampleEs()
,TooltipTitle::sampleFr()
,TooltipTitle::sampleJa()
,TooltipTitle::sampleKo()
,TooltipTitle::sampleRu()
,TooltipTitle::sampleZh()
);
}
}
from typing import Optional, Any, TypeVar, Type, cast
T = TypeVar("T")
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def from_none(x: Any) -> Any:
assert x is None
return x
def from_union(fs, x):
for f in fs:
try:
return f(x)
except:
pass
assert False
def from_int(x: Any) -> int:
assert isinstance(x, int) and not isinstance(x, bool)
return x
def from_float(x: Any) -> float:
assert isinstance(x, (float, int)) and not isinstance(x, bool)
return float(x)
def from_bool(x: Any) -> bool:
assert isinstance(x, bool)
return x
def to_float(x: Any) -> float:
assert isinstance(x, (int, float))
return x
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
class DisplayName:
de: Optional[str]
en: str
es: Optional[str]
fr: Optional[str]
ja: Optional[str]
ko: Optional[str]
ru: Optional[str]
zh: Optional[str]
def __init__(self, de: Optional[str], en: str, es: Optional[str], fr: Optional[str], ja: Optional[str], ko: Optional[str], ru: Optional[str], zh: Optional[str]) -> None:
self.de = de
self.en = en
self.es = es
self.fr = fr
self.ja = ja
self.ko = ko
self.ru = ru
self.zh = zh
@staticmethod
def from_dict(obj: Any) -> 'DisplayName':
assert isinstance(obj, dict)
de = from_union([from_str, from_none], obj.get("de"))
en = from_str(obj.get("en"))
es = from_union([from_str, from_none], obj.get("es"))
fr = from_union([from_str, from_none], obj.get("fr"))
ja = from_union([from_str, from_none], obj.get("ja"))
ko = from_union([from_str, from_none], obj.get("ko"))
ru = from_union([from_str, from_none], obj.get("ru"))
zh = from_union([from_str, from_none], obj.get("zh"))
return DisplayName(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
if self.de is not None:
result["de"] = from_union([from_str, from_none], self.de)
result["en"] = from_str(self.en)
if self.es is not None:
result["es"] = from_union([from_str, from_none], self.es)
if self.fr is not None:
result["fr"] = from_union([from_str, from_none], self.fr)
if self.ja is not None:
result["ja"] = from_union([from_str, from_none], self.ja)
if self.ko is not None:
result["ko"] = from_union([from_str, from_none], self.ko)
if self.ru is not None:
result["ru"] = from_union([from_str, from_none], self.ru)
if self.zh is not None:
result["zh"] = from_union([from_str, from_none], self.zh)
return result
class TooltipDescription:
de: Optional[str]
en: str
es: Optional[str]
fr: Optional[str]
ja: Optional[str]
ko: Optional[str]
ru: Optional[str]
zh: Optional[str]
def __init__(self, de: Optional[str], en: str, es: Optional[str], fr: Optional[str], ja: Optional[str], ko: Optional[str], ru: Optional[str], zh: Optional[str]) -> None:
self.de = de
self.en = en
self.es = es
self.fr = fr
self.ja = ja
self.ko = ko
self.ru = ru
self.zh = zh
@staticmethod
def from_dict(obj: Any) -> 'TooltipDescription':
assert isinstance(obj, dict)
de = from_union([from_str, from_none], obj.get("de"))
en = from_str(obj.get("en"))
es = from_union([from_str, from_none], obj.get("es"))
fr = from_union([from_str, from_none], obj.get("fr"))
ja = from_union([from_str, from_none], obj.get("ja"))
ko = from_union([from_str, from_none], obj.get("ko"))
ru = from_union([from_str, from_none], obj.get("ru"))
zh = from_union([from_str, from_none], obj.get("zh"))
return TooltipDescription(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
if self.de is not None:
result["de"] = from_union([from_str, from_none], self.de)
result["en"] = from_str(self.en)
if self.es is not None:
result["es"] = from_union([from_str, from_none], self.es)
if self.fr is not None:
result["fr"] = from_union([from_str, from_none], self.fr)
if self.ja is not None:
result["ja"] = from_union([from_str, from_none], self.ja)
if self.ko is not None:
result["ko"] = from_union([from_str, from_none], self.ko)
if self.ru is not None:
result["ru"] = from_union([from_str, from_none], self.ru)
if self.zh is not None:
result["zh"] = from_union([from_str, from_none], self.zh)
return result
class TooltipTitle:
de: Optional[str]
en: str
es: Optional[str]
fr: Optional[str]
ja: Optional[str]
ko: Optional[str]
ru: Optional[str]
zh: Optional[str]
def __init__(self, de: Optional[str], en: str, es: Optional[str], fr: Optional[str], ja: Optional[str], ko: Optional[str], ru: Optional[str], zh: Optional[str]) -> None:
self.de = de
self.en = en
self.es = es
self.fr = fr
self.ja = ja
self.ko = ko
self.ru = ru
self.zh = zh
@staticmethod
def from_dict(obj: Any) -> 'TooltipTitle':
assert isinstance(obj, dict)
de = from_union([from_str, from_none], obj.get("de"))
en = from_str(obj.get("en"))
es = from_union([from_str, from_none], obj.get("es"))
fr = from_union([from_str, from_none], obj.get("fr"))
ja = from_union([from_str, from_none], obj.get("ja"))
ko = from_union([from_str, from_none], obj.get("ko"))
ru = from_union([from_str, from_none], obj.get("ru"))
zh = from_union([from_str, from_none], obj.get("zh"))
return TooltipTitle(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
if self.de is not None:
result["de"] = from_union([from_str, from_none], self.de)
result["en"] = from_str(self.en)
if self.es is not None:
result["es"] = from_union([from_str, from_none], self.es)
if self.fr is not None:
result["fr"] = from_union([from_str, from_none], self.fr)
if self.ja is not None:
result["ja"] = from_union([from_str, from_none], self.ja)
if self.ko is not None:
result["ko"] = from_union([from_str, from_none], self.ko)
if self.ru is not None:
result["ru"] = from_union([from_str, from_none], self.ru)
if self.zh is not None:
result["zh"] = from_union([from_str, from_none], self.zh)
return result
class DogmaAttribute:
key: int
attribute_id: int
category_id: Optional[int]
charge_recharge_time_id: Optional[int]
data_type: int
default_value: float
description: Optional[str]
display_name: Optional[DisplayName]
display_when_zero: Optional[bool]
high_is_good: bool
icon_id: Optional[int]
max_attribute_id: Optional[int]
min_attribute_id: Optional[int]
name: str
published: bool
stackable: bool
tooltip_description: Optional[TooltipDescription]
tooltip_title: Optional[TooltipTitle]
unit_id: Optional[int]
def __init__(self, key: int, attribute_id: int, category_id: Optional[int], charge_recharge_time_id: Optional[int], data_type: int, default_value: float, description: Optional[str], display_name: Optional[DisplayName], display_when_zero: Optional[bool], high_is_good: bool, icon_id: Optional[int], max_attribute_id: Optional[int], min_attribute_id: Optional[int], name: str, published: bool, stackable: bool, tooltip_description: Optional[TooltipDescription], tooltip_title: Optional[TooltipTitle], unit_id: Optional[int]) -> None:
self.key = key
self.attribute_id = attribute_id
self.category_id = category_id
self.charge_recharge_time_id = charge_recharge_time_id
self.data_type = data_type
self.default_value = default_value
self.description = description
self.display_name = display_name
self.display_when_zero = display_when_zero
self.high_is_good = high_is_good
self.icon_id = icon_id
self.max_attribute_id = max_attribute_id
self.min_attribute_id = min_attribute_id
self.name = name
self.published = published
self.stackable = stackable
self.tooltip_description = tooltip_description
self.tooltip_title = tooltip_title
self.unit_id = unit_id
@staticmethod
def from_dict(obj: Any) -> 'DogmaAttribute':
assert isinstance(obj, dict)
key = from_int(obj.get("_key"))
attribute_id = from_int(obj.get("attributeID"))
category_id = from_union([from_int, from_none], obj.get("categoryID"))
charge_recharge_time_id = from_union([from_int, from_none], obj.get("chargeRechargeTimeID"))
data_type = from_int(obj.get("dataType"))
default_value = from_float(obj.get("defaultValue"))
description = from_union([from_str, from_none], obj.get("description"))
display_name = from_union([DisplayName.from_dict, from_none], obj.get("displayName"))
display_when_zero = from_union([from_bool, from_none], obj.get("displayWhenZero"))
high_is_good = from_bool(obj.get("highIsGood"))
icon_id = from_union([from_int, from_none], obj.get("iconID"))
max_attribute_id = from_union([from_int, from_none], obj.get("maxAttributeID"))
min_attribute_id = from_union([from_int, from_none], obj.get("minAttributeID"))
name = from_str(obj.get("name"))
published = from_bool(obj.get("published"))
stackable = from_bool(obj.get("stackable"))
tooltip_description = from_union([TooltipDescription.from_dict, from_none], obj.get("tooltipDescription"))
tooltip_title = from_union([TooltipTitle.from_dict, from_none], obj.get("tooltipTitle"))
unit_id = from_union([from_int, from_none], obj.get("unitID"))
return DogmaAttribute(key, attribute_id, category_id, charge_recharge_time_id, data_type, default_value, description, display_name, display_when_zero, high_is_good, icon_id, max_attribute_id, min_attribute_id, name, published, stackable, tooltip_description, tooltip_title, unit_id)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_int(self.key)
result["attributeID"] = from_int(self.attribute_id)
if self.category_id is not None:
result["categoryID"] = from_union([from_int, from_none], self.category_id)
if self.charge_recharge_time_id is not None:
result["chargeRechargeTimeID"] = from_union([from_int, from_none], self.charge_recharge_time_id)
result["dataType"] = from_int(self.data_type)
result["defaultValue"] = to_float(self.default_value)
if self.description is not None:
result["description"] = from_union([from_str, from_none], self.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.display_when_zero is not None:
result["displayWhenZero"] = from_union([from_bool, from_none], self.display_when_zero)
result["highIsGood"] = from_bool(self.high_is_good)
if self.icon_id is not None:
result["iconID"] = from_union([from_int, from_none], self.icon_id)
if self.max_attribute_id is not None:
result["maxAttributeID"] = from_union([from_int, from_none], self.max_attribute_id)
if self.min_attribute_id is not None:
result["minAttributeID"] = from_union([from_int, from_none], self.min_attribute_id)
result["name"] = from_str(self.name)
result["published"] = from_bool(self.published)
result["stackable"] = from_bool(self.stackable)
if self.tooltip_description is not None:
result["tooltipDescription"] = from_union([lambda x: to_class(TooltipDescription, x), from_none], self.tooltip_description)
if self.tooltip_title is not None:
result["tooltipTitle"] = from_union([lambda x: to_class(TooltipTitle, x), from_none], self.tooltip_title)
if self.unit_id is not None:
result["unitID"] = from_union([from_int, from_none], self.unit_id)
return result
def dogma_attribute_from_dict(s: Any) -> DogmaAttribute:
return DogmaAttribute.from_dict(s)
def dogma_attribute_to_dict(x: DogmaAttribute) -> Any:
return to_class(DogmaAttribute, x)
// To parse this data:
//
// import { Convert, DogmaAttribute } from "./file";
//
// const dogmaAttribute = Convert.toDogmaAttribute(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
export interface DogmaAttribute {
_key: number;
attributeID: number;
categoryID?: number;
chargeRechargeTimeID?: number;
dataType: number;
defaultValue: number;
description?: string;
displayName?: DisplayName;
displayWhenZero?: boolean;
highIsGood: boolean;
iconID?: number;
maxAttributeID?: number;
minAttributeID?: number;
name: string;
published: boolean;
stackable: boolean;
tooltipDescription?: TooltipDescription;
tooltipTitle?: TooltipTitle;
unitID?: number;
[property: string]: any;
}
export interface DisplayName {
de?: string;
en: string;
es?: string;
fr?: string;
ja?: string;
ko?: string;
ru?: string;
zh?: string;
[property: string]: any;
}
export interface TooltipDescription {
de?: string;
en: string;
es?: string;
fr?: string;
ja?: string;
ko?: string;
ru?: string;
zh?: string;
[property: string]: any;
}
export interface TooltipTitle {
de?: string;
en: string;
es?: string;
fr?: string;
ja?: string;
ko?: string;
ru?: string;
zh?: string;
[property: string]: any;
}
// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
public static toDogmaAttribute(json: string): DogmaAttribute {
return cast(JSON.parse(json), r("DogmaAttribute"));
}
public static dogmaAttributeToJson(value: DogmaAttribute): string {
return JSON.stringify(uncast(value, r("DogmaAttribute")), 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 = {
"DogmaAttribute": o([
{ json: "_key", js: "_key", typ: 0 },
{ json: "attributeID", js: "attributeID", typ: 0 },
{ json: "categoryID", js: "categoryID", typ: u(undefined, 0) },
{ json: "chargeRechargeTimeID", js: "chargeRechargeTimeID", typ: u(undefined, 0) },
{ json: "dataType", js: "dataType", typ: 0 },
{ json: "defaultValue", js: "defaultValue", typ: 3.14 },
{ json: "description", js: "description", typ: u(undefined, "") },
{ json: "displayName", js: "displayName", typ: u(undefined, r("DisplayName")) },
{ json: "displayWhenZero", js: "displayWhenZero", typ: u(undefined, true) },
{ json: "highIsGood", js: "highIsGood", typ: true },
{ json: "iconID", js: "iconID", typ: u(undefined, 0) },
{ json: "maxAttributeID", js: "maxAttributeID", typ: u(undefined, 0) },
{ json: "minAttributeID", js: "minAttributeID", typ: u(undefined, 0) },
{ json: "name", js: "name", typ: "" },
{ json: "published", js: "published", typ: true },
{ json: "stackable", js: "stackable", typ: true },
{ json: "tooltipDescription", js: "tooltipDescription", typ: u(undefined, r("TooltipDescription")) },
{ json: "tooltipTitle", js: "tooltipTitle", typ: u(undefined, r("TooltipTitle")) },
{ json: "unitID", js: "unitID", typ: u(undefined, 0) },
], "any"),
"DisplayName": o([
{ json: "de", js: "de", typ: u(undefined, "") },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: u(undefined, "") },
{ json: "fr", js: "fr", typ: u(undefined, "") },
{ json: "ja", js: "ja", typ: u(undefined, "") },
{ json: "ko", js: "ko", typ: u(undefined, "") },
{ json: "ru", js: "ru", typ: u(undefined, "") },
{ json: "zh", js: "zh", typ: u(undefined, "") },
], "any"),
"TooltipDescription": o([
{ json: "de", js: "de", typ: u(undefined, "") },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: u(undefined, "") },
{ json: "fr", js: "fr", typ: u(undefined, "") },
{ json: "ja", js: "ja", typ: u(undefined, "") },
{ json: "ko", js: "ko", typ: u(undefined, "") },
{ json: "ru", js: "ru", typ: u(undefined, "") },
{ json: "zh", js: "zh", typ: u(undefined, "") },
], "any"),
"TooltipTitle": o([
{ json: "de", js: "de", typ: u(undefined, "") },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: u(undefined, "") },
{ json: "fr", js: "fr", typ: u(undefined, "") },
{ json: "ja", js: "ja", typ: u(undefined, "") },
{ json: "ko", js: "ko", typ: u(undefined, "") },
{ json: "ru", js: "ru", typ: u(undefined, "") },
{ json: "zh", js: "zh", typ: u(undefined, "") },
], "any"),
};