missions.jsonl
Schema
_key(required): integer
Range: 875 .. 17192agentTypeID: integer
Range: 9 .. 13corporationID: integer
Range: 1000017 .. 1000419-
courierMission: objectobjectiveQuantity(required): integer
Range: 1 .. 100000objectiveSingleton(required): booleanobjectiveTypeID(required): integer
Range: 20 .. 91858
-
expirationTime: integer
Range: 0 .. 43200 -
extraStandings: array of object_key(required): integer
Range: 500001 .. 500019_value(required): number
Range: 1.5 .. 30
-
factionID: integer
Range: 500001 .. 500020 hasStandingRewards(required): booleaninitialAgentGiftQuantity: integer
Range: 0 .. 500initialAgentGiftTypeID: integer
Range: 29 .. 93643-
killMission: objectdropItemInMissionContainer: integer
Range: 30762 .. 30793dungeonID: integer
Range: 184 .. 14222objectiveQuantity: integer
Range: 0 .. 40000objectiveTypeID: integer
Range: 34 .. 88105
-
messages: array of object_key(required): stringde: stringen(required): stringes: stringfr: stringja: stringko: stringru: stringzh: string
-
missionRewards: object-
bonusReward: objectrewardQuantity: integer
Range: 1 .. 10600000rewardTypeID: integer
Range: 29 .. 27294
-
bonusTimeInterval: integer
Range: 1 .. 10500000 reward: objectrewardQuantity(required): integer
Range: 1 .. 40000000rewardTypeID: integer
Range: 29 .. 90039
-
-
name(required): objectde: stringen(required): stringes: stringfr: stringja: stringko: stringru: stringzh: string
Code snippets
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using QuickType;
//
// var mission = Mission.FromJson(jsonString);
namespace QuickType
{
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
public partial class Mission
{
[JsonProperty("_key")]
public long Key { get; set; }
[JsonProperty("agentTypeID", NullValueHandling = NullValueHandling.Ignore)]
public long? AgentTypeId { get; set; }
[JsonProperty("corporationID", NullValueHandling = NullValueHandling.Ignore)]
public long? CorporationId { get; set; }
[JsonProperty("courierMission", NullValueHandling = NullValueHandling.Ignore)]
public CourierMission CourierMission { get; set; }
[JsonProperty("expirationTime", NullValueHandling = NullValueHandling.Ignore)]
public long? ExpirationTime { get; set; }
[JsonProperty("extraStandings", NullValueHandling = NullValueHandling.Ignore)]
public ExtraStanding[] ExtraStandings { get; set; }
[JsonProperty("factionID", NullValueHandling = NullValueHandling.Ignore)]
public long? FactionId { get; set; }
[JsonProperty("hasStandingRewards")]
public bool HasStandingRewards { get; set; }
[JsonProperty("initialAgentGiftQuantity", NullValueHandling = NullValueHandling.Ignore)]
public long? InitialAgentGiftQuantity { get; set; }
[JsonProperty("initialAgentGiftTypeID", NullValueHandling = NullValueHandling.Ignore)]
public long? InitialAgentGiftTypeId { get; set; }
[JsonProperty("killMission", NullValueHandling = NullValueHandling.Ignore)]
public KillMission KillMission { get; set; }
[JsonProperty("messages", NullValueHandling = NullValueHandling.Ignore)]
public Message[] Messages { get; set; }
[JsonProperty("missionRewards", NullValueHandling = NullValueHandling.Ignore)]
public MissionRewards MissionRewards { get; set; }
[JsonProperty("name")]
public Name Name { get; set; }
}
public partial class CourierMission
{
[JsonProperty("objectiveQuantity")]
public long ObjectiveQuantity { get; set; }
[JsonProperty("objectiveSingleton")]
public bool ObjectiveSingleton { get; set; }
[JsonProperty("objectiveTypeID")]
public long ObjectiveTypeId { get; set; }
}
public partial class ExtraStanding
{
[JsonProperty("_key")]
public long Key { get; set; }
[JsonProperty("_value")]
[JsonConverter(typeof(MinMaxValueCheckConverter))]
public double Value { get; set; }
}
public partial class KillMission
{
[JsonProperty("dropItemInMissionContainer", NullValueHandling = NullValueHandling.Ignore)]
public long? DropItemInMissionContainer { get; set; }
[JsonProperty("dungeonID", NullValueHandling = NullValueHandling.Ignore)]
public long? DungeonId { get; set; }
[JsonProperty("objectiveQuantity", NullValueHandling = NullValueHandling.Ignore)]
public long? ObjectiveQuantity { get; set; }
[JsonProperty("objectiveTypeID", NullValueHandling = NullValueHandling.Ignore)]
public long? ObjectiveTypeId { get; set; }
}
public partial class Message
{
[JsonProperty("_key")]
[JsonConverter(typeof(PurpleMinMaxLengthCheckConverter))]
public string Key { get; set; }
[JsonProperty("de", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(FluffyMinMaxLengthCheckConverter))]
public string De { get; set; }
[JsonProperty("en")]
[JsonConverter(typeof(TentacledMinMaxLengthCheckConverter))]
public string En { get; set; }
[JsonProperty("es", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(StickyMinMaxLengthCheckConverter))]
public string Es { get; set; }
[JsonProperty("fr", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(IndigoMinMaxLengthCheckConverter))]
public string Fr { get; set; }
[JsonProperty("ja", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(IndecentMinMaxLengthCheckConverter))]
public string Ja { get; set; }
[JsonProperty("ko", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(HilariousMinMaxLengthCheckConverter))]
public string Ko { get; set; }
[JsonProperty("ru", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(AmbitiousMinMaxLengthCheckConverter))]
public string Ru { get; set; }
[JsonProperty("zh", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(CunningMinMaxLengthCheckConverter))]
public string Zh { get; set; }
}
public partial class MissionRewards
{
[JsonProperty("bonusReward", NullValueHandling = NullValueHandling.Ignore)]
public BonusReward BonusReward { get; set; }
[JsonProperty("bonusTimeInterval", NullValueHandling = NullValueHandling.Ignore)]
public long? BonusTimeInterval { get; set; }
[JsonProperty("reward", NullValueHandling = NullValueHandling.Ignore)]
public Reward Reward { get; set; }
}
public partial class BonusReward
{
[JsonProperty("rewardQuantity", NullValueHandling = NullValueHandling.Ignore)]
public long? RewardQuantity { get; set; }
[JsonProperty("rewardTypeID", NullValueHandling = NullValueHandling.Ignore)]
public long? RewardTypeId { get; set; }
}
public partial class Reward
{
[JsonProperty("rewardQuantity")]
public long RewardQuantity { get; set; }
[JsonProperty("rewardTypeID", NullValueHandling = NullValueHandling.Ignore)]
public long? RewardTypeId { get; set; }
}
public partial class Name
{
[JsonProperty("de", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MagentaMinMaxLengthCheckConverter))]
public string De { get; set; }
[JsonProperty("en")]
[JsonConverter(typeof(FriskyMinMaxLengthCheckConverter))]
public string En { get; set; }
[JsonProperty("es", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MischievousMinMaxLengthCheckConverter))]
public string Es { get; set; }
[JsonProperty("fr", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MischievousMinMaxLengthCheckConverter))]
public string Fr { get; set; }
[JsonProperty("ja", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(BraggadociousMinMaxLengthCheckConverter))]
public string Ja { get; set; }
[JsonProperty("ko", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter1))]
public string Ko { get; set; }
[JsonProperty("ru", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter2))]
public string Ru { get; set; }
[JsonProperty("zh", NullValueHandling = NullValueHandling.Ignore)]
[JsonConverter(typeof(MinMaxLengthCheckConverter3))]
public string Zh { get; set; }
}
public partial class Mission
{
public static Mission FromJson(string json) => JsonConvert.DeserializeObject<Mission>(json, QuickType.Converter.Settings);
}
public static class Serialize
{
public static string ToJson(this Mission self) => JsonConvert.SerializeObject(self, QuickType.Converter.Settings);
}
internal static class Converter
{
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
},
};
}
internal class MinMaxValueCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(double) || t == typeof(double?);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<double>(reader);
if (value >= 1.5 && value <= 30)
{
return value;
}
throw new Exception("Cannot unmarshal type double");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (double)untypedValue;
if (value >= 1.5 && value <= 30)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type double");
}
public static readonly MinMaxValueCheckConverter Singleton = new MinMaxValueCheckConverter();
}
internal class PurpleMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 23 && value.Length <= 50)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 23 && value.Length <= 50)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly PurpleMinMaxLengthCheckConverter Singleton = new PurpleMinMaxLengthCheckConverter();
}
internal class FluffyMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 4166)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 4166)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly FluffyMinMaxLengthCheckConverter Singleton = new FluffyMinMaxLengthCheckConverter();
}
internal class TentacledMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 3443)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 3443)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly TentacledMinMaxLengthCheckConverter Singleton = new TentacledMinMaxLengthCheckConverter();
}
internal class StickyMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 3871)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 3871)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly StickyMinMaxLengthCheckConverter Singleton = new StickyMinMaxLengthCheckConverter();
}
internal class IndigoMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 4287)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 4287)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly IndigoMinMaxLengthCheckConverter Singleton = new IndigoMinMaxLengthCheckConverter();
}
internal class IndecentMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 1588)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 1588)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly IndecentMinMaxLengthCheckConverter Singleton = new IndecentMinMaxLengthCheckConverter();
}
internal class HilariousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 1781)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 1781)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly HilariousMinMaxLengthCheckConverter Singleton = new HilariousMinMaxLengthCheckConverter();
}
internal class AmbitiousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 3 && value.Length <= 3772)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 3 && value.Length <= 3772)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly AmbitiousMinMaxLengthCheckConverter Singleton = new AmbitiousMinMaxLengthCheckConverter();
}
internal class CunningMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 1338)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 1338)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly CunningMinMaxLengthCheckConverter Singleton = new CunningMinMaxLengthCheckConverter();
}
internal class MagentaMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 84)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 84)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MagentaMinMaxLengthCheckConverter Singleton = new MagentaMinMaxLengthCheckConverter();
}
internal class FriskyMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 74)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 74)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly FriskyMinMaxLengthCheckConverter Singleton = new FriskyMinMaxLengthCheckConverter();
}
internal class MischievousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 80)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 80)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MischievousMinMaxLengthCheckConverter Singleton = new MischievousMinMaxLengthCheckConverter();
}
internal class BraggadociousMinMaxLengthCheckConverter : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 1 && value.Length <= 40)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 1 && value.Length <= 40)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly BraggadociousMinMaxLengthCheckConverter Singleton = new BraggadociousMinMaxLengthCheckConverter();
}
internal class MinMaxLengthCheckConverter1 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 1 && value.Length <= 46)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 1 && value.Length <= 46)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter1 Singleton = new MinMaxLengthCheckConverter1();
}
internal class MinMaxLengthCheckConverter2 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 133)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 133)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter2 Singleton = new MinMaxLengthCheckConverter2();
}
internal class MinMaxLengthCheckConverter3 : JsonConverter
{
public override bool CanConvert(Type t) => t == typeof(string);
public override object ReadJson(JsonReader reader, Type t, object existingValue, JsonSerializer serializer)
{
var value = serializer.Deserialize<string>(reader);
if (value.Length >= 2 && value.Length <= 39)
{
return value;
}
throw new Exception("Cannot unmarshal type string");
}
public override void WriteJson(JsonWriter writer, object untypedValue, JsonSerializer serializer)
{
var value = (string)untypedValue;
if (value.Length >= 2 && value.Length <= 39)
{
serializer.Serialize(writer, value);
return;
}
throw new Exception("Cannot marshal type string");
}
public static readonly MinMaxLengthCheckConverter3 Singleton = new MinMaxLengthCheckConverter3();
}
}
// 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:
//
// mission, err := UnmarshalMission(bytes)
// bytes, err = mission.Marshal()
package model
import "encoding/json"
func UnmarshalMission(data []byte) (Mission, error) {
var r Mission
err := json.Unmarshal(data, &r)
return r, err
}
func (r *Mission) Marshal() ([]byte, error) {
return json.Marshal(r)
}
type Mission struct {
Key int64 `json:"_key"`
AgentTypeID *int64 `json:"agentTypeID,omitempty"`
CorporationID *int64 `json:"corporationID,omitempty"`
CourierMission *CourierMission `json:"courierMission,omitempty"`
ExpirationTime *int64 `json:"expirationTime,omitempty"`
ExtraStandings []ExtraStanding `json:"extraStandings,omitempty"`
FactionID *int64 `json:"factionID,omitempty"`
HasStandingRewards bool `json:"hasStandingRewards"`
InitialAgentGiftQuantity *int64 `json:"initialAgentGiftQuantity,omitempty"`
InitialAgentGiftTypeID *int64 `json:"initialAgentGiftTypeID,omitempty"`
KillMission *KillMission `json:"killMission,omitempty"`
Messages []Message `json:"messages,omitempty"`
MissionRewards *MissionRewards `json:"missionRewards,omitempty"`
Name Name `json:"name"`
}
type CourierMission struct {
ObjectiveQuantity int64 `json:"objectiveQuantity"`
ObjectiveSingleton bool `json:"objectiveSingleton"`
ObjectiveTypeID int64 `json:"objectiveTypeID"`
}
type ExtraStanding struct {
Key int64 `json:"_key"`
Value float64 `json:"_value"`
}
type KillMission struct {
DropItemInMissionContainer *int64 `json:"dropItemInMissionContainer,omitempty"`
DungeonID *int64 `json:"dungeonID,omitempty"`
ObjectiveQuantity *int64 `json:"objectiveQuantity,omitempty"`
ObjectiveTypeID *int64 `json:"objectiveTypeID,omitempty"`
}
type Message struct {
Key string `json:"_key"`
De *string `json:"de,omitempty"`
En string `json:"en"`
Es *string `json:"es,omitempty"`
Fr *string `json:"fr,omitempty"`
Ja *string `json:"ja,omitempty"`
Ko *string `json:"ko,omitempty"`
Ru *string `json:"ru,omitempty"`
Zh *string `json:"zh,omitempty"`
}
type MissionRewards struct {
BonusReward *BonusReward `json:"bonusReward,omitempty"`
BonusTimeInterval *int64 `json:"bonusTimeInterval,omitempty"`
Reward *Reward `json:"reward,omitempty"`
}
type BonusReward struct {
RewardQuantity *int64 `json:"rewardQuantity,omitempty"`
RewardTypeID *int64 `json:"rewardTypeID,omitempty"`
}
type Reward struct {
RewardQuantity int64 `json:"rewardQuantity"`
RewardTypeID *int64 `json:"rewardTypeID,omitempty"`
}
type Name struct {
De *string `json:"de,omitempty"`
En string `json:"en"`
Es *string `json:"es,omitempty"`
Fr *string `json:"fr,omitempty"`
Ja *string `json:"ja,omitempty"`
Ko *string `json:"ko,omitempty"`
Ru *string `json:"ru,omitempty"`
Zh *string `json:"zh,omitempty"`
}
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"_key":{"type":"integer","minimum":875,"maximum":17192},"agentTypeID":{"type":"integer","minimum":9,"maximum":13},"corporationID":{"type":"integer","minimum":1000017,"maximum":1000419},"courierMission":{"type":"object","properties":{"objectiveQuantity":{"type":"integer","minimum":1,"maximum":100000},"objectiveSingleton":{"type":"boolean"},"objectiveTypeID":{"type":"integer","minimum":20,"maximum":91858}},"required":["objectiveQuantity","objectiveSingleton","objectiveTypeID"]},"expirationTime":{"type":"integer","minimum":0,"maximum":43200},"extraStandings":{"type":"array","items":{"type":"object","properties":{"_key":{"type":"integer","minimum":500001,"maximum":500019},"_value":{"type":"number","minimum":1.5,"maximum":30.0}},"required":["_key","_value"]},"minItems":1,"maxItems":1},"factionID":{"type":"integer","minimum":500001,"maximum":500020},"hasStandingRewards":{"type":"boolean"},"initialAgentGiftQuantity":{"type":"integer","minimum":0,"maximum":500},"initialAgentGiftTypeID":{"type":"integer","minimum":29,"maximum":93643},"killMission":{"type":"object","properties":{"dropItemInMissionContainer":{"type":"integer","minimum":30762,"maximum":30793},"dungeonID":{"type":"integer","minimum":184,"maximum":14222},"objectiveQuantity":{"type":"integer","minimum":0,"maximum":40000},"objectiveTypeID":{"type":"integer","minimum":34,"maximum":88105}}},"messages":{"type":"array","items":{"type":"object","properties":{"_key":{"type":"string","minLength":23,"maxLength":50},"de":{"type":"string","minLength":3,"maxLength":4166},"en":{"type":"string","minLength":3,"maxLength":3443},"es":{"type":"string","minLength":3,"maxLength":3871},"fr":{"type":"string","minLength":3,"maxLength":4287},"ja":{"type":"string","minLength":2,"maxLength":1588},"ko":{"type":"string","minLength":2,"maxLength":1781},"ru":{"type":"string","minLength":3,"maxLength":3772},"zh":{"type":"string","minLength":2,"maxLength":1338}},"required":["_key","en"]},"minItems":1,"maxItems":17},"missionRewards":{"type":"object","properties":{"bonusReward":{"type":"object","properties":{"rewardQuantity":{"type":"integer","minimum":1,"maximum":10600000},"rewardTypeID":{"type":"integer","minimum":29,"maximum":27294}}},"bonusTimeInterval":{"type":"integer","minimum":1,"maximum":10500000},"reward":{"type":"object","properties":{"rewardQuantity":{"type":"integer","minimum":1,"maximum":40000000},"rewardTypeID":{"type":"integer","minimum":29,"maximum":90039}},"required":["rewardQuantity"]}}},"name":{"type":"object","properties":{"de":{"type":"string","minLength":2,"maxLength":84},"en":{"type":"string","minLength":2,"maxLength":74},"es":{"type":"string","minLength":2,"maxLength":80},"fr":{"type":"string","minLength":2,"maxLength":80},"ja":{"type":"string","minLength":1,"maxLength":40},"ko":{"type":"string","minLength":1,"maxLength":46},"ru":{"type":"string","minLength":2,"maxLength":133},"zh":{"type":"string","minLength":2,"maxLength":39}},"required":["en"]}},"required":["_key","hasStandingRewards","name"]}
// To parse the JSON, install kotlin's serialization plugin and do:
//
// val json = Json { allowStructuredMapKeys = true }
// val mission = json.parse(Mission.serializer(), jsonString)
package model
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
@Serializable
data class Mission (
@SerialName("_key")
val key: Long,
@SerialName("agentTypeID")
val agentTypeId: Long? = null,
@SerialName("corporationID")
val corporationId: Long? = null,
val courierMission: CourierMission? = null,
val expirationTime: Long? = null,
val extraStandings: List<ExtraStanding>? = null,
@SerialName("factionID")
val factionId: Long? = null,
val hasStandingRewards: Boolean,
val initialAgentGiftQuantity: Long? = null,
@SerialName("initialAgentGiftTypeID")
val initialAgentGiftTypeId: Long? = null,
val killMission: KillMission? = null,
val messages: List<Message>? = null,
val missionRewards: MissionRewards? = null,
val name: Name
)
@Serializable
data class CourierMission (
val objectiveQuantity: Long,
val objectiveSingleton: Boolean,
@SerialName("objectiveTypeID")
val objectiveTypeId: Long
)
@Serializable
data class ExtraStanding (
@SerialName("_key")
val key: Long,
@SerialName("_value")
val value: Double
)
@Serializable
data class KillMission (
val dropItemInMissionContainer: Long? = null,
@SerialName("dungeonID")
val dungeonId: Long? = null,
val objectiveQuantity: Long? = null,
@SerialName("objectiveTypeID")
val objectiveTypeId: Long? = null
)
@Serializable
data class Message (
@SerialName("_key")
val key: String,
val de: String? = null,
val en: String,
val es: String? = null,
val fr: String? = null,
val ja: String? = null,
val ko: String? = null,
val ru: String? = null,
val zh: String? = null
)
@Serializable
data class MissionRewards (
val bonusReward: BonusReward? = null,
val bonusTimeInterval: Long? = null,
val reward: Reward? = null
)
@Serializable
data class BonusReward (
val rewardQuantity: Long? = null,
@SerialName("rewardTypeID")
val rewardTypeId: Long? = null
)
@Serializable
data class Reward (
val rewardQuantity: Long,
@SerialName("rewardTypeID")
val rewardTypeId: Long? = null
)
@Serializable
data class Name (
val de: String? = null,
val en: String,
val es: String? = null,
val fr: String? = null,
val ja: String? = null,
val ko: String? = null,
val ru: String? = null,
val zh: String? = null
)
<?php
// This is a autogenerated file:Mission
class Mission {
private int $key; // json:_key Required
private ?int $agentTypeId; // json:agentTypeID Optional
private ?int $corporationId; // json:corporationID Optional
private ?CourierMission $courierMission; // json:courierMission Optional
private ?int $expirationTime; // json:expirationTime Optional
private ?array $extraStandings; // json:extraStandings Optional
private ?int $factionId; // json:factionID Optional
private bool $hasStandingRewards; // json:hasStandingRewards Required
private ?int $initialAgentGiftQuantity; // json:initialAgentGiftQuantity Optional
private ?int $initialAgentGiftTypeId; // json:initialAgentGiftTypeID Optional
private ?KillMission $killMission; // json:killMission Optional
private ?array $messages; // json:messages Optional
private ?MissionRewards $missionRewards; // json:missionRewards Optional
private Name $name; // json:name Required
/**
* @param int $key
* @param int|null $agentTypeId
* @param int|null $corporationId
* @param CourierMission|null $courierMission
* @param int|null $expirationTime
* @param array|null $extraStandings
* @param int|null $factionId
* @param bool $hasStandingRewards
* @param int|null $initialAgentGiftQuantity
* @param int|null $initialAgentGiftTypeId
* @param KillMission|null $killMission
* @param array|null $messages
* @param MissionRewards|null $missionRewards
* @param Name $name
*/
public function __construct(int $key, ?int $agentTypeId, ?int $corporationId, ?CourierMission $courierMission, ?int $expirationTime, ?array $extraStandings, ?int $factionId, bool $hasStandingRewards, ?int $initialAgentGiftQuantity, ?int $initialAgentGiftTypeId, ?KillMission $killMission, ?array $messages, ?MissionRewards $missionRewards, Name $name) {
$this->key = $key;
$this->agentTypeId = $agentTypeId;
$this->corporationId = $corporationId;
$this->courierMission = $courierMission;
$this->expirationTime = $expirationTime;
$this->extraStandings = $extraStandings;
$this->factionId = $factionId;
$this->hasStandingRewards = $hasStandingRewards;
$this->initialAgentGiftQuantity = $initialAgentGiftQuantity;
$this->initialAgentGiftTypeId = $initialAgentGiftTypeId;
$this->killMission = $killMission;
$this->messages = $messages;
$this->missionRewards = $missionRewards;
$this->name = $name;
}
/**
* @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 (Mission::validateKey($this->key)) {
return $this->key; /*int*/
}
throw new Exception('never get to this Mission::key');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateKey(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::key");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getKey(): int {
if (Mission::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey Mission::key');
}
/**
* @return int
*/
public static function sampleKey(): int {
return 31; /*31:key*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromAgentTypeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toAgentTypeId(): ?int {
if (Mission::validateAgentTypeId($this->agentTypeId)) {
if (!is_null($this->agentTypeId)) {
return $this->agentTypeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::agentTypeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateAgentTypeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::agentTypeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getAgentTypeId(): ?int {
if (Mission::validateAgentTypeId($this->agentTypeId)) {
return $this->agentTypeId;
}
throw new Exception('never get to getAgentTypeId Mission::agentTypeId');
}
/**
* @return ?int
*/
public static function sampleAgentTypeId(): ?int {
return 32; /*32:agentTypeId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromCorporationId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toCorporationId(): ?int {
if (Mission::validateCorporationId($this->corporationId)) {
if (!is_null($this->corporationId)) {
return $this->corporationId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::corporationId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateCorporationId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::corporationId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getCorporationId(): ?int {
if (Mission::validateCorporationId($this->corporationId)) {
return $this->corporationId;
}
throw new Exception('never get to getCorporationId Mission::corporationId');
}
/**
* @return ?int
*/
public static function sampleCorporationId(): ?int {
return 33; /*33:corporationId*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?CourierMission
*/
public static function fromCourierMission(?stdClass $value): ?CourierMission {
if (!is_null($value)) {
return CourierMission::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toCourierMission(): ?stdClass {
if (Mission::validateCourierMission($this->courierMission)) {
if (!is_null($this->courierMission)) {
return $this->courierMission->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::courierMission');
}
/**
* @param CourierMission|null
* @return bool
* @throws Exception
*/
public static function validateCourierMission(?CourierMission $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?CourierMission
*/
public function getCourierMission(): ?CourierMission {
if (Mission::validateCourierMission($this->courierMission)) {
return $this->courierMission;
}
throw new Exception('never get to getCourierMission Mission::courierMission');
}
/**
* @return ?CourierMission
*/
public static function sampleCourierMission(): ?CourierMission {
return CourierMission::sample(); /*34:courierMission*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromExpirationTime(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toExpirationTime(): ?int {
if (Mission::validateExpirationTime($this->expirationTime)) {
if (!is_null($this->expirationTime)) {
return $this->expirationTime; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::expirationTime');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateExpirationTime(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::expirationTime");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getExpirationTime(): ?int {
if (Mission::validateExpirationTime($this->expirationTime)) {
return $this->expirationTime;
}
throw new Exception('never get to getExpirationTime Mission::expirationTime');
}
/**
* @return ?int
*/
public static function sampleExpirationTime(): ?int {
return 35; /*35:expirationTime*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromExtraStandings(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return ExtraStanding::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toExtraStandings(): ?array {
if (Mission::validateExtraStandings($this->extraStandings)) {
if (!is_null($this->extraStandings)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->extraStandings);
} else {
return null;
}
}
throw new Exception('never get to this Mission::extraStandings');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateExtraStandings(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Mission::extraStandings");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getExtraStandings(): ?array {
if (Mission::validateExtraStandings($this->extraStandings)) {
return $this->extraStandings;
}
throw new Exception('never get to getExtraStandings Mission::extraStandings');
}
/**
* @return ?array
*/
public static function sampleExtraStandings(): ?array {
return array(
ExtraStanding::sample() /*36:*/
); /* 36:extraStandings*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromFactionId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toFactionId(): ?int {
if (Mission::validateFactionId($this->factionId)) {
if (!is_null($this->factionId)) {
return $this->factionId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::factionId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateFactionId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::factionId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getFactionId(): ?int {
if (Mission::validateFactionId($this->factionId)) {
return $this->factionId;
}
throw new Exception('never get to getFactionId Mission::factionId');
}
/**
* @return ?int
*/
public static function sampleFactionId(): ?int {
return 37; /*37:factionId*/
}
/**
* @param bool $value
* @throws Exception
* @return bool
*/
public static function fromHasStandingRewards(bool $value): bool {
return $value; /*bool*/
}
/**
* @throws Exception
* @return bool
*/
public function toHasStandingRewards(): bool {
if (Mission::validateHasStandingRewards($this->hasStandingRewards)) {
return $this->hasStandingRewards; /*bool*/
}
throw new Exception('never get to this Mission::hasStandingRewards');
}
/**
* @param bool
* @return bool
* @throws Exception
*/
public static function validateHasStandingRewards(bool $value): bool {
if (!is_bool($value)) {
throw new Exception("Attribute Error:Mission::hasStandingRewards");
}
return true;
}
/**
* @throws Exception
* @return bool
*/
public function getHasStandingRewards(): bool {
if (Mission::validateHasStandingRewards($this->hasStandingRewards)) {
return $this->hasStandingRewards;
}
throw new Exception('never get to getHasStandingRewards Mission::hasStandingRewards');
}
/**
* @return bool
*/
public static function sampleHasStandingRewards(): bool {
return true; /*38:hasStandingRewards*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromInitialAgentGiftQuantity(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toInitialAgentGiftQuantity(): ?int {
if (Mission::validateInitialAgentGiftQuantity($this->initialAgentGiftQuantity)) {
if (!is_null($this->initialAgentGiftQuantity)) {
return $this->initialAgentGiftQuantity; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::initialAgentGiftQuantity');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateInitialAgentGiftQuantity(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::initialAgentGiftQuantity");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getInitialAgentGiftQuantity(): ?int {
if (Mission::validateInitialAgentGiftQuantity($this->initialAgentGiftQuantity)) {
return $this->initialAgentGiftQuantity;
}
throw new Exception('never get to getInitialAgentGiftQuantity Mission::initialAgentGiftQuantity');
}
/**
* @return ?int
*/
public static function sampleInitialAgentGiftQuantity(): ?int {
return 39; /*39:initialAgentGiftQuantity*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromInitialAgentGiftTypeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toInitialAgentGiftTypeId(): ?int {
if (Mission::validateInitialAgentGiftTypeId($this->initialAgentGiftTypeId)) {
if (!is_null($this->initialAgentGiftTypeId)) {
return $this->initialAgentGiftTypeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::initialAgentGiftTypeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateInitialAgentGiftTypeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Mission::initialAgentGiftTypeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getInitialAgentGiftTypeId(): ?int {
if (Mission::validateInitialAgentGiftTypeId($this->initialAgentGiftTypeId)) {
return $this->initialAgentGiftTypeId;
}
throw new Exception('never get to getInitialAgentGiftTypeId Mission::initialAgentGiftTypeId');
}
/**
* @return ?int
*/
public static function sampleInitialAgentGiftTypeId(): ?int {
return 40; /*40:initialAgentGiftTypeId*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?KillMission
*/
public static function fromKillMission(?stdClass $value): ?KillMission {
if (!is_null($value)) {
return KillMission::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toKillMission(): ?stdClass {
if (Mission::validateKillMission($this->killMission)) {
if (!is_null($this->killMission)) {
return $this->killMission->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::killMission');
}
/**
* @param KillMission|null
* @return bool
* @throws Exception
*/
public static function validateKillMission(?KillMission $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?KillMission
*/
public function getKillMission(): ?KillMission {
if (Mission::validateKillMission($this->killMission)) {
return $this->killMission;
}
throw new Exception('never get to getKillMission Mission::killMission');
}
/**
* @return ?KillMission
*/
public static function sampleKillMission(): ?KillMission {
return KillMission::sample(); /*41:killMission*/
}
/**
* @param ?array $value
* @throws Exception
* @return ?array
*/
public static function fromMessages(?array $value): ?array {
if (!is_null($value)) {
return array_map(function ($value) {
return Message::from($value); /*class*/
}, $value);
} else {
return null;
}
}
/**
* @throws Exception
* @return ?array
*/
public function toMessages(): ?array {
if (Mission::validateMessages($this->messages)) {
if (!is_null($this->messages)) {
return array_map(function ($value) {
return $value->to(); /*class*/
}, $this->messages);
} else {
return null;
}
}
throw new Exception('never get to this Mission::messages');
}
/**
* @param array|null
* @return bool
* @throws Exception
*/
public static function validateMessages(?array $value): bool {
if (!is_null($value)) {
if (!is_array($value)) {
throw new Exception("Attribute Error:Mission::messages");
}
array_walk($value, function($value_v) {
$value_v->validate();
});
}
return true;
}
/**
* @throws Exception
* @return ?array
*/
public function getMessages(): ?array {
if (Mission::validateMessages($this->messages)) {
return $this->messages;
}
throw new Exception('never get to getMessages Mission::messages');
}
/**
* @return ?array
*/
public static function sampleMessages(): ?array {
return array(
Message::sample() /*42:*/
); /* 42:messages*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?MissionRewards
*/
public static function fromMissionRewards(?stdClass $value): ?MissionRewards {
if (!is_null($value)) {
return MissionRewards::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toMissionRewards(): ?stdClass {
if (Mission::validateMissionRewards($this->missionRewards)) {
if (!is_null($this->missionRewards)) {
return $this->missionRewards->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this Mission::missionRewards');
}
/**
* @param MissionRewards|null
* @return bool
* @throws Exception
*/
public static function validateMissionRewards(?MissionRewards $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?MissionRewards
*/
public function getMissionRewards(): ?MissionRewards {
if (Mission::validateMissionRewards($this->missionRewards)) {
return $this->missionRewards;
}
throw new Exception('never get to getMissionRewards Mission::missionRewards');
}
/**
* @return ?MissionRewards
*/
public static function sampleMissionRewards(): ?MissionRewards {
return MissionRewards::sample(); /*43:missionRewards*/
}
/**
* @param stdClass $value
* @throws Exception
* @return Name
*/
public static function fromName(stdClass $value): Name {
return Name::from($value); /*class*/
}
/**
* @throws Exception
* @return stdClass
*/
public function toName(): stdClass {
if (Mission::validateName($this->name)) {
return $this->name->to(); /*class*/
}
throw new Exception('never get to this Mission::name');
}
/**
* @param Name
* @return bool
* @throws Exception
*/
public static function validateName(Name $value): bool {
$value->validate();
return true;
}
/**
* @throws Exception
* @return Name
*/
public function getName(): Name {
if (Mission::validateName($this->name)) {
return $this->name;
}
throw new Exception('never get to getName Mission::name');
}
/**
* @return Name
*/
public static function sampleName(): Name {
return Name::sample(); /*44:name*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Mission::validateKey($this->key)
|| Mission::validateAgentTypeId($this->agentTypeId)
|| Mission::validateCorporationId($this->corporationId)
|| Mission::validateCourierMission($this->courierMission)
|| Mission::validateExpirationTime($this->expirationTime)
|| Mission::validateExtraStandings($this->extraStandings)
|| Mission::validateFactionId($this->factionId)
|| Mission::validateHasStandingRewards($this->hasStandingRewards)
|| Mission::validateInitialAgentGiftQuantity($this->initialAgentGiftQuantity)
|| Mission::validateInitialAgentGiftTypeId($this->initialAgentGiftTypeId)
|| Mission::validateKillMission($this->killMission)
|| Mission::validateMessages($this->messages)
|| Mission::validateMissionRewards($this->missionRewards)
|| Mission::validateName($this->name);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'agentTypeID'} = $this->toAgentTypeId();
$out->{'corporationID'} = $this->toCorporationId();
$out->{'courierMission'} = $this->toCourierMission();
$out->{'expirationTime'} = $this->toExpirationTime();
$out->{'extraStandings'} = $this->toExtraStandings();
$out->{'factionID'} = $this->toFactionId();
$out->{'hasStandingRewards'} = $this->toHasStandingRewards();
$out->{'initialAgentGiftQuantity'} = $this->toInitialAgentGiftQuantity();
$out->{'initialAgentGiftTypeID'} = $this->toInitialAgentGiftTypeId();
$out->{'killMission'} = $this->toKillMission();
$out->{'messages'} = $this->toMessages();
$out->{'missionRewards'} = $this->toMissionRewards();
$out->{'name'} = $this->toName();
return $out;
}
/**
* @param stdClass $obj
* @return Mission
* @throws Exception
*/
public static function from(stdClass $obj): Mission {
return new Mission(
Mission::fromKey($obj->{'_key'})
,Mission::fromAgentTypeId($obj->{'agentTypeID'})
,Mission::fromCorporationId($obj->{'corporationID'})
,Mission::fromCourierMission($obj->{'courierMission'})
,Mission::fromExpirationTime($obj->{'expirationTime'})
,Mission::fromExtraStandings($obj->{'extraStandings'})
,Mission::fromFactionId($obj->{'factionID'})
,Mission::fromHasStandingRewards($obj->{'hasStandingRewards'})
,Mission::fromInitialAgentGiftQuantity($obj->{'initialAgentGiftQuantity'})
,Mission::fromInitialAgentGiftTypeId($obj->{'initialAgentGiftTypeID'})
,Mission::fromKillMission($obj->{'killMission'})
,Mission::fromMessages($obj->{'messages'})
,Mission::fromMissionRewards($obj->{'missionRewards'})
,Mission::fromName($obj->{'name'})
);
}
/**
* @return Mission
*/
public static function sample(): Mission {
return new Mission(
Mission::sampleKey()
,Mission::sampleAgentTypeId()
,Mission::sampleCorporationId()
,Mission::sampleCourierMission()
,Mission::sampleExpirationTime()
,Mission::sampleExtraStandings()
,Mission::sampleFactionId()
,Mission::sampleHasStandingRewards()
,Mission::sampleInitialAgentGiftQuantity()
,Mission::sampleInitialAgentGiftTypeId()
,Mission::sampleKillMission()
,Mission::sampleMessages()
,Mission::sampleMissionRewards()
,Mission::sampleName()
);
}
}
// This is a autogenerated file:CourierMission
class CourierMission {
private int $objectiveQuantity; // json:objectiveQuantity Required
private bool $objectiveSingleton; // json:objectiveSingleton Required
private int $objectiveTypeId; // json:objectiveTypeID Required
/**
* @param int $objectiveQuantity
* @param bool $objectiveSingleton
* @param int $objectiveTypeId
*/
public function __construct(int $objectiveQuantity, bool $objectiveSingleton, int $objectiveTypeId) {
$this->objectiveQuantity = $objectiveQuantity;
$this->objectiveSingleton = $objectiveSingleton;
$this->objectiveTypeId = $objectiveTypeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromObjectiveQuantity(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toObjectiveQuantity(): int {
if (CourierMission::validateObjectiveQuantity($this->objectiveQuantity)) {
return $this->objectiveQuantity; /*int*/
}
throw new Exception('never get to this CourierMission::objectiveQuantity');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateObjectiveQuantity(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:CourierMission::objectiveQuantity");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getObjectiveQuantity(): int {
if (CourierMission::validateObjectiveQuantity($this->objectiveQuantity)) {
return $this->objectiveQuantity;
}
throw new Exception('never get to getObjectiveQuantity CourierMission::objectiveQuantity');
}
/**
* @return int
*/
public static function sampleObjectiveQuantity(): int {
return 31; /*31:objectiveQuantity*/
}
/**
* @param bool $value
* @throws Exception
* @return bool
*/
public static function fromObjectiveSingleton(bool $value): bool {
return $value; /*bool*/
}
/**
* @throws Exception
* @return bool
*/
public function toObjectiveSingleton(): bool {
if (CourierMission::validateObjectiveSingleton($this->objectiveSingleton)) {
return $this->objectiveSingleton; /*bool*/
}
throw new Exception('never get to this CourierMission::objectiveSingleton');
}
/**
* @param bool
* @return bool
* @throws Exception
*/
public static function validateObjectiveSingleton(bool $value): bool {
if (!is_bool($value)) {
throw new Exception("Attribute Error:CourierMission::objectiveSingleton");
}
return true;
}
/**
* @throws Exception
* @return bool
*/
public function getObjectiveSingleton(): bool {
if (CourierMission::validateObjectiveSingleton($this->objectiveSingleton)) {
return $this->objectiveSingleton;
}
throw new Exception('never get to getObjectiveSingleton CourierMission::objectiveSingleton');
}
/**
* @return bool
*/
public static function sampleObjectiveSingleton(): bool {
return true; /*32:objectiveSingleton*/
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromObjectiveTypeId(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toObjectiveTypeId(): int {
if (CourierMission::validateObjectiveTypeId($this->objectiveTypeId)) {
return $this->objectiveTypeId; /*int*/
}
throw new Exception('never get to this CourierMission::objectiveTypeId');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateObjectiveTypeId(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:CourierMission::objectiveTypeId");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getObjectiveTypeId(): int {
if (CourierMission::validateObjectiveTypeId($this->objectiveTypeId)) {
return $this->objectiveTypeId;
}
throw new Exception('never get to getObjectiveTypeId CourierMission::objectiveTypeId');
}
/**
* @return int
*/
public static function sampleObjectiveTypeId(): int {
return 33; /*33:objectiveTypeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return CourierMission::validateObjectiveQuantity($this->objectiveQuantity)
|| CourierMission::validateObjectiveSingleton($this->objectiveSingleton)
|| CourierMission::validateObjectiveTypeId($this->objectiveTypeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'objectiveQuantity'} = $this->toObjectiveQuantity();
$out->{'objectiveSingleton'} = $this->toObjectiveSingleton();
$out->{'objectiveTypeID'} = $this->toObjectiveTypeId();
return $out;
}
/**
* @param stdClass $obj
* @return CourierMission
* @throws Exception
*/
public static function from(stdClass $obj): CourierMission {
return new CourierMission(
CourierMission::fromObjectiveQuantity($obj->{'objectiveQuantity'})
,CourierMission::fromObjectiveSingleton($obj->{'objectiveSingleton'})
,CourierMission::fromObjectiveTypeId($obj->{'objectiveTypeID'})
);
}
/**
* @return CourierMission
*/
public static function sample(): CourierMission {
return new CourierMission(
CourierMission::sampleObjectiveQuantity()
,CourierMission::sampleObjectiveSingleton()
,CourierMission::sampleObjectiveTypeId()
);
}
}
// This is a autogenerated file:ExtraStanding
class ExtraStanding {
private int $key; // json:_key Required
private float $value; // json:_value Required
/**
* @param int $key
* @param float $value
*/
public function __construct(int $key, float $value) {
$this->key = $key;
$this->value = $value;
}
/**
* @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 (ExtraStanding::validateKey($this->key)) {
return $this->key; /*int*/
}
throw new Exception('never get to this ExtraStanding::key');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateKey(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:ExtraStanding::key");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getKey(): int {
if (ExtraStanding::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey ExtraStanding::key');
}
/**
* @return int
*/
public static function sampleKey(): int {
return 31; /*31:key*/
}
/**
* @param float $value
* @throws Exception
* @return float
*/
public static function fromValue(float $value): float {
return $value; /*float*/
}
/**
* @throws Exception
* @return float
*/
public function toValue(): float {
if (ExtraStanding::validateValue($this->value)) {
return $this->value; /*float*/
}
throw new Exception('never get to this ExtraStanding::value');
}
/**
* @param float
* @return bool
* @throws Exception
*/
public static function validateValue(float $value): bool {
if (!is_float($value)) {
throw new Exception("Attribute Error:ExtraStanding::value");
}
return true;
}
/**
* @throws Exception
* @return float
*/
public function getValue(): float {
if (ExtraStanding::validateValue($this->value)) {
return $this->value;
}
throw new Exception('never get to getValue ExtraStanding::value');
}
/**
* @return float
*/
public static function sampleValue(): float {
return 32.032; /*32:value*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return ExtraStanding::validateKey($this->key)
|| ExtraStanding::validateValue($this->value);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'_value'} = $this->toValue();
return $out;
}
/**
* @param stdClass $obj
* @return ExtraStanding
* @throws Exception
*/
public static function from(stdClass $obj): ExtraStanding {
return new ExtraStanding(
ExtraStanding::fromKey($obj->{'_key'})
,ExtraStanding::fromValue($obj->{'_value'})
);
}
/**
* @return ExtraStanding
*/
public static function sample(): ExtraStanding {
return new ExtraStanding(
ExtraStanding::sampleKey()
,ExtraStanding::sampleValue()
);
}
}
// This is a autogenerated file:KillMission
class KillMission {
private ?int $dropItemInMissionContainer; // json:dropItemInMissionContainer Optional
private ?int $dungeonId; // json:dungeonID Optional
private ?int $objectiveQuantity; // json:objectiveQuantity Optional
private ?int $objectiveTypeId; // json:objectiveTypeID Optional
/**
* @param int|null $dropItemInMissionContainer
* @param int|null $dungeonId
* @param int|null $objectiveQuantity
* @param int|null $objectiveTypeId
*/
public function __construct(?int $dropItemInMissionContainer, ?int $dungeonId, ?int $objectiveQuantity, ?int $objectiveTypeId) {
$this->dropItemInMissionContainer = $dropItemInMissionContainer;
$this->dungeonId = $dungeonId;
$this->objectiveQuantity = $objectiveQuantity;
$this->objectiveTypeId = $objectiveTypeId;
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromDropItemInMissionContainer(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toDropItemInMissionContainer(): ?int {
if (KillMission::validateDropItemInMissionContainer($this->dropItemInMissionContainer)) {
if (!is_null($this->dropItemInMissionContainer)) {
return $this->dropItemInMissionContainer; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this KillMission::dropItemInMissionContainer');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateDropItemInMissionContainer(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:KillMission::dropItemInMissionContainer");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getDropItemInMissionContainer(): ?int {
if (KillMission::validateDropItemInMissionContainer($this->dropItemInMissionContainer)) {
return $this->dropItemInMissionContainer;
}
throw new Exception('never get to getDropItemInMissionContainer KillMission::dropItemInMissionContainer');
}
/**
* @return ?int
*/
public static function sampleDropItemInMissionContainer(): ?int {
return 31; /*31:dropItemInMissionContainer*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromDungeonId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toDungeonId(): ?int {
if (KillMission::validateDungeonId($this->dungeonId)) {
if (!is_null($this->dungeonId)) {
return $this->dungeonId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this KillMission::dungeonId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateDungeonId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:KillMission::dungeonId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getDungeonId(): ?int {
if (KillMission::validateDungeonId($this->dungeonId)) {
return $this->dungeonId;
}
throw new Exception('never get to getDungeonId KillMission::dungeonId');
}
/**
* @return ?int
*/
public static function sampleDungeonId(): ?int {
return 32; /*32:dungeonId*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromObjectiveQuantity(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toObjectiveQuantity(): ?int {
if (KillMission::validateObjectiveQuantity($this->objectiveQuantity)) {
if (!is_null($this->objectiveQuantity)) {
return $this->objectiveQuantity; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this KillMission::objectiveQuantity');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateObjectiveQuantity(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:KillMission::objectiveQuantity");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getObjectiveQuantity(): ?int {
if (KillMission::validateObjectiveQuantity($this->objectiveQuantity)) {
return $this->objectiveQuantity;
}
throw new Exception('never get to getObjectiveQuantity KillMission::objectiveQuantity');
}
/**
* @return ?int
*/
public static function sampleObjectiveQuantity(): ?int {
return 33; /*33:objectiveQuantity*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromObjectiveTypeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toObjectiveTypeId(): ?int {
if (KillMission::validateObjectiveTypeId($this->objectiveTypeId)) {
if (!is_null($this->objectiveTypeId)) {
return $this->objectiveTypeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this KillMission::objectiveTypeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateObjectiveTypeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:KillMission::objectiveTypeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getObjectiveTypeId(): ?int {
if (KillMission::validateObjectiveTypeId($this->objectiveTypeId)) {
return $this->objectiveTypeId;
}
throw new Exception('never get to getObjectiveTypeId KillMission::objectiveTypeId');
}
/**
* @return ?int
*/
public static function sampleObjectiveTypeId(): ?int {
return 34; /*34:objectiveTypeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return KillMission::validateDropItemInMissionContainer($this->dropItemInMissionContainer)
|| KillMission::validateDungeonId($this->dungeonId)
|| KillMission::validateObjectiveQuantity($this->objectiveQuantity)
|| KillMission::validateObjectiveTypeId($this->objectiveTypeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'dropItemInMissionContainer'} = $this->toDropItemInMissionContainer();
$out->{'dungeonID'} = $this->toDungeonId();
$out->{'objectiveQuantity'} = $this->toObjectiveQuantity();
$out->{'objectiveTypeID'} = $this->toObjectiveTypeId();
return $out;
}
/**
* @param stdClass $obj
* @return KillMission
* @throws Exception
*/
public static function from(stdClass $obj): KillMission {
return new KillMission(
KillMission::fromDropItemInMissionContainer($obj->{'dropItemInMissionContainer'})
,KillMission::fromDungeonId($obj->{'dungeonID'})
,KillMission::fromObjectiveQuantity($obj->{'objectiveQuantity'})
,KillMission::fromObjectiveTypeId($obj->{'objectiveTypeID'})
);
}
/**
* @return KillMission
*/
public static function sample(): KillMission {
return new KillMission(
KillMission::sampleDropItemInMissionContainer()
,KillMission::sampleDungeonId()
,KillMission::sampleObjectiveQuantity()
,KillMission::sampleObjectiveTypeId()
);
}
}
// This is a autogenerated file:Message
class Message {
private string $key; // json:_key Required
private ?string $de; // json:de Optional
private string $en; // json:en Required
private ?string $es; // json:es Optional
private ?string $fr; // json:fr Optional
private ?string $ja; // json:ja Optional
private ?string $ko; // json:ko Optional
private ?string $ru; // json:ru Optional
private ?string $zh; // json:zh Optional
/**
* @param string $key
* @param string|null $de
* @param string $en
* @param string|null $es
* @param string|null $fr
* @param string|null $ja
* @param string|null $ko
* @param string|null $ru
* @param string|null $zh
*/
public function __construct(string $key, ?string $de, string $en, ?string $es, ?string $fr, ?string $ja, ?string $ko, ?string $ru, ?string $zh) {
$this->key = $key;
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromKey(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toKey(): string {
if (Message::validateKey($this->key)) {
return $this->key; /*string*/
}
throw new Exception('never get to this Message::key');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateKey(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::key");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getKey(): string {
if (Message::validateKey($this->key)) {
return $this->key;
}
throw new Exception('never get to getKey Message::key');
}
/**
* @return string
*/
public static function sampleKey(): string {
return 'Message::key::31'; /*31:key*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromDe(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toDe(): ?string {
if (Message::validateDe($this->de)) {
if (!is_null($this->de)) {
return $this->de; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::de');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateDe(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::de");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDe(): ?string {
if (Message::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe Message::de');
}
/**
* @return ?string
*/
public static function sampleDe(): ?string {
return 'Message::de::32'; /*32:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (Message::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this Message::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (Message::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn Message::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'Message::en::33'; /*33:en*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromEs(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toEs(): ?string {
if (Message::validateEs($this->es)) {
if (!is_null($this->es)) {
return $this->es; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::es');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateEs(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::es");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getEs(): ?string {
if (Message::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs Message::es');
}
/**
* @return ?string
*/
public static function sampleEs(): ?string {
return 'Message::es::34'; /*34:es*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromFr(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toFr(): ?string {
if (Message::validateFr($this->fr)) {
if (!is_null($this->fr)) {
return $this->fr; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::fr');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateFr(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::fr");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getFr(): ?string {
if (Message::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr Message::fr');
}
/**
* @return ?string
*/
public static function sampleFr(): ?string {
return 'Message::fr::35'; /*35:fr*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromJa(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toJa(): ?string {
if (Message::validateJa($this->ja)) {
if (!is_null($this->ja)) {
return $this->ja; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::ja');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateJa(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::ja");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getJa(): ?string {
if (Message::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa Message::ja');
}
/**
* @return ?string
*/
public static function sampleJa(): ?string {
return 'Message::ja::36'; /*36:ja*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromKo(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toKo(): ?string {
if (Message::validateKo($this->ko)) {
if (!is_null($this->ko)) {
return $this->ko; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::ko');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateKo(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::ko");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getKo(): ?string {
if (Message::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo Message::ko');
}
/**
* @return ?string
*/
public static function sampleKo(): ?string {
return 'Message::ko::37'; /*37:ko*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromRu(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toRu(): ?string {
if (Message::validateRu($this->ru)) {
if (!is_null($this->ru)) {
return $this->ru; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::ru');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateRu(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::ru");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getRu(): ?string {
if (Message::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu Message::ru');
}
/**
* @return ?string
*/
public static function sampleRu(): ?string {
return 'Message::ru::38'; /*38:ru*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromZh(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toZh(): ?string {
if (Message::validateZh($this->zh)) {
if (!is_null($this->zh)) {
return $this->zh; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Message::zh');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateZh(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Message::zh");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getZh(): ?string {
if (Message::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh Message::zh');
}
/**
* @return ?string
*/
public static function sampleZh(): ?string {
return 'Message::zh::39'; /*39:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Message::validateKey($this->key)
|| Message::validateDe($this->de)
|| Message::validateEn($this->en)
|| Message::validateEs($this->es)
|| Message::validateFr($this->fr)
|| Message::validateJa($this->ja)
|| Message::validateKo($this->ko)
|| Message::validateRu($this->ru)
|| Message::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'_key'} = $this->toKey();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return Message
* @throws Exception
*/
public static function from(stdClass $obj): Message {
return new Message(
Message::fromKey($obj->{'_key'})
,Message::fromDe($obj->{'de'})
,Message::fromEn($obj->{'en'})
,Message::fromEs($obj->{'es'})
,Message::fromFr($obj->{'fr'})
,Message::fromJa($obj->{'ja'})
,Message::fromKo($obj->{'ko'})
,Message::fromRu($obj->{'ru'})
,Message::fromZh($obj->{'zh'})
);
}
/**
* @return Message
*/
public static function sample(): Message {
return new Message(
Message::sampleKey()
,Message::sampleDe()
,Message::sampleEn()
,Message::sampleEs()
,Message::sampleFr()
,Message::sampleJa()
,Message::sampleKo()
,Message::sampleRu()
,Message::sampleZh()
);
}
}
// This is a autogenerated file:MissionRewards
class MissionRewards {
private ?BonusReward $bonusReward; // json:bonusReward Optional
private ?int $bonusTimeInterval; // json:bonusTimeInterval Optional
private ?Reward $reward; // json:reward Optional
/**
* @param BonusReward|null $bonusReward
* @param int|null $bonusTimeInterval
* @param Reward|null $reward
*/
public function __construct(?BonusReward $bonusReward, ?int $bonusTimeInterval, ?Reward $reward) {
$this->bonusReward = $bonusReward;
$this->bonusTimeInterval = $bonusTimeInterval;
$this->reward = $reward;
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?BonusReward
*/
public static function fromBonusReward(?stdClass $value): ?BonusReward {
if (!is_null($value)) {
return BonusReward::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toBonusReward(): ?stdClass {
if (MissionRewards::validateBonusReward($this->bonusReward)) {
if (!is_null($this->bonusReward)) {
return $this->bonusReward->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this MissionRewards::bonusReward');
}
/**
* @param BonusReward|null
* @return bool
* @throws Exception
*/
public static function validateBonusReward(?BonusReward $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?BonusReward
*/
public function getBonusReward(): ?BonusReward {
if (MissionRewards::validateBonusReward($this->bonusReward)) {
return $this->bonusReward;
}
throw new Exception('never get to getBonusReward MissionRewards::bonusReward');
}
/**
* @return ?BonusReward
*/
public static function sampleBonusReward(): ?BonusReward {
return BonusReward::sample(); /*31:bonusReward*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromBonusTimeInterval(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toBonusTimeInterval(): ?int {
if (MissionRewards::validateBonusTimeInterval($this->bonusTimeInterval)) {
if (!is_null($this->bonusTimeInterval)) {
return $this->bonusTimeInterval; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this MissionRewards::bonusTimeInterval');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateBonusTimeInterval(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:MissionRewards::bonusTimeInterval");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getBonusTimeInterval(): ?int {
if (MissionRewards::validateBonusTimeInterval($this->bonusTimeInterval)) {
return $this->bonusTimeInterval;
}
throw new Exception('never get to getBonusTimeInterval MissionRewards::bonusTimeInterval');
}
/**
* @return ?int
*/
public static function sampleBonusTimeInterval(): ?int {
return 32; /*32:bonusTimeInterval*/
}
/**
* @param ?stdClass $value
* @throws Exception
* @return ?Reward
*/
public static function fromReward(?stdClass $value): ?Reward {
if (!is_null($value)) {
return Reward::from($value); /*class*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?stdClass
*/
public function toReward(): ?stdClass {
if (MissionRewards::validateReward($this->reward)) {
if (!is_null($this->reward)) {
return $this->reward->to(); /*class*/
} else {
return null;
}
}
throw new Exception('never get to this MissionRewards::reward');
}
/**
* @param Reward|null
* @return bool
* @throws Exception
*/
public static function validateReward(?Reward $value): bool {
if (!is_null($value)) {
$value->validate();
}
return true;
}
/**
* @throws Exception
* @return ?Reward
*/
public function getReward(): ?Reward {
if (MissionRewards::validateReward($this->reward)) {
return $this->reward;
}
throw new Exception('never get to getReward MissionRewards::reward');
}
/**
* @return ?Reward
*/
public static function sampleReward(): ?Reward {
return Reward::sample(); /*33:reward*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return MissionRewards::validateBonusReward($this->bonusReward)
|| MissionRewards::validateBonusTimeInterval($this->bonusTimeInterval)
|| MissionRewards::validateReward($this->reward);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'bonusReward'} = $this->toBonusReward();
$out->{'bonusTimeInterval'} = $this->toBonusTimeInterval();
$out->{'reward'} = $this->toReward();
return $out;
}
/**
* @param stdClass $obj
* @return MissionRewards
* @throws Exception
*/
public static function from(stdClass $obj): MissionRewards {
return new MissionRewards(
MissionRewards::fromBonusReward($obj->{'bonusReward'})
,MissionRewards::fromBonusTimeInterval($obj->{'bonusTimeInterval'})
,MissionRewards::fromReward($obj->{'reward'})
);
}
/**
* @return MissionRewards
*/
public static function sample(): MissionRewards {
return new MissionRewards(
MissionRewards::sampleBonusReward()
,MissionRewards::sampleBonusTimeInterval()
,MissionRewards::sampleReward()
);
}
}
// This is a autogenerated file:BonusReward
class BonusReward {
private ?int $rewardQuantity; // json:rewardQuantity Optional
private ?int $rewardTypeId; // json:rewardTypeID Optional
/**
* @param int|null $rewardQuantity
* @param int|null $rewardTypeId
*/
public function __construct(?int $rewardQuantity, ?int $rewardTypeId) {
$this->rewardQuantity = $rewardQuantity;
$this->rewardTypeId = $rewardTypeId;
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromRewardQuantity(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toRewardQuantity(): ?int {
if (BonusReward::validateRewardQuantity($this->rewardQuantity)) {
if (!is_null($this->rewardQuantity)) {
return $this->rewardQuantity; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this BonusReward::rewardQuantity');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateRewardQuantity(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:BonusReward::rewardQuantity");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getRewardQuantity(): ?int {
if (BonusReward::validateRewardQuantity($this->rewardQuantity)) {
return $this->rewardQuantity;
}
throw new Exception('never get to getRewardQuantity BonusReward::rewardQuantity');
}
/**
* @return ?int
*/
public static function sampleRewardQuantity(): ?int {
return 31; /*31:rewardQuantity*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromRewardTypeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toRewardTypeId(): ?int {
if (BonusReward::validateRewardTypeId($this->rewardTypeId)) {
if (!is_null($this->rewardTypeId)) {
return $this->rewardTypeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this BonusReward::rewardTypeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateRewardTypeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:BonusReward::rewardTypeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getRewardTypeId(): ?int {
if (BonusReward::validateRewardTypeId($this->rewardTypeId)) {
return $this->rewardTypeId;
}
throw new Exception('never get to getRewardTypeId BonusReward::rewardTypeId');
}
/**
* @return ?int
*/
public static function sampleRewardTypeId(): ?int {
return 32; /*32:rewardTypeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return BonusReward::validateRewardQuantity($this->rewardQuantity)
|| BonusReward::validateRewardTypeId($this->rewardTypeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'rewardQuantity'} = $this->toRewardQuantity();
$out->{'rewardTypeID'} = $this->toRewardTypeId();
return $out;
}
/**
* @param stdClass $obj
* @return BonusReward
* @throws Exception
*/
public static function from(stdClass $obj): BonusReward {
return new BonusReward(
BonusReward::fromRewardQuantity($obj->{'rewardQuantity'})
,BonusReward::fromRewardTypeId($obj->{'rewardTypeID'})
);
}
/**
* @return BonusReward
*/
public static function sample(): BonusReward {
return new BonusReward(
BonusReward::sampleRewardQuantity()
,BonusReward::sampleRewardTypeId()
);
}
}
// This is a autogenerated file:Reward
class Reward {
private int $rewardQuantity; // json:rewardQuantity Required
private ?int $rewardTypeId; // json:rewardTypeID Optional
/**
* @param int $rewardQuantity
* @param int|null $rewardTypeId
*/
public function __construct(int $rewardQuantity, ?int $rewardTypeId) {
$this->rewardQuantity = $rewardQuantity;
$this->rewardTypeId = $rewardTypeId;
}
/**
* @param int $value
* @throws Exception
* @return int
*/
public static function fromRewardQuantity(int $value): int {
return $value; /*int*/
}
/**
* @throws Exception
* @return int
*/
public function toRewardQuantity(): int {
if (Reward::validateRewardQuantity($this->rewardQuantity)) {
return $this->rewardQuantity; /*int*/
}
throw new Exception('never get to this Reward::rewardQuantity');
}
/**
* @param int
* @return bool
* @throws Exception
*/
public static function validateRewardQuantity(int $value): bool {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Reward::rewardQuantity");
}
return true;
}
/**
* @throws Exception
* @return int
*/
public function getRewardQuantity(): int {
if (Reward::validateRewardQuantity($this->rewardQuantity)) {
return $this->rewardQuantity;
}
throw new Exception('never get to getRewardQuantity Reward::rewardQuantity');
}
/**
* @return int
*/
public static function sampleRewardQuantity(): int {
return 31; /*31:rewardQuantity*/
}
/**
* @param ?int $value
* @throws Exception
* @return ?int
*/
public static function fromRewardTypeId(?int $value): ?int {
if (!is_null($value)) {
return $value; /*int*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?int
*/
public function toRewardTypeId(): ?int {
if (Reward::validateRewardTypeId($this->rewardTypeId)) {
if (!is_null($this->rewardTypeId)) {
return $this->rewardTypeId; /*int*/
} else {
return null;
}
}
throw new Exception('never get to this Reward::rewardTypeId');
}
/**
* @param int|null
* @return bool
* @throws Exception
*/
public static function validateRewardTypeId(?int $value): bool {
if (!is_null($value)) {
if (!is_integer($value)) {
throw new Exception("Attribute Error:Reward::rewardTypeId");
}
}
return true;
}
/**
* @throws Exception
* @return ?int
*/
public function getRewardTypeId(): ?int {
if (Reward::validateRewardTypeId($this->rewardTypeId)) {
return $this->rewardTypeId;
}
throw new Exception('never get to getRewardTypeId Reward::rewardTypeId');
}
/**
* @return ?int
*/
public static function sampleRewardTypeId(): ?int {
return 32; /*32:rewardTypeId*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Reward::validateRewardQuantity($this->rewardQuantity)
|| Reward::validateRewardTypeId($this->rewardTypeId);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'rewardQuantity'} = $this->toRewardQuantity();
$out->{'rewardTypeID'} = $this->toRewardTypeId();
return $out;
}
/**
* @param stdClass $obj
* @return Reward
* @throws Exception
*/
public static function from(stdClass $obj): Reward {
return new Reward(
Reward::fromRewardQuantity($obj->{'rewardQuantity'})
,Reward::fromRewardTypeId($obj->{'rewardTypeID'})
);
}
/**
* @return Reward
*/
public static function sample(): Reward {
return new Reward(
Reward::sampleRewardQuantity()
,Reward::sampleRewardTypeId()
);
}
}
// This is a autogenerated file:Name
class Name {
private ?string $de; // json:de Optional
private string $en; // json:en Required
private ?string $es; // json:es Optional
private ?string $fr; // json:fr Optional
private ?string $ja; // json:ja Optional
private ?string $ko; // json:ko Optional
private ?string $ru; // json:ru Optional
private ?string $zh; // json:zh Optional
/**
* @param string|null $de
* @param string $en
* @param string|null $es
* @param string|null $fr
* @param string|null $ja
* @param string|null $ko
* @param string|null $ru
* @param string|null $zh
*/
public function __construct(?string $de, string $en, ?string $es, ?string $fr, ?string $ja, ?string $ko, ?string $ru, ?string $zh) {
$this->de = $de;
$this->en = $en;
$this->es = $es;
$this->fr = $fr;
$this->ja = $ja;
$this->ko = $ko;
$this->ru = $ru;
$this->zh = $zh;
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromDe(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toDe(): ?string {
if (Name::validateDe($this->de)) {
if (!is_null($this->de)) {
return $this->de; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::de');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateDe(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::de");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getDe(): ?string {
if (Name::validateDe($this->de)) {
return $this->de;
}
throw new Exception('never get to getDe Name::de');
}
/**
* @return ?string
*/
public static function sampleDe(): ?string {
return 'Name::de::31'; /*31:de*/
}
/**
* @param string $value
* @throws Exception
* @return string
*/
public static function fromEn(string $value): string {
return $value; /*string*/
}
/**
* @throws Exception
* @return string
*/
public function toEn(): string {
if (Name::validateEn($this->en)) {
return $this->en; /*string*/
}
throw new Exception('never get to this Name::en');
}
/**
* @param string
* @return bool
* @throws Exception
*/
public static function validateEn(string $value): bool {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::en");
}
return true;
}
/**
* @throws Exception
* @return string
*/
public function getEn(): string {
if (Name::validateEn($this->en)) {
return $this->en;
}
throw new Exception('never get to getEn Name::en');
}
/**
* @return string
*/
public static function sampleEn(): string {
return 'Name::en::32'; /*32:en*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromEs(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toEs(): ?string {
if (Name::validateEs($this->es)) {
if (!is_null($this->es)) {
return $this->es; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::es');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateEs(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::es");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getEs(): ?string {
if (Name::validateEs($this->es)) {
return $this->es;
}
throw new Exception('never get to getEs Name::es');
}
/**
* @return ?string
*/
public static function sampleEs(): ?string {
return 'Name::es::33'; /*33:es*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromFr(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toFr(): ?string {
if (Name::validateFr($this->fr)) {
if (!is_null($this->fr)) {
return $this->fr; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::fr');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateFr(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::fr");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getFr(): ?string {
if (Name::validateFr($this->fr)) {
return $this->fr;
}
throw new Exception('never get to getFr Name::fr');
}
/**
* @return ?string
*/
public static function sampleFr(): ?string {
return 'Name::fr::34'; /*34:fr*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromJa(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toJa(): ?string {
if (Name::validateJa($this->ja)) {
if (!is_null($this->ja)) {
return $this->ja; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::ja');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateJa(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::ja");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getJa(): ?string {
if (Name::validateJa($this->ja)) {
return $this->ja;
}
throw new Exception('never get to getJa Name::ja');
}
/**
* @return ?string
*/
public static function sampleJa(): ?string {
return 'Name::ja::35'; /*35:ja*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromKo(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toKo(): ?string {
if (Name::validateKo($this->ko)) {
if (!is_null($this->ko)) {
return $this->ko; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::ko');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateKo(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::ko");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getKo(): ?string {
if (Name::validateKo($this->ko)) {
return $this->ko;
}
throw new Exception('never get to getKo Name::ko');
}
/**
* @return ?string
*/
public static function sampleKo(): ?string {
return 'Name::ko::36'; /*36:ko*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromRu(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toRu(): ?string {
if (Name::validateRu($this->ru)) {
if (!is_null($this->ru)) {
return $this->ru; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::ru');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateRu(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::ru");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getRu(): ?string {
if (Name::validateRu($this->ru)) {
return $this->ru;
}
throw new Exception('never get to getRu Name::ru');
}
/**
* @return ?string
*/
public static function sampleRu(): ?string {
return 'Name::ru::37'; /*37:ru*/
}
/**
* @param ?string $value
* @throws Exception
* @return ?string
*/
public static function fromZh(?string $value): ?string {
if (!is_null($value)) {
return $value; /*string*/
} else {
return null;
}
}
/**
* @throws Exception
* @return ?string
*/
public function toZh(): ?string {
if (Name::validateZh($this->zh)) {
if (!is_null($this->zh)) {
return $this->zh; /*string*/
} else {
return null;
}
}
throw new Exception('never get to this Name::zh');
}
/**
* @param string|null
* @return bool
* @throws Exception
*/
public static function validateZh(?string $value): bool {
if (!is_null($value)) {
if (!is_string($value)) {
throw new Exception("Attribute Error:Name::zh");
}
}
return true;
}
/**
* @throws Exception
* @return ?string
*/
public function getZh(): ?string {
if (Name::validateZh($this->zh)) {
return $this->zh;
}
throw new Exception('never get to getZh Name::zh');
}
/**
* @return ?string
*/
public static function sampleZh(): ?string {
return 'Name::zh::38'; /*38:zh*/
}
/**
* @throws Exception
* @return bool
*/
public function validate(): bool {
return Name::validateDe($this->de)
|| Name::validateEn($this->en)
|| Name::validateEs($this->es)
|| Name::validateFr($this->fr)
|| Name::validateJa($this->ja)
|| Name::validateKo($this->ko)
|| Name::validateRu($this->ru)
|| Name::validateZh($this->zh);
}
/**
* @return stdClass
* @throws Exception
*/
public function to(): stdClass {
$out = new stdClass();
$out->{'de'} = $this->toDe();
$out->{'en'} = $this->toEn();
$out->{'es'} = $this->toEs();
$out->{'fr'} = $this->toFr();
$out->{'ja'} = $this->toJa();
$out->{'ko'} = $this->toKo();
$out->{'ru'} = $this->toRu();
$out->{'zh'} = $this->toZh();
return $out;
}
/**
* @param stdClass $obj
* @return Name
* @throws Exception
*/
public static function from(stdClass $obj): Name {
return new Name(
Name::fromDe($obj->{'de'})
,Name::fromEn($obj->{'en'})
,Name::fromEs($obj->{'es'})
,Name::fromFr($obj->{'fr'})
,Name::fromJa($obj->{'ja'})
,Name::fromKo($obj->{'ko'})
,Name::fromRu($obj->{'ru'})
,Name::fromZh($obj->{'zh'})
);
}
/**
* @return Name
*/
public static function sample(): Name {
return new Name(
Name::sampleDe()
,Name::sampleEn()
,Name::sampleEs()
,Name::sampleFr()
,Name::sampleJa()
,Name::sampleKo()
,Name::sampleRu()
,Name::sampleZh()
);
}
}
from typing import Any, Optional, List, TypeVar, Type, cast, Callable
T = TypeVar("T")
def from_int(x: Any) -> int:
assert isinstance(x, int) and not isinstance(x, bool)
return x
def from_bool(x: Any) -> bool:
assert isinstance(x, bool)
return x
def from_float(x: Any) -> float:
assert isinstance(x, (float, int)) and not isinstance(x, bool)
return float(x)
def to_float(x: Any) -> float:
assert isinstance(x, (int, float))
return x
def from_none(x: Any) -> Any:
assert x is None
return x
def from_union(fs, x):
for f in fs:
try:
return f(x)
except:
pass
assert False
def from_str(x: Any) -> str:
assert isinstance(x, str)
return x
def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
assert isinstance(x, list)
return [f(y) for y in x]
class CourierMission:
objective_quantity: int
objective_singleton: bool
objective_type_id: int
def __init__(self, objective_quantity: int, objective_singleton: bool, objective_type_id: int) -> None:
self.objective_quantity = objective_quantity
self.objective_singleton = objective_singleton
self.objective_type_id = objective_type_id
@staticmethod
def from_dict(obj: Any) -> 'CourierMission':
assert isinstance(obj, dict)
objective_quantity = from_int(obj.get("objectiveQuantity"))
objective_singleton = from_bool(obj.get("objectiveSingleton"))
objective_type_id = from_int(obj.get("objectiveTypeID"))
return CourierMission(objective_quantity, objective_singleton, objective_type_id)
def to_dict(self) -> dict:
result: dict = {}
result["objectiveQuantity"] = from_int(self.objective_quantity)
result["objectiveSingleton"] = from_bool(self.objective_singleton)
result["objectiveTypeID"] = from_int(self.objective_type_id)
return result
class ExtraStanding:
key: int
value: float
def __init__(self, key: int, value: float) -> None:
self.key = key
self.value = value
@staticmethod
def from_dict(obj: Any) -> 'ExtraStanding':
assert isinstance(obj, dict)
key = from_int(obj.get("_key"))
value = from_float(obj.get("_value"))
return ExtraStanding(key, value)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_int(self.key)
result["_value"] = to_float(self.value)
return result
class KillMission:
drop_item_in_mission_container: Optional[int]
dungeon_id: Optional[int]
objective_quantity: Optional[int]
objective_type_id: Optional[int]
def __init__(self, drop_item_in_mission_container: Optional[int], dungeon_id: Optional[int], objective_quantity: Optional[int], objective_type_id: Optional[int]) -> None:
self.drop_item_in_mission_container = drop_item_in_mission_container
self.dungeon_id = dungeon_id
self.objective_quantity = objective_quantity
self.objective_type_id = objective_type_id
@staticmethod
def from_dict(obj: Any) -> 'KillMission':
assert isinstance(obj, dict)
drop_item_in_mission_container = from_union([from_int, from_none], obj.get("dropItemInMissionContainer"))
dungeon_id = from_union([from_int, from_none], obj.get("dungeonID"))
objective_quantity = from_union([from_int, from_none], obj.get("objectiveQuantity"))
objective_type_id = from_union([from_int, from_none], obj.get("objectiveTypeID"))
return KillMission(drop_item_in_mission_container, dungeon_id, objective_quantity, objective_type_id)
def to_dict(self) -> dict:
result: dict = {}
if self.drop_item_in_mission_container is not None:
result["dropItemInMissionContainer"] = from_union([from_int, from_none], self.drop_item_in_mission_container)
if self.dungeon_id is not None:
result["dungeonID"] = from_union([from_int, from_none], self.dungeon_id)
if self.objective_quantity is not None:
result["objectiveQuantity"] = from_union([from_int, from_none], self.objective_quantity)
if self.objective_type_id is not None:
result["objectiveTypeID"] = from_union([from_int, from_none], self.objective_type_id)
return result
class Message:
key: str
de: Optional[str]
en: str
es: Optional[str]
fr: Optional[str]
ja: Optional[str]
ko: Optional[str]
ru: Optional[str]
zh: Optional[str]
def __init__(self, key: str, de: Optional[str], en: str, es: Optional[str], fr: Optional[str], ja: Optional[str], ko: Optional[str], ru: Optional[str], zh: Optional[str]) -> None:
self.key = key
self.de = de
self.en = en
self.es = es
self.fr = fr
self.ja = ja
self.ko = ko
self.ru = ru
self.zh = zh
@staticmethod
def from_dict(obj: Any) -> 'Message':
assert isinstance(obj, dict)
key = from_str(obj.get("_key"))
de = from_union([from_str, from_none], obj.get("de"))
en = from_str(obj.get("en"))
es = from_union([from_str, from_none], obj.get("es"))
fr = from_union([from_str, from_none], obj.get("fr"))
ja = from_union([from_str, from_none], obj.get("ja"))
ko = from_union([from_str, from_none], obj.get("ko"))
ru = from_union([from_str, from_none], obj.get("ru"))
zh = from_union([from_str, from_none], obj.get("zh"))
return Message(key, de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_str(self.key)
if self.de is not None:
result["de"] = from_union([from_str, from_none], self.de)
result["en"] = from_str(self.en)
if self.es is not None:
result["es"] = from_union([from_str, from_none], self.es)
if self.fr is not None:
result["fr"] = from_union([from_str, from_none], self.fr)
if self.ja is not None:
result["ja"] = from_union([from_str, from_none], self.ja)
if self.ko is not None:
result["ko"] = from_union([from_str, from_none], self.ko)
if self.ru is not None:
result["ru"] = from_union([from_str, from_none], self.ru)
if self.zh is not None:
result["zh"] = from_union([from_str, from_none], self.zh)
return result
class BonusReward:
reward_quantity: Optional[int]
reward_type_id: Optional[int]
def __init__(self, reward_quantity: Optional[int], reward_type_id: Optional[int]) -> None:
self.reward_quantity = reward_quantity
self.reward_type_id = reward_type_id
@staticmethod
def from_dict(obj: Any) -> 'BonusReward':
assert isinstance(obj, dict)
reward_quantity = from_union([from_int, from_none], obj.get("rewardQuantity"))
reward_type_id = from_union([from_int, from_none], obj.get("rewardTypeID"))
return BonusReward(reward_quantity, reward_type_id)
def to_dict(self) -> dict:
result: dict = {}
if self.reward_quantity is not None:
result["rewardQuantity"] = from_union([from_int, from_none], self.reward_quantity)
if self.reward_type_id is not None:
result["rewardTypeID"] = from_union([from_int, from_none], self.reward_type_id)
return result
class Reward:
reward_quantity: int
reward_type_id: Optional[int]
def __init__(self, reward_quantity: int, reward_type_id: Optional[int]) -> None:
self.reward_quantity = reward_quantity
self.reward_type_id = reward_type_id
@staticmethod
def from_dict(obj: Any) -> 'Reward':
assert isinstance(obj, dict)
reward_quantity = from_int(obj.get("rewardQuantity"))
reward_type_id = from_union([from_int, from_none], obj.get("rewardTypeID"))
return Reward(reward_quantity, reward_type_id)
def to_dict(self) -> dict:
result: dict = {}
result["rewardQuantity"] = from_int(self.reward_quantity)
if self.reward_type_id is not None:
result["rewardTypeID"] = from_union([from_int, from_none], self.reward_type_id)
return result
class MissionRewards:
bonus_reward: Optional[BonusReward]
bonus_time_interval: Optional[int]
reward: Optional[Reward]
def __init__(self, bonus_reward: Optional[BonusReward], bonus_time_interval: Optional[int], reward: Optional[Reward]) -> None:
self.bonus_reward = bonus_reward
self.bonus_time_interval = bonus_time_interval
self.reward = reward
@staticmethod
def from_dict(obj: Any) -> 'MissionRewards':
assert isinstance(obj, dict)
bonus_reward = from_union([BonusReward.from_dict, from_none], obj.get("bonusReward"))
bonus_time_interval = from_union([from_int, from_none], obj.get("bonusTimeInterval"))
reward = from_union([Reward.from_dict, from_none], obj.get("reward"))
return MissionRewards(bonus_reward, bonus_time_interval, reward)
def to_dict(self) -> dict:
result: dict = {}
if self.bonus_reward is not None:
result["bonusReward"] = from_union([lambda x: to_class(BonusReward, x), from_none], self.bonus_reward)
if self.bonus_time_interval is not None:
result["bonusTimeInterval"] = from_union([from_int, from_none], self.bonus_time_interval)
if self.reward is not None:
result["reward"] = from_union([lambda x: to_class(Reward, x), from_none], self.reward)
return result
class Name:
de: Optional[str]
en: str
es: Optional[str]
fr: Optional[str]
ja: Optional[str]
ko: Optional[str]
ru: Optional[str]
zh: Optional[str]
def __init__(self, de: Optional[str], en: str, es: Optional[str], fr: Optional[str], ja: Optional[str], ko: Optional[str], ru: Optional[str], zh: Optional[str]) -> None:
self.de = de
self.en = en
self.es = es
self.fr = fr
self.ja = ja
self.ko = ko
self.ru = ru
self.zh = zh
@staticmethod
def from_dict(obj: Any) -> 'Name':
assert isinstance(obj, dict)
de = from_union([from_str, from_none], obj.get("de"))
en = from_str(obj.get("en"))
es = from_union([from_str, from_none], obj.get("es"))
fr = from_union([from_str, from_none], obj.get("fr"))
ja = from_union([from_str, from_none], obj.get("ja"))
ko = from_union([from_str, from_none], obj.get("ko"))
ru = from_union([from_str, from_none], obj.get("ru"))
zh = from_union([from_str, from_none], obj.get("zh"))
return Name(de, en, es, fr, ja, ko, ru, zh)
def to_dict(self) -> dict:
result: dict = {}
if self.de is not None:
result["de"] = from_union([from_str, from_none], self.de)
result["en"] = from_str(self.en)
if self.es is not None:
result["es"] = from_union([from_str, from_none], self.es)
if self.fr is not None:
result["fr"] = from_union([from_str, from_none], self.fr)
if self.ja is not None:
result["ja"] = from_union([from_str, from_none], self.ja)
if self.ko is not None:
result["ko"] = from_union([from_str, from_none], self.ko)
if self.ru is not None:
result["ru"] = from_union([from_str, from_none], self.ru)
if self.zh is not None:
result["zh"] = from_union([from_str, from_none], self.zh)
return result
class Mission:
key: int
agent_type_id: Optional[int]
corporation_id: Optional[int]
courier_mission: Optional[CourierMission]
expiration_time: Optional[int]
extra_standings: Optional[List[ExtraStanding]]
faction_id: Optional[int]
has_standing_rewards: bool
initial_agent_gift_quantity: Optional[int]
initial_agent_gift_type_id: Optional[int]
kill_mission: Optional[KillMission]
messages: Optional[List[Message]]
mission_rewards: Optional[MissionRewards]
name: Name
def __init__(self, key: int, agent_type_id: Optional[int], corporation_id: Optional[int], courier_mission: Optional[CourierMission], expiration_time: Optional[int], extra_standings: Optional[List[ExtraStanding]], faction_id: Optional[int], has_standing_rewards: bool, initial_agent_gift_quantity: Optional[int], initial_agent_gift_type_id: Optional[int], kill_mission: Optional[KillMission], messages: Optional[List[Message]], mission_rewards: Optional[MissionRewards], name: Name) -> None:
self.key = key
self.agent_type_id = agent_type_id
self.corporation_id = corporation_id
self.courier_mission = courier_mission
self.expiration_time = expiration_time
self.extra_standings = extra_standings
self.faction_id = faction_id
self.has_standing_rewards = has_standing_rewards
self.initial_agent_gift_quantity = initial_agent_gift_quantity
self.initial_agent_gift_type_id = initial_agent_gift_type_id
self.kill_mission = kill_mission
self.messages = messages
self.mission_rewards = mission_rewards
self.name = name
@staticmethod
def from_dict(obj: Any) -> 'Mission':
assert isinstance(obj, dict)
key = from_int(obj.get("_key"))
agent_type_id = from_union([from_int, from_none], obj.get("agentTypeID"))
corporation_id = from_union([from_int, from_none], obj.get("corporationID"))
courier_mission = from_union([CourierMission.from_dict, from_none], obj.get("courierMission"))
expiration_time = from_union([from_int, from_none], obj.get("expirationTime"))
extra_standings = from_union([lambda x: from_list(ExtraStanding.from_dict, x), from_none], obj.get("extraStandings"))
faction_id = from_union([from_int, from_none], obj.get("factionID"))
has_standing_rewards = from_bool(obj.get("hasStandingRewards"))
initial_agent_gift_quantity = from_union([from_int, from_none], obj.get("initialAgentGiftQuantity"))
initial_agent_gift_type_id = from_union([from_int, from_none], obj.get("initialAgentGiftTypeID"))
kill_mission = from_union([KillMission.from_dict, from_none], obj.get("killMission"))
messages = from_union([lambda x: from_list(Message.from_dict, x), from_none], obj.get("messages"))
mission_rewards = from_union([MissionRewards.from_dict, from_none], obj.get("missionRewards"))
name = Name.from_dict(obj.get("name"))
return Mission(key, agent_type_id, corporation_id, courier_mission, expiration_time, extra_standings, faction_id, has_standing_rewards, initial_agent_gift_quantity, initial_agent_gift_type_id, kill_mission, messages, mission_rewards, name)
def to_dict(self) -> dict:
result: dict = {}
result["_key"] = from_int(self.key)
if self.agent_type_id is not None:
result["agentTypeID"] = from_union([from_int, from_none], self.agent_type_id)
if self.corporation_id is not None:
result["corporationID"] = from_union([from_int, from_none], self.corporation_id)
if self.courier_mission is not None:
result["courierMission"] = from_union([lambda x: to_class(CourierMission, x), from_none], self.courier_mission)
if self.expiration_time is not None:
result["expirationTime"] = from_union([from_int, from_none], self.expiration_time)
if self.extra_standings is not None:
result["extraStandings"] = from_union([lambda x: from_list(lambda x: to_class(ExtraStanding, x), x), from_none], self.extra_standings)
if self.faction_id is not None:
result["factionID"] = from_union([from_int, from_none], self.faction_id)
result["hasStandingRewards"] = from_bool(self.has_standing_rewards)
if self.initial_agent_gift_quantity is not None:
result["initialAgentGiftQuantity"] = from_union([from_int, from_none], self.initial_agent_gift_quantity)
if self.initial_agent_gift_type_id is not None:
result["initialAgentGiftTypeID"] = from_union([from_int, from_none], self.initial_agent_gift_type_id)
if self.kill_mission is not None:
result["killMission"] = from_union([lambda x: to_class(KillMission, x), from_none], self.kill_mission)
if self.messages is not None:
result["messages"] = from_union([lambda x: from_list(lambda x: to_class(Message, x), x), from_none], self.messages)
if self.mission_rewards is not None:
result["missionRewards"] = from_union([lambda x: to_class(MissionRewards, x), from_none], self.mission_rewards)
result["name"] = to_class(Name, self.name)
return result
def mission_from_dict(s: Any) -> Mission:
return Mission.from_dict(s)
def mission_to_dict(x: Mission) -> Any:
return to_class(Mission, x)
// To parse this data:
//
// import { Convert, Mission } from "./file";
//
// const mission = Convert.toMission(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
export interface Mission {
_key: number;
agentTypeID?: number;
corporationID?: number;
courierMission?: CourierMission;
expirationTime?: number;
extraStandings?: ExtraStanding[];
factionID?: number;
hasStandingRewards: boolean;
initialAgentGiftQuantity?: number;
initialAgentGiftTypeID?: number;
killMission?: KillMission;
messages?: Message[];
missionRewards?: MissionRewards;
name: Name;
[property: string]: any;
}
export interface CourierMission {
objectiveQuantity: number;
objectiveSingleton: boolean;
objectiveTypeID: number;
[property: string]: any;
}
export interface ExtraStanding {
_key: number;
_value: number;
[property: string]: any;
}
export interface KillMission {
dropItemInMissionContainer?: number;
dungeonID?: number;
objectiveQuantity?: number;
objectiveTypeID?: number;
[property: string]: any;
}
export interface Message {
_key: string;
de?: string;
en: string;
es?: string;
fr?: string;
ja?: string;
ko?: string;
ru?: string;
zh?: string;
[property: string]: any;
}
export interface MissionRewards {
bonusReward?: BonusReward;
bonusTimeInterval?: number;
reward?: Reward;
[property: string]: any;
}
export interface BonusReward {
rewardQuantity?: number;
rewardTypeID?: number;
[property: string]: any;
}
export interface Reward {
rewardQuantity: number;
rewardTypeID?: number;
[property: string]: any;
}
export interface Name {
de?: string;
en: string;
es?: string;
fr?: string;
ja?: string;
ko?: string;
ru?: string;
zh?: string;
[property: string]: any;
}
// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
public static toMission(json: string): Mission {
return cast(JSON.parse(json), r("Mission"));
}
public static missionToJson(value: Mission): string {
return JSON.stringify(uncast(value, r("Mission")), 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 = {
"Mission": o([
{ json: "_key", js: "_key", typ: 0 },
{ json: "agentTypeID", js: "agentTypeID", typ: u(undefined, 0) },
{ json: "corporationID", js: "corporationID", typ: u(undefined, 0) },
{ json: "courierMission", js: "courierMission", typ: u(undefined, r("CourierMission")) },
{ json: "expirationTime", js: "expirationTime", typ: u(undefined, 0) },
{ json: "extraStandings", js: "extraStandings", typ: u(undefined, a(r("ExtraStanding"))) },
{ json: "factionID", js: "factionID", typ: u(undefined, 0) },
{ json: "hasStandingRewards", js: "hasStandingRewards", typ: true },
{ json: "initialAgentGiftQuantity", js: "initialAgentGiftQuantity", typ: u(undefined, 0) },
{ json: "initialAgentGiftTypeID", js: "initialAgentGiftTypeID", typ: u(undefined, 0) },
{ json: "killMission", js: "killMission", typ: u(undefined, r("KillMission")) },
{ json: "messages", js: "messages", typ: u(undefined, a(r("Message"))) },
{ json: "missionRewards", js: "missionRewards", typ: u(undefined, r("MissionRewards")) },
{ json: "name", js: "name", typ: r("Name") },
], "any"),
"CourierMission": o([
{ json: "objectiveQuantity", js: "objectiveQuantity", typ: 0 },
{ json: "objectiveSingleton", js: "objectiveSingleton", typ: true },
{ json: "objectiveTypeID", js: "objectiveTypeID", typ: 0 },
], "any"),
"ExtraStanding": o([
{ json: "_key", js: "_key", typ: 0 },
{ json: "_value", js: "_value", typ: 3.14 },
], "any"),
"KillMission": o([
{ json: "dropItemInMissionContainer", js: "dropItemInMissionContainer", typ: u(undefined, 0) },
{ json: "dungeonID", js: "dungeonID", typ: u(undefined, 0) },
{ json: "objectiveQuantity", js: "objectiveQuantity", typ: u(undefined, 0) },
{ json: "objectiveTypeID", js: "objectiveTypeID", typ: u(undefined, 0) },
], "any"),
"Message": o([
{ json: "_key", js: "_key", typ: "" },
{ json: "de", js: "de", typ: u(undefined, "") },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: u(undefined, "") },
{ json: "fr", js: "fr", typ: u(undefined, "") },
{ json: "ja", js: "ja", typ: u(undefined, "") },
{ json: "ko", js: "ko", typ: u(undefined, "") },
{ json: "ru", js: "ru", typ: u(undefined, "") },
{ json: "zh", js: "zh", typ: u(undefined, "") },
], "any"),
"MissionRewards": o([
{ json: "bonusReward", js: "bonusReward", typ: u(undefined, r("BonusReward")) },
{ json: "bonusTimeInterval", js: "bonusTimeInterval", typ: u(undefined, 0) },
{ json: "reward", js: "reward", typ: u(undefined, r("Reward")) },
], "any"),
"BonusReward": o([
{ json: "rewardQuantity", js: "rewardQuantity", typ: u(undefined, 0) },
{ json: "rewardTypeID", js: "rewardTypeID", typ: u(undefined, 0) },
], "any"),
"Reward": o([
{ json: "rewardQuantity", js: "rewardQuantity", typ: 0 },
{ json: "rewardTypeID", js: "rewardTypeID", typ: u(undefined, 0) },
], "any"),
"Name": o([
{ json: "de", js: "de", typ: u(undefined, "") },
{ json: "en", js: "en", typ: "" },
{ json: "es", js: "es", typ: u(undefined, "") },
{ json: "fr", js: "fr", typ: u(undefined, "") },
{ json: "ja", js: "ja", typ: u(undefined, "") },
{ json: "ko", js: "ko", typ: u(undefined, "") },
{ json: "ru", js: "ru", typ: u(undefined, "") },
{ json: "zh", js: "zh", typ: u(undefined, "") },
], "any"),
};