skinrComponents.jsonl
Schema
_key(required): integer
Range: 53 .. 2055-
associatedTypeIds(required): array of objectlicenseUsesGranted(required): integer
Range: -1 .. 1typeID(required): integer
Range: 82340 .. 95418
-
category(required): integer
Range: 1 .. 3 finish(required): enum
Enum values:Matte,Satin,GlossiconFile(required): string-
name(required): objectde: stringen(required): stringes: stringfr: stringja: stringko: stringru: stringzh: string
-
projectionTypeU(required): enum
Enum values:Clamp,Repeat,Border projectionTypeV(required): enum
Enum values:Clamp,Border,Repeatpublished(required): booleanrarity(required): integer
Range: 1 .. 6resourceFile(required): stringsequenceBinder(required): objectcount(required): integer
Range: 1 .. 7500itemTypeID(required): integer
Range: 81348 .. 81350
Code snippets
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using QuickType;
//
// var skinrComponent = SkinrComponent.FromJson(jsonString);
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public partial class SkinrComponent
{
[JsonProperty("_key")]
public long Key { get; set; }
[JsonProperty("associatedTypeIds")]
public AssociatedTypeId[] AssociatedTypeIds { get; set; }
[JsonProperty("category")]
public long Category { get; set; }
[JsonProperty("finish")]
public Finish Finish { get; set; }
[JsonProperty("iconFile")]
[JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
public string IconFile { get; set; }
[JsonProperty("name")]
public Name Name { get; set; }
[JsonProperty("projectionTypeU")]
public ProjectionType ProjectionTypeU { get; set; }
[JsonProperty("projectionTypeV")]
public ProjectionType ProjectionTypeV { get; set; }
[JsonProperty("published")]
public bool Published { get; set; }
[JsonProperty("rarity")]
public long Rarity { get; set; }
[JsonProperty("resourceFile")]
[JsonConverter(typeof(MagentaMinMaxLengthCheckConverter))]
public string ResourceFile { get; set; }
[JsonProperty("sequenceBinder")]
public SequenceBinder SequenceBinder { get; set; }
}
public partial class AssociatedTypeId
{
[JsonProperty("licenseUsesGranted")]
public long LicenseUsesGranted { get; set; }
[JsonProperty("typeID")]
public long TypeId { get; set; }
}
public partial class Name
{
[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 SequenceBinder
{
[JsonProperty("count")]
public long Count { get; set; }
[JsonProperty("itemTypeID")]
public long ItemTypeId { get; set; }
}
public enum Finish { Gloss, Matte, Satin };
public enum ProjectionType { Border, Clamp, Repeat };
public partial class SkinrComponent
{
public static SkinrComponent FromJson(string json) => JsonConvert.DeserializeObject<SkinrComponent>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this SkinrComponent 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 =
{
FinishConverter.Singleton,
ProjectionTypeConverter.Singleton,
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
internal class FinishConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(Finish) || t == typeof(Finish?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "Gloss":
return Finish.Gloss;
case "Matte":
return Finish.Matte;
case "Satin":
return Finish.Satin;
}
throw new Exception("Cannot unmarshal type Finish");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Finish)untypedValue;
switch (value)
{
case Finish.Gloss:
serializer.Serialize(writer, "Gloss");
return;
case Finish.Matte:
serializer.Serialize(writer, "Matte");
return;
case Finish.Satin:
serializer.Serialize(writer, "Satin");
return;
}
throw new Exception("Cannot marshal type Finish");
}
public static readonly FinishConverter Singleton = new FinishConverter();
}
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 >= 66 && value.Length <= 95)
{
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 >= 66 && value.Length <= 95)
{
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 >= 7 && value.Length <= 33)
{
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 >= 7 && value.Length <= 33)
{
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 >= 7 && value.Length <= 29)
{
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 >= 7 && value.Length <= 29)
{
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 <= 36)
{
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 <= 36)
{
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 >= 5 && value.Length <= 34)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 5 && value.Length <= 34)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly 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 >= 3 && value.Length <= 22)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 22)
{
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 <= 15)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 15)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly 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 >= 7 && value.Length <= 32)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 7 && value.Length <= 32)
{
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 <= 11)
{
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 <= 11)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly CunningMinMaxLengthCheckConverter Singleton = new CunningMinMaxLengthCheckConverter();
}
internal class ProjectionTypeConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(ProjectionType) || t == typeof(ProjectionType?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "Border":
return ProjectionType.Border;
case "Clamp":
return ProjectionType.Clamp;
case "Repeat":
return ProjectionType.Repeat;
}
throw new Exception("Cannot unmarshal type ProjectionType");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (ProjectionType)untypedValue;
switch (value)
{
case ProjectionType.Border:
serializer.Serialize(writer, "Border");
return;
case ProjectionType.Clamp:
serializer.Serialize(writer, "Clamp");
return;
case ProjectionType.Repeat:
serializer.Serialize(writer, "Repeat");
return;
}
throw new Exception("Cannot marshal type ProjectionType");
}
public static readonly ProjectionTypeConverter Singleton = new ProjectionTypeConverter();
}
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 >= 43 && value.Length <= 90)
{
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 >= 43 && value.Length <= 90)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MagentaMinMaxLengthCheckConverter Singleton = new MagentaMinMaxLengthCheckConverter();
}
}
// 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:
//
// skinrComponent, err := UnmarshalSkinrComponent(bytes)
// bytes, err = skinrComponent.Marshal()
package model
import "encoding/json"
func UnmarshalSkinrComponent(data []byte) (SkinrComponent, error) {
var r SkinrComponent
err := json.Unmarshal(data, &r)
return r, err
}
func (r *SkinrComponent) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type SkinrComponent struct {
Key int64 `json:"_key"`
AssociatedTypeIDS []AssociatedTypeID `json:"associatedTypeIds"`
Category int64 `json:"category"`
Finish Finish `json:"finish"`
IconFile string `json:"iconFile"`
Name Name `json:"name"`
ProjectionTypeU ProjectionType `json:"projectionTypeU"`
ProjectionTypeV ProjectionType `json:"projectionTypeV"`
Published bool `json:"published"`
Rarity int64 `json:"rarity"`
ResourceFile string `json:"resourceFile"`
SequenceBinder SequenceBinder `json:"sequenceBinder"`
}
type AssociatedTypeID struct {
LicenseUsesGranted int64 `json:"licenseUsesGranted"`
TypeID int64 `json:"typeID"`
}
type Name 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 SequenceBinder struct {
Count int64 `json:"count"`
ItemTypeID int64 `json:"itemTypeID"`
}
type Finish string
const (
Gloss Finish = "Gloss"
Matte Finish = "Matte"
Satin Finish = "Satin"
)
type ProjectionType string
const (
Border ProjectionType = "Border"
Clamp ProjectionType = "Clamp"
Repeat ProjectionType = "Repeat"
)
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":53,"maximum":2055},"associatedTypeIds":{"type":"array","items":{"type":"object","properties":{"licenseUsesGranted":{"type":"integer","minimum":-1,"maximum":1},"typeID":{"type":"integer","minimum":82340,"maximum":95418}},"required":["licenseUsesGranted","typeID"]},"minItems":1,"maxItems":2},"category":{"type":"integer","minimum":1,"maximum":3},"finish":{"type":"string","enum":["Matte","Satin","Gloss"]},"iconFile":{"type":"string","minLength":66,"maxLength":95},"name":{"type":"object","properties":{"de":{"type":"string","minLength":7,"maxLength":33},"en":{"type":"string","minLength":7,"maxLength":29},"es":{"type":"string","minLength":4,"maxLength":36},"fr":{"type":"string","minLength":5,"maxLength":34},"ja":{"type":"string","minLength":3,"maxLength":22},"ko":{"type":"string","minLength":2,"maxLength":15},"ru":{"type":"string","minLength":7,"maxLength":32},"zh":{"type":"string","minLength":2,"maxLength":11}},"required":["en"]},"projectionTypeU":{"type":"string","enum":["Clamp","Repeat","Border"]},"projectionTypeV":{"type":"string","enum":["Clamp","Border","Repeat"]},"published":{"type":"boolean"},"rarity":{"type":"integer","minimum":1,"maximum":6},"resourceFile":{"type":"string","minLength":43,"maxLength":90},"sequenceBinder":{"type":"object","properties":{"count":{"type":"integer","minimum":1,"maximum":7500},"itemTypeID":{"type":"integer","minimum":81348,"maximum":81350}},"required":["count","itemTypeID"]}},"required":["_key","associatedTypeIds","category","finish","iconFile","name","projectionTypeU","projectionTypeV","published","rarity","resourceFile","sequenceBinder"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json = Json { allowStructuredMapKeys = true }
// val skinrComponent = json.parse(SkinrComponent.serializer(), jsonString)
package model
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
@Serializable
data class SkinrComponent (
@SerialName("_key")
val key: Long,
val associatedTypeIds: List<AssociatedTypeId>,
val category: Long,
val finish: Finish,
val iconFile: String,
val name: Name,
val projectionTypeU: ProjectionType,
val projectionTypeV: ProjectionType,
val published: Boolean,
val rarity: Long,
val resourceFile: String,
val sequenceBinder: SequenceBinder
)
@Serializable
data class AssociatedTypeId (
val licenseUsesGranted: Long,
@SerialName("typeID")
val typeId: Long
)
@Serializable
enum class Finish(val value: String) {
@SerialName("Gloss") Gloss("Gloss"),
@SerialName("Matte") Matte("Matte"),
@SerialName("Satin") Satin("Satin");
}
@Serializable
data class Name (
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
enum class ProjectionType(val value: String) {
@SerialName("Border") Border("Border"),
@SerialName("Clamp") Clamp("Clamp"),
@SerialName("Repeat") Repeat("Repeat");
}
@Serializable
data class SequenceBinder (
val count: Long,
@SerialName("itemTypeID")
val itemTypeId: Long
)
<?php
// This is a autogenerated file:SkinrComponent
class SkinrComponent {
private int $key; // json:_key Required
private array $associatedTypeIds; // json:associatedTypeIds Required
private int $category; // json:category Required
private Finish $finish; // json:finish Required
private string $iconFile; // json:iconFile Required
private Name $name; // json:name Required
private ProjectionType $projectionTypeU; // json:projectionTypeU Required
private ProjectionType $projectionTypeV; // json:projectionTypeV Required
private bool $published; // json:published Required
private int $rarity; // json:rarity Required
private string $resourceFile; // json:resourceFile Required
private SequenceBinder $sequenceBinder; // json:sequenceBinder Required
/**
* @param int $key
* @param array $associatedTypeIds
* @param int $category
* @param Finish $finish
* @param string $iconFile
* @param Name $name
* @param ProjectionType $projectionTypeU
* @param ProjectionType $projectionTypeV
* @param bool $published
* @param int $rarity
* @param string $resourceFile
* @param SequenceBinder $sequenceBinder
*/
public function __construct(int $key, array $associatedTypeIds, int $category, Finish $finish, string $iconFile, Name $name, ProjectionType $projectionTypeU, ProjectionType $projectionTypeV, bool $published, int $rarity, string $resourceFile, SequenceBinder $sequenceBinder) {
$this->key = $key;
$this->associatedTypeIds = $associatedTypeIds;
$this->category = $category;
$this->finish = $finish;
$this->iconFile = $iconFile;
$this->name = $name;
$this->projectionTypeU = $projectionTypeU;
$this->projectionTypeV = $projectionTypeV;
$this->published = $published;
$this->rarity = $rarity;
$this->resourceFile = $resourceFile;
$this->sequenceBinder = $sequenceBinder;
}
/**
* @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 (SkinrComponent::validateKey($this->key)) {
return $this->key; /*int*/
}
throw new Exception('never get to this SkinrComponent::key');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateKey(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:SkinrComponent::key");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getKey(): int {
if (SkinrComponent::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey SkinrComponent::key');
}
/**
* @return int
*/
public static function sampleKey(): int {
return 31; /*31:key*/
}
/**
* @param array $value
* @throws Exception
* @return array
*/
public static function fromAssociatedTypeIds(array $value): array {
return array_map(function ($value) {
return AssociatedTypeId::from($value); /*class*/
}, $value);
}
/**
* @throws Exception
* @return array
*/
public function toAssociatedTypeIds(): array {
if (SkinrComponent::validateAssociatedTypeIds($this->associatedTypeIds)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->associatedTypeIds);
}
throw new Exception('never get to this SkinrComponent::associatedTypeIds');
}
/**
* @param array
* @return bool
* @throws Exception
*/
public static function validateAssociatedTypeIds(array $value): bool {
if (!is_array($value)) {
throw new Exception("Attribute Error:SkinrComponent::associatedTypeIds");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
return true;
}
/**
* @throws Exception
* @return array
*/
public function getAssociatedTypeIds(): array {
if (SkinrComponent::validateAssociatedTypeIds($this->associatedTypeIds)) {
return $this->associatedTypeIds;
}
throw new Exception('never get to getAssociatedTypeIds SkinrComponent::associatedTypeIds');
}
/**
* @return array
*/
public static function sampleAssociatedTypeIds(): array {
return array(
AssociatedTypeId::sample() /*32:*/
); /* 32:associatedTypeIds*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromCategory(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toCategory(): int {
if (SkinrComponent::validateCategory($this->category)) {
return $this->category; /*int*/
}
throw new Exception('never get to this SkinrComponent::category');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateCategory(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:SkinrComponent::category");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getCategory(): int {
if (SkinrComponent::validateCategory($this->category)) {
return $this->category;
}
throw new Exception('never get to getCategory SkinrComponent::category');
}
/**
* @return int
*/
public static function sampleCategory(): int {
return 33; /*33:category*/
}
/**
* @param string $value
* @throws Exception
* @return Finish
*/
public static function fromFinish(string $value): Finish {
return Finish::from($value); /*enum*/
}
/**
* @throws Exception
* @return string
*/
public function toFinish(): string {
if (SkinrComponent::validateFinish($this->finish)) {
return Finish::to($this->finish); /*enum*/
}
throw new Exception('never get to this SkinrComponent::finish');
}
/**
* @param Finish
* @return bool
* @throws Exception
*/
public static function validateFinish(Finish $value): bool {
Finish::to($value);
return true;
}
/**
* @throws Exception
* @return Finish
*/
public function getFinish(): Finish {
if (SkinrComponent::validateFinish($this->finish)) {
return $this->finish;
}
throw new Exception('never get to getFinish SkinrComponent::finish');
}
/**
* @return Finish
*/
public static function sampleFinish(): Finish {
return Finish::sample(); /*enum*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromIconFile(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toIconFile(): string {
if (SkinrComponent::validateIconFile($this->iconFile)) {
return $this->iconFile; /*string*/
}
throw new Exception('never get to this SkinrComponent::iconFile');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateIconFile(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:SkinrComponent::iconFile");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getIconFile(): string {
if (SkinrComponent::validateIconFile($this->iconFile)) {
return $this->iconFile;
}
throw new Exception('never get to getIconFile SkinrComponent::iconFile');
}
/**
* @return string
*/
public static function sampleIconFile(): string {
return 'SkinrComponent::iconFile::35'; /*35:iconFile*/
}
/**
* @param stdClass $value
* @throws Exception
* @return Name
*/
public static function fromName(stdClass $value): Name {
return Name::from($value); /*class*/
}
/**
* @throws Exception
* @return stdClass
*/
public function toName(): stdClass {
if (SkinrComponent::validateName($this->name)) {
return $this->name->to(); /*class*/
}
throw new Exception('never get to this SkinrComponent::name');
}
/**
* @param Name
* @return bool
* @throws Exception
*/
public static function validateName(Name $value): bool {
$value->validate();
return true;
}
/**
* @throws Exception
* @return Name
*/
public function getName(): Name {
if (SkinrComponent::validateName($this->name)) {
return $this->name;
}
throw new Exception('never get to getName SkinrComponent::name');
}
/**
* @return Name
*/
public static function sampleName(): Name {
return Name::sample(); /*36:name*/
}
/**
* @param string $value
* @throws Exception
* @return ProjectionType
*/
public static function fromProjectionTypeU(string $value): ProjectionType {
return ProjectionType::from($value); /*enum*/
}
/**
* @throws Exception
* @return string
*/
public function toProjectionTypeU(): string {
if (SkinrComponent::validateProjectionTypeU($this->projectionTypeU)) {
return ProjectionType::to($this->projectionTypeU); /*enum*/
}
throw new Exception('never get to this SkinrComponent::projectionTypeU');
}
/**
* @param ProjectionType
* @return bool
* @throws Exception
*/
public static function validateProjectionTypeU(ProjectionType $value): bool {
ProjectionType::to($value);
return true;
}
/**
* @throws Exception
* @return ProjectionType
*/
public function getProjectionTypeU(): ProjectionType {
if (SkinrComponent::validateProjectionTypeU($this->projectionTypeU)) {
return $this->projectionTypeU;
}
throw new Exception('never get to getProjectionTypeU SkinrComponent::projectionTypeU');
}
/**
* @return ProjectionType
*/
public static function sampleProjectionTypeU(): ProjectionType {
return ProjectionType::sample(); /*enum*/
}
/**
* @param string $value
* @throws Exception
* @return ProjectionType
*/
public static function fromProjectionTypeV(string $value): ProjectionType {
return ProjectionType::from($value); /*enum*/
}
/**
* @throws Exception
* @return string
*/
public function toProjectionTypeV(): string {
if (SkinrComponent::validateProjectionTypeV($this->projectionTypeV)) {
return ProjectionType::to($this->projectionTypeV); /*enum*/
}
throw new Exception('never get to this SkinrComponent::projectionTypeV');
}
/**
* @param ProjectionType
* @return bool
* @throws Exception
*/
public static function validateProjectionTypeV(ProjectionType $value): bool {
ProjectionType::to($value);
return true;
}
/**
* @throws Exception
* @return ProjectionType
*/
public function getProjectionTypeV(): ProjectionType {
if (SkinrComponent::validateProjectionTypeV($this->projectionTypeV)) {
return $this->projectionTypeV;
}
throw new Exception('never get to getProjectionTypeV SkinrComponent::projectionTypeV');
}
/**
* @return ProjectionType
*/
public static function sampleProjectionTypeV(): ProjectionType {
return ProjectionType::sample(); /*enum*/
}
/**
* @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 (SkinrComponent::validatePublished($this->published)) {
return $this->published; /*bool*/
}
throw new Exception('never get to this SkinrComponent::published');
}
/**
* @param bool
* @return bool
* @throws Exception
*/
public static function validatePublished(bool $value): bool {
if (!is_bool($value)) {
throw new Exception("Attribute Error:SkinrComponent::published");
}
return true;
}
/**
* @throws Exception
* @return bool
*/
public function getPublished(): bool {
if (SkinrComponent::validatePublished($this->published)) {
return $this->published;
}
throw new Exception('never get to getPublished SkinrComponent::published');
}
/**
* @return bool
*/
public static function samplePublished(): bool {
return true; /*39:published*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromRarity(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toRarity(): int {
if (SkinrComponent::validateRarity($this->rarity)) {
return $this->rarity; /*int*/
}
throw new Exception('never get to this SkinrComponent::rarity');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateRarity(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:SkinrComponent::rarity");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getRarity(): int {
if (SkinrComponent::validateRarity($this->rarity)) {
return $this->rarity;
}
throw new Exception('never get to getRarity SkinrComponent::rarity');
}
/**
* @return int
*/
public static function sampleRarity(): int {
return 40; /*40:rarity*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromResourceFile(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toResourceFile(): string {
if (SkinrComponent::validateResourceFile($this->resourceFile)) {
return $this->resourceFile; /*string*/
}
throw new Exception('never get to this SkinrComponent::resourceFile');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateResourceFile(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:SkinrComponent::resourceFile");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getResourceFile(): string {
if (SkinrComponent::validateResourceFile($this->resourceFile)) {
return $this->resourceFile;
}
throw new Exception('never get to getResourceFile SkinrComponent::resourceFile');
}
/**
* @return string
*/
public static function sampleResourceFile(): string {
return 'SkinrComponent::resourceFile::41'; /*41:resourceFile*/
}
/**
* @param stdClass $value
* @throws Exception
* @return SequenceBinder
*/
public static function fromSequenceBinder(stdClass $value): SequenceBinder {
return SequenceBinder::from($value); /*class*/
}
/**
* @throws Exception
* @return stdClass
*/
public function toSequenceBinder(): stdClass {
if (SkinrComponent::validateSequenceBinder($this->sequenceBinder)) {
return $this->sequenceBinder->to(); /*class*/
}
throw new Exception('never get to this SkinrComponent::sequenceBinder');
}
/**
* @param SequenceBinder
* @return bool
* @throws Exception
*/
public static function validateSequenceBinder(SequenceBinder $value): bool {
$value->validate();
return true;
}
/**
* @throws Exception
* @return SequenceBinder
*/
public function getSequenceBinder(): SequenceBinder {
if (SkinrComponent::validateSequenceBinder($this->sequenceBinder)) {
return $this->sequenceBinder;
}
throw new Exception('never get to getSequenceBinder SkinrComponent::sequenceBinder');
}
/**
* @return SequenceBinder
*/
public static function sampleSequenceBinder(): SequenceBinder {
return SequenceBinder::sample(); /*42:sequenceBinder*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return SkinrComponent::validateKey($this->key)
|| SkinrComponent::validateAssociatedTypeIds($this->associatedTypeIds)
|| SkinrComponent::validateCategory($this->category)
|| SkinrComponent::validateFinish($this->finish)
|| SkinrComponent::validateIconFile($this->iconFile)
|| SkinrComponent::validateName($this->name)
|| SkinrComponent::validateProjectionTypeU($this->projectionTypeU)
|| SkinrComponent::validateProjectionTypeV($this->projectionTypeV)
|| SkinrComponent::validatePublished($this->published)
|| SkinrComponent::validateRarity($this->rarity)
|| SkinrComponent::validateResourceFile($this->resourceFile)
|| SkinrComponent::validateSequenceBinder($this->sequenceBinder);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'associatedTypeIds'} = $this->toAssociatedTypeIds();
$out->{'category'} = $this->toCategory();
$out->{'finish'} = $this->toFinish();
$out->{'iconFile'} = $this->toIconFile();
$out->{'name'} = $this->toName();
$out->{'projectionTypeU'} = $this->toProjectionTypeU();
$out->{'projectionTypeV'} = $this->toProjectionTypeV();
$out->{'published'} = $this->toPublished();
$out->{'rarity'} = $this->toRarity();
$out->{'resourceFile'} = $this->toResourceFile();
$out->{'sequenceBinder'} = $this->toSequenceBinder();
return $out;
}
/**
* @param stdClass $obj
* @return SkinrComponent
* @throws Exception
*/
public static function from(stdClass $obj): SkinrComponent {
return new SkinrComponent(
SkinrComponent::fromKey($obj->{'_key'})
,SkinrComponent::fromAssociatedTypeIds($obj->{'associatedTypeIds'})
,SkinrComponent::fromCategory($obj->{'category'})
,SkinrComponent::fromFinish($obj->{'finish'})
,SkinrComponent::fromIconFile($obj->{'iconFile'})
,SkinrComponent::fromName($obj->{'name'})
,SkinrComponent::fromProjectionTypeU($obj->{'projectionTypeU'})
,SkinrComponent::fromProjectionTypeV($obj->{'projectionTypeV'})
,SkinrComponent::fromPublished($obj->{'published'})
,SkinrComponent::fromRarity($obj->{'rarity'})
,SkinrComponent::fromResourceFile($obj->{'resourceFile'})
,SkinrComponent::fromSequenceBinder($obj->{'sequenceBinder'})
);
}
/**
* @return SkinrComponent
*/
public static function sample(): SkinrComponent {
return new SkinrComponent(
SkinrComponent::sampleKey()
,SkinrComponent::sampleAssociatedTypeIds()
,SkinrComponent::sampleCategory()
,SkinrComponent::sampleFinish()
,SkinrComponent::sampleIconFile()
,SkinrComponent::sampleName()
,SkinrComponent::sampleProjectionTypeU()
,SkinrComponent::sampleProjectionTypeV()
,SkinrComponent::samplePublished()
,SkinrComponent::sampleRarity()
,SkinrComponent::sampleResourceFile()
,SkinrComponent::sampleSequenceBinder()
);
}
}
// This is a autogenerated file:AssociatedTypeId
class AssociatedTypeId {
private int $licenseUsesGranted; // json:licenseUsesGranted Required
private int $typeId; // json:typeID Required
/**
* @param int $licenseUsesGranted
* @param int $typeId
*/
public function __construct(int $licenseUsesGranted, int $typeId) {
$this->licenseUsesGranted = $licenseUsesGranted;
$this->typeId = $typeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromLicenseUsesGranted(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toLicenseUsesGranted(): int {
if (AssociatedTypeId::validateLicenseUsesGranted($this->licenseUsesGranted)) {
return $this->licenseUsesGranted; /*int*/
}
throw new Exception('never get to this AssociatedTypeId::licenseUsesGranted');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateLicenseUsesGranted(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:AssociatedTypeId::licenseUsesGranted");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getLicenseUsesGranted(): int {
if (AssociatedTypeId::validateLicenseUsesGranted($this->licenseUsesGranted)) {
return $this->licenseUsesGranted;
}
throw new Exception('never get to getLicenseUsesGranted AssociatedTypeId::licenseUsesGranted');
}
/**
* @return int
*/
public static function sampleLicenseUsesGranted(): int {
return 31; /*31:licenseUsesGranted*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromTypeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toTypeId(): int {
if (AssociatedTypeId::validateTypeId($this->typeId)) {
return $this->typeId; /*int*/
}
throw new Exception('never get to this AssociatedTypeId::typeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateTypeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:AssociatedTypeId::typeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getTypeId(): int {
if (AssociatedTypeId::validateTypeId($this->typeId)) {
return $this->typeId;
}
throw new Exception('never get to getTypeId AssociatedTypeId::typeId');
}
/**
* @return int
*/
public static function sampleTypeId(): int {
return 32; /*32:typeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return AssociatedTypeId::validateLicenseUsesGranted($this->licenseUsesGranted)
|| AssociatedTypeId::validateTypeId($this->typeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'licenseUsesGranted'} = $this->toLicenseUsesGranted();
$out->{'typeID'} = $this->toTypeId();
return $out;
}
/**
* @param stdClass $obj
* @return AssociatedTypeId
* @throws Exception
*/
public static function from(stdClass $obj): AssociatedTypeId {
return new AssociatedTypeId(
AssociatedTypeId::fromLicenseUsesGranted($obj->{'licenseUsesGranted'})
,AssociatedTypeId::fromTypeId($obj->{'typeID'})
);
}
/**
* @return AssociatedTypeId
*/
public static function sample(): AssociatedTypeId {
return new AssociatedTypeId(
AssociatedTypeId::sampleLicenseUsesGranted()
,AssociatedTypeId::sampleTypeId()
);
}
}
// This is a autogenerated file:Finish
class Finish {
public static Finish $GLOSS;
public static Finish $MATTE;
public static Finish $SATIN;
public static function init() {
Finish::$GLOSS = new Finish('Gloss');
Finish::$MATTE = new Finish('Matte');
Finish::$SATIN = new Finish('Satin');
}
private string $enum;
public function __construct(string $enum) {
$this->enum = $enum;
}
/**
* @param Finish
* @return string
* @throws Exception
*/
public static function to(Finish $obj): string {
switch ($obj->enum) {
case Finish::$GLOSS->enum: return 'Gloss';
case Finish::$MATTE->enum: return 'Matte';
case Finish::$SATIN->enum: return 'Satin';
}
throw new Exception('the give value is not an enum-value.');
}
/**
* @param mixed
* @return Finish
* @throws Exception
*/
public static function from($obj): Finish {
switch ($obj) {
case 'Gloss': return Finish::$GLOSS;
case 'Matte': return Finish::$MATTE;
case 'Satin': return Finish::$SATIN;
}
throw new Exception("Cannot deserialize Finish");
}
/**
* @return Finish
*/
public static function sample(): Finish {
return Finish::$GLOSS;
}
}
Finish::init();
// This is a autogenerated file:Name
class Name {
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 (Name::validateDe($this->de)) {
if (!is_null($this->de)) {
return $this->de; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::de");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDe(): ?string {
if (Name::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe Name::de');
}
/**
* @return ?string
*/
public static function sampleDe(): ?string {
return 'Name::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (Name::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this Name::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (Name::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn Name::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'Name::en::32'; /*32:en*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromEs(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toEs(): ?string {
if (Name::validateEs($this->es)) {
if (!is_null($this->es)) {
return $this->es; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::es");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getEs(): ?string {
if (Name::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs Name::es');
}
/**
* @return ?string
*/
public static function sampleEs(): ?string {
return 'Name::es::33'; /*33:es*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromFr(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toFr(): ?string {
if (Name::validateFr($this->fr)) {
if (!is_null($this->fr)) {
return $this->fr; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::fr");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getFr(): ?string {
if (Name::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr Name::fr');
}
/**
* @return ?string
*/
public static function sampleFr(): ?string {
return 'Name::fr::34'; /*34:fr*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromJa(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toJa(): ?string {
if (Name::validateJa($this->ja)) {
if (!is_null($this->ja)) {
return $this->ja; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::ja");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getJa(): ?string {
if (Name::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa Name::ja');
}
/**
* @return ?string
*/
public static function sampleJa(): ?string {
return 'Name::ja::35'; /*35:ja*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromKo(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toKo(): ?string {
if (Name::validateKo($this->ko)) {
if (!is_null($this->ko)) {
return $this->ko; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::ko");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getKo(): ?string {
if (Name::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo Name::ko');
}
/**
* @return ?string
*/
public static function sampleKo(): ?string {
return 'Name::ko::36'; /*36:ko*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromRu(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toRu(): ?string {
if (Name::validateRu($this->ru)) {
if (!is_null($this->ru)) {
return $this->ru; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::ru");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getRu(): ?string {
if (Name::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu Name::ru');
}
/**
* @return ?string
*/
public static function sampleRu(): ?string {
return 'Name::ru::37'; /*37:ru*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromZh(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toZh(): ?string {
if (Name::validateZh($this->zh)) {
if (!is_null($this->zh)) {
return $this->zh; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::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:Name::zh");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getZh(): ?string {
if (Name::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh Name::zh');
}
/**
* @return ?string
*/
public static function sampleZh(): ?string {
return 'Name::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Name::validateDe($this->de)
|| Name::validateEn($this->en)
|| Name::validateEs($this->es)
|| Name::validateFr($this->fr)
|| Name::validateJa($this->ja)
|| Name::validateKo($this->ko)
|| Name::validateRu($this->ru)
|| Name::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return Name
* @throws Exception
*/
public static function from(stdClass $obj): Name {
return new Name(
Name::fromDe($obj->{'de'})
,Name::fromEn($obj->{'en'})
,Name::fromEs($obj->{'es'})
,Name::fromFr($obj->{'fr'})
,Name::fromJa($obj->{'ja'})
,Name::fromKo($obj->{'ko'})
,Name::fromRu($obj->{'ru'})
,Name::fromZh($obj->{'zh'})
);
}
/**
* @return Name
*/
public static function sample(): Name {
return new Name(
Name::sampleDe()
,Name::sampleEn()
,Name::sampleEs()
,Name::sampleFr()
,Name::sampleJa()
,Name::sampleKo()
,Name::sampleRu()
,Name::sampleZh()
);
}
}
// This is a autogenerated file:ProjectionType
class ProjectionType {
public static ProjectionType $BORDER;
public static ProjectionType $CLAMP;
public static ProjectionType $REPEAT;
public static function init() {
ProjectionType::$BORDER = new ProjectionType('Border');
ProjectionType::$CLAMP = new ProjectionType('Clamp');
ProjectionType::$REPEAT = new ProjectionType('Repeat');
}
private string $enum;
public function __construct(string $enum) {
$this->enum = $enum;
}
/**
* @param ProjectionType
* @return string
* @throws Exception
*/
public static function to(ProjectionType $obj): string {
switch ($obj->enum) {
case ProjectionType::$BORDER->enum: return 'Border';
case ProjectionType::$CLAMP->enum: return 'Clamp';
case ProjectionType::$REPEAT->enum: return 'Repeat';
}
throw new Exception('the give value is not an enum-value.');
}
/**
* @param mixed
* @return ProjectionType
* @throws Exception
*/
public static function from($obj): ProjectionType {
switch ($obj) {
case 'Border': return ProjectionType::$BORDER;
case 'Clamp': return ProjectionType::$CLAMP;
case 'Repeat': return ProjectionType::$REPEAT;
}
throw new Exception("Cannot deserialize ProjectionType");
}
/**
* @return ProjectionType
*/
public static function sample(): ProjectionType {
return ProjectionType::$BORDER;
}
}
ProjectionType::init();
// This is a autogenerated file:SequenceBinder
class SequenceBinder {
private int $count; // json:count Required
private int $itemTypeId; // json:itemTypeID Required
/**
* @param int $count
* @param int $itemTypeId
*/
public function __construct(int $count, int $itemTypeId) {
$this->count = $count;
$this->itemTypeId = $itemTypeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromCount(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toCount(): int {
if (SequenceBinder::validateCount($this->count)) {
return $this->count; /*int*/
}
throw new Exception('never get to this SequenceBinder::count');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateCount(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:SequenceBinder::count");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getCount(): int {
if (SequenceBinder::validateCount($this->count)) {
return $this->count;
}
throw new Exception('never get to getCount SequenceBinder::count');
}
/**
* @return int
*/
public static function sampleCount(): int {
return 31; /*31:count*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromItemTypeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toItemTypeId(): int {
if (SequenceBinder::validateItemTypeId($this->itemTypeId)) {
return $this->itemTypeId; /*int*/
}
throw new Exception('never get to this SequenceBinder::itemTypeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateItemTypeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:SequenceBinder::itemTypeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getItemTypeId(): int {
if (SequenceBinder::validateItemTypeId($this->itemTypeId)) {
return $this->itemTypeId;
}
throw new Exception('never get to getItemTypeId SequenceBinder::itemTypeId');
}
/**
* @return int
*/
public static function sampleItemTypeId(): int {
return 32; /*32:itemTypeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return SequenceBinder::validateCount($this->count)
|| SequenceBinder::validateItemTypeId($this->itemTypeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'count'} = $this->toCount();
$out->{'itemTypeID'} = $this->toItemTypeId();
return $out;
}
/**
* @param stdClass $obj
* @return SequenceBinder
* @throws Exception
*/
public static function from(stdClass $obj): SequenceBinder {
return new SequenceBinder(
SequenceBinder::fromCount($obj->{'count'})
,SequenceBinder::fromItemTypeId($obj->{'itemTypeID'})
);
}
/**
* @return SequenceBinder
*/
public static function sample(): SequenceBinder {
return new SequenceBinder(
SequenceBinder::sampleCount()
,SequenceBinder::sampleItemTypeId()
);
}
}
from typing import Any, Optional, List, TypeVar, Callable, Type, cast
from enum import Enum
T = TypeVar("T")
EnumT = TypeVar("EnumT", bound=Enum)
def from_int(x: Any) -> int:
assert isinstance(x, int) and not isinstance(x, bool)
return x
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def from_none(x: Any) -> Any:
assert x is None
return x
def from_union(fs, x):
for f in fs:
try:
return f(x)
except:
pass
assert False
def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
assert isinstance(x, list)
return [f(y) for y in x]
def from_bool(x: Any) -> bool:
assert isinstance(x, bool)
return x
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
def to_enum(c: Type[EnumT], x: Any) -> EnumT:
assert isinstance(x, c)
return x.value
class AssociatedTypeID:
license_uses_granted: int
type_id: int
def __init__(self, license_uses_granted: int, type_id: int) -> None:
self.license_uses_granted = license_uses_granted
self.type_id = type_id
@staticmethod
def from_dict(obj: Any) -> 'AssociatedTypeID':
assert isinstance(obj, dict)
license_uses_granted = from_int(obj.get("licenseUsesGranted"))
type_id = from_int(obj.get("typeID"))
return AssociatedTypeID(license_uses_granted, type_id)
def to_dict(self) -> dict:
result: dict = {}
result["licenseUsesGranted"] = from_int(self.license_uses_granted)
result["typeID"] = from_int(self.type_id)
return result
class Finish(Enum):
GLOSS = "Gloss"
MATTE = "Matte"
SATIN = "Satin"
class Name:
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) -> 'Name':
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 Name(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 ProjectionType(Enum):
BORDER = "Border"
CLAMP = "Clamp"
REPEAT = "Repeat"
class SequenceBinder:
count: int
item_type_id: int
def __init__(self, count: int, item_type_id: int) -> None:
self.count = count
self.item_type_id = item_type_id
@staticmethod
def from_dict(obj: Any) -> 'SequenceBinder':
assert isinstance(obj, dict)
count = from_int(obj.get("count"))
item_type_id = from_int(obj.get("itemTypeID"))
return SequenceBinder(count, item_type_id)
def to_dict(self) -> dict:
result: dict = {}
result["count"] = from_int(self.count)
result["itemTypeID"] = from_int(self.item_type_id)
return result
class SkinrComponent:
key: int
associated_type_ids: List[AssociatedTypeID]
category: int
finish: Finish
icon_file: str
name: Name
projection_type_u: ProjectionType
projection_type_v: ProjectionType
published: bool
rarity: int
resource_file: str
sequence_binder: SequenceBinder
def __init__(self, key: int, associated_type_ids: List[AssociatedTypeID], category: int, finish: Finish, icon_file: str, name: Name, projection_type_u: ProjectionType, projection_type_v: ProjectionType, published: bool, rarity: int, resource_file: str, sequence_binder: SequenceBinder) -> None:
self.key = key
self.associated_type_ids = associated_type_ids
self.category = category
self.finish = finish
self.icon_file = icon_file
self.name = name
self.projection_type_u = projection_type_u
self.projection_type_v = projection_type_v
self.published = published
self.rarity = rarity
self.resource_file = resource_file
self.sequence_binder = sequence_binder
@staticmethod
def from_dict(obj: Any) -> 'SkinrComponent':
assert isinstance(obj, dict)
key = from_int(obj.get("_key"))
associated_type_ids = from_list(AssociatedTypeID.from_dict, obj.get("associatedTypeIds"))
category = from_int(obj.get("category"))
finish = Finish(obj.get("finish"))
icon_file = from_str(obj.get("iconFile"))
name = Name.from_dict(obj.get("name"))
projection_type_u = ProjectionType(obj.get("projectionTypeU"))
projection_type_v = ProjectionType(obj.get("projectionTypeV"))
published = from_bool(obj.get("published"))
rarity = from_int(obj.get("rarity"))
resource_file = from_str(obj.get("resourceFile"))
sequence_binder = SequenceBinder.from_dict(obj.get("sequenceBinder"))
return SkinrComponent(key, associated_type_ids, category, finish, icon_file, name, projection_type_u, projection_type_v, published, rarity, resource_file, sequence_binder)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_int(self.key)
result["associatedTypeIds"] = from_list(lambda x: to_class(AssociatedTypeID, x), self.associated_type_ids)
result["category"] = from_int(self.category)
result["finish"] = to_enum(Finish, self.finish)
result["iconFile"] = from_str(self.icon_file)
result["name"] = to_class(Name, self.name)
result["projectionTypeU"] = to_enum(ProjectionType, self.projection_type_u)
result["projectionTypeV"] = to_enum(ProjectionType, self.projection_type_v)
result["published"] = from_bool(self.published)
result["rarity"] = from_int(self.rarity)
result["resourceFile"] = from_str(self.resource_file)
result["sequenceBinder"] = to_class(SequenceBinder, self.sequence_binder)
return result
def skinr_component_from_dict(s: Any) -> SkinrComponent:
return SkinrComponent.from_dict(s)
def skinr_component_to_dict(x: SkinrComponent) -> Any:
return to_class(SkinrComponent, x)
// To parse this data:
//
// import { Convert, SkinrComponent } from "./file";
//
// const skinrComponent = Convert.toSkinrComponent(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
export interface SkinrComponent {
_key: number;
associatedTypeIds: AssociatedTypeId[];
category: number;
finish: Finish;
iconFile: string;
name: Name;
projectionTypeU: ProjectionType;
projectionTypeV: ProjectionType;
published: boolean;
rarity: number;
resourceFile: string;
sequenceBinder: SequenceBinder;
[property: string]: any;
}
export interface AssociatedTypeId {
licenseUsesGranted: number;
typeID: number;
[property: string]: any;
}
export enum Finish {
Gloss = "Gloss",
Matte = "Matte",
Satin = "Satin",
}
export interface Name {
de?: string;
en: string;
es?: string;
fr?: string;
ja?: string;
ko?: string;
ru?: string;
zh?: string;
[property: string]: any;
}
export enum ProjectionType {
Border = "Border",
Clamp = "Clamp",
Repeat = "Repeat",
}
export interface SequenceBinder {
count: number;
itemTypeID: number;
[property: string]: any;
}
// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
public static toSkinrComponent(json: string): SkinrComponent {
return cast(JSON.parse(json), r("SkinrComponent"));
}
public static skinrComponentToJson(value: SkinrComponent): string {
return JSON.stringify(uncast(value, r("SkinrComponent")), 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 = {
"SkinrComponent": o([
{ json: "_key", js: "_key", typ: 0 },
{ json: "associatedTypeIds", js: "associatedTypeIds", typ: a(r("AssociatedTypeId")) },
{ json: "category", js: "category", typ: 0 },
{ json: "finish", js: "finish", typ: r("Finish") },
{ json: "iconFile", js: "iconFile", typ: "" },
{ json: "name", js: "name", typ: r("Name") },
{ json: "projectionTypeU", js: "projectionTypeU", typ: r("ProjectionType") },
{ json: "projectionTypeV", js: "projectionTypeV", typ: r("ProjectionType") },
{ json: "published", js: "published", typ: true },
{ json: "rarity", js: "rarity", typ: 0 },
{ json: "resourceFile", js: "resourceFile", typ: "" },
{ json: "sequenceBinder", js: "sequenceBinder", typ: r("SequenceBinder") },
], "any"),
"AssociatedTypeId": o([
{ json: "licenseUsesGranted", js: "licenseUsesGranted", typ: 0 },
{ json: "typeID", js: "typeID", typ: 0 },
], "any"),
"Name": 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"),
"SequenceBinder": o([
{ json: "count", js: "count", typ: 0 },
{ json: "itemTypeID", js: "itemTypeID", typ: 0 },
], "any"),
"Finish": [
"Gloss",
"Matte",
"Satin",
],
"ProjectionType": [
"Border",
"Clamp",
"Repeat",
],
};