industryModifierSources.jsonl
Schema
_key(required): integer
Range: 35825 .. 48078-
copying: object-
cost: array of objectdogmaAttributeID(required): integer
Range: 2569 .. 2601
-
time: array of objectdogmaAttributeID(required): integer
Range: 2570 .. 2602
-
-
invention: object-
cost: array of objectdogmaAttributeID(required): integer
Range: 2563 .. 2601
-
time: array of objectdogmaAttributeID(required): integer
Range: 2564 .. 2602
-
-
manufacturing: object-
cost: array of objectdogmaAttributeID(required): integer
Range: 2601 .. 2601
-
material: array of objectdogmaAttributeID(required): integer
Range: 2538 .. 2658filterID: integer
Range: 1 .. 15
-
time: array of objectdogmaAttributeID(required): integer
Range: 2539 .. 2659filterID: integer
Range: 1 .. 15
-
-
reaction: object-
material: array of objectdogmaAttributeID(required): integer
Range: 2716 .. 2720filterID(required): integer
Range: 16 .. 18
-
time: array of objectdogmaAttributeID(required): integer
Range: 2715 .. 2721filterID: integer
Range: 16 .. 18
-
-
researchMaterial: object-
cost: array of objectdogmaAttributeID(required): integer
Range: 2565 .. 2601
-
time: array of objectdogmaAttributeID(required): integer
Range: 2566 .. 2602
-
-
researchTime: object-
cost: array of objectdogmaAttributeID(required): integer
Range: 2565 .. 2601
-
time: array of objectdogmaAttributeID(required): integer
Range: 2566 .. 2602
-
Code snippets
// <auto-generated />
//
// To parse this JSON data, add NuGet 'System.Text.Json' then do:
//
// using QuickType;
//
// var industryModifierSource = IndustryModifierSource.FromJson(jsonString);
#nullable enable
#pragma warning disable CS8618
#pragma warning disable CS8601
#pragma warning disable CS8602
#pragma warning disable CS8603
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Globalization;
public partial class IndustryModifierSource
{
[JsonPropertyName("_key")]
public long Key { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("copying")]
public Copying? Copying { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("invention")]
public Invention? Invention { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("manufacturing")]
public Manufacturing? Manufacturing { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("reaction")]
public Reaction? Reaction { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("researchMaterial")]
public ResearchMaterial? ResearchMaterial { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("researchTime")]
public ResearchTime? ResearchTime { get; set; }
}
public partial class Copying
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cost")]
public CopyingCost[]? Cost { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("time")]
public CopyingTime[]? Time { get; set; }
}
public partial class CopyingCost
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class CopyingTime
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class Invention
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cost")]
public InventionCost[]? Cost { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("time")]
public InventionTime[]? Time { get; set; }
}
public partial class InventionCost
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class InventionTime
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class Manufacturing
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cost")]
public ManufacturingCost[]? Cost { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("material")]
public ManufacturingMaterial[]? Material { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("time")]
public ManufacturingTime[]? Time { get; set; }
}
public partial class ManufacturingCost
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class ManufacturingMaterial
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("filterID")]
public long? FilterId { get; set; }
}
public partial class ManufacturingTime
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("filterID")]
public long? FilterId { get; set; }
}
public partial class Reaction
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("material")]
public ReactionMaterial[]? Material { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("time")]
public ReactionTime[]? Time { get; set; }
}
public partial class ReactionMaterial
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
[JsonPropertyName("filterID")]
public long FilterId { get; set; }
}
public partial class ReactionTime
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("filterID")]
public long? FilterId { get; set; }
}
public partial class ResearchMaterial
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cost")]
public ResearchMaterialCost[]? Cost { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("time")]
public ResearchMaterialTime[]? Time { get; set; }
}
public partial class ResearchMaterialCost
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class ResearchMaterialTime
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class ResearchTime
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("cost")]
public ResearchTimeCost[]? Cost { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("time")]
public ResearchTimeTime[]? Time { get; set; }
}
public partial class ResearchTimeCost
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class ResearchTimeTime
{
[JsonPropertyName("dogmaAttributeID")]
public long DogmaAttributeId { get; set; }
}
public partial class IndustryModifierSource
{
public static IndustryModifierSource FromJson(string json) => JsonSerializer.Deserialize<IndustryModifierSource>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this IndustryModifierSource self) => JsonSerializer.Serialize(self, QuickType.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerOptions Settings = new(JsonSerializerDefaults.General)
{
Converters =
{
new DateOnlyConverter(),
new TimeOnlyConverter(),
IsoDateTimeOffsetConverter.Singleton
},
};
}
public class DateOnlyConverter : JsonConverter<DateOnly>
{
private readonly string serializationFormat;
public DateOnlyConverter() : this(null) { }
public DateOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
}
public override DateOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return DateOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, DateOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
public class TimeOnlyConverter : JsonConverter<TimeOnly>
{
private readonly string serializationFormat;
public TimeOnlyConverter() : this(null) { }
public TimeOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
}
public override TimeOnly Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var value = reader.GetString();
return TimeOnly.Parse(value!);
}
public override void Write(Utf8JsonWriter writer, TimeOnly value, JsonSerializerOptions options)
=> writer.WriteStringValue(value.ToString(serializationFormat));
}
internal class IsoDateTimeOffsetConverter : JsonConverter<DateTimeOffset>
{
public override bool CanConvert(Type t) => t == typeof(DateTimeOffset);
private const string DefaultDateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
private DateTimeStyles _dateTimeStyles = DateTimeStyles.RoundtripKind;
private string? _dateTimeFormat;
private CultureInfo? _culture;
public DateTimeStyles DateTimeStyles
{
get => _dateTimeStyles;
set => _dateTimeStyles = value;
}
public string? DateTimeFormat
{
get => _dateTimeFormat ?? string.Empty;
set => _dateTimeFormat = (string.IsNullOrEmpty(value)) ? null : value;
}
public CultureInfo Culture
{
get => _culture ?? CultureInfo.CurrentCulture;
set => _culture = value;
}
public override void Write(Utf8JsonWriter writer, DateTimeOffset value, JsonSerializerOptions options)
{
string text;
if ((_dateTimeStyles & DateTimeStyles.AdjustToUniversal) == DateTimeStyles.AdjustToUniversal
|| (_dateTimeStyles & DateTimeStyles.AssumeUniversal) == DateTimeStyles.AssumeUniversal)
{
value = value.ToUniversalTime();
}
text = value.ToString(_dateTimeFormat ?? DefaultDateTimeFormat, Culture);
writer.WriteStringValue(text);
}
public override DateTimeOffset Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
string? dateText = reader.GetString();
if (string.IsNullOrEmpty(dateText) == false)
{
if (!string.IsNullOrEmpty(_dateTimeFormat))
{
return DateTimeOffset.ParseExact(dateText, _dateTimeFormat, Culture, _dateTimeStyles);
}
else
{
return DateTimeOffset.Parse(dateText, Culture, _dateTimeStyles);
}
}
else
{
return default(DateTimeOffset);
}
}
public static readonly IsoDateTimeOffsetConverter Singleton = new IsoDateTimeOffsetConverter();
}
}
#pragma warning restore CS8618
#pragma warning restore CS8601
#pragma warning restore CS8602
#pragma warning restore CS8603
// 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:
//
// industryModifierSource, err := UnmarshalIndustryModifierSource(bytes)
// bytes, err = industryModifierSource.Marshal()
package model
import "encoding/json"
func UnmarshalIndustryModifierSource(data []byte) (IndustryModifierSource, error) {
var r IndustryModifierSource
err := json.Unmarshal(data, &r)
return r, err
}
func (r *IndustryModifierSource) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type IndustryModifierSource struct {
Key int64 `json:"_key"`
Copying *Copying `json:"copying,omitempty"`
Invention *Invention `json:"invention,omitempty"`
Manufacturing *Manufacturing `json:"manufacturing,omitempty"`
Reaction *Reaction `json:"reaction,omitempty"`
ResearchMaterial *ResearchMaterial `json:"researchMaterial,omitempty"`
ResearchTime *ResearchTime `json:"researchTime,omitempty"`
}
type Copying struct {
Cost []CopyingCost `json:"cost,omitempty"`
Time []CopyingTime `json:"time,omitempty"`
}
type CopyingCost struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type CopyingTime struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type Invention struct {
Cost []InventionCost `json:"cost,omitempty"`
Time []InventionTime `json:"time,omitempty"`
}
type InventionCost struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type InventionTime struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type Manufacturing struct {
Cost []ManufacturingCost `json:"cost,omitempty"`
Material []ManufacturingMaterial `json:"material,omitempty"`
Time []ManufacturingTime `json:"time,omitempty"`
}
type ManufacturingCost struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type ManufacturingMaterial struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
FilterID *int64 `json:"filterID,omitempty"`
}
type ManufacturingTime struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
FilterID *int64 `json:"filterID,omitempty"`
}
type Reaction struct {
Material []ReactionMaterial `json:"material,omitempty"`
Time []ReactionTime `json:"time,omitempty"`
}
type ReactionMaterial struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
FilterID int64 `json:"filterID"`
}
type ReactionTime struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
FilterID *int64 `json:"filterID,omitempty"`
}
type ResearchMaterial struct {
Cost []ResearchMaterialCost `json:"cost,omitempty"`
Time []ResearchMaterialTime `json:"time,omitempty"`
}
type ResearchMaterialCost struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type ResearchMaterialTime struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type ResearchTime struct {
Cost []ResearchTimeCost `json:"cost,omitempty"`
Time []ResearchTimeTime `json:"time,omitempty"`
}
type ResearchTimeCost struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
type ResearchTimeTime struct {
DogmaAttributeID int64 `json:"dogmaAttributeID"`
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":35825,"maximum":48078},"copying":{"type":"object","properties":{"cost":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2569,"maximum":2601}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1},"time":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2570,"maximum":2602}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1}}},"invention":{"type":"object","properties":{"cost":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2563,"maximum":2601}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1},"time":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2564,"maximum":2602}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1}}},"manufacturing":{"type":"object","properties":{"cost":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2601,"maximum":2601}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1},"material":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2538,"maximum":2658},"filterID":{"type":"integer","minimum":1,"maximum":15}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":4},"time":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2539,"maximum":2659},"filterID":{"type":"integer","minimum":1,"maximum":15}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":7}}},"reaction":{"type":"object","properties":{"material":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2716,"maximum":2720},"filterID":{"type":"integer","minimum":16,"maximum":18}},"required":["dogmaAttributeID","filterID"]},"minItems":1,"maxItems":3},"time":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2715,"maximum":2721},"filterID":{"type":"integer","minimum":16,"maximum":18}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":3}}},"researchMaterial":{"type":"object","properties":{"cost":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2565,"maximum":2601}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1},"time":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2566,"maximum":2602}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1}}},"researchTime":{"type":"object","properties":{"cost":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2565,"maximum":2601}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1},"time":{"type":"array","items":{"type":"object","properties":{"dogmaAttributeID":{"type":"integer","minimum":2566,"maximum":2602}},"required":["dogmaAttributeID"]},"minItems":1,"maxItems":1}}}},"required":["_key"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json = Json { allowStructuredMapKeys = true }
// val industryModifierSource = json.parse(IndustryModifierSource.serializer(), jsonString)
package model
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
@Serializable
data class IndustryModifierSource (
@SerialName("_key")
val key: Long,
val copying: Copying? = null,
val invention: Invention? = null,
val manufacturing: Manufacturing? = null,
val reaction: Reaction? = null,
val researchMaterial: ResearchMaterial? = null,
val researchTime: ResearchTime? = null
)
@Serializable
data class Copying (
val cost: List<CopyingCost>? = null,
val time: List<CopyingTime>? = null
)
@Serializable
data class CopyingCost (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class CopyingTime (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class Invention (
val cost: List<InventionCost>? = null,
val time: List<InventionTime>? = null
)
@Serializable
data class InventionCost (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class InventionTime (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class Manufacturing (
val cost: List<ManufacturingCost>? = null,
val material: List<ManufacturingMaterial>? = null,
val time: List<ManufacturingTime>? = null
)
@Serializable
data class ManufacturingCost (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class ManufacturingMaterial (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long,
@SerialName("filterID")
val filterId: Long? = null
)
@Serializable
data class ManufacturingTime (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long,
@SerialName("filterID")
val filterId: Long? = null
)
@Serializable
data class Reaction (
val material: List<ReactionMaterial>? = null,
val time: List<ReactionTime>? = null
)
@Serializable
data class ReactionMaterial (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long,
@SerialName("filterID")
val filterId: Long
)
@Serializable
data class ReactionTime (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long,
@SerialName("filterID")
val filterId: Long? = null
)
@Serializable
data class ResearchMaterial (
val cost: List<ResearchMaterialCost>? = null,
val time: List<ResearchMaterialTime>? = null
)
@Serializable
data class ResearchMaterialCost (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class ResearchMaterialTime (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class ResearchTime (
val cost: List<ResearchTimeCost>? = null,
val time: List<ResearchTimeTime>? = null
)
@Serializable
data class ResearchTimeCost (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
@Serializable
data class ResearchTimeTime (
@SerialName("dogmaAttributeID")
val dogmaAttributeId: Long
)
<?php
// This is an autogenerated file:IndustryModifierSource
class IndustryModifierSource {
private int $key; // json:_key Required
private ?Copying $copying; // json:copying Optional
private ?Invention $invention; // json:invention Optional
private ?Manufacturing $manufacturing; // json:manufacturing Optional
private ?Reaction $reaction; // json:reaction Optional
private ?ResearchMaterial $researchMaterial; // json:researchMaterial Optional
private ?ResearchTime $researchTime; // json:researchTime Optional
/**
* @param int $key
* @param Copying|null $copying
* @param Invention|null $invention
* @param Manufacturing|null $manufacturing
* @param Reaction|null $reaction
* @param ResearchMaterial|null $researchMaterial
* @param ResearchTime|null $researchTime
*/
public function __construct(int $key, ?Copying $copying, ?Invention $invention, ?Manufacturing $manufacturing, ?Reaction $reaction, ?ResearchMaterial $researchMaterial, ?ResearchTime $researchTime) {
$this->key = $key;
$this->copying = $copying;
$this->invention = $invention;
$this->manufacturing = $manufacturing;
$this->reaction = $reaction;
$this->researchMaterial = $researchMaterial;
$this->researchTime = $researchTime;
}
/**
* @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 (IndustryModifierSource::validateKey($this->key)) {
return $this->key; /*int*/
}
throw new Exception('never get to this IndustryModifierSource::key');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateKey(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:IndustryModifierSource::key");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getKey(): int {
if (IndustryModifierSource::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey IndustryModifierSource::key');
}
/**
* @return int
*/
public static function sampleKey(): int {
return 31; /*31:key*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Copying
*/
public static function fromCopying(?stdClass $value): ?Copying {
if (!is_null($value)) {
return Copying::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toCopying(): ?stdClass {
if (IndustryModifierSource::validateCopying($this->copying)) {
if (!is_null($this->copying)) {
return $this->copying->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this IndustryModifierSource::copying');
}
/**
* @param Copying|null
* @return bool
* @throws Exception
*/
public static function validateCopying(?Copying $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Copying
*/
public function getCopying(): ?Copying {
if (IndustryModifierSource::validateCopying($this->copying)) {
return $this->copying;
}
throw new Exception('never get to getCopying IndustryModifierSource::copying');
}
/**
* @return ?Copying
*/
public static function sampleCopying(): ?Copying {
return Copying::sample(); /*32:copying*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Invention
*/
public static function fromInvention(?stdClass $value): ?Invention {
if (!is_null($value)) {
return Invention::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toInvention(): ?stdClass {
if (IndustryModifierSource::validateInvention($this->invention)) {
if (!is_null($this->invention)) {
return $this->invention->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this IndustryModifierSource::invention');
}
/**
* @param Invention|null
* @return bool
* @throws Exception
*/
public static function validateInvention(?Invention $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Invention
*/
public function getInvention(): ?Invention {
if (IndustryModifierSource::validateInvention($this->invention)) {
return $this->invention;
}
throw new Exception('never get to getInvention IndustryModifierSource::invention');
}
/**
* @return ?Invention
*/
public static function sampleInvention(): ?Invention {
return Invention::sample(); /*33:invention*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Manufacturing
*/
public static function fromManufacturing(?stdClass $value): ?Manufacturing {
if (!is_null($value)) {
return Manufacturing::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toManufacturing(): ?stdClass {
if (IndustryModifierSource::validateManufacturing($this->manufacturing)) {
if (!is_null($this->manufacturing)) {
return $this->manufacturing->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this IndustryModifierSource::manufacturing');
}
/**
* @param Manufacturing|null
* @return bool
* @throws Exception
*/
public static function validateManufacturing(?Manufacturing $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Manufacturing
*/
public function getManufacturing(): ?Manufacturing {
if (IndustryModifierSource::validateManufacturing($this->manufacturing)) {
return $this->manufacturing;
}
throw new Exception('never get to getManufacturing IndustryModifierSource::manufacturing');
}
/**
* @return ?Manufacturing
*/
public static function sampleManufacturing(): ?Manufacturing {
return Manufacturing::sample(); /*34:manufacturing*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Reaction
*/
public static function fromReaction(?stdClass $value): ?Reaction {
if (!is_null($value)) {
return Reaction::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toReaction(): ?stdClass {
if (IndustryModifierSource::validateReaction($this->reaction)) {
if (!is_null($this->reaction)) {
return $this->reaction->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this IndustryModifierSource::reaction');
}
/**
* @param Reaction|null
* @return bool
* @throws Exception
*/
public static function validateReaction(?Reaction $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Reaction
*/
public function getReaction(): ?Reaction {
if (IndustryModifierSource::validateReaction($this->reaction)) {
return $this->reaction;
}
throw new Exception('never get to getReaction IndustryModifierSource::reaction');
}
/**
* @return ?Reaction
*/
public static function sampleReaction(): ?Reaction {
return Reaction::sample(); /*35:reaction*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?ResearchMaterial
*/
public static function fromResearchMaterial(?stdClass $value): ?ResearchMaterial {
if (!is_null($value)) {
return ResearchMaterial::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toResearchMaterial(): ?stdClass {
if (IndustryModifierSource::validateResearchMaterial($this->researchMaterial)) {
if (!is_null($this->researchMaterial)) {
return $this->researchMaterial->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this IndustryModifierSource::researchMaterial');
}
/**
* @param ResearchMaterial|null
* @return bool
* @throws Exception
*/
public static function validateResearchMaterial(?ResearchMaterial $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?ResearchMaterial
*/
public function getResearchMaterial(): ?ResearchMaterial {
if (IndustryModifierSource::validateResearchMaterial($this->researchMaterial)) {
return $this->researchMaterial;
}
throw new Exception('never get to getResearchMaterial IndustryModifierSource::researchMaterial');
}
/**
* @return ?ResearchMaterial
*/
public static function sampleResearchMaterial(): ?ResearchMaterial {
return ResearchMaterial::sample(); /*36:researchMaterial*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?ResearchTime
*/
public static function fromResearchTime(?stdClass $value): ?ResearchTime {
if (!is_null($value)) {
return ResearchTime::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toResearchTime(): ?stdClass {
if (IndustryModifierSource::validateResearchTime($this->researchTime)) {
if (!is_null($this->researchTime)) {
return $this->researchTime->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this IndustryModifierSource::researchTime');
}
/**
* @param ResearchTime|null
* @return bool
* @throws Exception
*/
public static function validateResearchTime(?ResearchTime $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?ResearchTime
*/
public function getResearchTime(): ?ResearchTime {
if (IndustryModifierSource::validateResearchTime($this->researchTime)) {
return $this->researchTime;
}
throw new Exception('never get to getResearchTime IndustryModifierSource::researchTime');
}
/**
* @return ?ResearchTime
*/
public static function sampleResearchTime(): ?ResearchTime {
return ResearchTime::sample(); /*37:researchTime*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return IndustryModifierSource::validateKey($this->key)
|| IndustryModifierSource::validateCopying($this->copying)
|| IndustryModifierSource::validateInvention($this->invention)
|| IndustryModifierSource::validateManufacturing($this->manufacturing)
|| IndustryModifierSource::validateReaction($this->reaction)
|| IndustryModifierSource::validateResearchMaterial($this->researchMaterial)
|| IndustryModifierSource::validateResearchTime($this->researchTime);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'copying'} = $this->toCopying();
$out->{'invention'} = $this->toInvention();
$out->{'manufacturing'} = $this->toManufacturing();
$out->{'reaction'} = $this->toReaction();
$out->{'researchMaterial'} = $this->toResearchMaterial();
$out->{'researchTime'} = $this->toResearchTime();
return $out;
}
/**
* @param stdClass $obj
* @return IndustryModifierSource
* @throws Exception
*/
public static function from(stdClass $obj): IndustryModifierSource {
return new IndustryModifierSource(
IndustryModifierSource::fromKey($obj->{'_key'})
,IndustryModifierSource::fromCopying($obj->{'copying'})
,IndustryModifierSource::fromInvention($obj->{'invention'})
,IndustryModifierSource::fromManufacturing($obj->{'manufacturing'})
,IndustryModifierSource::fromReaction($obj->{'reaction'})
,IndustryModifierSource::fromResearchMaterial($obj->{'researchMaterial'})
,IndustryModifierSource::fromResearchTime($obj->{'researchTime'})
);
}
/**
* @return IndustryModifierSource
*/
public static function sample(): IndustryModifierSource {
return new IndustryModifierSource(
IndustryModifierSource::sampleKey()
,IndustryModifierSource::sampleCopying()
,IndustryModifierSource::sampleInvention()
,IndustryModifierSource::sampleManufacturing()
,IndustryModifierSource::sampleReaction()
,IndustryModifierSource::sampleResearchMaterial()
,IndustryModifierSource::sampleResearchTime()
);
}
}
// This is an autogenerated file:Copying
class Copying {
private ?array $cost; // json:cost Optional
private ?array $time; // json:time Optional
/**
* @param array|null $cost
* @param array|null $time
*/
public function __construct(?array $cost, ?array $time) {
$this->cost = $cost;
$this->time = $time;
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromCost(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return CopyingCost::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toCost(): ?array {
if (Copying::validateCost($this->cost)) {
if (!is_null($this->cost)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->cost);
} else {
return null;
}
}
throw new Exception('never get to this Copying::cost');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateCost(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Copying::cost");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getCost(): ?array {
if (Copying::validateCost($this->cost)) {
return $this->cost;
}
throw new Exception('never get to getCost Copying::cost');
}
/**
* @return ?array
*/
public static function sampleCost(): ?array {
return array(
CopyingCost::sample() /*31:*/
); /* 31:cost*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromTime(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return CopyingTime::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toTime(): ?array {
if (Copying::validateTime($this->time)) {
if (!is_null($this->time)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->time);
} else {
return null;
}
}
throw new Exception('never get to this Copying::time');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateTime(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Copying::time");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getTime(): ?array {
if (Copying::validateTime($this->time)) {
return $this->time;
}
throw new Exception('never get to getTime Copying::time');
}
/**
* @return ?array
*/
public static function sampleTime(): ?array {
return array(
CopyingTime::sample() /*32:*/
); /* 32:time*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Copying::validateCost($this->cost)
|| Copying::validateTime($this->time);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'cost'} = $this->toCost();
$out->{'time'} = $this->toTime();
return $out;
}
/**
* @param stdClass $obj
* @return Copying
* @throws Exception
*/
public static function from(stdClass $obj): Copying {
return new Copying(
Copying::fromCost($obj->{'cost'})
,Copying::fromTime($obj->{'time'})
);
}
/**
* @return Copying
*/
public static function sample(): Copying {
return new Copying(
Copying::sampleCost()
,Copying::sampleTime()
);
}
}
// This is an autogenerated file:CopyingCost
class CopyingCost {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (CopyingCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this CopyingCost::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:CopyingCost::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (CopyingCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId CopyingCost::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return CopyingCost::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return CopyingCost
* @throws Exception
*/
public static function from(stdClass $obj): CopyingCost {
return new CopyingCost(
CopyingCost::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return CopyingCost
*/
public static function sample(): CopyingCost {
return new CopyingCost(
CopyingCost::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:CopyingTime
class CopyingTime {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (CopyingTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this CopyingTime::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:CopyingTime::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (CopyingTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId CopyingTime::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return CopyingTime::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return CopyingTime
* @throws Exception
*/
public static function from(stdClass $obj): CopyingTime {
return new CopyingTime(
CopyingTime::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return CopyingTime
*/
public static function sample(): CopyingTime {
return new CopyingTime(
CopyingTime::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:Invention
class Invention {
private ?array $cost; // json:cost Optional
private ?array $time; // json:time Optional
/**
* @param array|null $cost
* @param array|null $time
*/
public function __construct(?array $cost, ?array $time) {
$this->cost = $cost;
$this->time = $time;
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromCost(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return InventionCost::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toCost(): ?array {
if (Invention::validateCost($this->cost)) {
if (!is_null($this->cost)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->cost);
} else {
return null;
}
}
throw new Exception('never get to this Invention::cost');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateCost(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Invention::cost");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getCost(): ?array {
if (Invention::validateCost($this->cost)) {
return $this->cost;
}
throw new Exception('never get to getCost Invention::cost');
}
/**
* @return ?array
*/
public static function sampleCost(): ?array {
return array(
InventionCost::sample() /*31:*/
); /* 31:cost*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromTime(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return InventionTime::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toTime(): ?array {
if (Invention::validateTime($this->time)) {
if (!is_null($this->time)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->time);
} else {
return null;
}
}
throw new Exception('never get to this Invention::time');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateTime(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Invention::time");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getTime(): ?array {
if (Invention::validateTime($this->time)) {
return $this->time;
}
throw new Exception('never get to getTime Invention::time');
}
/**
* @return ?array
*/
public static function sampleTime(): ?array {
return array(
InventionTime::sample() /*32:*/
); /* 32:time*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Invention::validateCost($this->cost)
|| Invention::validateTime($this->time);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'cost'} = $this->toCost();
$out->{'time'} = $this->toTime();
return $out;
}
/**
* @param stdClass $obj
* @return Invention
* @throws Exception
*/
public static function from(stdClass $obj): Invention {
return new Invention(
Invention::fromCost($obj->{'cost'})
,Invention::fromTime($obj->{'time'})
);
}
/**
* @return Invention
*/
public static function sample(): Invention {
return new Invention(
Invention::sampleCost()
,Invention::sampleTime()
);
}
}
// This is an autogenerated file:InventionCost
class InventionCost {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (InventionCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this InventionCost::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:InventionCost::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (InventionCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId InventionCost::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return InventionCost::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return InventionCost
* @throws Exception
*/
public static function from(stdClass $obj): InventionCost {
return new InventionCost(
InventionCost::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return InventionCost
*/
public static function sample(): InventionCost {
return new InventionCost(
InventionCost::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:InventionTime
class InventionTime {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (InventionTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this InventionTime::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:InventionTime::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (InventionTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId InventionTime::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return InventionTime::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return InventionTime
* @throws Exception
*/
public static function from(stdClass $obj): InventionTime {
return new InventionTime(
InventionTime::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return InventionTime
*/
public static function sample(): InventionTime {
return new InventionTime(
InventionTime::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:Manufacturing
class Manufacturing {
private ?array $cost; // json:cost Optional
private ?array $material; // json:material Optional
private ?array $time; // json:time Optional
/**
* @param array|null $cost
* @param array|null $material
* @param array|null $time
*/
public function __construct(?array $cost, ?array $material, ?array $time) {
$this->cost = $cost;
$this->material = $material;
$this->time = $time;
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromCost(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ManufacturingCost::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toCost(): ?array {
if (Manufacturing::validateCost($this->cost)) {
if (!is_null($this->cost)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->cost);
} else {
return null;
}
}
throw new Exception('never get to this Manufacturing::cost');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateCost(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Manufacturing::cost");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getCost(): ?array {
if (Manufacturing::validateCost($this->cost)) {
return $this->cost;
}
throw new Exception('never get to getCost Manufacturing::cost');
}
/**
* @return ?array
*/
public static function sampleCost(): ?array {
return array(
ManufacturingCost::sample() /*31:*/
); /* 31:cost*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromMaterial(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ManufacturingMaterial::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toMaterial(): ?array {
if (Manufacturing::validateMaterial($this->material)) {
if (!is_null($this->material)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->material);
} else {
return null;
}
}
throw new Exception('never get to this Manufacturing::material');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateMaterial(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Manufacturing::material");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getMaterial(): ?array {
if (Manufacturing::validateMaterial($this->material)) {
return $this->material;
}
throw new Exception('never get to getMaterial Manufacturing::material');
}
/**
* @return ?array
*/
public static function sampleMaterial(): ?array {
return array(
ManufacturingMaterial::sample() /*32:*/
); /* 32:material*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromTime(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ManufacturingTime::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toTime(): ?array {
if (Manufacturing::validateTime($this->time)) {
if (!is_null($this->time)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->time);
} else {
return null;
}
}
throw new Exception('never get to this Manufacturing::time');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateTime(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Manufacturing::time");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getTime(): ?array {
if (Manufacturing::validateTime($this->time)) {
return $this->time;
}
throw new Exception('never get to getTime Manufacturing::time');
}
/**
* @return ?array
*/
public static function sampleTime(): ?array {
return array(
ManufacturingTime::sample() /*33:*/
); /* 33:time*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Manufacturing::validateCost($this->cost)
|| Manufacturing::validateMaterial($this->material)
|| Manufacturing::validateTime($this->time);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'cost'} = $this->toCost();
$out->{'material'} = $this->toMaterial();
$out->{'time'} = $this->toTime();
return $out;
}
/**
* @param stdClass $obj
* @return Manufacturing
* @throws Exception
*/
public static function from(stdClass $obj): Manufacturing {
return new Manufacturing(
Manufacturing::fromCost($obj->{'cost'})
,Manufacturing::fromMaterial($obj->{'material'})
,Manufacturing::fromTime($obj->{'time'})
);
}
/**
* @return Manufacturing
*/
public static function sample(): Manufacturing {
return new Manufacturing(
Manufacturing::sampleCost()
,Manufacturing::sampleMaterial()
,Manufacturing::sampleTime()
);
}
}
// This is an autogenerated file:ManufacturingCost
class ManufacturingCost {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ManufacturingCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ManufacturingCost::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ManufacturingCost::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ManufacturingCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ManufacturingCost::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ManufacturingCost::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return ManufacturingCost
* @throws Exception
*/
public static function from(stdClass $obj): ManufacturingCost {
return new ManufacturingCost(
ManufacturingCost::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return ManufacturingCost
*/
public static function sample(): ManufacturingCost {
return new ManufacturingCost(
ManufacturingCost::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:ManufacturingMaterial
class ManufacturingMaterial {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
private ?int $filterId; // json:filterID Optional
/**
* @param int $dogmaAttributeId
* @param int|null $filterId
*/
public function __construct(int $dogmaAttributeId, ?int $filterId) {
$this->dogmaAttributeId = $dogmaAttributeId;
$this->filterId = $filterId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ManufacturingMaterial::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ManufacturingMaterial::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ManufacturingMaterial::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ManufacturingMaterial::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ManufacturingMaterial::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromFilterId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toFilterId(): ?int {
if (ManufacturingMaterial::validateFilterId($this->filterId)) {
if (!is_null($this->filterId)) {
return $this->filterId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this ManufacturingMaterial::filterId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateFilterId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ManufacturingMaterial::filterId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getFilterId(): ?int {
if (ManufacturingMaterial::validateFilterId($this->filterId)) {
return $this->filterId;
}
throw new Exception('never get to getFilterId ManufacturingMaterial::filterId');
}
/**
* @return ?int
*/
public static function sampleFilterId(): ?int {
return 32; /*32:filterId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ManufacturingMaterial::validateDogmaAttributeId($this->dogmaAttributeId)
|| ManufacturingMaterial::validateFilterId($this->filterId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
$out->{'filterID'} = $this->toFilterId();
return $out;
}
/**
* @param stdClass $obj
* @return ManufacturingMaterial
* @throws Exception
*/
public static function from(stdClass $obj): ManufacturingMaterial {
return new ManufacturingMaterial(
ManufacturingMaterial::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
,ManufacturingMaterial::fromFilterId($obj->{'filterID'})
);
}
/**
* @return ManufacturingMaterial
*/
public static function sample(): ManufacturingMaterial {
return new ManufacturingMaterial(
ManufacturingMaterial::sampleDogmaAttributeId()
,ManufacturingMaterial::sampleFilterId()
);
}
}
// This is an autogenerated file:ManufacturingTime
class ManufacturingTime {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
private ?int $filterId; // json:filterID Optional
/**
* @param int $dogmaAttributeId
* @param int|null $filterId
*/
public function __construct(int $dogmaAttributeId, ?int $filterId) {
$this->dogmaAttributeId = $dogmaAttributeId;
$this->filterId = $filterId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ManufacturingTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ManufacturingTime::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ManufacturingTime::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ManufacturingTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ManufacturingTime::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromFilterId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toFilterId(): ?int {
if (ManufacturingTime::validateFilterId($this->filterId)) {
if (!is_null($this->filterId)) {
return $this->filterId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this ManufacturingTime::filterId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateFilterId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ManufacturingTime::filterId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getFilterId(): ?int {
if (ManufacturingTime::validateFilterId($this->filterId)) {
return $this->filterId;
}
throw new Exception('never get to getFilterId ManufacturingTime::filterId');
}
/**
* @return ?int
*/
public static function sampleFilterId(): ?int {
return 32; /*32:filterId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ManufacturingTime::validateDogmaAttributeId($this->dogmaAttributeId)
|| ManufacturingTime::validateFilterId($this->filterId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
$out->{'filterID'} = $this->toFilterId();
return $out;
}
/**
* @param stdClass $obj
* @return ManufacturingTime
* @throws Exception
*/
public static function from(stdClass $obj): ManufacturingTime {
return new ManufacturingTime(
ManufacturingTime::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
,ManufacturingTime::fromFilterId($obj->{'filterID'})
);
}
/**
* @return ManufacturingTime
*/
public static function sample(): ManufacturingTime {
return new ManufacturingTime(
ManufacturingTime::sampleDogmaAttributeId()
,ManufacturingTime::sampleFilterId()
);
}
}
// This is an autogenerated file:Reaction
class Reaction {
private ?array $material; // json:material Optional
private ?array $time; // json:time Optional
/**
* @param array|null $material
* @param array|null $time
*/
public function __construct(?array $material, ?array $time) {
$this->material = $material;
$this->time = $time;
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromMaterial(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ReactionMaterial::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toMaterial(): ?array {
if (Reaction::validateMaterial($this->material)) {
if (!is_null($this->material)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->material);
} else {
return null;
}
}
throw new Exception('never get to this Reaction::material');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateMaterial(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Reaction::material");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getMaterial(): ?array {
if (Reaction::validateMaterial($this->material)) {
return $this->material;
}
throw new Exception('never get to getMaterial Reaction::material');
}
/**
* @return ?array
*/
public static function sampleMaterial(): ?array {
return array(
ReactionMaterial::sample() /*31:*/
); /* 31:material*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromTime(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ReactionTime::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toTime(): ?array {
if (Reaction::validateTime($this->time)) {
if (!is_null($this->time)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->time);
} else {
return null;
}
}
throw new Exception('never get to this Reaction::time');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateTime(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Reaction::time");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getTime(): ?array {
if (Reaction::validateTime($this->time)) {
return $this->time;
}
throw new Exception('never get to getTime Reaction::time');
}
/**
* @return ?array
*/
public static function sampleTime(): ?array {
return array(
ReactionTime::sample() /*32:*/
); /* 32:time*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Reaction::validateMaterial($this->material)
|| Reaction::validateTime($this->time);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'material'} = $this->toMaterial();
$out->{'time'} = $this->toTime();
return $out;
}
/**
* @param stdClass $obj
* @return Reaction
* @throws Exception
*/
public static function from(stdClass $obj): Reaction {
return new Reaction(
Reaction::fromMaterial($obj->{'material'})
,Reaction::fromTime($obj->{'time'})
);
}
/**
* @return Reaction
*/
public static function sample(): Reaction {
return new Reaction(
Reaction::sampleMaterial()
,Reaction::sampleTime()
);
}
}
// This is an autogenerated file:ReactionMaterial
class ReactionMaterial {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
private int $filterId; // json:filterID Required
/**
* @param int $dogmaAttributeId
* @param int $filterId
*/
public function __construct(int $dogmaAttributeId, int $filterId) {
$this->dogmaAttributeId = $dogmaAttributeId;
$this->filterId = $filterId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ReactionMaterial::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ReactionMaterial::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ReactionMaterial::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ReactionMaterial::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ReactionMaterial::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromFilterId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toFilterId(): int {
if (ReactionMaterial::validateFilterId($this->filterId)) {
return $this->filterId; /*int*/
}
throw new Exception('never get to this ReactionMaterial::filterId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateFilterId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ReactionMaterial::filterId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getFilterId(): int {
if (ReactionMaterial::validateFilterId($this->filterId)) {
return $this->filterId;
}
throw new Exception('never get to getFilterId ReactionMaterial::filterId');
}
/**
* @return int
*/
public static function sampleFilterId(): int {
return 32; /*32:filterId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ReactionMaterial::validateDogmaAttributeId($this->dogmaAttributeId)
|| ReactionMaterial::validateFilterId($this->filterId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
$out->{'filterID'} = $this->toFilterId();
return $out;
}
/**
* @param stdClass $obj
* @return ReactionMaterial
* @throws Exception
*/
public static function from(stdClass $obj): ReactionMaterial {
return new ReactionMaterial(
ReactionMaterial::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
,ReactionMaterial::fromFilterId($obj->{'filterID'})
);
}
/**
* @return ReactionMaterial
*/
public static function sample(): ReactionMaterial {
return new ReactionMaterial(
ReactionMaterial::sampleDogmaAttributeId()
,ReactionMaterial::sampleFilterId()
);
}
}
// This is an autogenerated file:ReactionTime
class ReactionTime {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
private ?int $filterId; // json:filterID Optional
/**
* @param int $dogmaAttributeId
* @param int|null $filterId
*/
public function __construct(int $dogmaAttributeId, ?int $filterId) {
$this->dogmaAttributeId = $dogmaAttributeId;
$this->filterId = $filterId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ReactionTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ReactionTime::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ReactionTime::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ReactionTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ReactionTime::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromFilterId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toFilterId(): ?int {
if (ReactionTime::validateFilterId($this->filterId)) {
if (!is_null($this->filterId)) {
return $this->filterId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this ReactionTime::filterId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateFilterId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ReactionTime::filterId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getFilterId(): ?int {
if (ReactionTime::validateFilterId($this->filterId)) {
return $this->filterId;
}
throw new Exception('never get to getFilterId ReactionTime::filterId');
}
/**
* @return ?int
*/
public static function sampleFilterId(): ?int {
return 32; /*32:filterId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ReactionTime::validateDogmaAttributeId($this->dogmaAttributeId)
|| ReactionTime::validateFilterId($this->filterId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
$out->{'filterID'} = $this->toFilterId();
return $out;
}
/**
* @param stdClass $obj
* @return ReactionTime
* @throws Exception
*/
public static function from(stdClass $obj): ReactionTime {
return new ReactionTime(
ReactionTime::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
,ReactionTime::fromFilterId($obj->{'filterID'})
);
}
/**
* @return ReactionTime
*/
public static function sample(): ReactionTime {
return new ReactionTime(
ReactionTime::sampleDogmaAttributeId()
,ReactionTime::sampleFilterId()
);
}
}
// This is an autogenerated file:ResearchMaterial
class ResearchMaterial {
private ?array $cost; // json:cost Optional
private ?array $time; // json:time Optional
/**
* @param array|null $cost
* @param array|null $time
*/
public function __construct(?array $cost, ?array $time) {
$this->cost = $cost;
$this->time = $time;
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromCost(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ResearchMaterialCost::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toCost(): ?array {
if (ResearchMaterial::validateCost($this->cost)) {
if (!is_null($this->cost)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->cost);
} else {
return null;
}
}
throw new Exception('never get to this ResearchMaterial::cost');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateCost(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:ResearchMaterial::cost");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getCost(): ?array {
if (ResearchMaterial::validateCost($this->cost)) {
return $this->cost;
}
throw new Exception('never get to getCost ResearchMaterial::cost');
}
/**
* @return ?array
*/
public static function sampleCost(): ?array {
return array(
ResearchMaterialCost::sample() /*31:*/
); /* 31:cost*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromTime(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ResearchMaterialTime::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toTime(): ?array {
if (ResearchMaterial::validateTime($this->time)) {
if (!is_null($this->time)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->time);
} else {
return null;
}
}
throw new Exception('never get to this ResearchMaterial::time');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateTime(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:ResearchMaterial::time");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getTime(): ?array {
if (ResearchMaterial::validateTime($this->time)) {
return $this->time;
}
throw new Exception('never get to getTime ResearchMaterial::time');
}
/**
* @return ?array
*/
public static function sampleTime(): ?array {
return array(
ResearchMaterialTime::sample() /*32:*/
); /* 32:time*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ResearchMaterial::validateCost($this->cost)
|| ResearchMaterial::validateTime($this->time);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'cost'} = $this->toCost();
$out->{'time'} = $this->toTime();
return $out;
}
/**
* @param stdClass $obj
* @return ResearchMaterial
* @throws Exception
*/
public static function from(stdClass $obj): ResearchMaterial {
return new ResearchMaterial(
ResearchMaterial::fromCost($obj->{'cost'})
,ResearchMaterial::fromTime($obj->{'time'})
);
}
/**
* @return ResearchMaterial
*/
public static function sample(): ResearchMaterial {
return new ResearchMaterial(
ResearchMaterial::sampleCost()
,ResearchMaterial::sampleTime()
);
}
}
// This is an autogenerated file:ResearchMaterialCost
class ResearchMaterialCost {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ResearchMaterialCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ResearchMaterialCost::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ResearchMaterialCost::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ResearchMaterialCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ResearchMaterialCost::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ResearchMaterialCost::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return ResearchMaterialCost
* @throws Exception
*/
public static function from(stdClass $obj): ResearchMaterialCost {
return new ResearchMaterialCost(
ResearchMaterialCost::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return ResearchMaterialCost
*/
public static function sample(): ResearchMaterialCost {
return new ResearchMaterialCost(
ResearchMaterialCost::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:ResearchMaterialTime
class ResearchMaterialTime {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ResearchMaterialTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ResearchMaterialTime::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ResearchMaterialTime::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ResearchMaterialTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ResearchMaterialTime::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ResearchMaterialTime::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return ResearchMaterialTime
* @throws Exception
*/
public static function from(stdClass $obj): ResearchMaterialTime {
return new ResearchMaterialTime(
ResearchMaterialTime::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return ResearchMaterialTime
*/
public static function sample(): ResearchMaterialTime {
return new ResearchMaterialTime(
ResearchMaterialTime::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:ResearchTime
class ResearchTime {
private ?array $cost; // json:cost Optional
private ?array $time; // json:time Optional
/**
* @param array|null $cost
* @param array|null $time
*/
public function __construct(?array $cost, ?array $time) {
$this->cost = $cost;
$this->time = $time;
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromCost(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ResearchTimeCost::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toCost(): ?array {
if (ResearchTime::validateCost($this->cost)) {
if (!is_null($this->cost)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->cost);
} else {
return null;
}
}
throw new Exception('never get to this ResearchTime::cost');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateCost(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:ResearchTime::cost");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getCost(): ?array {
if (ResearchTime::validateCost($this->cost)) {
return $this->cost;
}
throw new Exception('never get to getCost ResearchTime::cost');
}
/**
* @return ?array
*/
public static function sampleCost(): ?array {
return array(
ResearchTimeCost::sample() /*31:*/
); /* 31:cost*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromTime(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ResearchTimeTime::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toTime(): ?array {
if (ResearchTime::validateTime($this->time)) {
if (!is_null($this->time)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->time);
} else {
return null;
}
}
throw new Exception('never get to this ResearchTime::time');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateTime(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:ResearchTime::time");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getTime(): ?array {
if (ResearchTime::validateTime($this->time)) {
return $this->time;
}
throw new Exception('never get to getTime ResearchTime::time');
}
/**
* @return ?array
*/
public static function sampleTime(): ?array {
return array(
ResearchTimeTime::sample() /*32:*/
); /* 32:time*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ResearchTime::validateCost($this->cost)
|| ResearchTime::validateTime($this->time);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'cost'} = $this->toCost();
$out->{'time'} = $this->toTime();
return $out;
}
/**
* @param stdClass $obj
* @return ResearchTime
* @throws Exception
*/
public static function from(stdClass $obj): ResearchTime {
return new ResearchTime(
ResearchTime::fromCost($obj->{'cost'})
,ResearchTime::fromTime($obj->{'time'})
);
}
/**
* @return ResearchTime
*/
public static function sample(): ResearchTime {
return new ResearchTime(
ResearchTime::sampleCost()
,ResearchTime::sampleTime()
);
}
}
// This is an autogenerated file:ResearchTimeCost
class ResearchTimeCost {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ResearchTimeCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ResearchTimeCost::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ResearchTimeCost::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ResearchTimeCost::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ResearchTimeCost::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ResearchTimeCost::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return ResearchTimeCost
* @throws Exception
*/
public static function from(stdClass $obj): ResearchTimeCost {
return new ResearchTimeCost(
ResearchTimeCost::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return ResearchTimeCost
*/
public static function sample(): ResearchTimeCost {
return new ResearchTimeCost(
ResearchTimeCost::sampleDogmaAttributeId()
);
}
}
// This is an autogenerated file:ResearchTimeTime
class ResearchTimeTime {
private int $dogmaAttributeId; // json:dogmaAttributeID Required
/**
* @param int $dogmaAttributeId
*/
public function __construct(int $dogmaAttributeId) {
$this->dogmaAttributeId = $dogmaAttributeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromDogmaAttributeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toDogmaAttributeId(): int {
if (ResearchTimeTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId; /*int*/
}
throw new Exception('never get to this ResearchTimeTime::dogmaAttributeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateDogmaAttributeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ResearchTimeTime::dogmaAttributeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getDogmaAttributeId(): int {
if (ResearchTimeTime::validateDogmaAttributeId($this->dogmaAttributeId)) {
return $this->dogmaAttributeId;
}
throw new Exception('never get to getDogmaAttributeId ResearchTimeTime::dogmaAttributeId');
}
/**
* @return int
*/
public static function sampleDogmaAttributeId(): int {
return 31; /*31:dogmaAttributeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ResearchTimeTime::validateDogmaAttributeId($this->dogmaAttributeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dogmaAttributeID'} = $this->toDogmaAttributeId();
return $out;
}
/**
* @param stdClass $obj
* @return ResearchTimeTime
* @throws Exception
*/
public static function from(stdClass $obj): ResearchTimeTime {
return new ResearchTimeTime(
ResearchTimeTime::fromDogmaAttributeId($obj->{'dogmaAttributeID'})
);
}
/**
* @return ResearchTimeTime
*/
public static function sample(): ResearchTimeTime {
return new ResearchTimeTime(
ResearchTimeTime::sampleDogmaAttributeId()
);
}
}
from dataclasses import dataclass
from typing import Any, TypeVar, Callable, Type, cast
T = TypeVar("T")
def from_int(x: Any) -> int:
assert isinstance(x, int) and not isinstance(x, bool)
return x
def from_list(f: Callable[[Any], T], x: Any) -> list[T]:
assert isinstance(x, list)
return [f(y) for y in 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 to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
@dataclass
class CopyingCost:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'CopyingCost':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return CopyingCost(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class CopyingTime:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'CopyingTime':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return CopyingTime(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class Copying:
cost: list[CopyingCost] | None = None
time: list[CopyingTime] | None = None
@staticmethod
def from_dict(obj: Any) -> 'Copying':
assert isinstance(obj, dict)
cost = from_union([lambda x: from_list(CopyingCost.from_dict, x), from_none], obj.get("cost"))
time = from_union([lambda x: from_list(CopyingTime.from_dict, x), from_none], obj.get("time"))
return Copying(cost, time)
def to_dict(self) -> dict:
result: dict = {}
if self.cost is not None:
result["cost"] = from_union([lambda x: from_list(lambda x: to_class(CopyingCost, x), x), from_none], self.cost)
if self.time is not None:
result["time"] = from_union([lambda x: from_list(lambda x: to_class(CopyingTime, x), x), from_none], self.time)
return result
@dataclass
class InventionCost:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'InventionCost':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return InventionCost(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class InventionTime:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'InventionTime':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return InventionTime(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class Invention:
cost: list[InventionCost] | None = None
time: list[InventionTime] | None = None
@staticmethod
def from_dict(obj: Any) -> 'Invention':
assert isinstance(obj, dict)
cost = from_union([lambda x: from_list(InventionCost.from_dict, x), from_none], obj.get("cost"))
time = from_union([lambda x: from_list(InventionTime.from_dict, x), from_none], obj.get("time"))
return Invention(cost, time)
def to_dict(self) -> dict:
result: dict = {}
if self.cost is not None:
result["cost"] = from_union([lambda x: from_list(lambda x: to_class(InventionCost, x), x), from_none], self.cost)
if self.time is not None:
result["time"] = from_union([lambda x: from_list(lambda x: to_class(InventionTime, x), x), from_none], self.time)
return result
@dataclass
class ManufacturingCost:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'ManufacturingCost':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return ManufacturingCost(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class ManufacturingMaterial:
dogma_attribute_id: int
filter_id: int | None = None
@staticmethod
def from_dict(obj: Any) -> 'ManufacturingMaterial':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
filter_id = from_union([from_int, from_none], obj.get("filterID"))
return ManufacturingMaterial(dogma_attribute_id, filter_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
if self.filter_id is not None:
result["filterID"] = from_union([from_int, from_none], self.filter_id)
return result
@dataclass
class ManufacturingTime:
dogma_attribute_id: int
filter_id: int | None = None
@staticmethod
def from_dict(obj: Any) -> 'ManufacturingTime':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
filter_id = from_union([from_int, from_none], obj.get("filterID"))
return ManufacturingTime(dogma_attribute_id, filter_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
if self.filter_id is not None:
result["filterID"] = from_union([from_int, from_none], self.filter_id)
return result
@dataclass
class Manufacturing:
cost: list[ManufacturingCost] | None = None
material: list[ManufacturingMaterial] | None = None
time: list[ManufacturingTime] | None = None
@staticmethod
def from_dict(obj: Any) -> 'Manufacturing':
assert isinstance(obj, dict)
cost = from_union([lambda x: from_list(ManufacturingCost.from_dict, x), from_none], obj.get("cost"))
material = from_union([lambda x: from_list(ManufacturingMaterial.from_dict, x), from_none], obj.get("material"))
time = from_union([lambda x: from_list(ManufacturingTime.from_dict, x), from_none], obj.get("time"))
return Manufacturing(cost, material, time)
def to_dict(self) -> dict:
result: dict = {}
if self.cost is not None:
result["cost"] = from_union([lambda x: from_list(lambda x: to_class(ManufacturingCost, x), x), from_none], self.cost)
if self.material is not None:
result["material"] = from_union([lambda x: from_list(lambda x: to_class(ManufacturingMaterial, x), x), from_none], self.material)
if self.time is not None:
result["time"] = from_union([lambda x: from_list(lambda x: to_class(ManufacturingTime, x), x), from_none], self.time)
return result
@dataclass
class ReactionMaterial:
dogma_attribute_id: int
filter_id: int
@staticmethod
def from_dict(obj: Any) -> 'ReactionMaterial':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
filter_id = from_int(obj.get("filterID"))
return ReactionMaterial(dogma_attribute_id, filter_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
result["filterID"] = from_int(self.filter_id)
return result
@dataclass
class ReactionTime:
dogma_attribute_id: int
filter_id: int | None = None
@staticmethod
def from_dict(obj: Any) -> 'ReactionTime':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
filter_id = from_union([from_int, from_none], obj.get("filterID"))
return ReactionTime(dogma_attribute_id, filter_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
if self.filter_id is not None:
result["filterID"] = from_union([from_int, from_none], self.filter_id)
return result
@dataclass
class Reaction:
material: list[ReactionMaterial] | None = None
time: list[ReactionTime] | None = None
@staticmethod
def from_dict(obj: Any) -> 'Reaction':
assert isinstance(obj, dict)
material = from_union([lambda x: from_list(ReactionMaterial.from_dict, x), from_none], obj.get("material"))
time = from_union([lambda x: from_list(ReactionTime.from_dict, x), from_none], obj.get("time"))
return Reaction(material, time)
def to_dict(self) -> dict:
result: dict = {}
if self.material is not None:
result["material"] = from_union([lambda x: from_list(lambda x: to_class(ReactionMaterial, x), x), from_none], self.material)
if self.time is not None:
result["time"] = from_union([lambda x: from_list(lambda x: to_class(ReactionTime, x), x), from_none], self.time)
return result
@dataclass
class ResearchMaterialCost:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'ResearchMaterialCost':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return ResearchMaterialCost(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class ResearchMaterialTime:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'ResearchMaterialTime':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return ResearchMaterialTime(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class ResearchMaterial:
cost: list[ResearchMaterialCost] | None = None
time: list[ResearchMaterialTime] | None = None
@staticmethod
def from_dict(obj: Any) -> 'ResearchMaterial':
assert isinstance(obj, dict)
cost = from_union([lambda x: from_list(ResearchMaterialCost.from_dict, x), from_none], obj.get("cost"))
time = from_union([lambda x: from_list(ResearchMaterialTime.from_dict, x), from_none], obj.get("time"))
return ResearchMaterial(cost, time)
def to_dict(self) -> dict:
result: dict = {}
if self.cost is not None:
result["cost"] = from_union([lambda x: from_list(lambda x: to_class(ResearchMaterialCost, x), x), from_none], self.cost)
if self.time is not None:
result["time"] = from_union([lambda x: from_list(lambda x: to_class(ResearchMaterialTime, x), x), from_none], self.time)
return result
@dataclass
class ResearchTimeCost:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'ResearchTimeCost':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return ResearchTimeCost(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class ResearchTimeTime:
dogma_attribute_id: int
@staticmethod
def from_dict(obj: Any) -> 'ResearchTimeTime':
assert isinstance(obj, dict)
dogma_attribute_id = from_int(obj.get("dogmaAttributeID"))
return ResearchTimeTime(dogma_attribute_id)
def to_dict(self) -> dict:
result: dict = {}
result["dogmaAttributeID"] = from_int(self.dogma_attribute_id)
return result
@dataclass
class ResearchTime:
cost: list[ResearchTimeCost] | None = None
time: list[ResearchTimeTime] | None = None
@staticmethod
def from_dict(obj: Any) -> 'ResearchTime':
assert isinstance(obj, dict)
cost = from_union([lambda x: from_list(ResearchTimeCost.from_dict, x), from_none], obj.get("cost"))
time = from_union([lambda x: from_list(ResearchTimeTime.from_dict, x), from_none], obj.get("time"))
return ResearchTime(cost, time)
def to_dict(self) -> dict:
result: dict = {}
if self.cost is not None:
result["cost"] = from_union([lambda x: from_list(lambda x: to_class(ResearchTimeCost, x), x), from_none], self.cost)
if self.time is not None:
result["time"] = from_union([lambda x: from_list(lambda x: to_class(ResearchTimeTime, x), x), from_none], self.time)
return result
@dataclass
class IndustryModifierSource:
key: int
copying: Copying | None = None
invention: Invention | None = None
manufacturing: Manufacturing | None = None
reaction: Reaction | None = None
research_material: ResearchMaterial | None = None
research_time: ResearchTime | None = None
@staticmethod
def from_dict(obj: Any) -> 'IndustryModifierSource':
assert isinstance(obj, dict)
key = from_int(obj.get("_key"))
copying = from_union([Copying.from_dict, from_none], obj.get("copying"))
invention = from_union([Invention.from_dict, from_none], obj.get("invention"))
manufacturing = from_union([Manufacturing.from_dict, from_none], obj.get("manufacturing"))
reaction = from_union([Reaction.from_dict, from_none], obj.get("reaction"))
research_material = from_union([ResearchMaterial.from_dict, from_none], obj.get("researchMaterial"))
research_time = from_union([ResearchTime.from_dict, from_none], obj.get("researchTime"))
return IndustryModifierSource(key, copying, invention, manufacturing, reaction, research_material, research_time)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_int(self.key)
if self.copying is not None:
result["copying"] = from_union([lambda x: to_class(Copying, x), from_none], self.copying)
if self.invention is not None:
result["invention"] = from_union([lambda x: to_class(Invention, x), from_none], self.invention)
if self.manufacturing is not None:
result["manufacturing"] = from_union([lambda x: to_class(Manufacturing, x), from_none], self.manufacturing)
if self.reaction is not None:
result["reaction"] = from_union([lambda x: to_class(Reaction, x), from_none], self.reaction)
if self.research_material is not None:
result["researchMaterial"] = from_union([lambda x: to_class(ResearchMaterial, x), from_none], self.research_material)
if self.research_time is not None:
result["researchTime"] = from_union([lambda x: to_class(ResearchTime, x), from_none], self.research_time)
return result
def industry_modifier_source_from_dict(s: Any) -> IndustryModifierSource:
return IndustryModifierSource.from_dict(s)
def industry_modifier_source_to_dict(x: IndustryModifierSource) -> Any:
return to_class(IndustryModifierSource, x)
// To parse this data:
//
// import { Convert, IndustryModifierSource } from "./IndustryModifierSource";
//
// const industryModifierSource = Convert.toIndustryModifierSource(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
export interface IndustryModifierSource {
_key: number;
copying?: Copying;
invention?: Invention;
manufacturing?: Manufacturing;
reaction?: Reaction;
researchMaterial?: ResearchMaterial;
researchTime?: ResearchTime;
[property: string]: unknown;
}
export interface Copying {
cost?: [CopyingCost, ...CopyingCost[]];
time?: [CopyingTime, ...CopyingTime[]];
[property: string]: unknown;
}
export interface CopyingCost {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface CopyingTime {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface Invention {
cost?: [InventionCost, ...InventionCost[]];
time?: [InventionTime, ...InventionTime[]];
[property: string]: unknown;
}
export interface InventionCost {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface InventionTime {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface Manufacturing {
cost?: [ManufacturingCost, ...ManufacturingCost[]];
material?: [ManufacturingMaterial, ...ManufacturingMaterial[]];
time?: [ManufacturingTime, ...ManufacturingTime[]];
[property: string]: unknown;
}
export interface ManufacturingCost {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface ManufacturingMaterial {
dogmaAttributeID: number;
filterID?: number;
[property: string]: unknown;
}
export interface ManufacturingTime {
dogmaAttributeID: number;
filterID?: number;
[property: string]: unknown;
}
export interface Reaction {
material?: [ReactionMaterial, ...ReactionMaterial[]];
time?: [ReactionTime, ...ReactionTime[]];
[property: string]: unknown;
}
export interface ReactionMaterial {
dogmaAttributeID: number;
filterID: number;
[property: string]: unknown;
}
export interface ReactionTime {
dogmaAttributeID: number;
filterID?: number;
[property: string]: unknown;
}
export interface ResearchMaterial {
cost?: [ResearchMaterialCost, ...ResearchMaterialCost[]];
time?: [ResearchMaterialTime, ...ResearchMaterialTime[]];
[property: string]: unknown;
}
export interface ResearchMaterialCost {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface ResearchMaterialTime {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface ResearchTime {
cost?: [ResearchTimeCost, ...ResearchTimeCost[]];
time?: [ResearchTimeTime, ...ResearchTimeTime[]];
[property: string]: unknown;
}
export interface ResearchTimeCost {
dogmaAttributeID: number;
[property: string]: unknown;
}
export interface ResearchTimeTime {
dogmaAttributeID: number;
[property: string]: unknown;
}
// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
public static toIndustryModifierSource(json: string): IndustryModifierSource {
return cast(JSON.parse(json), r("IndustryModifierSource"));
}
public static industryModifierSourceToJson(value: IndustryModifierSource): string {
return JSON.stringify(uncast(value, r("IndustryModifierSource")), 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 = {
"IndustryModifierSource": o([
{ json: "_key", js: "_key", typ: 0 },
{ json: "copying", js: "copying", typ: u(undefined, r("Copying")) },
{ json: "invention", js: "invention", typ: u(undefined, r("Invention")) },
{ json: "manufacturing", js: "manufacturing", typ: u(undefined, r("Manufacturing")) },
{ json: "reaction", js: "reaction", typ: u(undefined, r("Reaction")) },
{ json: "researchMaterial", js: "researchMaterial", typ: u(undefined, r("ResearchMaterial")) },
{ json: "researchTime", js: "researchTime", typ: u(undefined, r("ResearchTime")) },
], "any"),
"Copying": o([
{ json: "cost", js: "cost", typ: u(undefined, a(r("CopyingCost"))) },
{ json: "time", js: "time", typ: u(undefined, a(r("CopyingTime"))) },
], "any"),
"CopyingCost": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"CopyingTime": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"Invention": o([
{ json: "cost", js: "cost", typ: u(undefined, a(r("InventionCost"))) },
{ json: "time", js: "time", typ: u(undefined, a(r("InventionTime"))) },
], "any"),
"InventionCost": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"InventionTime": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"Manufacturing": o([
{ json: "cost", js: "cost", typ: u(undefined, a(r("ManufacturingCost"))) },
{ json: "material", js: "material", typ: u(undefined, a(r("ManufacturingMaterial"))) },
{ json: "time", js: "time", typ: u(undefined, a(r("ManufacturingTime"))) },
], "any"),
"ManufacturingCost": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"ManufacturingMaterial": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
{ json: "filterID", js: "filterID", typ: u(undefined, 0) },
], "any"),
"ManufacturingTime": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
{ json: "filterID", js: "filterID", typ: u(undefined, 0) },
], "any"),
"Reaction": o([
{ json: "material", js: "material", typ: u(undefined, a(r("ReactionMaterial"))) },
{ json: "time", js: "time", typ: u(undefined, a(r("ReactionTime"))) },
], "any"),
"ReactionMaterial": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
{ json: "filterID", js: "filterID", typ: 0 },
], "any"),
"ReactionTime": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
{ json: "filterID", js: "filterID", typ: u(undefined, 0) },
], "any"),
"ResearchMaterial": o([
{ json: "cost", js: "cost", typ: u(undefined, a(r("ResearchMaterialCost"))) },
{ json: "time", js: "time", typ: u(undefined, a(r("ResearchMaterialTime"))) },
], "any"),
"ResearchMaterialCost": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"ResearchMaterialTime": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"ResearchTime": o([
{ json: "cost", js: "cost", typ: u(undefined, a(r("ResearchTimeCost"))) },
{ json: "time", js: "time", typ: u(undefined, a(r("ResearchTimeTime"))) },
], "any"),
"ResearchTimeCost": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
"ResearchTimeTime": o([
{ json: "dogmaAttributeID", js: "dogmaAttributeID", typ: 0 },
], "any"),
};