Test case
1 generated file · +3 −3test/inputs/json/misc/29f47.json
Mkotlin-jacksondefault / TopLevel.kt+3 −3
| @@ -299,9 +299,9 @@ sealed class Edited { | ||
| 299 | 299 | |
| 300 | 300 | companion object { |
| 301 | 301 | fun fromJson(jn: JsonNode): Edited = when (jn) { |
| 302 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 303 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 304 | - else -> throw IllegalArgumentException() | |
| 302 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 303 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 304 | + else -> throw IllegalArgumentException() | |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | } |
Test case
1 generated file · +4 −4test/inputs/json/misc/a0496.json
Mkotlin-jacksondefault / TopLevel.kt+4 −4
| @@ -107,10 +107,10 @@ sealed class Datum { | ||
| 107 | 107 | |
| 108 | 108 | companion object { |
| 109 | 109 | fun fromJson(jn: JsonNode): Datum = when (jn) { |
| 110 | - is TextNode -> DateValue(mapper.treeToValue(jn)) | |
| 111 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 112 | - null -> NullValue() | |
| 113 | - else -> throw IllegalArgumentException() | |
| 110 | + is TextNode -> DateValue(mapper.treeToValue(jn)) | |
| 111 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 112 | + null -> NullValue() | |
| 113 | + else -> throw IllegalArgumentException() | |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | } |
Test case
1 generated file · +31 −31test/inputs/json/priority/combinations1.json
Mkotlin-jacksondefault / TopLevel.kt+31 −31
| @@ -346,9 +346,9 @@ sealed class Clinodome { | ||
| 346 | 346 | |
| 347 | 347 | companion object { |
| 348 | 348 | fun fromJson(jn: JsonNode): Clinodome = when (jn) { |
| 349 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 350 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 351 | - else -> throw IllegalArgumentException() | |
| 349 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 350 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 351 | + else -> throw IllegalArgumentException() | |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | } |
| @@ -364,9 +364,9 @@ sealed class CoadjustElement { | ||
| 364 | 364 | |
| 365 | 365 | companion object { |
| 366 | 366 | fun fromJson(jn: JsonNode): CoadjustElement = when (jn) { |
| 367 | - is ObjectNode -> CoadjustClassValue(mapper.treeToValue(jn)) | |
| 368 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 369 | - else -> throw IllegalArgumentException() | |
| 367 | + is ObjectNode -> CoadjustClassValue(mapper.treeToValue(jn)) | |
| 368 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 369 | + else -> throw IllegalArgumentException() | |
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | } |
| @@ -425,9 +425,9 @@ sealed class Consilience { | ||
| 425 | 425 | |
| 426 | 426 | companion object { |
| 427 | 427 | fun fromJson(jn: JsonNode): Consilience = when (jn) { |
| 428 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 429 | - is ObjectNode -> IntegerMapValue(mapper.treeToValue(jn)) | |
| 430 | - else -> throw IllegalArgumentException() | |
| 428 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 429 | + is ObjectNode -> IntegerMapValue(mapper.treeToValue(jn)) | |
| 430 | + else -> throw IllegalArgumentException() | |
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | } |
| @@ -674,10 +674,10 @@ sealed class Eleutheromania { | ||
| 674 | 674 | |
| 675 | 675 | companion object { |
| 676 | 676 | fun fromJson(jn: JsonNode): Eleutheromania = when (jn) { |
| 677 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 678 | - is ObjectNode -> IntegerMapValue(mapper.treeToValue(jn)) | |
| 679 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 680 | - else -> throw IllegalArgumentException() | |
| 677 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 678 | + is ObjectNode -> IntegerMapValue(mapper.treeToValue(jn)) | |
| 679 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 680 | + else -> throw IllegalArgumentException() | |
| 681 | 681 | } |
| 682 | 682 | } |
| 683 | 683 | } |
| @@ -744,9 +744,9 @@ sealed class Epipaleolithic { | ||
| 744 | 744 | |
| 745 | 745 | companion object { |
| 746 | 746 | fun fromJson(jn: JsonNode): Epipaleolithic = when (jn) { |
| 747 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 748 | - is ArrayNode -> IntegerArrayValue(mapper.treeToValue(jn)) | |
| 749 | - else -> throw IllegalArgumentException() | |
| 747 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 748 | + is ArrayNode -> IntegerArrayValue(mapper.treeToValue(jn)) | |
| 749 | + else -> throw IllegalArgumentException() | |
| 750 | 750 | } |
| 751 | 751 | } |
| 752 | 752 | } |
| @@ -764,10 +764,10 @@ sealed class Expropriable { | ||
| 764 | 764 | |
| 765 | 765 | companion object { |
| 766 | 766 | fun fromJson(jn: JsonNode): Expropriable = when (jn) { |
| 767 | - is ObjectNode -> CimeliaClassValue(mapper.treeToValue(jn)) | |
| 768 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 769 | - is ArrayNode -> NullArrayValue(mapper.treeToValue(jn)) | |
| 770 | - else -> throw IllegalArgumentException() | |
| 767 | + is ObjectNode -> CimeliaClassValue(mapper.treeToValue(jn)) | |
| 768 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 769 | + is ArrayNode -> NullArrayValue(mapper.treeToValue(jn)) | |
| 770 | + else -> throw IllegalArgumentException() | |
| 771 | 771 | } |
| 772 | 772 | } |
| 773 | 773 | } |
| @@ -783,9 +783,9 @@ sealed class FagginglyElement { | ||
| 783 | 783 | |
| 784 | 784 | companion object { |
| 785 | 785 | fun fromJson(jn: JsonNode): FagginglyElement = when (jn) { |
| 786 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 787 | - is ObjectNode -> FagginglyClassValue(mapper.treeToValue(jn)) | |
| 788 | - else -> throw IllegalArgumentException() | |
| 786 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 787 | + is ObjectNode -> FagginglyClassValue(mapper.treeToValue(jn)) | |
| 788 | + else -> throw IllegalArgumentException() | |
| 789 | 789 | } |
| 790 | 790 | } |
| 791 | 791 | } |
| @@ -888,10 +888,10 @@ sealed class FlagmakingElement { | ||
| 888 | 888 | |
| 889 | 889 | companion object { |
| 890 | 890 | fun fromJson(jn: JsonNode): FlagmakingElement = when (jn) { |
| 891 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 892 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 893 | - is ObjectNode -> FlagmakingClassValue(mapper.treeToValue(jn)) | |
| 894 | - else -> throw IllegalArgumentException() | |
| 891 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 892 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 893 | + is ObjectNode -> FlagmakingClassValue(mapper.treeToValue(jn)) | |
| 894 | + else -> throw IllegalArgumentException() | |
| 895 | 895 | } |
| 896 | 896 | } |
| 897 | 897 | } |
| @@ -1196,10 +1196,10 @@ sealed class Intentiveness { | ||
| 1196 | 1196 | |
| 1197 | 1197 | companion object { |
| 1198 | 1198 | fun fromJson(jn: JsonNode): Intentiveness = when (jn) { |
| 1199 | - is ObjectNode -> CimeliaClassValue(mapper.treeToValue(jn)) | |
| 1200 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1201 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 1202 | - else -> throw IllegalArgumentException() | |
| 1199 | + is ObjectNode -> CimeliaClassValue(mapper.treeToValue(jn)) | |
| 1200 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1201 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 1202 | + else -> throw IllegalArgumentException() | |
| 1203 | 1203 | } |
| 1204 | 1204 | } |
| 1205 | 1205 | } |
Test case
1 generated file · +2,292 −0test/inputs/json/priority/combinations2.json
Arubydefault / TopLevel.rb+2,292 −0
| @@ -0,0 +1,2292 @@ | ||
| 1 | +# This code may look unusually verbose for Ruby (and it is), but | |
| 2 | +# it performs some subtle and complex validation of JSON data. | |
| 3 | +# | |
| 4 | +# To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do: | |
| 5 | +# | |
| 6 | +# top_level = TopLevel.from_json! "{…}" | |
| 7 | +# puts top_level.wayao["…"] | |
| 8 | +# | |
| 9 | +# If from_json! succeeds, the value returned matches the schema. | |
| 10 | + | |
| 11 | +require 'json' | |
| 12 | +require 'dry-types' | |
| 13 | +require 'dry-struct' | |
| 14 | + | |
| 15 | +module Types | |
| 16 | + include Dry.Types(default: :nominal) | |
| 17 | + | |
| 18 | + Integer = Strict::Integer | |
| 19 | + Nil = Strict::Nil | |
| 20 | + Bool = Strict::Bool | |
| 21 | + Hash = Strict::Hash | |
| 22 | + String = Strict::String | |
| 23 | + Double = Strict::Float | Strict::Integer | |
| 24 | +end | |
| 25 | + | |
| 26 | +class Abranchiata < Dry::Struct | |
| 27 | + attribute :integer, Types::Integer.optional | |
| 28 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 29 | + attribute :null, Types::Nil.optional | |
| 30 | + | |
| 31 | + def self.from_dynamic!(d) | |
| 32 | + if schema[:integer].right.valid? d | |
| 33 | + return new(integer: d, integer_array: nil, null: nil) | |
| 34 | + end | |
| 35 | + if schema[:integer_array].right.valid? d | |
| 36 | + return new(integer_array: d, integer: nil, null: nil) | |
| 37 | + end | |
| 38 | + if schema[:null].right.valid? d | |
| 39 | + return new(null: d, integer_array: nil, integer: nil) | |
| 40 | + end | |
| 41 | + raise "Invalid union" | |
| 42 | + end | |
| 43 | + | |
| 44 | + def self.from_json!(json) | |
| 45 | + from_dynamic!(JSON.parse(json)) | |
| 46 | + end | |
| 47 | + | |
| 48 | + def to_dynamic | |
| 49 | + if integer != nil | |
| 50 | + integer | |
| 51 | + elsif integer_array != nil | |
| 52 | + integer_array | |
| 53 | + else | |
| 54 | + nil | |
| 55 | + end | |
| 56 | + end | |
| 57 | + | |
| 58 | + def to_json(options = nil) | |
| 59 | + JSON.generate(to_dynamic, options) | |
| 60 | + end | |
| 61 | +end | |
| 62 | + | |
| 63 | +class Academe < Dry::Struct | |
| 64 | + attribute :integer, Types::Integer.optional | |
| 65 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 66 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 67 | + | |
| 68 | + def self.from_dynamic!(d) | |
| 69 | + if schema[:integer].right.valid? d | |
| 70 | + return new(integer: d, integer_array: nil, integer_map: nil) | |
| 71 | + end | |
| 72 | + if schema[:integer_array].right.valid? d | |
| 73 | + return new(integer_array: d, integer: nil, integer_map: nil) | |
| 74 | + end | |
| 75 | + begin | |
| 76 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 77 | + if schema[:integer_map].right.valid? value | |
| 78 | + return new(integer_map: value, integer_array: nil, integer: nil) | |
| 79 | + end | |
| 80 | + rescue | |
| 81 | + end | |
| 82 | + raise "Invalid union" | |
| 83 | + end | |
| 84 | + | |
| 85 | + def self.from_json!(json) | |
| 86 | + from_dynamic!(JSON.parse(json)) | |
| 87 | + end | |
| 88 | + | |
| 89 | + def to_dynamic | |
| 90 | + if integer != nil | |
| 91 | + integer | |
| 92 | + elsif integer_array != nil | |
| 93 | + integer_array | |
| 94 | + elsif integer_map != nil | |
| 95 | + integer_map | |
| 96 | + end | |
| 97 | + end | |
| 98 | + | |
| 99 | + def to_json(options = nil) | |
| 100 | + JSON.generate(to_dynamic, options) | |
| 101 | + end | |
| 102 | +end | |
| 103 | + | |
| 104 | +class Acquirable < Dry::Struct | |
| 105 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 106 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 107 | + | |
| 108 | + def self.from_dynamic!(d) | |
| 109 | + begin | |
| 110 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 111 | + if schema[:integer_map].right.valid? value | |
| 112 | + return new(integer_map: value, union_array: nil) | |
| 113 | + end | |
| 114 | + rescue | |
| 115 | + end | |
| 116 | + if schema[:union_array].right.valid? d | |
| 117 | + return new(union_array: d, integer_map: nil) | |
| 118 | + end | |
| 119 | + raise "Invalid union" | |
| 120 | + end | |
| 121 | + | |
| 122 | + def self.from_json!(json) | |
| 123 | + from_dynamic!(JSON.parse(json)) | |
| 124 | + end | |
| 125 | + | |
| 126 | + def to_dynamic | |
| 127 | + if integer_map != nil | |
| 128 | + integer_map | |
| 129 | + elsif union_array != nil | |
| 130 | + union_array | |
| 131 | + end | |
| 132 | + end | |
| 133 | + | |
| 134 | + def to_json(options = nil) | |
| 135 | + JSON.generate(to_dynamic, options) | |
| 136 | + end | |
| 137 | +end | |
| 138 | + | |
| 139 | +class Aerometry < Dry::Struct | |
| 140 | + attribute :bool, Types::Bool.optional | |
| 141 | + attribute :double, Types::Double.optional | |
| 142 | + | |
| 143 | + def self.from_dynamic!(d) | |
| 144 | + if schema[:bool].right.valid? d | |
| 145 | + return new(bool: d, double: nil) | |
| 146 | + end | |
| 147 | + if schema[:double].right.valid? d | |
| 148 | + return new(double: d, bool: nil) | |
| 149 | + end | |
| 150 | + raise "Invalid union" | |
| 151 | + end | |
| 152 | + | |
| 153 | + def self.from_json!(json) | |
| 154 | + from_dynamic!(JSON.parse(json)) | |
| 155 | + end | |
| 156 | + | |
| 157 | + def to_dynamic | |
| 158 | + if bool != nil | |
| 159 | + bool | |
| 160 | + elsif double != nil | |
| 161 | + double | |
| 162 | + end | |
| 163 | + end | |
| 164 | + | |
| 165 | + def to_json(options = nil) | |
| 166 | + JSON.generate(to_dynamic, options) | |
| 167 | + end | |
| 168 | +end | |
| 169 | + | |
| 170 | +class Alexin < Dry::Struct | |
| 171 | + attribute :bool, Types::Bool.optional | |
| 172 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 173 | + | |
| 174 | + def self.from_dynamic!(d) | |
| 175 | + if schema[:bool].right.valid? d | |
| 176 | + return new(bool: d, integer_array: nil) | |
| 177 | + end | |
| 178 | + if schema[:integer_array].right.valid? d | |
| 179 | + return new(integer_array: d, bool: nil) | |
| 180 | + end | |
| 181 | + raise "Invalid union" | |
| 182 | + end | |
| 183 | + | |
| 184 | + def self.from_json!(json) | |
| 185 | + from_dynamic!(JSON.parse(json)) | |
| 186 | + end | |
| 187 | + | |
| 188 | + def to_dynamic | |
| 189 | + if bool != nil | |
| 190 | + bool | |
| 191 | + elsif integer_array != nil | |
| 192 | + integer_array | |
| 193 | + end | |
| 194 | + end | |
| 195 | + | |
| 196 | + def to_json(options = nil) | |
| 197 | + JSON.generate(to_dynamic, options) | |
| 198 | + end | |
| 199 | +end | |
| 200 | + | |
| 201 | +class AlleviateClass < Dry::Struct | |
| 202 | + attribute :apriori, Types::Nil | |
| 203 | + attribute :beggarer, Types::Nil | |
| 204 | + attribute :brokenheartedly, Types::Nil | |
| 205 | + attribute :debilitation, Types::Nil | |
| 206 | + attribute :frike, Types::Nil | |
| 207 | + attribute :gastrolith, Types::Nil | |
| 208 | + attribute :hulsean, Types::Nil | |
| 209 | + attribute :orthocentric, Types::Nil | |
| 210 | + attribute :petaly, Types::Nil | |
| 211 | + attribute :probudgeting, Types::Nil | |
| 212 | + attribute :reacquire, Types::Nil | |
| 213 | + attribute :scow, Types::Nil | |
| 214 | + attribute :shutoff, Types::Nil | |
| 215 | + attribute :subcontiguous, Types::Nil | |
| 216 | + attribute :suffumigate, Types::Nil | |
| 217 | + attribute :transformable, Types::Nil | |
| 218 | + attribute :uncoroneted, Types::Nil | |
| 219 | + attribute :unparking, Types::Nil | |
| 220 | + attribute :unvarnishedness, Types::Nil | |
| 221 | + attribute :wherewithal, Types::Nil | |
| 222 | + | |
| 223 | + def self.from_dynamic!(d) | |
| 224 | + d = Types::Hash[d] | |
| 225 | + new( | |
| 226 | + apriori: d.fetch("apriori"), | |
| 227 | + beggarer: d.fetch("beggarer"), | |
| 228 | + brokenheartedly: d.fetch("brokenheartedly"), | |
| 229 | + debilitation: d.fetch("debilitation"), | |
| 230 | + frike: d.fetch("frike"), | |
| 231 | + gastrolith: d.fetch("gastrolith"), | |
| 232 | + hulsean: d.fetch("Hulsean"), | |
| 233 | + orthocentric: d.fetch("orthocentric"), | |
| 234 | + petaly: d.fetch("petaly"), | |
| 235 | + probudgeting: d.fetch("probudgeting"), | |
| 236 | + reacquire: d.fetch("reacquire"), | |
| 237 | + scow: d.fetch("scow"), | |
| 238 | + shutoff: d.fetch("shutoff"), | |
| 239 | + subcontiguous: d.fetch("subcontiguous"), | |
| 240 | + suffumigate: d.fetch("suffumigate"), | |
| 241 | + transformable: d.fetch("transformable"), | |
| 242 | + uncoroneted: d.fetch("uncoroneted"), | |
| 243 | + unparking: d.fetch("unparking"), | |
| 244 | + unvarnishedness: d.fetch("unvarnishedness"), | |
| 245 | + wherewithal: d.fetch("wherewithal"), | |
| 246 | + ) | |
| 247 | + end | |
| 248 | + | |
| 249 | + def self.from_json!(json) | |
| 250 | + from_dynamic!(JSON.parse(json)) | |
| 251 | + end | |
| 252 | + | |
| 253 | + def to_dynamic | |
| 254 | + { | |
| 255 | + "apriori" => apriori, | |
| 256 | + "beggarer" => beggarer, | |
| 257 | + "brokenheartedly" => brokenheartedly, | |
| 258 | + "debilitation" => debilitation, | |
| 259 | + "frike" => frike, | |
| 260 | + "gastrolith" => gastrolith, | |
| 261 | + "Hulsean" => hulsean, | |
| 262 | + "orthocentric" => orthocentric, | |
| 263 | + "petaly" => petaly, | |
| 264 | + "probudgeting" => probudgeting, | |
| 265 | + "reacquire" => reacquire, | |
| 266 | + "scow" => scow, | |
| 267 | + "shutoff" => shutoff, | |
| 268 | + "subcontiguous" => subcontiguous, | |
| 269 | + "suffumigate" => suffumigate, | |
| 270 | + "transformable" => transformable, | |
| 271 | + "uncoroneted" => uncoroneted, | |
| 272 | + "unparking" => unparking, | |
| 273 | + "unvarnishedness" => unvarnishedness, | |
| 274 | + "wherewithal" => wherewithal, | |
| 275 | + } | |
| 276 | + end | |
| 277 | + | |
| 278 | + def to_json(options = nil) | |
| 279 | + JSON.generate(to_dynamic, options) | |
| 280 | + end | |
| 281 | +end | |
| 282 | + | |
| 283 | +class AlleviateElement < Dry::Struct | |
| 284 | + attribute :alleviate_class, AlleviateClass.optional | |
| 285 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 286 | + | |
| 287 | + def self.from_dynamic!(d) | |
| 288 | + begin | |
| 289 | + value = AlleviateClass.from_dynamic!(d) | |
| 290 | + if schema[:alleviate_class].right.valid? value | |
| 291 | + return new(alleviate_class: value, union_array: nil) | |
| 292 | + end | |
| 293 | + rescue | |
| 294 | + end | |
| 295 | + if schema[:union_array].right.valid? d | |
| 296 | + return new(union_array: d, alleviate_class: nil) | |
| 297 | + end | |
| 298 | + raise "Invalid union" | |
| 299 | + end | |
| 300 | + | |
| 301 | + def self.from_json!(json) | |
| 302 | + from_dynamic!(JSON.parse(json)) | |
| 303 | + end | |
| 304 | + | |
| 305 | + def to_dynamic | |
| 306 | + if alleviate_class != nil | |
| 307 | + alleviate_class.to_dynamic | |
| 308 | + elsif union_array != nil | |
| 309 | + union_array | |
| 310 | + end | |
| 311 | + end | |
| 312 | + | |
| 313 | + def to_json(options = nil) | |
| 314 | + JSON.generate(to_dynamic, options) | |
| 315 | + end | |
| 316 | +end | |
| 317 | + | |
| 318 | +class Rebecca < Dry::Struct | |
| 319 | + attribute :catharticalness, Types::Double | |
| 320 | + attribute :chirotherium, Types::Integer | |
| 321 | + attribute :disdiapason, Types::String | |
| 322 | + attribute :homocerc, Types::Bool | |
| 323 | + attribute :nonbookish, Types::Nil | |
| 324 | + | |
| 325 | + def self.from_dynamic!(d) | |
| 326 | + d = Types::Hash[d] | |
| 327 | + new( | |
| 328 | + catharticalness: d.fetch("catharticalness"), | |
| 329 | + chirotherium: d.fetch("Chirotherium"), | |
| 330 | + disdiapason: d.fetch("disdiapason"), | |
| 331 | + homocerc: d.fetch("homocerc"), | |
| 332 | + nonbookish: d.fetch("nonbookish"), | |
| 333 | + ) | |
| 334 | + end | |
| 335 | + | |
| 336 | + def self.from_json!(json) | |
| 337 | + from_dynamic!(JSON.parse(json)) | |
| 338 | + end | |
| 339 | + | |
| 340 | + def to_dynamic | |
| 341 | + { | |
| 342 | + "catharticalness" => catharticalness, | |
| 343 | + "Chirotherium" => chirotherium, | |
| 344 | + "disdiapason" => disdiapason, | |
| 345 | + "homocerc" => homocerc, | |
| 346 | + "nonbookish" => nonbookish, | |
| 347 | + } | |
| 348 | + end | |
| 349 | + | |
| 350 | + def to_json(options = nil) | |
| 351 | + JSON.generate(to_dynamic, options) | |
| 352 | + end | |
| 353 | +end | |
| 354 | + | |
| 355 | +class Amaa < Dry::Struct | |
| 356 | + attribute :bool, Types::Bool.optional | |
| 357 | + attribute :integer, Types::Integer.optional | |
| 358 | + attribute :rebecca, Rebecca.optional | |
| 359 | + | |
| 360 | + def self.from_dynamic!(d) | |
| 361 | + if schema[:bool].right.valid? d | |
| 362 | + return new(bool: d, rebecca: nil, integer: nil) | |
| 363 | + end | |
| 364 | + if schema[:integer].right.valid? d | |
| 365 | + return new(integer: d, bool: nil, rebecca: nil) | |
| 366 | + end | |
| 367 | + begin | |
| 368 | + value = Rebecca.from_dynamic!(d) | |
| 369 | + if schema[:rebecca].right.valid? value | |
| 370 | + return new(rebecca: value, bool: nil, integer: nil) | |
| 371 | + end | |
| 372 | + rescue | |
| 373 | + end | |
| 374 | + raise "Invalid union" | |
| 375 | + end | |
| 376 | + | |
| 377 | + def self.from_json!(json) | |
| 378 | + from_dynamic!(JSON.parse(json)) | |
| 379 | + end | |
| 380 | + | |
| 381 | + def to_dynamic | |
| 382 | + if bool != nil | |
| 383 | + bool | |
| 384 | + elsif integer != nil | |
| 385 | + integer | |
| 386 | + elsif rebecca != nil | |
| 387 | + rebecca.to_dynamic | |
| 388 | + end | |
| 389 | + end | |
| 390 | + | |
| 391 | + def to_json(options = nil) | |
| 392 | + JSON.generate(to_dynamic, options) | |
| 393 | + end | |
| 394 | +end | |
| 395 | + | |
| 396 | +class Ambassage < Dry::Struct | |
| 397 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 398 | + attribute :string, Types::String.optional | |
| 399 | + | |
| 400 | + def self.from_dynamic!(d) | |
| 401 | + if schema[:null_array].right.valid? d | |
| 402 | + return new(null_array: d, string: nil) | |
| 403 | + end | |
| 404 | + if schema[:string].right.valid? d | |
| 405 | + return new(string: d, null_array: nil) | |
| 406 | + end | |
| 407 | + raise "Invalid union" | |
| 408 | + end | |
| 409 | + | |
| 410 | + def self.from_json!(json) | |
| 411 | + from_dynamic!(JSON.parse(json)) | |
| 412 | + end | |
| 413 | + | |
| 414 | + def to_dynamic | |
| 415 | + if null_array != nil | |
| 416 | + null_array | |
| 417 | + elsif string != nil | |
| 418 | + string | |
| 419 | + end | |
| 420 | + end | |
| 421 | + | |
| 422 | + def to_json(options = nil) | |
| 423 | + JSON.generate(to_dynamic, options) | |
| 424 | + end | |
| 425 | +end | |
| 426 | + | |
| 427 | +class Amphithyron < Dry::Struct | |
| 428 | + attribute :akroasis, Types::Integer.optional | |
| 429 | + attribute :antiphonical, Types::Integer.optional | |
| 430 | + attribute :basebred, Types::Integer.optional | |
| 431 | + attribute :catharticalness, Types::Double.optional | |
| 432 | + attribute :chirotherium, Types::Integer.optional | |
| 433 | + attribute :conductometric, Types::Integer.optional | |
| 434 | + attribute :disdiapason, Types::String.optional | |
| 435 | + attribute :ensilation, Types::Integer.optional | |
| 436 | + attribute :eyebolt, Types::Integer.optional | |
| 437 | + attribute :fistulated, Types::Integer.optional | |
| 438 | + attribute :heteropod, Types::Integer.optional | |
| 439 | + attribute :homocerc, Types::Bool.optional | |
| 440 | + attribute :juniperus, Types::Integer.optional | |
| 441 | + attribute :labyrinthically, Types::Integer.optional | |
| 442 | + attribute :martyrization, Types::Integer.optional | |
| 443 | + attribute :mispolicy, Types::Integer.optional | |
| 444 | + attribute :multipara, Types::Integer.optional | |
| 445 | + attribute :nazirite, Types::Integer.optional | |
| 446 | + attribute :nonbookish, Types::Nil.optional | |
| 447 | + attribute :possessorial, Types::Integer.optional | |
| 448 | + attribute :shamed, Types::Integer.optional | |
| 449 | + attribute :shelfworn, Types::Integer.optional | |
| 450 | + attribute :stagnum, Types::Integer.optional | |
| 451 | + attribute :those, Types::Integer.optional | |
| 452 | + attribute :undecimal, Types::Integer.optional | |
| 453 | + | |
| 454 | + def self.from_dynamic!(d) | |
| 455 | + d = Types::Hash[d] | |
| 456 | + new( | |
| 457 | + akroasis: d["akroasis"], | |
| 458 | + antiphonical: d["antiphonical"], | |
| 459 | + basebred: d["basebred"], | |
| 460 | + catharticalness: d["catharticalness"], | |
| 461 | + chirotherium: d["Chirotherium"], | |
| 462 | + conductometric: d["conductometric"], | |
| 463 | + disdiapason: d["disdiapason"], | |
| 464 | + ensilation: d["ensilation"], | |
| 465 | + eyebolt: d["eyebolt"], | |
| 466 | + fistulated: d["fistulated"], | |
| 467 | + heteropod: d["heteropod"], | |
| 468 | + homocerc: d["homocerc"], | |
| 469 | + juniperus: d["Juniperus"], | |
| 470 | + labyrinthically: d["labyrinthically"], | |
| 471 | + martyrization: d["martyrization"], | |
| 472 | + mispolicy: d["mispolicy"], | |
| 473 | + multipara: d["multipara"], | |
| 474 | + nazirite: d["Nazirite"], | |
| 475 | + nonbookish: d["nonbookish"], | |
| 476 | + possessorial: d["possessorial"], | |
| 477 | + shamed: d["shamed"], | |
| 478 | + shelfworn: d["shelfworn"], | |
| 479 | + stagnum: d["stagnum"], | |
| 480 | + those: d["Those"], | |
| 481 | + undecimal: d["undecimal"], | |
| 482 | + ) | |
| 483 | + end | |
| 484 | + | |
| 485 | + def self.from_json!(json) | |
| 486 | + from_dynamic!(JSON.parse(json)) | |
| 487 | + end | |
| 488 | + | |
| 489 | + def to_dynamic | |
| 490 | + { | |
| 491 | + "akroasis" => akroasis, | |
| 492 | + "antiphonical" => antiphonical, | |
| 493 | + "basebred" => basebred, | |
| 494 | + "catharticalness" => catharticalness, | |
| 495 | + "Chirotherium" => chirotherium, | |
| 496 | + "conductometric" => conductometric, | |
| 497 | + "disdiapason" => disdiapason, | |
| 498 | + "ensilation" => ensilation, | |
| 499 | + "eyebolt" => eyebolt, | |
| 500 | + "fistulated" => fistulated, | |
| 501 | + "heteropod" => heteropod, | |
| 502 | + "homocerc" => homocerc, | |
| 503 | + "Juniperus" => juniperus, | |
| 504 | + "labyrinthically" => labyrinthically, | |
| 505 | + "martyrization" => martyrization, | |
| 506 | + "mispolicy" => mispolicy, | |
| 507 | + "multipara" => multipara, | |
| 508 | + "Nazirite" => nazirite, | |
| 509 | + "nonbookish" => nonbookish, | |
| 510 | + "possessorial" => possessorial, | |
| 511 | + "shamed" => shamed, | |
| 512 | + "shelfworn" => shelfworn, | |
| 513 | + "stagnum" => stagnum, | |
| 514 | + "Those" => those, | |
| 515 | + "undecimal" => undecimal, | |
| 516 | + } | |
| 517 | + end | |
| 518 | + | |
| 519 | + def to_json(options = nil) | |
| 520 | + JSON.generate(to_dynamic, options) | |
| 521 | + end | |
| 522 | +end | |
| 523 | + | |
| 524 | +class AnkeeClass < Dry::Struct | |
| 525 | + attribute :anomoean, Types::Nil | |
| 526 | + attribute :barleyhood, Types::Nil | |
| 527 | + attribute :befriender, Types::Nil | |
| 528 | + attribute :brutishness, Types::Nil | |
| 529 | + attribute :cephalalgy, Types::Nil | |
| 530 | + attribute :cirurgian, Types::Nil | |
| 531 | + attribute :conventionally, Types::Nil | |
| 532 | + attribute :jackshay, Types::Nil | |
| 533 | + attribute :milammeter, Types::Nil | |
| 534 | + attribute :naja, Types::Nil | |
| 535 | + attribute :ombrological, Types::Nil | |
| 536 | + attribute :phonasthenia, Types::Nil | |
| 537 | + attribute :retrievableness, Types::Nil | |
| 538 | + attribute :snakily, Types::Nil | |
| 539 | + attribute :swot, Types::Nil | |
| 540 | + attribute :tartlet, Types::Nil | |
| 541 | + attribute :thiofuran, Types::Nil | |
| 542 | + attribute :tracheophone, Types::Nil | |
| 543 | + attribute :tuglike, Types::Nil | |
| 544 | + attribute :unscratchingly, Types::Nil | |
| 545 | + | |
| 546 | + def self.from_dynamic!(d) | |
| 547 | + d = Types::Hash[d] | |
| 548 | + new( | |
| 549 | + anomoean: d.fetch("Anomoean"), | |
| 550 | + barleyhood: d.fetch("barleyhood"), | |
| 551 | + befriender: d.fetch("befriender"), | |
| 552 | + brutishness: d.fetch("brutishness"), | |
| 553 | + cephalalgy: d.fetch("cephalalgy"), | |
| 554 | + cirurgian: d.fetch("cirurgian"), | |
| 555 | + conventionally: d.fetch("conventionally"), | |
| 556 | + jackshay: d.fetch("jackshay"), | |
| 557 | + milammeter: d.fetch("milammeter"), | |
| 558 | + naja: d.fetch("Naja"), | |
| 559 | + ombrological: d.fetch("ombrological"), | |
| 560 | + phonasthenia: d.fetch("phonasthenia"), | |
| 561 | + retrievableness: d.fetch("retrievableness"), | |
| 562 | + snakily: d.fetch("snakily"), | |
| 563 | + swot: d.fetch("swot"), | |
| 564 | + tartlet: d.fetch("tartlet"), | |
| 565 | + thiofuran: d.fetch("thiofuran"), | |
| 566 | + tracheophone: d.fetch("tracheophone"), | |
| 567 | + tuglike: d.fetch("tuglike"), | |
| 568 | + unscratchingly: d.fetch("unscratchingly"), | |
| 569 | + ) | |
| 570 | + end | |
| 571 | + | |
| 572 | + def self.from_json!(json) | |
| 573 | + from_dynamic!(JSON.parse(json)) | |
| 574 | + end | |
| 575 | + | |
| 576 | + def to_dynamic | |
| 577 | + { | |
| 578 | + "Anomoean" => anomoean, | |
| 579 | + "barleyhood" => barleyhood, | |
| 580 | + "befriender" => befriender, | |
| 581 | + "brutishness" => brutishness, | |
| 582 | + "cephalalgy" => cephalalgy, | |
| 583 | + "cirurgian" => cirurgian, | |
| 584 | + "conventionally" => conventionally, | |
| 585 | + "jackshay" => jackshay, | |
| 586 | + "milammeter" => milammeter, | |
| 587 | + "Naja" => naja, | |
| 588 | + "ombrological" => ombrological, | |
| 589 | + "phonasthenia" => phonasthenia, | |
| 590 | + "retrievableness" => retrievableness, | |
| 591 | + "snakily" => snakily, | |
| 592 | + "swot" => swot, | |
| 593 | + "tartlet" => tartlet, | |
| 594 | + "thiofuran" => thiofuran, | |
| 595 | + "tracheophone" => tracheophone, | |
| 596 | + "tuglike" => tuglike, | |
| 597 | + "unscratchingly" => unscratchingly, | |
| 598 | + } | |
| 599 | + end | |
| 600 | + | |
| 601 | + def to_json(options = nil) | |
| 602 | + JSON.generate(to_dynamic, options) | |
| 603 | + end | |
| 604 | +end | |
| 605 | + | |
| 606 | +class AnkeeElement < Dry::Struct | |
| 607 | + attribute :ankee_class, AnkeeClass.optional | |
| 608 | + attribute :integer, Types::Integer.optional | |
| 609 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 610 | + | |
| 611 | + def self.from_dynamic!(d) | |
| 612 | + begin | |
| 613 | + value = AnkeeClass.from_dynamic!(d) | |
| 614 | + if schema[:ankee_class].right.valid? value | |
| 615 | + return new(ankee_class: value, integer_array: nil, integer: nil) | |
| 616 | + end | |
| 617 | + rescue | |
| 618 | + end | |
| 619 | + if schema[:integer].right.valid? d | |
| 620 | + return new(integer: d, integer_array: nil, ankee_class: nil) | |
| 621 | + end | |
| 622 | + if schema[:integer_array].right.valid? d | |
| 623 | + return new(integer_array: d, ankee_class: nil, integer: nil) | |
| 624 | + end | |
| 625 | + raise "Invalid union" | |
| 626 | + end | |
| 627 | + | |
| 628 | + def self.from_json!(json) | |
| 629 | + from_dynamic!(JSON.parse(json)) | |
| 630 | + end | |
| 631 | + | |
| 632 | + def to_dynamic | |
| 633 | + if ankee_class != nil | |
| 634 | + ankee_class.to_dynamic | |
| 635 | + elsif integer != nil | |
| 636 | + integer | |
| 637 | + elsif integer_array != nil | |
| 638 | + integer_array | |
| 639 | + end | |
| 640 | + end | |
| 641 | + | |
| 642 | + def to_json(options = nil) | |
| 643 | + JSON.generate(to_dynamic, options) | |
| 644 | + end | |
| 645 | +end | |
| 646 | + | |
| 647 | +class AnsarieClass < Dry::Struct | |
| 648 | + attribute :accension, Types::Nil | |
| 649 | + attribute :alida, Types::Nil | |
| 650 | + attribute :asteria, Types::Nil | |
| 651 | + attribute :beriberic, Types::Nil | |
| 652 | + attribute :edgebone, Types::Nil | |
| 653 | + attribute :gastrodialysis, Types::Nil | |
| 654 | + attribute :geographic, Types::Nil | |
| 655 | + attribute :ictonyx, Types::Nil | |
| 656 | + attribute :metrocele, Types::Nil | |
| 657 | + attribute :misgraft, Types::Nil | |
| 658 | + attribute :monteith, Types::Nil | |
| 659 | + attribute :notcher, Types::Nil | |
| 660 | + attribute :prorestriction, Types::Nil | |
| 661 | + attribute :ramist, Types::Nil | |
| 662 | + attribute :throatlet, Types::Nil | |
| 663 | + attribute :unfair, Types::Nil | |
| 664 | + attribute :unsynonymous, Types::Nil | |
| 665 | + attribute :water, Types::Nil | |
| 666 | + attribute :zestfully, Types::Nil | |
| 667 | + attribute :zincic, Types::Nil | |
| 668 | + | |
| 669 | + def self.from_dynamic!(d) | |
| 670 | + d = Types::Hash[d] | |
| 671 | + new( | |
| 672 | + accension: d.fetch("accension"), | |
| 673 | + alida: d.fetch("Alida"), | |
| 674 | + asteria: d.fetch("asteria"), | |
| 675 | + beriberic: d.fetch("beriberic"), | |
| 676 | + edgebone: d.fetch("edgebone"), | |
| 677 | + gastrodialysis: d.fetch("gastrodialysis"), | |
| 678 | + geographic: d.fetch("geographic"), | |
| 679 | + ictonyx: d.fetch("Ictonyx"), | |
| 680 | + metrocele: d.fetch("metrocele"), | |
| 681 | + misgraft: d.fetch("misgraft"), | |
| 682 | + monteith: d.fetch("monteith"), | |
| 683 | + notcher: d.fetch("notcher"), | |
| 684 | + prorestriction: d.fetch("prorestriction"), | |
| 685 | + ramist: d.fetch("Ramist"), | |
| 686 | + throatlet: d.fetch("throatlet"), | |
| 687 | + unfair: d.fetch("unfair"), | |
| 688 | + unsynonymous: d.fetch("unsynonymous"), | |
| 689 | + water: d.fetch("water"), | |
| 690 | + zestfully: d.fetch("zestfully"), | |
| 691 | + zincic: d.fetch("zincic"), | |
| 692 | + ) | |
| 693 | + end | |
| 694 | + | |
| 695 | + def self.from_json!(json) | |
| 696 | + from_dynamic!(JSON.parse(json)) | |
| 697 | + end | |
| 698 | + | |
| 699 | + def to_dynamic | |
| 700 | + { | |
| 701 | + "accension" => accension, | |
| 702 | + "Alida" => alida, | |
| 703 | + "asteria" => asteria, | |
| 704 | + "beriberic" => beriberic, | |
| 705 | + "edgebone" => edgebone, | |
| 706 | + "gastrodialysis" => gastrodialysis, | |
| 707 | + "geographic" => geographic, | |
| 708 | + "Ictonyx" => ictonyx, | |
| 709 | + "metrocele" => metrocele, | |
| 710 | + "misgraft" => misgraft, | |
| 711 | + "monteith" => monteith, | |
| 712 | + "notcher" => notcher, | |
| 713 | + "prorestriction" => prorestriction, | |
| 714 | + "Ramist" => ramist, | |
| 715 | + "throatlet" => throatlet, | |
| 716 | + "unfair" => unfair, | |
| 717 | + "unsynonymous" => unsynonymous, | |
| 718 | + "water" => water, | |
| 719 | + "zestfully" => zestfully, | |
| 720 | + "zincic" => zincic, | |
| 721 | + } | |
| 722 | + end | |
| 723 | + | |
| 724 | + def to_json(options = nil) | |
| 725 | + JSON.generate(to_dynamic, options) | |
| 726 | + end | |
| 727 | +end | |
| 728 | + | |
| 729 | +class AnsarieElement < Dry::Struct | |
| 730 | + attribute :ansarie_class, AnsarieClass.optional | |
| 731 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 732 | + attribute :null, Types::Nil.optional | |
| 733 | + | |
| 734 | + def self.from_dynamic!(d) | |
| 735 | + begin | |
| 736 | + value = AnsarieClass.from_dynamic!(d) | |
| 737 | + if schema[:ansarie_class].right.valid? value | |
| 738 | + return new(ansarie_class: value, integer_array: nil, null: nil) | |
| 739 | + end | |
| 740 | + rescue | |
| 741 | + end | |
| 742 | + if schema[:integer_array].right.valid? d | |
| 743 | + return new(integer_array: d, ansarie_class: nil, null: nil) | |
| 744 | + end | |
| 745 | + if schema[:null].right.valid? d | |
| 746 | + return new(null: d, integer_array: nil, ansarie_class: nil) | |
| 747 | + end | |
| 748 | + raise "Invalid union" | |
| 749 | + end | |
| 750 | + | |
| 751 | + def self.from_json!(json) | |
| 752 | + from_dynamic!(JSON.parse(json)) | |
| 753 | + end | |
| 754 | + | |
| 755 | + def to_dynamic | |
| 756 | + if ansarie_class != nil | |
| 757 | + ansarie_class.to_dynamic | |
| 758 | + elsif integer_array != nil | |
| 759 | + integer_array | |
| 760 | + else | |
| 761 | + nil | |
| 762 | + end | |
| 763 | + end | |
| 764 | + | |
| 765 | + def to_json(options = nil) | |
| 766 | + JSON.generate(to_dynamic, options) | |
| 767 | + end | |
| 768 | +end | |
| 769 | + | |
| 770 | +class Aphasia < Dry::Struct | |
| 771 | + attribute :integer, Types::Integer.optional | |
| 772 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 773 | + | |
| 774 | + def self.from_dynamic!(d) | |
| 775 | + if schema[:integer].right.valid? d | |
| 776 | + return new(integer: d, integer_array: nil) | |
| 777 | + end | |
| 778 | + if schema[:integer_array].right.valid? d | |
| 779 | + return new(integer_array: d, integer: nil) | |
| 780 | + end | |
| 781 | + raise "Invalid union" | |
| 782 | + end | |
| 783 | + | |
| 784 | + def self.from_json!(json) | |
| 785 | + from_dynamic!(JSON.parse(json)) | |
| 786 | + end | |
| 787 | + | |
| 788 | + def to_dynamic | |
| 789 | + if integer != nil | |
| 790 | + integer | |
| 791 | + elsif integer_array != nil | |
| 792 | + integer_array | |
| 793 | + end | |
| 794 | + end | |
| 795 | + | |
| 796 | + def to_json(options = nil) | |
| 797 | + JSON.generate(to_dynamic, options) | |
| 798 | + end | |
| 799 | +end | |
| 800 | + | |
| 801 | +class Asprawl < Dry::Struct | |
| 802 | + attribute :double, Types::Double.optional | |
| 803 | + attribute :string, Types::String.optional | |
| 804 | + | |
| 805 | + def self.from_dynamic!(d) | |
| 806 | + if schema[:double].right.valid? d | |
| 807 | + return new(double: d, string: nil) | |
| 808 | + end | |
| 809 | + if schema[:string].right.valid? d | |
| 810 | + return new(string: d, double: nil) | |
| 811 | + end | |
| 812 | + raise "Invalid union" | |
| 813 | + end | |
| 814 | + | |
| 815 | + def self.from_json!(json) | |
| 816 | + from_dynamic!(JSON.parse(json)) | |
| 817 | + end | |
| 818 | + | |
| 819 | + def to_dynamic | |
| 820 | + if double != nil | |
| 821 | + double | |
| 822 | + elsif string != nil | |
| 823 | + string | |
| 824 | + end | |
| 825 | + end | |
| 826 | + | |
| 827 | + def to_json(options = nil) | |
| 828 | + JSON.generate(to_dynamic, options) | |
| 829 | + end | |
| 830 | +end | |
| 831 | + | |
| 832 | +class Bedesman < Dry::Struct | |
| 833 | + attribute :bool, Types::Bool.optional | |
| 834 | + attribute :double, Types::Double.optional | |
| 835 | + attribute :string, Types::String.optional | |
| 836 | + | |
| 837 | + def self.from_dynamic!(d) | |
| 838 | + if schema[:bool].right.valid? d | |
| 839 | + return new(bool: d, double: nil, string: nil) | |
| 840 | + end | |
| 841 | + if schema[:double].right.valid? d | |
| 842 | + return new(double: d, bool: nil, string: nil) | |
| 843 | + end | |
| 844 | + if schema[:string].right.valid? d | |
| 845 | + return new(string: d, bool: nil, double: nil) | |
| 846 | + end | |
| 847 | + raise "Invalid union" | |
| 848 | + end | |
| 849 | + | |
| 850 | + def self.from_json!(json) | |
| 851 | + from_dynamic!(JSON.parse(json)) | |
| 852 | + end | |
| 853 | + | |
| 854 | + def to_dynamic | |
| 855 | + if bool != nil | |
| 856 | + bool | |
| 857 | + elsif double != nil | |
| 858 | + double | |
| 859 | + elsif string != nil | |
| 860 | + string | |
| 861 | + end | |
| 862 | + end | |
| 863 | + | |
| 864 | + def to_json(options = nil) | |
| 865 | + JSON.generate(to_dynamic, options) | |
| 866 | + end | |
| 867 | +end | |
| 868 | + | |
| 869 | +class Belard < Dry::Struct | |
| 870 | + attribute :double, Types::Double.optional | |
| 871 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 872 | + attribute :rebecca, Rebecca.optional | |
| 873 | + | |
| 874 | + def self.from_dynamic!(d) | |
| 875 | + if schema[:double].right.valid? d | |
| 876 | + return new(double: d, integer_array: nil, rebecca: nil) | |
| 877 | + end | |
| 878 | + if schema[:integer_array].right.valid? d | |
| 879 | + return new(integer_array: d, rebecca: nil, double: nil) | |
| 880 | + end | |
| 881 | + begin | |
| 882 | + value = Rebecca.from_dynamic!(d) | |
| 883 | + if schema[:rebecca].right.valid? value | |
| 884 | + return new(rebecca: value, integer_array: nil, double: nil) | |
| 885 | + end | |
| 886 | + rescue | |
| 887 | + end | |
| 888 | + raise "Invalid union" | |
| 889 | + end | |
| 890 | + | |
| 891 | + def self.from_json!(json) | |
| 892 | + from_dynamic!(JSON.parse(json)) | |
| 893 | + end | |
| 894 | + | |
| 895 | + def to_dynamic | |
| 896 | + if double != nil | |
| 897 | + double | |
| 898 | + elsif integer_array != nil | |
| 899 | + integer_array | |
| 900 | + elsif rebecca != nil | |
| 901 | + rebecca.to_dynamic | |
| 902 | + end | |
| 903 | + end | |
| 904 | + | |
| 905 | + def to_json(options = nil) | |
| 906 | + JSON.generate(to_dynamic, options) | |
| 907 | + end | |
| 908 | +end | |
| 909 | + | |
| 910 | +class Bocking < Dry::Struct | |
| 911 | + attribute :bool, Types::Bool.optional | |
| 912 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 913 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 914 | + | |
| 915 | + def self.from_dynamic!(d) | |
| 916 | + if schema[:bool].right.valid? d | |
| 917 | + return new(bool: d, integer_array: nil, integer_map: nil) | |
| 918 | + end | |
| 919 | + if schema[:integer_array].right.valid? d | |
| 920 | + return new(integer_array: d, bool: nil, integer_map: nil) | |
| 921 | + end | |
| 922 | + begin | |
| 923 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 924 | + if schema[:integer_map].right.valid? value | |
| 925 | + return new(integer_map: value, integer_array: nil, bool: nil) | |
| 926 | + end | |
| 927 | + rescue | |
| 928 | + end | |
| 929 | + raise "Invalid union" | |
| 930 | + end | |
| 931 | + | |
| 932 | + def self.from_json!(json) | |
| 933 | + from_dynamic!(JSON.parse(json)) | |
| 934 | + end | |
| 935 | + | |
| 936 | + def to_dynamic | |
| 937 | + if bool != nil | |
| 938 | + bool | |
| 939 | + elsif integer_array != nil | |
| 940 | + integer_array | |
| 941 | + elsif integer_map != nil | |
| 942 | + integer_map | |
| 943 | + end | |
| 944 | + end | |
| 945 | + | |
| 946 | + def to_json(options = nil) | |
| 947 | + JSON.generate(to_dynamic, options) | |
| 948 | + end | |
| 949 | +end | |
| 950 | + | |
| 951 | +class Brawlingly < Dry::Struct | |
| 952 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 953 | + attribute :union_map, Types::Hash.meta(of: Types::Integer.optional).optional | |
| 954 | + | |
| 955 | + def self.from_dynamic!(d) | |
| 956 | + if schema[:null_array].right.valid? d | |
| 957 | + return new(null_array: d, union_map: nil) | |
| 958 | + end | |
| 959 | + begin | |
| 960 | + value = Types::Hash[d].map { |k, v| [k, v] }.to_h | |
| 961 | + if schema[:union_map].right.valid? value | |
| 962 | + return new(union_map: value, null_array: nil) | |
| 963 | + end | |
| 964 | + rescue | |
| 965 | + end | |
| 966 | + raise "Invalid union" | |
| 967 | + end | |
| 968 | + | |
| 969 | + def self.from_json!(json) | |
| 970 | + from_dynamic!(JSON.parse(json)) | |
| 971 | + end | |
| 972 | + | |
| 973 | + def to_dynamic | |
| 974 | + if null_array != nil | |
| 975 | + null_array | |
| 976 | + elsif union_map != nil | |
| 977 | + union_map | |
| 978 | + end | |
| 979 | + end | |
| 980 | + | |
| 981 | + def to_json(options = nil) | |
| 982 | + JSON.generate(to_dynamic, options) | |
| 983 | + end | |
| 984 | +end | |
| 985 | + | |
| 986 | +class Brookie < Dry::Struct | |
| 987 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 988 | + attribute :rebecca, Rebecca.optional | |
| 989 | + | |
| 990 | + def self.from_dynamic!(d) | |
| 991 | + if schema[:integer_array].right.valid? d | |
| 992 | + return new(integer_array: d, rebecca: nil) | |
| 993 | + end | |
| 994 | + begin | |
| 995 | + value = Rebecca.from_dynamic!(d) | |
| 996 | + if schema[:rebecca].right.valid? value | |
| 997 | + return new(rebecca: value, integer_array: nil) | |
| 998 | + end | |
| 999 | + rescue | |
| 1000 | + end | |
| 1001 | + raise "Invalid union" | |
| 1002 | + end | |
| 1003 | + | |
| 1004 | + def self.from_json!(json) | |
| 1005 | + from_dynamic!(JSON.parse(json)) | |
| 1006 | + end | |
| 1007 | + | |
| 1008 | + def to_dynamic | |
| 1009 | + if integer_array != nil | |
| 1010 | + integer_array | |
| 1011 | + elsif rebecca != nil | |
| 1012 | + rebecca.to_dynamic | |
| 1013 | + end | |
| 1014 | + end | |
| 1015 | + | |
| 1016 | + def to_json(options = nil) | |
| 1017 | + JSON.generate(to_dynamic, options) | |
| 1018 | + end | |
| 1019 | +end | |
| 1020 | + | |
| 1021 | +class Bumboatman < Dry::Struct | |
| 1022 | + attribute :null, Types::Nil.optional | |
| 1023 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1024 | + attribute :string, Types::String.optional | |
| 1025 | + | |
| 1026 | + def self.from_dynamic!(d) | |
| 1027 | + if schema[:null].right.valid? d | |
| 1028 | + return new(null: d, null_array: nil, string: nil) | |
| 1029 | + end | |
| 1030 | + if schema[:null_array].right.valid? d | |
| 1031 | + return new(null_array: d, null: nil, string: nil) | |
| 1032 | + end | |
| 1033 | + if schema[:string].right.valid? d | |
| 1034 | + return new(string: d, null_array: nil, null: nil) | |
| 1035 | + end | |
| 1036 | + raise "Invalid union" | |
| 1037 | + end | |
| 1038 | + | |
| 1039 | + def self.from_json!(json) | |
| 1040 | + from_dynamic!(JSON.parse(json)) | |
| 1041 | + end | |
| 1042 | + | |
| 1043 | + def to_dynamic | |
| 1044 | + if null_array != nil | |
| 1045 | + null_array | |
| 1046 | + elsif string != nil | |
| 1047 | + string | |
| 1048 | + else | |
| 1049 | + nil | |
| 1050 | + end | |
| 1051 | + end | |
| 1052 | + | |
| 1053 | + def to_json(options = nil) | |
| 1054 | + JSON.generate(to_dynamic, options) | |
| 1055 | + end | |
| 1056 | +end | |
| 1057 | + | |
| 1058 | +class Calaverite < Dry::Struct | |
| 1059 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1060 | + attribute :string, Types::String.optional | |
| 1061 | + | |
| 1062 | + def self.from_dynamic!(d) | |
| 1063 | + if schema[:integer_array].right.valid? d | |
| 1064 | + return new(integer_array: d, string: nil) | |
| 1065 | + end | |
| 1066 | + if schema[:string].right.valid? d | |
| 1067 | + return new(string: d, integer_array: nil) | |
| 1068 | + end | |
| 1069 | + raise "Invalid union" | |
| 1070 | + end | |
| 1071 | + | |
| 1072 | + def self.from_json!(json) | |
| 1073 | + from_dynamic!(JSON.parse(json)) | |
| 1074 | + end | |
| 1075 | + | |
| 1076 | + def to_dynamic | |
| 1077 | + if integer_array != nil | |
| 1078 | + integer_array | |
| 1079 | + elsif string != nil | |
| 1080 | + string | |
| 1081 | + end | |
| 1082 | + end | |
| 1083 | + | |
| 1084 | + def to_json(options = nil) | |
| 1085 | + JSON.generate(to_dynamic, options) | |
| 1086 | + end | |
| 1087 | +end | |
| 1088 | + | |
| 1089 | +class Catallactic < Dry::Struct | |
| 1090 | + attribute :bool, Types::Bool.optional | |
| 1091 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1092 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1093 | + | |
| 1094 | + def self.from_dynamic!(d) | |
| 1095 | + if schema[:bool].right.valid? d | |
| 1096 | + return new(bool: d, null_array: nil, integer_map: nil) | |
| 1097 | + end | |
| 1098 | + begin | |
| 1099 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1100 | + if schema[:integer_map].right.valid? value | |
| 1101 | + return new(integer_map: value, null_array: nil, bool: nil) | |
| 1102 | + end | |
| 1103 | + rescue | |
| 1104 | + end | |
| 1105 | + if schema[:null_array].right.valid? d | |
| 1106 | + return new(null_array: d, bool: nil, integer_map: nil) | |
| 1107 | + end | |
| 1108 | + raise "Invalid union" | |
| 1109 | + end | |
| 1110 | + | |
| 1111 | + def self.from_json!(json) | |
| 1112 | + from_dynamic!(JSON.parse(json)) | |
| 1113 | + end | |
| 1114 | + | |
| 1115 | + def to_dynamic | |
| 1116 | + if bool != nil | |
| 1117 | + bool | |
| 1118 | + elsif integer_map != nil | |
| 1119 | + integer_map | |
| 1120 | + elsif null_array != nil | |
| 1121 | + null_array | |
| 1122 | + end | |
| 1123 | + end | |
| 1124 | + | |
| 1125 | + def to_json(options = nil) | |
| 1126 | + JSON.generate(to_dynamic, options) | |
| 1127 | + end | |
| 1128 | +end | |
| 1129 | + | |
| 1130 | +class Cemental < Dry::Struct | |
| 1131 | + attribute :double, Types::Double.optional | |
| 1132 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1133 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1134 | + | |
| 1135 | + def self.from_dynamic!(d) | |
| 1136 | + if schema[:double].right.valid? d | |
| 1137 | + return new(double: d, integer_array: nil, integer_map: nil) | |
| 1138 | + end | |
| 1139 | + if schema[:integer_array].right.valid? d | |
| 1140 | + return new(integer_array: d, double: nil, integer_map: nil) | |
| 1141 | + end | |
| 1142 | + begin | |
| 1143 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1144 | + if schema[:integer_map].right.valid? value | |
| 1145 | + return new(integer_map: value, integer_array: nil, double: nil) | |
| 1146 | + end | |
| 1147 | + rescue | |
| 1148 | + end | |
| 1149 | + raise "Invalid union" | |
| 1150 | + end | |
| 1151 | + | |
| 1152 | + def self.from_json!(json) | |
| 1153 | + from_dynamic!(JSON.parse(json)) | |
| 1154 | + end | |
| 1155 | + | |
| 1156 | + def to_dynamic | |
| 1157 | + if double != nil | |
| 1158 | + double | |
| 1159 | + elsif integer_array != nil | |
| 1160 | + integer_array | |
| 1161 | + elsif integer_map != nil | |
| 1162 | + integer_map | |
| 1163 | + end | |
| 1164 | + end | |
| 1165 | + | |
| 1166 | + def to_json(options = nil) | |
| 1167 | + JSON.generate(to_dynamic, options) | |
| 1168 | + end | |
| 1169 | +end | |
| 1170 | + | |
| 1171 | +class ChytridiaceaeClass < Dry::Struct | |
| 1172 | + attribute :batidaceae, Types::Nil | |
| 1173 | + attribute :brechites, Types::Nil | |
| 1174 | + attribute :codespairer, Types::Nil | |
| 1175 | + attribute :emery, Types::Nil | |
| 1176 | + attribute :enervative, Types::Nil | |
| 1177 | + attribute :excriminate, Types::Nil | |
| 1178 | + attribute :goshenite, Types::Nil | |
| 1179 | + attribute :grime, Types::Nil | |
| 1180 | + attribute :gritten, Types::Nil | |
| 1181 | + attribute :hectorly, Types::Nil | |
| 1182 | + attribute :intermediation, Types::Nil | |
| 1183 | + attribute :meeterly, Types::Nil | |
| 1184 | + attribute :narraganset, Types::Nil | |
| 1185 | + attribute :onymatic, Types::Nil | |
| 1186 | + attribute :paddlecock, Types::Nil | |
| 1187 | + attribute :thana, Types::Nil | |
| 1188 | + attribute :thornily, Types::Nil | |
| 1189 | + attribute :uckia, Types::Nil | |
| 1190 | + attribute :unmettle, Types::Nil | |
| 1191 | + attribute :vorticellid, Types::Nil | |
| 1192 | + | |
| 1193 | + def self.from_dynamic!(d) | |
| 1194 | + d = Types::Hash[d] | |
| 1195 | + new( | |
| 1196 | + batidaceae: d.fetch("Batidaceae"), | |
| 1197 | + brechites: d.fetch("Brechites"), | |
| 1198 | + codespairer: d.fetch("codespairer"), | |
| 1199 | + emery: d.fetch("Emery"), | |
| 1200 | + enervative: d.fetch("enervative"), | |
| 1201 | + excriminate: d.fetch("excriminate"), | |
| 1202 | + goshenite: d.fetch("goshenite"), | |
| 1203 | + grime: d.fetch("grime"), | |
| 1204 | + gritten: d.fetch("gritten"), | |
| 1205 | + hectorly: d.fetch("hectorly"), | |
| 1206 | + intermediation: d.fetch("intermediation"), | |
| 1207 | + meeterly: d.fetch("meeterly"), | |
| 1208 | + narraganset: d.fetch("Narraganset"), | |
| 1209 | + onymatic: d.fetch("onymatic"), | |
| 1210 | + paddlecock: d.fetch("paddlecock"), | |
| 1211 | + thana: d.fetch("thana"), | |
| 1212 | + thornily: d.fetch("thornily"), | |
| 1213 | + uckia: d.fetch("uckia"), | |
| 1214 | + unmettle: d.fetch("unmettle"), | |
| 1215 | + vorticellid: d.fetch("vorticellid"), | |
| 1216 | + ) | |
| 1217 | + end | |
| 1218 | + | |
| 1219 | + def self.from_json!(json) | |
| 1220 | + from_dynamic!(JSON.parse(json)) | |
| 1221 | + end | |
| 1222 | + | |
| 1223 | + def to_dynamic | |
| 1224 | + { | |
| 1225 | + "Batidaceae" => batidaceae, | |
| 1226 | + "Brechites" => brechites, | |
| 1227 | + "codespairer" => codespairer, | |
| 1228 | + "Emery" => emery, | |
| 1229 | + "enervative" => enervative, | |
| 1230 | + "excriminate" => excriminate, | |
| 1231 | + "goshenite" => goshenite, | |
| 1232 | + "grime" => grime, | |
| 1233 | + "gritten" => gritten, | |
| 1234 | + "hectorly" => hectorly, | |
| 1235 | + "intermediation" => intermediation, | |
| 1236 | + "meeterly" => meeterly, | |
| 1237 | + "Narraganset" => narraganset, | |
| 1238 | + "onymatic" => onymatic, | |
| 1239 | + "paddlecock" => paddlecock, | |
| 1240 | + "thana" => thana, | |
| 1241 | + "thornily" => thornily, | |
| 1242 | + "uckia" => uckia, | |
| 1243 | + "unmettle" => unmettle, | |
| 1244 | + "vorticellid" => vorticellid, | |
| 1245 | + } | |
| 1246 | + end | |
| 1247 | + | |
| 1248 | + def to_json(options = nil) | |
| 1249 | + JSON.generate(to_dynamic, options) | |
| 1250 | + end | |
| 1251 | +end | |
| 1252 | + | |
| 1253 | +class ChytridiaceaeElement < Dry::Struct | |
| 1254 | + attribute :bool, Types::Bool.optional | |
| 1255 | + attribute :chytridiaceae_class, ChytridiaceaeClass.optional | |
| 1256 | + attribute :null, Types::Nil.optional | |
| 1257 | + | |
| 1258 | + def self.from_dynamic!(d) | |
| 1259 | + if schema[:bool].right.valid? d | |
| 1260 | + return new(bool: d, chytridiaceae_class: nil, null: nil) | |
| 1261 | + end | |
| 1262 | + begin | |
| 1263 | + value = ChytridiaceaeClass.from_dynamic!(d) | |
| 1264 | + if schema[:chytridiaceae_class].right.valid? value | |
| 1265 | + return new(chytridiaceae_class: value, bool: nil, null: nil) | |
| 1266 | + end | |
| 1267 | + rescue | |
| 1268 | + end | |
| 1269 | + if schema[:null].right.valid? d | |
| 1270 | + return new(null: d, bool: nil, chytridiaceae_class: nil) | |
| 1271 | + end | |
| 1272 | + raise "Invalid union" | |
| 1273 | + end | |
| 1274 | + | |
| 1275 | + def self.from_json!(json) | |
| 1276 | + from_dynamic!(JSON.parse(json)) | |
| 1277 | + end | |
| 1278 | + | |
| 1279 | + def to_dynamic | |
| 1280 | + if bool != nil | |
| 1281 | + bool | |
| 1282 | + elsif chytridiaceae_class != nil | |
| 1283 | + chytridiaceae_class.to_dynamic | |
| 1284 | + else | |
| 1285 | + nil | |
| 1286 | + end | |
| 1287 | + end | |
| 1288 | + | |
| 1289 | + def to_json(options = nil) | |
| 1290 | + JSON.generate(to_dynamic, options) | |
| 1291 | + end | |
| 1292 | +end | |
| 1293 | + | |
| 1294 | +class DiscordiaClass < Dry::Struct | |
| 1295 | + attribute :altaic, Types::Integer.optional | |
| 1296 | + attribute :amoristic, Types::Integer.optional | |
| 1297 | + attribute :blennophthalmia, Types::Integer.optional | |
| 1298 | + attribute :catharticalness, Types::Double.optional | |
| 1299 | + attribute :chirotherium, Types::Integer.optional | |
| 1300 | + attribute :disciplinability, Types::Integer.optional | |
| 1301 | + attribute :disdiapason, Types::String.optional | |
| 1302 | + attribute :goofer, Types::Integer.optional | |
| 1303 | + attribute :homocerc, Types::Bool.optional | |
| 1304 | + attribute :laryngograph, Types::Integer.optional | |
| 1305 | + attribute :leucitis, Types::Integer.optional | |
| 1306 | + attribute :lymphocyst, Types::Integer.optional | |
| 1307 | + attribute :microcosmology, Types::Integer.optional | |
| 1308 | + attribute :nauseation, Types::Integer.optional | |
| 1309 | + attribute :nonbookish, Types::Nil.optional | |
| 1310 | + attribute :patarin, Types::Integer.optional | |
| 1311 | + attribute :preliberal, Types::Integer.optional | |
| 1312 | + attribute :prettifier, Types::Integer.optional | |
| 1313 | + attribute :rangework, Types::Integer.optional | |
| 1314 | + attribute :redient, Types::Integer.optional | |
| 1315 | + attribute :subfusiform, Types::Integer.optional | |
| 1316 | + attribute :suicidical, Types::Integer.optional | |
| 1317 | + attribute :swow, Types::Integer.optional | |
| 1318 | + attribute :wastrel, Types::Integer.optional | |
| 1319 | + attribute :wingle, Types::Integer.optional | |
| 1320 | + | |
| 1321 | + def self.from_dynamic!(d) | |
| 1322 | + d = Types::Hash[d] | |
| 1323 | + new( | |
| 1324 | + altaic: d["Altaic"], | |
| 1325 | + amoristic: d["amoristic"], | |
| 1326 | + blennophthalmia: d["blennophthalmia"], | |
| 1327 | + catharticalness: d["catharticalness"], | |
| 1328 | + chirotherium: d["Chirotherium"], | |
| 1329 | + disciplinability: d["disciplinability"], | |
| 1330 | + disdiapason: d["disdiapason"], | |
| 1331 | + goofer: d["goofer"], | |
| 1332 | + homocerc: d["homocerc"], | |
| 1333 | + laryngograph: d["laryngograph"], | |
| 1334 | + leucitis: d["leucitis"], | |
| 1335 | + lymphocyst: d["lymphocyst"], | |
| 1336 | + microcosmology: d["microcosmology"], | |
| 1337 | + nauseation: d["nauseation"], | |
| 1338 | + nonbookish: d["nonbookish"], | |
| 1339 | + patarin: d["Patarin"], | |
| 1340 | + preliberal: d["preliberal"], | |
| 1341 | + prettifier: d["prettifier"], | |
| 1342 | + rangework: d["rangework"], | |
| 1343 | + redient: d["redient"], | |
| 1344 | + subfusiform: d["subfusiform"], | |
| 1345 | + suicidical: d["suicidical"], | |
| 1346 | + swow: d["swow"], | |
| 1347 | + wastrel: d["wastrel"], | |
| 1348 | + wingle: d["wingle"], | |
| 1349 | + ) | |
| 1350 | + end | |
| 1351 | + | |
| 1352 | + def self.from_json!(json) | |
| 1353 | + from_dynamic!(JSON.parse(json)) | |
| 1354 | + end | |
| 1355 | + | |
| 1356 | + def to_dynamic | |
| 1357 | + { | |
| 1358 | + "Altaic" => altaic, | |
| 1359 | + "amoristic" => amoristic, | |
| 1360 | + "blennophthalmia" => blennophthalmia, | |
| 1361 | + "catharticalness" => catharticalness, | |
| 1362 | + "Chirotherium" => chirotherium, | |
| 1363 | + "disciplinability" => disciplinability, | |
| 1364 | + "disdiapason" => disdiapason, | |
| 1365 | + "goofer" => goofer, | |
| 1366 | + "homocerc" => homocerc, | |
| 1367 | + "laryngograph" => laryngograph, | |
| 1368 | + "leucitis" => leucitis, | |
| 1369 | + "lymphocyst" => lymphocyst, | |
| 1370 | + "microcosmology" => microcosmology, | |
| 1371 | + "nauseation" => nauseation, | |
| 1372 | + "nonbookish" => nonbookish, | |
| 1373 | + "Patarin" => patarin, | |
| 1374 | + "preliberal" => preliberal, | |
| 1375 | + "prettifier" => prettifier, | |
| 1376 | + "rangework" => rangework, | |
| 1377 | + "redient" => redient, | |
| 1378 | + "subfusiform" => subfusiform, | |
| 1379 | + "suicidical" => suicidical, | |
| 1380 | + "swow" => swow, | |
| 1381 | + "wastrel" => wastrel, | |
| 1382 | + "wingle" => wingle, | |
| 1383 | + } | |
| 1384 | + end | |
| 1385 | + | |
| 1386 | + def to_json(options = nil) | |
| 1387 | + JSON.generate(to_dynamic, options) | |
| 1388 | + end | |
| 1389 | +end | |
| 1390 | + | |
| 1391 | +class DiscordiaElement < Dry::Struct | |
| 1392 | + attribute :discordia_class, DiscordiaClass.optional | |
| 1393 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1394 | + | |
| 1395 | + def self.from_dynamic!(d) | |
| 1396 | + begin | |
| 1397 | + value = DiscordiaClass.from_dynamic!(d) | |
| 1398 | + if schema[:discordia_class].right.valid? value | |
| 1399 | + return new(discordia_class: value, integer_array: nil) | |
| 1400 | + end | |
| 1401 | + rescue | |
| 1402 | + end | |
| 1403 | + if schema[:integer_array].right.valid? d | |
| 1404 | + return new(integer_array: d, discordia_class: nil) | |
| 1405 | + end | |
| 1406 | + raise "Invalid union" | |
| 1407 | + end | |
| 1408 | + | |
| 1409 | + def self.from_json!(json) | |
| 1410 | + from_dynamic!(JSON.parse(json)) | |
| 1411 | + end | |
| 1412 | + | |
| 1413 | + def to_dynamic | |
| 1414 | + if discordia_class != nil | |
| 1415 | + discordia_class.to_dynamic | |
| 1416 | + elsif integer_array != nil | |
| 1417 | + integer_array | |
| 1418 | + end | |
| 1419 | + end | |
| 1420 | + | |
| 1421 | + def to_json(options = nil) | |
| 1422 | + JSON.generate(to_dynamic, options) | |
| 1423 | + end | |
| 1424 | +end | |
| 1425 | + | |
| 1426 | +class Endomyce < Dry::Struct | |
| 1427 | + attribute :integer, Types::Integer.optional | |
| 1428 | + attribute :string, Types::String.optional | |
| 1429 | + | |
| 1430 | + def self.from_dynamic!(d) | |
| 1431 | + if schema[:integer].right.valid? d | |
| 1432 | + return new(integer: d, string: nil) | |
| 1433 | + end | |
| 1434 | + if schema[:string].right.valid? d | |
| 1435 | + return new(string: d, integer: nil) | |
| 1436 | + end | |
| 1437 | + raise "Invalid union" | |
| 1438 | + end | |
| 1439 | + | |
| 1440 | + def self.from_json!(json) | |
| 1441 | + from_dynamic!(JSON.parse(json)) | |
| 1442 | + end | |
| 1443 | + | |
| 1444 | + def to_dynamic | |
| 1445 | + if integer != nil | |
| 1446 | + integer | |
| 1447 | + elsif string != nil | |
| 1448 | + string | |
| 1449 | + end | |
| 1450 | + end | |
| 1451 | + | |
| 1452 | + def to_json(options = nil) | |
| 1453 | + JSON.generate(to_dynamic, options) | |
| 1454 | + end | |
| 1455 | +end | |
| 1456 | + | |
| 1457 | +class Epinephelidae < Dry::Struct | |
| 1458 | + attribute :bool, Types::Bool.optional | |
| 1459 | + attribute :integer, Types::Integer.optional | |
| 1460 | + attribute :string, Types::String.optional | |
| 1461 | + | |
| 1462 | + def self.from_dynamic!(d) | |
| 1463 | + if schema[:bool].right.valid? d | |
| 1464 | + return new(bool: d, integer: nil, string: nil) | |
| 1465 | + end | |
| 1466 | + if schema[:integer].right.valid? d | |
| 1467 | + return new(integer: d, bool: nil, string: nil) | |
| 1468 | + end | |
| 1469 | + if schema[:string].right.valid? d | |
| 1470 | + return new(string: d, bool: nil, integer: nil) | |
| 1471 | + end | |
| 1472 | + raise "Invalid union" | |
| 1473 | + end | |
| 1474 | + | |
| 1475 | + def self.from_json!(json) | |
| 1476 | + from_dynamic!(JSON.parse(json)) | |
| 1477 | + end | |
| 1478 | + | |
| 1479 | + def to_dynamic | |
| 1480 | + if bool != nil | |
| 1481 | + bool | |
| 1482 | + elsif integer != nil | |
| 1483 | + integer | |
| 1484 | + elsif string != nil | |
| 1485 | + string | |
| 1486 | + end | |
| 1487 | + end | |
| 1488 | + | |
| 1489 | + def to_json(options = nil) | |
| 1490 | + JSON.generate(to_dynamic, options) | |
| 1491 | + end | |
| 1492 | +end | |
| 1493 | + | |
| 1494 | +class Eupatorium < Dry::Struct | |
| 1495 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1496 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1497 | + | |
| 1498 | + def self.from_dynamic!(d) | |
| 1499 | + begin | |
| 1500 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1501 | + if schema[:integer_map].right.valid? value | |
| 1502 | + return new(integer_map: value, null_array: nil) | |
| 1503 | + end | |
| 1504 | + rescue | |
| 1505 | + end | |
| 1506 | + if schema[:null_array].right.valid? d | |
| 1507 | + return new(null_array: d, integer_map: nil) | |
| 1508 | + end | |
| 1509 | + raise "Invalid union" | |
| 1510 | + end | |
| 1511 | + | |
| 1512 | + def self.from_json!(json) | |
| 1513 | + from_dynamic!(JSON.parse(json)) | |
| 1514 | + end | |
| 1515 | + | |
| 1516 | + def to_dynamic | |
| 1517 | + if integer_map != nil | |
| 1518 | + integer_map | |
| 1519 | + elsif null_array != nil | |
| 1520 | + null_array | |
| 1521 | + end | |
| 1522 | + end | |
| 1523 | + | |
| 1524 | + def to_json(options = nil) | |
| 1525 | + JSON.generate(to_dynamic, options) | |
| 1526 | + end | |
| 1527 | +end | |
| 1528 | + | |
| 1529 | +class GryphosaurusClass < Dry::Struct | |
| 1530 | + attribute :amissibility, Types::Nil | |
| 1531 | + attribute :burushaski, Types::Nil | |
| 1532 | + attribute :citronin, Types::Nil | |
| 1533 | + attribute :coplaintiff, Types::Nil | |
| 1534 | + attribute :disquisitionary, Types::Nil | |
| 1535 | + attribute :enoplan, Types::Nil | |
| 1536 | + attribute :faintness, Types::Nil | |
| 1537 | + attribute :hebetomy, Types::Nil | |
| 1538 | + attribute :islandry, Types::Nil | |
| 1539 | + attribute :lameduck, Types::Nil | |
| 1540 | + attribute :overbattle, Types::Nil | |
| 1541 | + attribute :overinterested, Types::Nil | |
| 1542 | + attribute :phrenologic, Types::Nil | |
| 1543 | + attribute :rainband, Types::Nil | |
| 1544 | + attribute :shiningly, Types::Nil | |
| 1545 | + attribute :stamineous, Types::Nil | |
| 1546 | + attribute :subscapularis, Types::Nil | |
| 1547 | + attribute :tahami, Types::Nil | |
| 1548 | + attribute :undaubed, Types::Nil | |
| 1549 | + attribute :underntime, Types::Nil | |
| 1550 | + | |
| 1551 | + def self.from_dynamic!(d) | |
| 1552 | + d = Types::Hash[d] | |
| 1553 | + new( | |
| 1554 | + amissibility: d.fetch("amissibility"), | |
| 1555 | + burushaski: d.fetch("Burushaski"), | |
| 1556 | + citronin: d.fetch("citronin"), | |
| 1557 | + coplaintiff: d.fetch("coplaintiff"), | |
| 1558 | + disquisitionary: d.fetch("disquisitionary"), | |
| 1559 | + enoplan: d.fetch("enoplan"), | |
| 1560 | + faintness: d.fetch("faintness"), | |
| 1561 | + hebetomy: d.fetch("hebetomy"), | |
| 1562 | + islandry: d.fetch("islandry"), | |
| 1563 | + lameduck: d.fetch("lameduck"), | |
| 1564 | + overbattle: d.fetch("overbattle"), | |
| 1565 | + overinterested: d.fetch("overinterested"), | |
| 1566 | + phrenologic: d.fetch("phrenologic"), | |
| 1567 | + rainband: d.fetch("rainband"), | |
| 1568 | + shiningly: d.fetch("shiningly"), | |
| 1569 | + stamineous: d.fetch("stamineous"), | |
| 1570 | + subscapularis: d.fetch("subscapularis"), | |
| 1571 | + tahami: d.fetch("Tahami"), | |
| 1572 | + undaubed: d.fetch("undaubed"), | |
| 1573 | + underntime: d.fetch("underntime"), | |
| 1574 | + ) | |
| 1575 | + end | |
| 1576 | + | |
| 1577 | + def self.from_json!(json) | |
| 1578 | + from_dynamic!(JSON.parse(json)) | |
| 1579 | + end | |
| 1580 | + | |
| 1581 | + def to_dynamic | |
| 1582 | + { | |
| 1583 | + "amissibility" => amissibility, | |
| 1584 | + "Burushaski" => burushaski, | |
| 1585 | + "citronin" => citronin, | |
| 1586 | + "coplaintiff" => coplaintiff, | |
| 1587 | + "disquisitionary" => disquisitionary, | |
| 1588 | + "enoplan" => enoplan, | |
| 1589 | + "faintness" => faintness, | |
| 1590 | + "hebetomy" => hebetomy, | |
| 1591 | + "islandry" => islandry, | |
| 1592 | + "lameduck" => lameduck, | |
| 1593 | + "overbattle" => overbattle, | |
| 1594 | + "overinterested" => overinterested, | |
| 1595 | + "phrenologic" => phrenologic, | |
| 1596 | + "rainband" => rainband, | |
| 1597 | + "shiningly" => shiningly, | |
| 1598 | + "stamineous" => stamineous, | |
| 1599 | + "subscapularis" => subscapularis, | |
| 1600 | + "Tahami" => tahami, | |
| 1601 | + "undaubed" => undaubed, | |
| 1602 | + "underntime" => underntime, | |
| 1603 | + } | |
| 1604 | + end | |
| 1605 | + | |
| 1606 | + def to_json(options = nil) | |
| 1607 | + JSON.generate(to_dynamic, options) | |
| 1608 | + end | |
| 1609 | +end | |
| 1610 | + | |
| 1611 | +class GryphosaurusElement < Dry::Struct | |
| 1612 | + attribute :gryphosaurus_class, GryphosaurusClass.optional | |
| 1613 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1614 | + attribute :string, Types::String.optional | |
| 1615 | + | |
| 1616 | + def self.from_dynamic!(d) | |
| 1617 | + begin | |
| 1618 | + value = GryphosaurusClass.from_dynamic!(d) | |
| 1619 | + if schema[:gryphosaurus_class].right.valid? value | |
| 1620 | + return new(gryphosaurus_class: value, integer_array: nil, string: nil) | |
| 1621 | + end | |
| 1622 | + rescue | |
| 1623 | + end | |
| 1624 | + if schema[:integer_array].right.valid? d | |
| 1625 | + return new(integer_array: d, gryphosaurus_class: nil, string: nil) | |
| 1626 | + end | |
| 1627 | + if schema[:string].right.valid? d | |
| 1628 | + return new(string: d, integer_array: nil, gryphosaurus_class: nil) | |
| 1629 | + end | |
| 1630 | + raise "Invalid union" | |
| 1631 | + end | |
| 1632 | + | |
| 1633 | + def self.from_json!(json) | |
| 1634 | + from_dynamic!(JSON.parse(json)) | |
| 1635 | + end | |
| 1636 | + | |
| 1637 | + def to_dynamic | |
| 1638 | + if gryphosaurus_class != nil | |
| 1639 | + gryphosaurus_class.to_dynamic | |
| 1640 | + elsif integer_array != nil | |
| 1641 | + integer_array | |
| 1642 | + elsif string != nil | |
| 1643 | + string | |
| 1644 | + end | |
| 1645 | + end | |
| 1646 | + | |
| 1647 | + def to_json(options = nil) | |
| 1648 | + JSON.generate(to_dynamic, options) | |
| 1649 | + end | |
| 1650 | +end | |
| 1651 | + | |
| 1652 | +class Koryak < Dry::Struct | |
| 1653 | + attribute :string, Types::String.optional | |
| 1654 | + attribute :union_map, Types::Hash.meta(of: Types::Integer.optional).optional | |
| 1655 | + | |
| 1656 | + def self.from_dynamic!(d) | |
| 1657 | + if schema[:string].right.valid? d | |
| 1658 | + return new(string: d, union_map: nil) | |
| 1659 | + end | |
| 1660 | + begin | |
| 1661 | + value = Types::Hash[d].map { |k, v| [k, v] }.to_h | |
| 1662 | + if schema[:union_map].right.valid? value | |
| 1663 | + return new(union_map: value, string: nil) | |
| 1664 | + end | |
| 1665 | + rescue | |
| 1666 | + end | |
| 1667 | + raise "Invalid union" | |
| 1668 | + end | |
| 1669 | + | |
| 1670 | + def self.from_json!(json) | |
| 1671 | + from_dynamic!(JSON.parse(json)) | |
| 1672 | + end | |
| 1673 | + | |
| 1674 | + def to_dynamic | |
| 1675 | + if string != nil | |
| 1676 | + string | |
| 1677 | + elsif union_map != nil | |
| 1678 | + union_map | |
| 1679 | + end | |
| 1680 | + end | |
| 1681 | + | |
| 1682 | + def to_json(options = nil) | |
| 1683 | + JSON.generate(to_dynamic, options) | |
| 1684 | + end | |
| 1685 | +end | |
| 1686 | + | |
| 1687 | +class LaviniaClass < Dry::Struct | |
| 1688 | + attribute :agitable, Types::Integer.optional | |
| 1689 | + attribute :asininity, Types::Integer.optional | |
| 1690 | + attribute :benefiter, Types::Integer.optional | |
| 1691 | + attribute :bronzelike, Types::Integer.optional | |
| 1692 | + attribute :catharticalness, Types::Double.optional | |
| 1693 | + attribute :chirotherium, Types::Integer.optional | |
| 1694 | + attribute :cholesteatomatous, Types::Integer.optional | |
| 1695 | + attribute :deprivement, Types::Integer.optional | |
| 1696 | + attribute :disdiapason, Types::String.optional | |
| 1697 | + attribute :flippantness, Types::Integer.optional | |
| 1698 | + attribute :fogproof, Types::Integer.optional | |
| 1699 | + attribute :homocerc, Types::Bool.optional | |
| 1700 | + attribute :merrymeeting, Types::Integer.optional | |
| 1701 | + attribute :nonbookish, Types::Nil.optional | |
| 1702 | + attribute :overcareful, Types::Integer.optional | |
| 1703 | + attribute :panaris, Types::Integer.optional | |
| 1704 | + attribute :preacceptance, Types::Integer.optional | |
| 1705 | + attribute :quinoxaline, Types::Integer.optional | |
| 1706 | + attribute :sig, Types::Integer.optional | |
| 1707 | + attribute :superconfusion, Types::Integer.optional | |
| 1708 | + attribute :tacana, Types::Integer.optional | |
| 1709 | + attribute :tillotter, Types::Integer.optional | |
| 1710 | + attribute :tranquillize, Types::Integer.optional | |
| 1711 | + attribute :unquestionable, Types::Integer.optional | |
| 1712 | + attribute :uproute, Types::Integer.optional | |
| 1713 | + | |
| 1714 | + def self.from_dynamic!(d) | |
| 1715 | + d = Types::Hash[d] | |
| 1716 | + new( | |
| 1717 | + agitable: d["agitable"], | |
| 1718 | + asininity: d["asininity"], | |
| 1719 | + benefiter: d["benefiter"], | |
| 1720 | + bronzelike: d["bronzelike"], | |
| 1721 | + catharticalness: d["catharticalness"], | |
| 1722 | + chirotherium: d["Chirotherium"], | |
| 1723 | + cholesteatomatous: d["cholesteatomatous"], | |
| 1724 | + deprivement: d["deprivement"], | |
| 1725 | + disdiapason: d["disdiapason"], | |
| 1726 | + flippantness: d["flippantness"], | |
| 1727 | + fogproof: d["fogproof"], | |
| 1728 | + homocerc: d["homocerc"], | |
| 1729 | + merrymeeting: d["merrymeeting"], | |
| 1730 | + nonbookish: d["nonbookish"], | |
| 1731 | + overcareful: d["overcareful"], | |
| 1732 | + panaris: d["panaris"], | |
| 1733 | + preacceptance: d["preacceptance"], | |
| 1734 | + quinoxaline: d["quinoxaline"], | |
| 1735 | + sig: d["sig"], | |
| 1736 | + superconfusion: d["superconfusion"], | |
| 1737 | + tacana: d["Tacana"], | |
| 1738 | + tillotter: d["tillotter"], | |
| 1739 | + tranquillize: d["tranquillize"], | |
| 1740 | + unquestionable: d["unquestionable"], | |
| 1741 | + uproute: d["uproute"], | |
| 1742 | + ) | |
| 1743 | + end | |
| 1744 | + | |
| 1745 | + def self.from_json!(json) | |
| 1746 | + from_dynamic!(JSON.parse(json)) | |
| 1747 | + end | |
| 1748 | + | |
| 1749 | + def to_dynamic | |
| 1750 | + { | |
| 1751 | + "agitable" => agitable, | |
| 1752 | + "asininity" => asininity, | |
| 1753 | + "benefiter" => benefiter, | |
| 1754 | + "bronzelike" => bronzelike, | |
| 1755 | + "catharticalness" => catharticalness, | |
| 1756 | + "Chirotherium" => chirotherium, | |
| 1757 | + "cholesteatomatous" => cholesteatomatous, | |
| 1758 | + "deprivement" => deprivement, | |
| 1759 | + "disdiapason" => disdiapason, | |
| 1760 | + "flippantness" => flippantness, | |
| 1761 | + "fogproof" => fogproof, | |
| 1762 | + "homocerc" => homocerc, | |
| 1763 | + "merrymeeting" => merrymeeting, | |
| 1764 | + "nonbookish" => nonbookish, | |
| 1765 | + "overcareful" => overcareful, | |
| 1766 | + "panaris" => panaris, | |
| 1767 | + "preacceptance" => preacceptance, | |
| 1768 | + "quinoxaline" => quinoxaline, | |
| 1769 | + "sig" => sig, | |
| 1770 | + "superconfusion" => superconfusion, | |
| 1771 | + "Tacana" => tacana, | |
| 1772 | + "tillotter" => tillotter, | |
| 1773 | + "tranquillize" => tranquillize, | |
| 1774 | + "unquestionable" => unquestionable, | |
| 1775 | + "uproute" => uproute, | |
| 1776 | + } | |
| 1777 | + end | |
| 1778 | + | |
| 1779 | + def to_json(options = nil) | |
| 1780 | + JSON.generate(to_dynamic, options) | |
| 1781 | + end | |
| 1782 | +end | |
| 1783 | + | |
| 1784 | +class LaviniaElement < Dry::Struct | |
| 1785 | + attribute :lavinia_class, LaviniaClass.optional | |
| 1786 | + attribute :string, Types::String.optional | |
| 1787 | + | |
| 1788 | + def self.from_dynamic!(d) | |
| 1789 | + begin | |
| 1790 | + value = LaviniaClass.from_dynamic!(d) | |
| 1791 | + if schema[:lavinia_class].right.valid? value | |
| 1792 | + return new(lavinia_class: value, string: nil) | |
| 1793 | + end | |
| 1794 | + rescue | |
| 1795 | + end | |
| 1796 | + if schema[:string].right.valid? d | |
| 1797 | + return new(string: d, lavinia_class: nil) | |
| 1798 | + end | |
| 1799 | + raise "Invalid union" | |
| 1800 | + end | |
| 1801 | + | |
| 1802 | + def self.from_json!(json) | |
| 1803 | + from_dynamic!(JSON.parse(json)) | |
| 1804 | + end | |
| 1805 | + | |
| 1806 | + def to_dynamic | |
| 1807 | + if lavinia_class != nil | |
| 1808 | + lavinia_class.to_dynamic | |
| 1809 | + elsif string != nil | |
| 1810 | + string | |
| 1811 | + end | |
| 1812 | + end | |
| 1813 | + | |
| 1814 | + def to_json(options = nil) | |
| 1815 | + JSON.generate(to_dynamic, options) | |
| 1816 | + end | |
| 1817 | +end | |
| 1818 | + | |
| 1819 | +class OskarClass < Dry::Struct | |
| 1820 | + attribute :acrobates, Types::Nil | |
| 1821 | + attribute :beanshooter, Types::Nil | |
| 1822 | + attribute :bearhound, Types::Nil | |
| 1823 | + attribute :cayuga, Types::Nil | |
| 1824 | + attribute :guarneri, Types::Nil | |
| 1825 | + attribute :hypochondriacism, Types::Nil | |
| 1826 | + attribute :indication, Types::Nil | |
| 1827 | + attribute :jaculative, Types::Nil | |
| 1828 | + attribute :nagana, Types::Nil | |
| 1829 | + attribute :netherlandish, Types::Nil | |
| 1830 | + attribute :noctivagous, Types::Nil | |
| 1831 | + attribute :nonphysiological, Types::Nil | |
| 1832 | + attribute :praxis, Types::Nil | |
| 1833 | + attribute :provision, Types::Nil | |
| 1834 | + attribute :subterhuman, Types::Nil | |
| 1835 | + attribute :sunlit, Types::Nil | |
| 1836 | + attribute :syncraniate, Types::Nil | |
| 1837 | + attribute :teachment, Types::Nil | |
| 1838 | + attribute :unmutinous, Types::Nil | |
| 1839 | + attribute :unstoppable, Types::Nil | |
| 1840 | + | |
| 1841 | + def self.from_dynamic!(d) | |
| 1842 | + d = Types::Hash[d] | |
| 1843 | + new( | |
| 1844 | + acrobates: d.fetch("Acrobates"), | |
| 1845 | + beanshooter: d.fetch("beanshooter"), | |
| 1846 | + bearhound: d.fetch("bearhound"), | |
| 1847 | + cayuga: d.fetch("Cayuga"), | |
| 1848 | + guarneri: d.fetch("guarneri"), | |
| 1849 | + hypochondriacism: d.fetch("hypochondriacism"), | |
| 1850 | + indication: d.fetch("indication"), | |
| 1851 | + jaculative: d.fetch("jaculative"), | |
| 1852 | + nagana: d.fetch("nagana"), | |
| 1853 | + netherlandish: d.fetch("Netherlandish"), | |
| 1854 | + noctivagous: d.fetch("noctivagous"), | |
| 1855 | + nonphysiological: d.fetch("nonphysiological"), | |
| 1856 | + praxis: d.fetch("praxis"), | |
| 1857 | + provision: d.fetch("provision"), | |
| 1858 | + subterhuman: d.fetch("subterhuman"), | |
| 1859 | + sunlit: d.fetch("sunlit"), | |
| 1860 | + syncraniate: d.fetch("syncraniate"), | |
| 1861 | + teachment: d.fetch("teachment"), | |
| 1862 | + unmutinous: d.fetch("unmutinous"), | |
| 1863 | + unstoppable: d.fetch("unstoppable"), | |
| 1864 | + ) | |
| 1865 | + end | |
| 1866 | + | |
| 1867 | + def self.from_json!(json) | |
| 1868 | + from_dynamic!(JSON.parse(json)) | |
| 1869 | + end | |
| 1870 | + | |
| 1871 | + def to_dynamic | |
| 1872 | + { | |
| 1873 | + "Acrobates" => acrobates, | |
| 1874 | + "beanshooter" => beanshooter, | |
| 1875 | + "bearhound" => bearhound, | |
| 1876 | + "Cayuga" => cayuga, | |
| 1877 | + "guarneri" => guarneri, | |
| 1878 | + "hypochondriacism" => hypochondriacism, | |
| 1879 | + "indication" => indication, | |
| 1880 | + "jaculative" => jaculative, | |
| 1881 | + "nagana" => nagana, | |
| 1882 | + "Netherlandish" => netherlandish, | |
| 1883 | + "noctivagous" => noctivagous, | |
| 1884 | + "nonphysiological" => nonphysiological, | |
| 1885 | + "praxis" => praxis, | |
| 1886 | + "provision" => provision, | |
| 1887 | + "subterhuman" => subterhuman, | |
| 1888 | + "sunlit" => sunlit, | |
| 1889 | + "syncraniate" => syncraniate, | |
| 1890 | + "teachment" => teachment, | |
| 1891 | + "unmutinous" => unmutinous, | |
| 1892 | + "unstoppable" => unstoppable, | |
| 1893 | + } | |
| 1894 | + end | |
| 1895 | + | |
| 1896 | + def to_json(options = nil) | |
| 1897 | + JSON.generate(to_dynamic, options) | |
| 1898 | + end | |
| 1899 | +end | |
| 1900 | + | |
| 1901 | +class OskarElement < Dry::Struct | |
| 1902 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1903 | + attribute :oskar_class, OskarClass.optional | |
| 1904 | + | |
| 1905 | + def self.from_dynamic!(d) | |
| 1906 | + if schema[:integer_array].right.valid? d | |
| 1907 | + return new(integer_array: d, oskar_class: nil) | |
| 1908 | + end | |
| 1909 | + begin | |
| 1910 | + value = OskarClass.from_dynamic!(d) | |
| 1911 | + if schema[:oskar_class].right.valid? value | |
| 1912 | + return new(oskar_class: value, integer_array: nil) | |
| 1913 | + end | |
| 1914 | + rescue | |
| 1915 | + end | |
| 1916 | + raise "Invalid union" | |
| 1917 | + end | |
| 1918 | + | |
| 1919 | + def self.from_json!(json) | |
| 1920 | + from_dynamic!(JSON.parse(json)) | |
| 1921 | + end | |
| 1922 | + | |
| 1923 | + def to_dynamic | |
| 1924 | + if integer_array != nil | |
| 1925 | + integer_array | |
| 1926 | + elsif oskar_class != nil | |
| 1927 | + oskar_class.to_dynamic | |
| 1928 | + end | |
| 1929 | + end | |
| 1930 | + | |
| 1931 | + def to_json(options = nil) | |
| 1932 | + JSON.generate(to_dynamic, options) | |
| 1933 | + end | |
| 1934 | +end | |
| 1935 | + | |
| 1936 | +class RebeccaElement < Dry::Struct | |
| 1937 | + attribute :integer, Types::Integer.optional | |
| 1938 | + attribute :rebecca, Rebecca.optional | |
| 1939 | + attribute :string, Types::String.optional | |
| 1940 | + | |
| 1941 | + def self.from_dynamic!(d) | |
| 1942 | + if schema[:integer].right.valid? d | |
| 1943 | + return new(integer: d, rebecca: nil, string: nil) | |
| 1944 | + end | |
| 1945 | + begin | |
| 1946 | + value = Rebecca.from_dynamic!(d) | |
| 1947 | + if schema[:rebecca].right.valid? value | |
| 1948 | + return new(rebecca: value, integer: nil, string: nil) | |
| 1949 | + end | |
| 1950 | + rescue | |
| 1951 | + end | |
| 1952 | + if schema[:string].right.valid? d | |
| 1953 | + return new(string: d, rebecca: nil, integer: nil) | |
| 1954 | + end | |
| 1955 | + raise "Invalid union" | |
| 1956 | + end | |
| 1957 | + | |
| 1958 | + def self.from_json!(json) | |
| 1959 | + from_dynamic!(JSON.parse(json)) | |
| 1960 | + end | |
| 1961 | + | |
| 1962 | + def to_dynamic | |
| 1963 | + if integer != nil | |
| 1964 | + integer | |
| 1965 | + elsif rebecca != nil | |
| 1966 | + rebecca.to_dynamic | |
| 1967 | + elsif string != nil | |
| 1968 | + string | |
| 1969 | + end | |
| 1970 | + end | |
| 1971 | + | |
| 1972 | + def to_json(options = nil) | |
| 1973 | + JSON.generate(to_dynamic, options) | |
| 1974 | + end | |
| 1975 | +end | |
| 1976 | + | |
| 1977 | +class Rhomboganoidei < Dry::Struct | |
| 1978 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1979 | + attribute :rebecca, Rebecca.optional | |
| 1980 | + attribute :string, Types::String.optional | |
| 1981 | + | |
| 1982 | + def self.from_dynamic!(d) | |
| 1983 | + if schema[:integer_array].right.valid? d | |
| 1984 | + return new(integer_array: d, rebecca: nil, string: nil) | |
| 1985 | + end | |
| 1986 | + begin | |
| 1987 | + value = Rebecca.from_dynamic!(d) | |
| 1988 | + if schema[:rebecca].right.valid? value | |
| 1989 | + return new(rebecca: value, integer_array: nil, string: nil) | |
| 1990 | + end | |
| 1991 | + rescue | |
| 1992 | + end | |
| 1993 | + if schema[:string].right.valid? d | |
| 1994 | + return new(string: d, integer_array: nil, rebecca: nil) | |
| 1995 | + end | |
| 1996 | + raise "Invalid union" | |
| 1997 | + end | |
| 1998 | + | |
| 1999 | + def self.from_json!(json) | |
| 2000 | + from_dynamic!(JSON.parse(json)) | |
| 2001 | + end | |
| 2002 | + | |
| 2003 | + def to_dynamic | |
| 2004 | + if integer_array != nil | |
| 2005 | + integer_array | |
| 2006 | + elsif rebecca != nil | |
| 2007 | + rebecca.to_dynamic | |
| 2008 | + elsif string != nil | |
| 2009 | + string | |
| 2010 | + end | |
| 2011 | + end | |
| 2012 | + | |
| 2013 | + def to_json(options = nil) | |
| 2014 | + JSON.generate(to_dynamic, options) | |
| 2015 | + end | |
| 2016 | +end | |
| 2017 | + | |
| 2018 | +class Ruellia < Dry::Struct | |
| 2019 | + attribute :bool, Types::Bool.optional | |
| 2020 | + attribute :rebecca, Rebecca.optional | |
| 2021 | + attribute :string, Types::String.optional | |
| 2022 | + | |
| 2023 | + def self.from_dynamic!(d) | |
| 2024 | + if schema[:bool].right.valid? d | |
| 2025 | + return new(bool: d, rebecca: nil, string: nil) | |
| 2026 | + end | |
| 2027 | + begin | |
| 2028 | + value = Rebecca.from_dynamic!(d) | |
| 2029 | + if schema[:rebecca].right.valid? value | |
| 2030 | + return new(rebecca: value, bool: nil, string: nil) | |
| 2031 | + end | |
| 2032 | + rescue | |
| 2033 | + end | |
| 2034 | + if schema[:string].right.valid? d | |
| 2035 | + return new(string: d, bool: nil, rebecca: nil) | |
| 2036 | + end | |
| 2037 | + raise "Invalid union" | |
| 2038 | + end | |
| 2039 | + | |
| 2040 | + def self.from_json!(json) | |
| 2041 | + from_dynamic!(JSON.parse(json)) | |
| 2042 | + end | |
| 2043 | + | |
| 2044 | + def to_dynamic | |
| 2045 | + if bool != nil | |
| 2046 | + bool | |
| 2047 | + elsif rebecca != nil | |
| 2048 | + rebecca.to_dynamic | |
| 2049 | + elsif string != nil | |
| 2050 | + string | |
| 2051 | + end | |
| 2052 | + end | |
| 2053 | + | |
| 2054 | + def to_json(options = nil) | |
| 2055 | + JSON.generate(to_dynamic, options) | |
| 2056 | + end | |
| 2057 | +end | |
| 2058 | + | |
| 2059 | +class School < Dry::Struct | |
| 2060 | + attribute :integer, Types::Integer.optional | |
| 2061 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2062 | + attribute :null, Types::Nil.optional | |
| 2063 | + | |
| 2064 | + def self.from_dynamic!(d) | |
| 2065 | + if schema[:integer].right.valid? d | |
| 2066 | + return new(integer: d, integer_map: nil, null: nil) | |
| 2067 | + end | |
| 2068 | + begin | |
| 2069 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2070 | + if schema[:integer_map].right.valid? value | |
| 2071 | + return new(integer_map: value, integer: nil, null: nil) | |
| 2072 | + end | |
| 2073 | + rescue | |
| 2074 | + end | |
| 2075 | + if schema[:null].right.valid? d | |
| 2076 | + return new(null: d, integer: nil, integer_map: nil) | |
| 2077 | + end | |
| 2078 | + raise "Invalid union" | |
| 2079 | + end | |
| 2080 | + | |
| 2081 | + def self.from_json!(json) | |
| 2082 | + from_dynamic!(JSON.parse(json)) | |
| 2083 | + end | |
| 2084 | + | |
| 2085 | + def to_dynamic | |
| 2086 | + if integer != nil | |
| 2087 | + integer | |
| 2088 | + elsif integer_map != nil | |
| 2089 | + integer_map | |
| 2090 | + else | |
| 2091 | + nil | |
| 2092 | + end | |
| 2093 | + end | |
| 2094 | + | |
| 2095 | + def to_json(options = nil) | |
| 2096 | + JSON.generate(to_dynamic, options) | |
| 2097 | + end | |
| 2098 | +end | |
| 2099 | + | |
| 2100 | +class Shakespearolater < Dry::Struct | |
| 2101 | + attribute :double, Types::Double.optional | |
| 2102 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 2103 | + attribute :string, Types::String.optional | |
| 2104 | + | |
| 2105 | + def self.from_dynamic!(d) | |
| 2106 | + if schema[:double].right.valid? d | |
| 2107 | + return new(double: d, integer_array: nil, string: nil) | |
| 2108 | + end | |
| 2109 | + if schema[:integer_array].right.valid? d | |
| 2110 | + return new(integer_array: d, double: nil, string: nil) | |
| 2111 | + end | |
| 2112 | + if schema[:string].right.valid? d | |
| 2113 | + return new(string: d, integer_array: nil, double: nil) | |
| 2114 | + end | |
| 2115 | + raise "Invalid union" | |
| 2116 | + end | |
| 2117 | + | |
| 2118 | + def self.from_json!(json) | |
| 2119 | + from_dynamic!(JSON.parse(json)) | |
| 2120 | + end | |
| 2121 | + | |
| 2122 | + def to_dynamic | |
| 2123 | + if double != nil | |
| 2124 | + double | |
| 2125 | + elsif integer_array != nil | |
| 2126 | + integer_array | |
| 2127 | + elsif string != nil | |
| 2128 | + string | |
| 2129 | + end | |
| 2130 | + end | |
| 2131 | + | |
| 2132 | + def to_json(options = nil) | |
| 2133 | + JSON.generate(to_dynamic, options) | |
| 2134 | + end | |
| 2135 | +end | |
| 2136 | + | |
| 2137 | +class TopLevel < Dry::Struct | |
| 2138 | + attribute :abranchiata, Types.Array(Types.Instance(Abranchiata)) | |
| 2139 | + attribute :academe, Types.Array(Types.Instance(Academe)) | |
| 2140 | + attribute :acquirable, Types.Array(Types.Instance(Acquirable)) | |
| 2141 | + attribute :aerometry, Types.Array(Types.Instance(Aerometry)) | |
| 2142 | + attribute :alexin, Types.Array(Types.Instance(Alexin)) | |
| 2143 | + attribute :alleviate, Types.Array(Types.Instance(AlleviateElement)) | |
| 2144 | + attribute :amaas, Types.Array(Types.Instance(Amaa)) | |
| 2145 | + attribute :ambassage, Types.Array(Types.Instance(Ambassage)) | |
| 2146 | + attribute :amphithyron, Types.Array(Amphithyron.optional) | |
| 2147 | + attribute :andriana, Types.Array(Types::String.optional) | |
| 2148 | + attribute :ankee, Types.Array(Types.Instance(AnkeeElement)) | |
| 2149 | + attribute :annihilator, Types.Array(Types::Hash.meta(of: Types::Integer.optional).optional) | |
| 2150 | + attribute :annulose, Types::Nil | |
| 2151 | + attribute :ansarie, Types.Array(Types.Instance(AnsarieElement)) | |
| 2152 | + attribute :aphasia, Types.Array(Types.Instance(Aphasia)) | |
| 2153 | + attribute :asprawl, Types.Array(Types.Instance(Asprawl)) | |
| 2154 | + attribute :attractive, Types.Array(Types::Bool.optional) | |
| 2155 | + attribute :barksome, Types::Hash.meta(of: Types::Integer) | |
| 2156 | + attribute :bedesman, Types.Array(Types.Instance(Bedesman)) | |
| 2157 | + attribute :belard, Types.Array(Types.Instance(Belard)) | |
| 2158 | + attribute :bocking, Types.Array(Types.Instance(Bocking)) | |
| 2159 | + attribute :brawlingly, Types.Array(Types.Instance(Brawlingly)) | |
| 2160 | + attribute :brookie, Types.Array(Types.Instance(Brookie)) | |
| 2161 | + attribute :bumboatman, Types.Array(Types.Instance(Bumboatman)) | |
| 2162 | + attribute :bystreet, Types.Array(Types::Nil) | |
| 2163 | + attribute :calaverite, Types.Array(Types.Instance(Calaverite)) | |
| 2164 | + attribute :catallactic, Types.Array(Types.Instance(Catallactic)) | |
| 2165 | + attribute :cemental, Types.Array(Types.Instance(Cemental)) | |
| 2166 | + attribute :chytridiaceae, Types.Array(Types.Instance(ChytridiaceaeElement)) | |
| 2167 | + attribute :discordia, Types.Array(Types.Instance(DiscordiaElement)) | |
| 2168 | + attribute :endomyces, Types.Array(Types.Instance(Endomyce)) | |
| 2169 | + attribute :epinephelidae, Types.Array(Types.Instance(Epinephelidae)) | |
| 2170 | + attribute :eupatorium, Types.Array(Types.Instance(Eupatorium)) | |
| 2171 | + attribute :gryphosaurus, Types.Array(Types.Instance(GryphosaurusElement)) | |
| 2172 | + attribute :koryak, Types.Array(Types.Instance(Koryak)) | |
| 2173 | + attribute :lavinia, Types.Array(Types.Instance(LaviniaElement)) | |
| 2174 | + attribute :oskar, Types.Array(Types.Instance(OskarElement)) | |
| 2175 | + attribute :rebecca, Types.Array(Types.Instance(RebeccaElement)) | |
| 2176 | + attribute :rhomboganoidei, Types.Array(Types.Instance(Rhomboganoidei)) | |
| 2177 | + attribute :rigsmal, Types::Bool | |
| 2178 | + attribute :ruellia, Types.Array(Types.Instance(Ruellia)) | |
| 2179 | + attribute :school, Types.Array(Types.Instance(School)) | |
| 2180 | + attribute :shakespearolater, Types.Array(Types.Instance(Shakespearolater)) | |
| 2181 | + attribute :svan, Types.Array(Types::Double) | |
| 2182 | + attribute :wayao, Types::Hash.meta(of: Types::Double) | |
| 2183 | + | |
| 2184 | + def self.from_dynamic!(d) | |
| 2185 | + d = Types::Hash[d] | |
| 2186 | + new( | |
| 2187 | + abranchiata: d.fetch("Abranchiata").map { |x| Abranchiata.from_dynamic!(x) }, | |
| 2188 | + academe: d.fetch("academe").map { |x| Academe.from_dynamic!(x) }, | |
| 2189 | + acquirable: d.fetch("acquirable").map { |x| Acquirable.from_dynamic!(x) }, | |
| 2190 | + aerometry: d.fetch("aerometry").map { |x| Aerometry.from_dynamic!(x) }, | |
| 2191 | + alexin: d.fetch("alexin").map { |x| Alexin.from_dynamic!(x) }, | |
| 2192 | + alleviate: d.fetch("alleviate").map { |x| AlleviateElement.from_dynamic!(x) }, | |
| 2193 | + amaas: d.fetch("amaas").map { |x| Amaa.from_dynamic!(x) }, | |
| 2194 | + ambassage: d.fetch("ambassage").map { |x| Ambassage.from_dynamic!(x) }, | |
| 2195 | + amphithyron: d.fetch("amphithyron").map { |x| x ? Amphithyron.from_dynamic!(x) : nil }, | |
| 2196 | + andriana: d.fetch("Andriana"), | |
| 2197 | + ankee: d.fetch("ankee").map { |x| AnkeeElement.from_dynamic!(x) }, | |
| 2198 | + annihilator: d.fetch("annihilator").map { |x| Types::Hash.optional[x]&.map { |k, v| [k, v] }&.to_h }, | |
| 2199 | + annulose: d.fetch("annulose"), | |
| 2200 | + ansarie: d.fetch("Ansarie").map { |x| AnsarieElement.from_dynamic!(x) }, | |
| 2201 | + aphasia: d.fetch("aphasia").map { |x| Aphasia.from_dynamic!(x) }, | |
| 2202 | + asprawl: d.fetch("asprawl").map { |x| Asprawl.from_dynamic!(x) }, | |
| 2203 | + attractive: d.fetch("attractive"), | |
| 2204 | + barksome: Types::Hash[d.fetch("barksome")].map { |k, v| [k, Types::Integer[v]] }.to_h, | |
| 2205 | + bedesman: d.fetch("bedesman").map { |x| Bedesman.from_dynamic!(x) }, | |
| 2206 | + belard: d.fetch("belard").map { |x| Belard.from_dynamic!(x) }, | |
| 2207 | + bocking: d.fetch("bocking").map { |x| Bocking.from_dynamic!(x) }, | |
| 2208 | + brawlingly: d.fetch("brawlingly").map { |x| Brawlingly.from_dynamic!(x) }, | |
| 2209 | + brookie: d.fetch("brookie").map { |x| Brookie.from_dynamic!(x) }, | |
| 2210 | + bumboatman: d.fetch("bumboatman").map { |x| Bumboatman.from_dynamic!(x) }, | |
| 2211 | + bystreet: d.fetch("bystreet"), | |
| 2212 | + calaverite: d.fetch("calaverite").map { |x| Calaverite.from_dynamic!(x) }, | |
| 2213 | + catallactic: d.fetch("catallactic").map { |x| Catallactic.from_dynamic!(x) }, | |
| 2214 | + cemental: d.fetch("cemental").map { |x| Cemental.from_dynamic!(x) }, | |
| 2215 | + chytridiaceae: d.fetch("Chytridiaceae").map { |x| ChytridiaceaeElement.from_dynamic!(x) }, | |
| 2216 | + discordia: d.fetch("Discordia").map { |x| DiscordiaElement.from_dynamic!(x) }, | |
| 2217 | + endomyces: d.fetch("Endomyces").map { |x| Endomyce.from_dynamic!(x) }, | |
| 2218 | + epinephelidae: d.fetch("Epinephelidae").map { |x| Epinephelidae.from_dynamic!(x) }, | |
| 2219 | + eupatorium: d.fetch("Eupatorium").map { |x| Eupatorium.from_dynamic!(x) }, | |
| 2220 | + gryphosaurus: d.fetch("Gryphosaurus").map { |x| GryphosaurusElement.from_dynamic!(x) }, | |
| 2221 | + koryak: d.fetch("Koryak").map { |x| Koryak.from_dynamic!(x) }, | |
| 2222 | + lavinia: d.fetch("Lavinia").map { |x| LaviniaElement.from_dynamic!(x) }, | |
| 2223 | + oskar: d.fetch("Oskar").map { |x| OskarElement.from_dynamic!(x) }, | |
| 2224 | + rebecca: d.fetch("Rebecca").map { |x| RebeccaElement.from_dynamic!(x) }, | |
| 2225 | + rhomboganoidei: d.fetch("Rhomboganoidei").map { |x| Rhomboganoidei.from_dynamic!(x) }, | |
| 2226 | + rigsmal: d.fetch("Rigsmal"), | |
| 2227 | + ruellia: d.fetch("Ruellia").map { |x| Ruellia.from_dynamic!(x) }, | |
| 2228 | + school: d.fetch("School").map { |x| School.from_dynamic!(x) }, | |
| 2229 | + shakespearolater: d.fetch("Shakespearolater").map { |x| Shakespearolater.from_dynamic!(x) }, | |
| 2230 | + svan: d.fetch("Svan"), | |
| 2231 | + wayao: Types::Hash[d.fetch("Wayao")].map { |k, v| [k, Types::Double[v]] }.to_h, | |
| 2232 | + ) | |
| 2233 | + end | |
| 2234 | + | |
| 2235 | + def self.from_json!(json) | |
| 2236 | + from_dynamic!(JSON.parse(json)) | |
| 2237 | + end | |
| 2238 | + | |
| 2239 | + def to_dynamic | |
| 2240 | + { | |
| 2241 | + "Abranchiata" => abranchiata.map { |x| x.to_dynamic }, | |
| 2242 | + "academe" => academe.map { |x| x.to_dynamic }, | |
| 2243 | + "acquirable" => acquirable.map { |x| x.to_dynamic }, | |
| 2244 | + "aerometry" => aerometry.map { |x| x.to_dynamic }, | |
| 2245 | + "alexin" => alexin.map { |x| x.to_dynamic }, | |
| 2246 | + "alleviate" => alleviate.map { |x| x.to_dynamic }, | |
| 2247 | + "amaas" => amaas.map { |x| x.to_dynamic }, | |
| 2248 | + "ambassage" => ambassage.map { |x| x.to_dynamic }, | |
| 2249 | + "amphithyron" => amphithyron.map { |x| x&.to_dynamic }, | |
| 2250 | + "Andriana" => andriana, | |
| 2251 | + "ankee" => ankee.map { |x| x.to_dynamic }, | |
| 2252 | + "annihilator" => annihilator, | |
| 2253 | + "annulose" => annulose, | |
| 2254 | + "Ansarie" => ansarie.map { |x| x.to_dynamic }, | |
| 2255 | + "aphasia" => aphasia.map { |x| x.to_dynamic }, | |
| 2256 | + "asprawl" => asprawl.map { |x| x.to_dynamic }, | |
| 2257 | + "attractive" => attractive, | |
| 2258 | + "barksome" => barksome, | |
| 2259 | + "bedesman" => bedesman.map { |x| x.to_dynamic }, | |
| 2260 | + "belard" => belard.map { |x| x.to_dynamic }, | |
| 2261 | + "bocking" => bocking.map { |x| x.to_dynamic }, | |
| 2262 | + "brawlingly" => brawlingly.map { |x| x.to_dynamic }, | |
| 2263 | + "brookie" => brookie.map { |x| x.to_dynamic }, | |
| 2264 | + "bumboatman" => bumboatman.map { |x| x.to_dynamic }, | |
| 2265 | + "bystreet" => bystreet, | |
| 2266 | + "calaverite" => calaverite.map { |x| x.to_dynamic }, | |
| 2267 | + "catallactic" => catallactic.map { |x| x.to_dynamic }, | |
| 2268 | + "cemental" => cemental.map { |x| x.to_dynamic }, | |
| 2269 | + "Chytridiaceae" => chytridiaceae.map { |x| x.to_dynamic }, | |
| 2270 | + "Discordia" => discordia.map { |x| x.to_dynamic }, | |
| 2271 | + "Endomyces" => endomyces.map { |x| x.to_dynamic }, | |
| 2272 | + "Epinephelidae" => epinephelidae.map { |x| x.to_dynamic }, | |
| 2273 | + "Eupatorium" => eupatorium.map { |x| x.to_dynamic }, | |
| 2274 | + "Gryphosaurus" => gryphosaurus.map { |x| x.to_dynamic }, | |
| 2275 | + "Koryak" => koryak.map { |x| x.to_dynamic }, | |
| 2276 | + "Lavinia" => lavinia.map { |x| x.to_dynamic }, | |
| 2277 | + "Oskar" => oskar.map { |x| x.to_dynamic }, | |
| 2278 | + "Rebecca" => rebecca.map { |x| x.to_dynamic }, | |
| 2279 | + "Rhomboganoidei" => rhomboganoidei.map { |x| x.to_dynamic }, | |
| 2280 | + "Rigsmal" => rigsmal, | |
| 2281 | + "Ruellia" => ruellia.map { |x| x.to_dynamic }, | |
| 2282 | + "School" => school.map { |x| x.to_dynamic }, | |
| 2283 | + "Shakespearolater" => shakespearolater.map { |x| x.to_dynamic }, | |
| 2284 | + "Svan" => svan, | |
| 2285 | + "Wayao" => wayao, | |
| 2286 | + } | |
| 2287 | + end | |
| 2288 | + | |
| 2289 | + def to_json(options = nil) | |
| 2290 | + JSON.generate(to_dynamic, options) | |
| 2291 | + end | |
| 2292 | +end |
Test case
1 generated file · +2,662 −0test/inputs/json/priority/combinations3.json
Arubydefault / TopLevel.rb+2,662 −0
| @@ -0,0 +1,2662 @@ | ||
| 1 | +# This code may look unusually verbose for Ruby (and it is), but | |
| 2 | +# it performs some subtle and complex validation of JSON data. | |
| 3 | +# | |
| 4 | +# To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do: | |
| 5 | +# | |
| 6 | +# top_level = TopLevel.from_json! "{…}" | |
| 7 | +# puts top_level.protext.first | |
| 8 | +# | |
| 9 | +# If from_json! succeeds, the value returned matches the schema. | |
| 10 | + | |
| 11 | +require 'json' | |
| 12 | +require 'dry-types' | |
| 13 | +require 'dry-struct' | |
| 14 | + | |
| 15 | +module Types | |
| 16 | + include Dry.Types(default: :nominal) | |
| 17 | + | |
| 18 | + Integer = Strict::Integer | |
| 19 | + Nil = Strict::Nil | |
| 20 | + Bool = Strict::Bool | |
| 21 | + Hash = Strict::Hash | |
| 22 | + String = Strict::String | |
| 23 | + Double = Strict::Float | Strict::Integer | |
| 24 | +end | |
| 25 | + | |
| 26 | +class JurorClass < Dry::Struct | |
| 27 | + attribute :adipsy, Types::Nil | |
| 28 | + attribute :auxiliator, Types::Nil | |
| 29 | + attribute :benda, Types::Nil | |
| 30 | + attribute :benjamin, Types::Nil | |
| 31 | + attribute :brandling, Types::Nil | |
| 32 | + attribute :epicurishly, Types::Nil | |
| 33 | + attribute :eremochaetous, Types::Nil | |
| 34 | + attribute :marten, Types::Nil | |
| 35 | + attribute :monocline, Types::Nil | |
| 36 | + attribute :olea, Types::Nil | |
| 37 | + attribute :palgat, Types::Nil | |
| 38 | + attribute :pennyworth, Types::Nil | |
| 39 | + attribute :pioury, Types::Nil | |
| 40 | + attribute :pragmatistic, Types::Nil | |
| 41 | + attribute :stylelessness, Types::Nil | |
| 42 | + attribute :systematical, Types::Nil | |
| 43 | + attribute :thready, Types::Nil | |
| 44 | + attribute :uncontemporary, Types::Nil | |
| 45 | + attribute :uncouched, Types::Nil | |
| 46 | + attribute :uninhabitedness, Types::Nil | |
| 47 | + | |
| 48 | + def self.from_dynamic!(d) | |
| 49 | + d = Types::Hash[d] | |
| 50 | + new( | |
| 51 | + adipsy: d.fetch("adipsy"), | |
| 52 | + auxiliator: d.fetch("auxiliator"), | |
| 53 | + benda: d.fetch("benda"), | |
| 54 | + benjamin: d.fetch("benjamin"), | |
| 55 | + brandling: d.fetch("brandling"), | |
| 56 | + epicurishly: d.fetch("epicurishly"), | |
| 57 | + eremochaetous: d.fetch("eremochaetous"), | |
| 58 | + marten: d.fetch("marten"), | |
| 59 | + monocline: d.fetch("monocline"), | |
| 60 | + olea: d.fetch("Olea"), | |
| 61 | + palgat: d.fetch("palgat"), | |
| 62 | + pennyworth: d.fetch("pennyworth"), | |
| 63 | + pioury: d.fetch("pioury"), | |
| 64 | + pragmatistic: d.fetch("pragmatistic"), | |
| 65 | + stylelessness: d.fetch("stylelessness"), | |
| 66 | + systematical: d.fetch("systematical"), | |
| 67 | + thready: d.fetch("thready"), | |
| 68 | + uncontemporary: d.fetch("uncontemporary"), | |
| 69 | + uncouched: d.fetch("uncouched"), | |
| 70 | + uninhabitedness: d.fetch("uninhabitedness"), | |
| 71 | + ) | |
| 72 | + end | |
| 73 | + | |
| 74 | + def self.from_json!(json) | |
| 75 | + from_dynamic!(JSON.parse(json)) | |
| 76 | + end | |
| 77 | + | |
| 78 | + def to_dynamic | |
| 79 | + { | |
| 80 | + "adipsy" => adipsy, | |
| 81 | + "auxiliator" => auxiliator, | |
| 82 | + "benda" => benda, | |
| 83 | + "benjamin" => benjamin, | |
| 84 | + "brandling" => brandling, | |
| 85 | + "epicurishly" => epicurishly, | |
| 86 | + "eremochaetous" => eremochaetous, | |
| 87 | + "marten" => marten, | |
| 88 | + "monocline" => monocline, | |
| 89 | + "Olea" => olea, | |
| 90 | + "palgat" => palgat, | |
| 91 | + "pennyworth" => pennyworth, | |
| 92 | + "pioury" => pioury, | |
| 93 | + "pragmatistic" => pragmatistic, | |
| 94 | + "stylelessness" => stylelessness, | |
| 95 | + "systematical" => systematical, | |
| 96 | + "thready" => thready, | |
| 97 | + "uncontemporary" => uncontemporary, | |
| 98 | + "uncouched" => uncouched, | |
| 99 | + "uninhabitedness" => uninhabitedness, | |
| 100 | + } | |
| 101 | + end | |
| 102 | + | |
| 103 | + def to_json(options = nil) | |
| 104 | + JSON.generate(to_dynamic, options) | |
| 105 | + end | |
| 106 | +end | |
| 107 | + | |
| 108 | +class JurorElement < Dry::Struct | |
| 109 | + attribute :bool, Types::Bool.optional | |
| 110 | + attribute :juror_class, JurorClass.optional | |
| 111 | + | |
| 112 | + def self.from_dynamic!(d) | |
| 113 | + if schema[:bool].right.valid? d | |
| 114 | + return new(bool: d, juror_class: nil) | |
| 115 | + end | |
| 116 | + begin | |
| 117 | + value = JurorClass.from_dynamic!(d) | |
| 118 | + if schema[:juror_class].right.valid? value | |
| 119 | + return new(juror_class: value, bool: nil) | |
| 120 | + end | |
| 121 | + rescue | |
| 122 | + end | |
| 123 | + raise "Invalid union" | |
| 124 | + end | |
| 125 | + | |
| 126 | + def self.from_json!(json) | |
| 127 | + from_dynamic!(JSON.parse(json)) | |
| 128 | + end | |
| 129 | + | |
| 130 | + def to_dynamic | |
| 131 | + if bool != nil | |
| 132 | + bool | |
| 133 | + elsif juror_class != nil | |
| 134 | + juror_class.to_dynamic | |
| 135 | + end | |
| 136 | + end | |
| 137 | + | |
| 138 | + def to_json(options = nil) | |
| 139 | + JSON.generate(to_dynamic, options) | |
| 140 | + end | |
| 141 | +end | |
| 142 | + | |
| 143 | +class Kongoni < Dry::Struct | |
| 144 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 145 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 146 | + | |
| 147 | + def self.from_dynamic!(d) | |
| 148 | + if schema[:integer_array].right.valid? d | |
| 149 | + return new(integer_array: d, integer_map: nil) | |
| 150 | + end | |
| 151 | + begin | |
| 152 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 153 | + if schema[:integer_map].right.valid? value | |
| 154 | + return new(integer_map: value, integer_array: nil) | |
| 155 | + end | |
| 156 | + rescue | |
| 157 | + end | |
| 158 | + raise "Invalid union" | |
| 159 | + end | |
| 160 | + | |
| 161 | + def self.from_json!(json) | |
| 162 | + from_dynamic!(JSON.parse(json)) | |
| 163 | + end | |
| 164 | + | |
| 165 | + def to_dynamic | |
| 166 | + if integer_array != nil | |
| 167 | + integer_array | |
| 168 | + elsif integer_map != nil | |
| 169 | + integer_map | |
| 170 | + end | |
| 171 | + end | |
| 172 | + | |
| 173 | + def to_json(options = nil) | |
| 174 | + JSON.generate(to_dynamic, options) | |
| 175 | + end | |
| 176 | +end | |
| 177 | + | |
| 178 | +class LadronismClass < Dry::Struct | |
| 179 | + attribute :acclaimer, Types::Nil | |
| 180 | + attribute :achree, Types::Nil | |
| 181 | + attribute :base, Types::Nil | |
| 182 | + attribute :conundrumize, Types::Nil | |
| 183 | + attribute :degerminator, Types::Nil | |
| 184 | + attribute :describable, Types::Nil | |
| 185 | + attribute :exasperatedly, Types::Nil | |
| 186 | + attribute :heroine, Types::Nil | |
| 187 | + attribute :indazin, Types::Nil | |
| 188 | + attribute :luteous, Types::Nil | |
| 189 | + attribute :papular, Types::Nil | |
| 190 | + attribute :pritch, Types::Nil | |
| 191 | + attribute :prodenia, Types::Nil | |
| 192 | + attribute :seege, Types::Nil | |
| 193 | + attribute :shopgirl, Types::Nil | |
| 194 | + attribute :tragedietta, Types::Nil | |
| 195 | + attribute :unsparse, Types::Nil | |
| 196 | + attribute :uplook, Types::Nil | |
| 197 | + attribute :vermiformis, Types::Nil | |
| 198 | + attribute :whafabout, Types::Nil | |
| 199 | + | |
| 200 | + def self.from_dynamic!(d) | |
| 201 | + d = Types::Hash[d] | |
| 202 | + new( | |
| 203 | + acclaimer: d.fetch("acclaimer"), | |
| 204 | + achree: d.fetch("achree"), | |
| 205 | + base: d.fetch("base"), | |
| 206 | + conundrumize: d.fetch("conundrumize"), | |
| 207 | + degerminator: d.fetch("degerminator"), | |
| 208 | + describable: d.fetch("describable"), | |
| 209 | + exasperatedly: d.fetch("exasperatedly"), | |
| 210 | + heroine: d.fetch("heroine"), | |
| 211 | + indazin: d.fetch("indazin"), | |
| 212 | + luteous: d.fetch("luteous"), | |
| 213 | + papular: d.fetch("papular"), | |
| 214 | + pritch: d.fetch("pritch"), | |
| 215 | + prodenia: d.fetch("Prodenia"), | |
| 216 | + seege: d.fetch("seege"), | |
| 217 | + shopgirl: d.fetch("shopgirl"), | |
| 218 | + tragedietta: d.fetch("tragedietta"), | |
| 219 | + unsparse: d.fetch("unsparse"), | |
| 220 | + uplook: d.fetch("uplook"), | |
| 221 | + vermiformis: d.fetch("vermiformis"), | |
| 222 | + whafabout: d.fetch("whafabout"), | |
| 223 | + ) | |
| 224 | + end | |
| 225 | + | |
| 226 | + def self.from_json!(json) | |
| 227 | + from_dynamic!(JSON.parse(json)) | |
| 228 | + end | |
| 229 | + | |
| 230 | + def to_dynamic | |
| 231 | + { | |
| 232 | + "acclaimer" => acclaimer, | |
| 233 | + "achree" => achree, | |
| 234 | + "base" => base, | |
| 235 | + "conundrumize" => conundrumize, | |
| 236 | + "degerminator" => degerminator, | |
| 237 | + "describable" => describable, | |
| 238 | + "exasperatedly" => exasperatedly, | |
| 239 | + "heroine" => heroine, | |
| 240 | + "indazin" => indazin, | |
| 241 | + "luteous" => luteous, | |
| 242 | + "papular" => papular, | |
| 243 | + "pritch" => pritch, | |
| 244 | + "Prodenia" => prodenia, | |
| 245 | + "seege" => seege, | |
| 246 | + "shopgirl" => shopgirl, | |
| 247 | + "tragedietta" => tragedietta, | |
| 248 | + "unsparse" => unsparse, | |
| 249 | + "uplook" => uplook, | |
| 250 | + "vermiformis" => vermiformis, | |
| 251 | + "whafabout" => whafabout, | |
| 252 | + } | |
| 253 | + end | |
| 254 | + | |
| 255 | + def to_json(options = nil) | |
| 256 | + JSON.generate(to_dynamic, options) | |
| 257 | + end | |
| 258 | +end | |
| 259 | + | |
| 260 | +class LadronismElement < Dry::Struct | |
| 261 | + attribute :double, Types::Double.optional | |
| 262 | + attribute :ladronism_class, LadronismClass.optional | |
| 263 | + attribute :string, Types::String.optional | |
| 264 | + | |
| 265 | + def self.from_dynamic!(d) | |
| 266 | + if schema[:double].right.valid? d | |
| 267 | + return new(double: d, ladronism_class: nil, string: nil) | |
| 268 | + end | |
| 269 | + begin | |
| 270 | + value = LadronismClass.from_dynamic!(d) | |
| 271 | + if schema[:ladronism_class].right.valid? value | |
| 272 | + return new(ladronism_class: value, double: nil, string: nil) | |
| 273 | + end | |
| 274 | + rescue | |
| 275 | + end | |
| 276 | + if schema[:string].right.valid? d | |
| 277 | + return new(string: d, ladronism_class: nil, double: nil) | |
| 278 | + end | |
| 279 | + raise "Invalid union" | |
| 280 | + end | |
| 281 | + | |
| 282 | + def self.from_json!(json) | |
| 283 | + from_dynamic!(JSON.parse(json)) | |
| 284 | + end | |
| 285 | + | |
| 286 | + def to_dynamic | |
| 287 | + if double != nil | |
| 288 | + double | |
| 289 | + elsif ladronism_class != nil | |
| 290 | + ladronism_class.to_dynamic | |
| 291 | + elsif string != nil | |
| 292 | + string | |
| 293 | + end | |
| 294 | + end | |
| 295 | + | |
| 296 | + def to_json(options = nil) | |
| 297 | + JSON.generate(to_dynamic, options) | |
| 298 | + end | |
| 299 | +end | |
| 300 | + | |
| 301 | +class LandlubberlyClass < Dry::Struct | |
| 302 | + attribute :acropoleis, Types::Nil | |
| 303 | + attribute :aminate, Types::Nil | |
| 304 | + attribute :amyraldism, Types::Nil | |
| 305 | + attribute :bipenniform, Types::Nil | |
| 306 | + attribute :bugre, Types::Nil | |
| 307 | + attribute :calycule, Types::Nil | |
| 308 | + attribute :caoutchouc, Types::Nil | |
| 309 | + attribute :disprover, Types::Nil | |
| 310 | + attribute :fitroot, Types::Nil | |
| 311 | + attribute :fulgently, Types::Nil | |
| 312 | + attribute :kickup, Types::Nil | |
| 313 | + attribute :laevoversion, Types::Nil | |
| 314 | + attribute :moter, Types::Nil | |
| 315 | + attribute :objectivity, Types::Nil | |
| 316 | + attribute :posterity, Types::Nil | |
| 317 | + attribute :postnuptial, Types::Nil | |
| 318 | + attribute :precedentary, Types::Nil | |
| 319 | + attribute :saddling, Types::Nil | |
| 320 | + attribute :subcurrent, Types::Nil | |
| 321 | + attribute :unrecriminative, Types::Nil | |
| 322 | + | |
| 323 | + def self.from_dynamic!(d) | |
| 324 | + d = Types::Hash[d] | |
| 325 | + new( | |
| 326 | + acropoleis: d.fetch("acropoleis"), | |
| 327 | + aminate: d.fetch("aminate"), | |
| 328 | + amyraldism: d.fetch("Amyraldism"), | |
| 329 | + bipenniform: d.fetch("bipenniform"), | |
| 330 | + bugre: d.fetch("bugre"), | |
| 331 | + calycule: d.fetch("calycule"), | |
| 332 | + caoutchouc: d.fetch("caoutchouc"), | |
| 333 | + disprover: d.fetch("disprover"), | |
| 334 | + fitroot: d.fetch("fitroot"), | |
| 335 | + fulgently: d.fetch("fulgently"), | |
| 336 | + kickup: d.fetch("kickup"), | |
| 337 | + laevoversion: d.fetch("laevoversion"), | |
| 338 | + moter: d.fetch("moter"), | |
| 339 | + objectivity: d.fetch("objectivity"), | |
| 340 | + posterity: d.fetch("posterity"), | |
| 341 | + postnuptial: d.fetch("postnuptial"), | |
| 342 | + precedentary: d.fetch("precedentary"), | |
| 343 | + saddling: d.fetch("saddling"), | |
| 344 | + subcurrent: d.fetch("subcurrent"), | |
| 345 | + unrecriminative: d.fetch("unrecriminative"), | |
| 346 | + ) | |
| 347 | + end | |
| 348 | + | |
| 349 | + def self.from_json!(json) | |
| 350 | + from_dynamic!(JSON.parse(json)) | |
| 351 | + end | |
| 352 | + | |
| 353 | + def to_dynamic | |
| 354 | + { | |
| 355 | + "acropoleis" => acropoleis, | |
| 356 | + "aminate" => aminate, | |
| 357 | + "Amyraldism" => amyraldism, | |
| 358 | + "bipenniform" => bipenniform, | |
| 359 | + "bugre" => bugre, | |
| 360 | + "calycule" => calycule, | |
| 361 | + "caoutchouc" => caoutchouc, | |
| 362 | + "disprover" => disprover, | |
| 363 | + "fitroot" => fitroot, | |
| 364 | + "fulgently" => fulgently, | |
| 365 | + "kickup" => kickup, | |
| 366 | + "laevoversion" => laevoversion, | |
| 367 | + "moter" => moter, | |
| 368 | + "objectivity" => objectivity, | |
| 369 | + "posterity" => posterity, | |
| 370 | + "postnuptial" => postnuptial, | |
| 371 | + "precedentary" => precedentary, | |
| 372 | + "saddling" => saddling, | |
| 373 | + "subcurrent" => subcurrent, | |
| 374 | + "unrecriminative" => unrecriminative, | |
| 375 | + } | |
| 376 | + end | |
| 377 | + | |
| 378 | + def to_json(options = nil) | |
| 379 | + JSON.generate(to_dynamic, options) | |
| 380 | + end | |
| 381 | +end | |
| 382 | + | |
| 383 | +class LandlubberlyElement < Dry::Struct | |
| 384 | + attribute :bool, Types::Bool.optional | |
| 385 | + attribute :integer, Types::Integer.optional | |
| 386 | + attribute :landlubberly_class, LandlubberlyClass.optional | |
| 387 | + | |
| 388 | + def self.from_dynamic!(d) | |
| 389 | + if schema[:bool].right.valid? d | |
| 390 | + return new(bool: d, landlubberly_class: nil, integer: nil) | |
| 391 | + end | |
| 392 | + if schema[:integer].right.valid? d | |
| 393 | + return new(integer: d, bool: nil, landlubberly_class: nil) | |
| 394 | + end | |
| 395 | + begin | |
| 396 | + value = LandlubberlyClass.from_dynamic!(d) | |
| 397 | + if schema[:landlubberly_class].right.valid? value | |
| 398 | + return new(landlubberly_class: value, bool: nil, integer: nil) | |
| 399 | + end | |
| 400 | + rescue | |
| 401 | + end | |
| 402 | + raise "Invalid union" | |
| 403 | + end | |
| 404 | + | |
| 405 | + def self.from_json!(json) | |
| 406 | + from_dynamic!(JSON.parse(json)) | |
| 407 | + end | |
| 408 | + | |
| 409 | + def to_dynamic | |
| 410 | + if bool != nil | |
| 411 | + bool | |
| 412 | + elsif integer != nil | |
| 413 | + integer | |
| 414 | + elsif landlubberly_class != nil | |
| 415 | + landlubberly_class.to_dynamic | |
| 416 | + end | |
| 417 | + end | |
| 418 | + | |
| 419 | + def to_json(options = nil) | |
| 420 | + JSON.generate(to_dynamic, options) | |
| 421 | + end | |
| 422 | +end | |
| 423 | + | |
| 424 | +class Listener < Dry::Struct | |
| 425 | + attribute :integer, Types::Integer.optional | |
| 426 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 427 | + | |
| 428 | + def self.from_dynamic!(d) | |
| 429 | + if schema[:integer].right.valid? d | |
| 430 | + return new(integer: d, null_array: nil) | |
| 431 | + end | |
| 432 | + if schema[:null_array].right.valid? d | |
| 433 | + return new(null_array: d, integer: nil) | |
| 434 | + end | |
| 435 | + raise "Invalid union" | |
| 436 | + end | |
| 437 | + | |
| 438 | + def self.from_json!(json) | |
| 439 | + from_dynamic!(JSON.parse(json)) | |
| 440 | + end | |
| 441 | + | |
| 442 | + def to_dynamic | |
| 443 | + if integer != nil | |
| 444 | + integer | |
| 445 | + elsif null_array != nil | |
| 446 | + null_array | |
| 447 | + end | |
| 448 | + end | |
| 449 | + | |
| 450 | + def to_json(options = nil) | |
| 451 | + JSON.generate(to_dynamic, options) | |
| 452 | + end | |
| 453 | +end | |
| 454 | + | |
| 455 | +class LupusClass < Dry::Struct | |
| 456 | + attribute :catharticalness, Types::Double.optional | |
| 457 | + attribute :chirotherium, Types::Integer.optional | |
| 458 | + attribute :chlorioninae, Types::Integer.optional | |
| 459 | + attribute :corvinae, Types::Integer.optional | |
| 460 | + attribute :crassina, Types::Integer.optional | |
| 461 | + attribute :disdiapason, Types::String.optional | |
| 462 | + attribute :exiguity, Types::Integer.optional | |
| 463 | + attribute :farcist, Types::Integer.optional | |
| 464 | + attribute :holographical, Types::Integer.optional | |
| 465 | + attribute :homocerc, Types::Bool.optional | |
| 466 | + attribute :ichthyophagan, Types::Integer.optional | |
| 467 | + attribute :implacable, Types::Integer.optional | |
| 468 | + attribute :nonbookish, Types::Nil.optional | |
| 469 | + attribute :outshiner, Types::Integer.optional | |
| 470 | + attribute :overweather, Types::Integer.optional | |
| 471 | + attribute :protonegroid, Types::Integer.optional | |
| 472 | + attribute :shallowish, Types::Integer.optional | |
| 473 | + attribute :snoke, Types::Integer.optional | |
| 474 | + attribute :snout, Types::Integer.optional | |
| 475 | + attribute :surveillance, Types::Integer.optional | |
| 476 | + attribute :threshingtime, Types::Integer.optional | |
| 477 | + attribute :thysanocarpus, Types::Integer.optional | |
| 478 | + attribute :unsignificantly, Types::Integer.optional | |
| 479 | + attribute :unsnap, Types::Integer.optional | |
| 480 | + attribute :vendible, Types::Integer.optional | |
| 481 | + | |
| 482 | + def self.from_dynamic!(d) | |
| 483 | + d = Types::Hash[d] | |
| 484 | + new( | |
| 485 | + catharticalness: d["catharticalness"], | |
| 486 | + chirotherium: d["Chirotherium"], | |
| 487 | + chlorioninae: d["Chlorioninae"], | |
| 488 | + corvinae: d["Corvinae"], | |
| 489 | + crassina: d["Crassina"], | |
| 490 | + disdiapason: d["disdiapason"], | |
| 491 | + exiguity: d["exiguity"], | |
| 492 | + farcist: d["farcist"], | |
| 493 | + holographical: d["holographical"], | |
| 494 | + homocerc: d["homocerc"], | |
| 495 | + ichthyophagan: d["ichthyophagan"], | |
| 496 | + implacable: d["implacable"], | |
| 497 | + nonbookish: d["nonbookish"], | |
| 498 | + outshiner: d["outshiner"], | |
| 499 | + overweather: d["overweather"], | |
| 500 | + protonegroid: d["protonegroid"], | |
| 501 | + shallowish: d["shallowish"], | |
| 502 | + snoke: d["snoke"], | |
| 503 | + snout: d["snout"], | |
| 504 | + surveillance: d["surveillance"], | |
| 505 | + threshingtime: d["threshingtime"], | |
| 506 | + thysanocarpus: d["Thysanocarpus"], | |
| 507 | + unsignificantly: d["unsignificantly"], | |
| 508 | + unsnap: d["unsnap"], | |
| 509 | + vendible: d["vendible"], | |
| 510 | + ) | |
| 511 | + end | |
| 512 | + | |
| 513 | + def self.from_json!(json) | |
| 514 | + from_dynamic!(JSON.parse(json)) | |
| 515 | + end | |
| 516 | + | |
| 517 | + def to_dynamic | |
| 518 | + { | |
| 519 | + "catharticalness" => catharticalness, | |
| 520 | + "Chirotherium" => chirotherium, | |
| 521 | + "Chlorioninae" => chlorioninae, | |
| 522 | + "Corvinae" => corvinae, | |
| 523 | + "Crassina" => crassina, | |
| 524 | + "disdiapason" => disdiapason, | |
| 525 | + "exiguity" => exiguity, | |
| 526 | + "farcist" => farcist, | |
| 527 | + "holographical" => holographical, | |
| 528 | + "homocerc" => homocerc, | |
| 529 | + "ichthyophagan" => ichthyophagan, | |
| 530 | + "implacable" => implacable, | |
| 531 | + "nonbookish" => nonbookish, | |
| 532 | + "outshiner" => outshiner, | |
| 533 | + "overweather" => overweather, | |
| 534 | + "protonegroid" => protonegroid, | |
| 535 | + "shallowish" => shallowish, | |
| 536 | + "snoke" => snoke, | |
| 537 | + "snout" => snout, | |
| 538 | + "surveillance" => surveillance, | |
| 539 | + "threshingtime" => threshingtime, | |
| 540 | + "Thysanocarpus" => thysanocarpus, | |
| 541 | + "unsignificantly" => unsignificantly, | |
| 542 | + "unsnap" => unsnap, | |
| 543 | + "vendible" => vendible, | |
| 544 | + } | |
| 545 | + end | |
| 546 | + | |
| 547 | + def to_json(options = nil) | |
| 548 | + JSON.generate(to_dynamic, options) | |
| 549 | + end | |
| 550 | +end | |
| 551 | + | |
| 552 | +class LupusElement < Dry::Struct | |
| 553 | + attribute :integer, Types::Integer.optional | |
| 554 | + attribute :lupus_class, LupusClass.optional | |
| 555 | + | |
| 556 | + def self.from_dynamic!(d) | |
| 557 | + if schema[:integer].right.valid? d | |
| 558 | + return new(integer: d, lupus_class: nil) | |
| 559 | + end | |
| 560 | + begin | |
| 561 | + value = LupusClass.from_dynamic!(d) | |
| 562 | + if schema[:lupus_class].right.valid? value | |
| 563 | + return new(lupus_class: value, integer: nil) | |
| 564 | + end | |
| 565 | + rescue | |
| 566 | + end | |
| 567 | + raise "Invalid union" | |
| 568 | + end | |
| 569 | + | |
| 570 | + def self.from_json!(json) | |
| 571 | + from_dynamic!(JSON.parse(json)) | |
| 572 | + end | |
| 573 | + | |
| 574 | + def to_dynamic | |
| 575 | + if integer != nil | |
| 576 | + integer | |
| 577 | + elsif lupus_class != nil | |
| 578 | + lupus_class.to_dynamic | |
| 579 | + end | |
| 580 | + end | |
| 581 | + | |
| 582 | + def to_json(options = nil) | |
| 583 | + JSON.generate(to_dynamic, options) | |
| 584 | + end | |
| 585 | +end | |
| 586 | + | |
| 587 | +class Maslin < Dry::Struct | |
| 588 | + attribute :alicant, Types::Integer.optional | |
| 589 | + attribute :antiatonement, Types::Nil.optional | |
| 590 | + attribute :anticorrosive, Types::Integer.optional | |
| 591 | + attribute :aphidozer, Types::Nil.optional | |
| 592 | + attribute :bakuninist, Types::Nil.optional | |
| 593 | + attribute :be, Types::Integer.optional | |
| 594 | + attribute :catharticalness, Types::Double.optional | |
| 595 | + attribute :chirotherium, Types::Integer.optional | |
| 596 | + attribute :chub, Types::Integer.optional | |
| 597 | + attribute :cuprosilicon, Types::Integer.optional | |
| 598 | + attribute :curtailedly, Types::Integer.optional | |
| 599 | + attribute :dellenite, Types::Integer.optional | |
| 600 | + attribute :dimitry, Types::Integer.optional | |
| 601 | + attribute :disdiapason, Types::String.optional | |
| 602 | + attribute :edifying, Types::Nil.optional | |
| 603 | + attribute :ethmoiditis, Types::Integer.optional | |
| 604 | + attribute :gastralgy, Types::Nil.optional | |
| 605 | + attribute :goatherd, Types::Integer.optional | |
| 606 | + attribute :hammerdress, Types::Integer.optional | |
| 607 | + attribute :hangfire, Types::Nil.optional | |
| 608 | + attribute :homocerc, Types::Bool.optional | |
| 609 | + attribute :lacunosity, Types::Integer.optional | |
| 610 | + attribute :longiloquence, Types::Nil.optional | |
| 611 | + attribute :mameliere, Types::Integer.optional | |
| 612 | + attribute :motherless, Types::Nil.optional | |
| 613 | + attribute :nonbookish, Types::Nil.optional | |
| 614 | + attribute :noncorrodible, Types::Nil.optional | |
| 615 | + attribute :nonsensicality, Types::Nil.optional | |
| 616 | + attribute :oafishly, Types::Integer.optional | |
| 617 | + attribute :pfund, Types::Nil.optional | |
| 618 | + attribute :preadvisory, Types::Nil.optional | |
| 619 | + attribute :retroflexed, Types::Nil.optional | |
| 620 | + attribute :saccharulmic, Types::Integer.optional | |
| 621 | + attribute :scowlful, Types::Integer.optional | |
| 622 | + attribute :secluded, Types::Nil.optional | |
| 623 | + attribute :slackage, Types::Nil.optional | |
| 624 | + attribute :sphaeridial, Types::Integer.optional | |
| 625 | + attribute :spondulics, Types::Nil.optional | |
| 626 | + attribute :subsecive, Types::Integer.optional | |
| 627 | + attribute :swellmobsman, Types::Nil.optional | |
| 628 | + attribute :trachyglossate, Types::Integer.optional | |
| 629 | + attribute :trialogue, Types::Nil.optional | |
| 630 | + attribute :unassuaged, Types::Integer.optional | |
| 631 | + attribute :ungross, Types::Nil.optional | |
| 632 | + attribute :unjudiciously, Types::Nil.optional | |
| 633 | + | |
| 634 | + def self.from_dynamic!(d) | |
| 635 | + d = Types::Hash[d] | |
| 636 | + new( | |
| 637 | + alicant: d["Alicant"], | |
| 638 | + antiatonement: d["antiatonement"], | |
| 639 | + anticorrosive: d["anticorrosive"], | |
| 640 | + aphidozer: d["aphidozer"], | |
| 641 | + bakuninist: d["Bakuninist"], | |
| 642 | + be: d["be"], | |
| 643 | + catharticalness: d["catharticalness"], | |
| 644 | + chirotherium: d["Chirotherium"], | |
| 645 | + chub: d["chub"], | |
| 646 | + cuprosilicon: d["cuprosilicon"], | |
| 647 | + curtailedly: d["curtailedly"], | |
| 648 | + dellenite: d["dellenite"], | |
| 649 | + dimitry: d["Dimitry"], | |
| 650 | + disdiapason: d["disdiapason"], | |
| 651 | + edifying: d["edifying"], | |
| 652 | + ethmoiditis: d["ethmoiditis"], | |
| 653 | + gastralgy: d["gastralgy"], | |
| 654 | + goatherd: d["goatherd"], | |
| 655 | + hammerdress: d["hammerdress"], | |
| 656 | + hangfire: d["hangfire"], | |
| 657 | + homocerc: d["homocerc"], | |
| 658 | + lacunosity: d["lacunosity"], | |
| 659 | + longiloquence: d["longiloquence"], | |
| 660 | + mameliere: d["mameliere"], | |
| 661 | + motherless: d["motherless"], | |
| 662 | + nonbookish: d["nonbookish"], | |
| 663 | + noncorrodible: d["noncorrodible"], | |
| 664 | + nonsensicality: d["nonsensicality"], | |
| 665 | + oafishly: d["oafishly"], | |
| 666 | + pfund: d["pfund"], | |
| 667 | + preadvisory: d["preadvisory"], | |
| 668 | + retroflexed: d["retroflexed"], | |
| 669 | + saccharulmic: d["saccharulmic"], | |
| 670 | + scowlful: d["scowlful"], | |
| 671 | + secluded: d["secluded"], | |
| 672 | + slackage: d["slackage"], | |
| 673 | + sphaeridial: d["sphaeridial"], | |
| 674 | + spondulics: d["spondulics"], | |
| 675 | + subsecive: d["subsecive"], | |
| 676 | + swellmobsman: d["swellmobsman"], | |
| 677 | + trachyglossate: d["trachyglossate"], | |
| 678 | + trialogue: d["trialogue"], | |
| 679 | + unassuaged: d["unassuaged"], | |
| 680 | + ungross: d["ungross"], | |
| 681 | + unjudiciously: d["unjudiciously"], | |
| 682 | + ) | |
| 683 | + end | |
| 684 | + | |
| 685 | + def self.from_json!(json) | |
| 686 | + from_dynamic!(JSON.parse(json)) | |
| 687 | + end | |
| 688 | + | |
| 689 | + def to_dynamic | |
| 690 | + { | |
| 691 | + "Alicant" => alicant, | |
| 692 | + "antiatonement" => antiatonement, | |
| 693 | + "anticorrosive" => anticorrosive, | |
| 694 | + "aphidozer" => aphidozer, | |
| 695 | + "Bakuninist" => bakuninist, | |
| 696 | + "be" => be, | |
| 697 | + "catharticalness" => catharticalness, | |
| 698 | + "Chirotherium" => chirotherium, | |
| 699 | + "chub" => chub, | |
| 700 | + "cuprosilicon" => cuprosilicon, | |
| 701 | + "curtailedly" => curtailedly, | |
| 702 | + "dellenite" => dellenite, | |
| 703 | + "Dimitry" => dimitry, | |
| 704 | + "disdiapason" => disdiapason, | |
| 705 | + "edifying" => edifying, | |
| 706 | + "ethmoiditis" => ethmoiditis, | |
| 707 | + "gastralgy" => gastralgy, | |
| 708 | + "goatherd" => goatherd, | |
| 709 | + "hammerdress" => hammerdress, | |
| 710 | + "hangfire" => hangfire, | |
| 711 | + "homocerc" => homocerc, | |
| 712 | + "lacunosity" => lacunosity, | |
| 713 | + "longiloquence" => longiloquence, | |
| 714 | + "mameliere" => mameliere, | |
| 715 | + "motherless" => motherless, | |
| 716 | + "nonbookish" => nonbookish, | |
| 717 | + "noncorrodible" => noncorrodible, | |
| 718 | + "nonsensicality" => nonsensicality, | |
| 719 | + "oafishly" => oafishly, | |
| 720 | + "pfund" => pfund, | |
| 721 | + "preadvisory" => preadvisory, | |
| 722 | + "retroflexed" => retroflexed, | |
| 723 | + "saccharulmic" => saccharulmic, | |
| 724 | + "scowlful" => scowlful, | |
| 725 | + "secluded" => secluded, | |
| 726 | + "slackage" => slackage, | |
| 727 | + "sphaeridial" => sphaeridial, | |
| 728 | + "spondulics" => spondulics, | |
| 729 | + "subsecive" => subsecive, | |
| 730 | + "swellmobsman" => swellmobsman, | |
| 731 | + "trachyglossate" => trachyglossate, | |
| 732 | + "trialogue" => trialogue, | |
| 733 | + "unassuaged" => unassuaged, | |
| 734 | + "ungross" => ungross, | |
| 735 | + "unjudiciously" => unjudiciously, | |
| 736 | + } | |
| 737 | + end | |
| 738 | + | |
| 739 | + def to_json(options = nil) | |
| 740 | + JSON.generate(to_dynamic, options) | |
| 741 | + end | |
| 742 | +end | |
| 743 | + | |
| 744 | +class MonaziteClass < Dry::Struct | |
| 745 | + attribute :catharticalness, Types::Double | |
| 746 | + attribute :chirotherium, Types::Integer | |
| 747 | + attribute :disdiapason, Types::String | |
| 748 | + attribute :homocerc, Types::Bool | |
| 749 | + attribute :nonbookish, Types::Nil | |
| 750 | + | |
| 751 | + def self.from_dynamic!(d) | |
| 752 | + d = Types::Hash[d] | |
| 753 | + new( | |
| 754 | + catharticalness: d.fetch("catharticalness"), | |
| 755 | + chirotherium: d.fetch("Chirotherium"), | |
| 756 | + disdiapason: d.fetch("disdiapason"), | |
| 757 | + homocerc: d.fetch("homocerc"), | |
| 758 | + nonbookish: d.fetch("nonbookish"), | |
| 759 | + ) | |
| 760 | + end | |
| 761 | + | |
| 762 | + def self.from_json!(json) | |
| 763 | + from_dynamic!(JSON.parse(json)) | |
| 764 | + end | |
| 765 | + | |
| 766 | + def to_dynamic | |
| 767 | + { | |
| 768 | + "catharticalness" => catharticalness, | |
| 769 | + "Chirotherium" => chirotherium, | |
| 770 | + "disdiapason" => disdiapason, | |
| 771 | + "homocerc" => homocerc, | |
| 772 | + "nonbookish" => nonbookish, | |
| 773 | + } | |
| 774 | + end | |
| 775 | + | |
| 776 | + def to_json(options = nil) | |
| 777 | + JSON.generate(to_dynamic, options) | |
| 778 | + end | |
| 779 | +end | |
| 780 | + | |
| 781 | +class MonaziteElement < Dry::Struct | |
| 782 | + attribute :double, Types::Double.optional | |
| 783 | + attribute :monazite_class, MonaziteClass.optional | |
| 784 | + | |
| 785 | + def self.from_dynamic!(d) | |
| 786 | + if schema[:double].right.valid? d | |
| 787 | + return new(double: d, monazite_class: nil) | |
| 788 | + end | |
| 789 | + begin | |
| 790 | + value = MonaziteClass.from_dynamic!(d) | |
| 791 | + if schema[:monazite_class].right.valid? value | |
| 792 | + return new(monazite_class: value, double: nil) | |
| 793 | + end | |
| 794 | + rescue | |
| 795 | + end | |
| 796 | + raise "Invalid union" | |
| 797 | + end | |
| 798 | + | |
| 799 | + def self.from_json!(json) | |
| 800 | + from_dynamic!(JSON.parse(json)) | |
| 801 | + end | |
| 802 | + | |
| 803 | + def to_dynamic | |
| 804 | + if double != nil | |
| 805 | + double | |
| 806 | + elsif monazite_class != nil | |
| 807 | + monazite_class.to_dynamic | |
| 808 | + end | |
| 809 | + end | |
| 810 | + | |
| 811 | + def to_json(options = nil) | |
| 812 | + JSON.generate(to_dynamic, options) | |
| 813 | + end | |
| 814 | +end | |
| 815 | + | |
| 816 | +class Monoliteral < Dry::Struct | |
| 817 | + attribute :bool, Types::Bool.optional | |
| 818 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 819 | + | |
| 820 | + def self.from_dynamic!(d) | |
| 821 | + if schema[:bool].right.valid? d | |
| 822 | + return new(bool: d, null_array: nil) | |
| 823 | + end | |
| 824 | + if schema[:null_array].right.valid? d | |
| 825 | + return new(null_array: d, bool: nil) | |
| 826 | + end | |
| 827 | + raise "Invalid union" | |
| 828 | + end | |
| 829 | + | |
| 830 | + def self.from_json!(json) | |
| 831 | + from_dynamic!(JSON.parse(json)) | |
| 832 | + end | |
| 833 | + | |
| 834 | + def to_dynamic | |
| 835 | + if bool != nil | |
| 836 | + bool | |
| 837 | + elsif null_array != nil | |
| 838 | + null_array | |
| 839 | + end | |
| 840 | + end | |
| 841 | + | |
| 842 | + def to_json(options = nil) | |
| 843 | + JSON.generate(to_dynamic, options) | |
| 844 | + end | |
| 845 | +end | |
| 846 | + | |
| 847 | +class MonotheisticallyClass < Dry::Struct | |
| 848 | + attribute :blaspheme, Types::Nil.optional | |
| 849 | + attribute :catharticalness, Types::Double.optional | |
| 850 | + attribute :celiosalpingectomy, Types::Nil.optional | |
| 851 | + attribute :chirotherium, Types::Integer.optional | |
| 852 | + attribute :consummativeness, Types::Nil.optional | |
| 853 | + attribute :disdiapason, Types::String.optional | |
| 854 | + attribute :egestive, Types::Nil.optional | |
| 855 | + attribute :enchylema, Types::Nil.optional | |
| 856 | + attribute :gasconade, Types::Nil.optional | |
| 857 | + attribute :holidayer, Types::Nil.optional | |
| 858 | + attribute :homocerc, Types::Bool.optional | |
| 859 | + attribute :intuitionalism, Types::Nil.optional | |
| 860 | + attribute :lophiostomate, Types::Nil.optional | |
| 861 | + attribute :monotheistically_trust, Types::Nil.optional | |
| 862 | + attribute :nonbookish, Types::Nil.optional | |
| 863 | + attribute :nonvolition, Types::Nil.optional | |
| 864 | + attribute :palatableness, Types::Nil.optional | |
| 865 | + attribute :pimpery, Types::Nil.optional | |
| 866 | + attribute :previolation, Types::Nil.optional | |
| 867 | + attribute :reconveyance, Types::Nil.optional | |
| 868 | + attribute :registership, Types::Nil.optional | |
| 869 | + attribute :rhyacolite, Types::Nil.optional | |
| 870 | + attribute :smithereens, Types::Nil.optional | |
| 871 | + attribute :superedification, Types::Nil.optional | |
| 872 | + attribute :whitestone, Types::Nil.optional | |
| 873 | + | |
| 874 | + def self.from_dynamic!(d) | |
| 875 | + d = Types::Hash[d] | |
| 876 | + new( | |
| 877 | + blaspheme: d["blaspheme"], | |
| 878 | + catharticalness: d["catharticalness"], | |
| 879 | + celiosalpingectomy: d["celiosalpingectomy"], | |
| 880 | + chirotherium: d["Chirotherium"], | |
| 881 | + consummativeness: d["consummativeness"], | |
| 882 | + disdiapason: d["disdiapason"], | |
| 883 | + egestive: d["egestive"], | |
| 884 | + enchylema: d["enchylema"], | |
| 885 | + gasconade: d["gasconade"], | |
| 886 | + holidayer: d["holidayer"], | |
| 887 | + homocerc: d["homocerc"], | |
| 888 | + intuitionalism: d["intuitionalism"], | |
| 889 | + lophiostomate: d["lophiostomate"], | |
| 890 | + monotheistically_trust: d["trust"], | |
| 891 | + nonbookish: d["nonbookish"], | |
| 892 | + nonvolition: d["nonvolition"], | |
| 893 | + palatableness: d["palatableness"], | |
| 894 | + pimpery: d["pimpery"], | |
| 895 | + previolation: d["previolation"], | |
| 896 | + reconveyance: d["reconveyance"], | |
| 897 | + registership: d["registership"], | |
| 898 | + rhyacolite: d["rhyacolite"], | |
| 899 | + smithereens: d["smithereens"], | |
| 900 | + superedification: d["superedification"], | |
| 901 | + whitestone: d["whitestone"], | |
| 902 | + ) | |
| 903 | + end | |
| 904 | + | |
| 905 | + def self.from_json!(json) | |
| 906 | + from_dynamic!(JSON.parse(json)) | |
| 907 | + end | |
| 908 | + | |
| 909 | + def to_dynamic | |
| 910 | + { | |
| 911 | + "blaspheme" => blaspheme, | |
| 912 | + "catharticalness" => catharticalness, | |
| 913 | + "celiosalpingectomy" => celiosalpingectomy, | |
| 914 | + "Chirotherium" => chirotherium, | |
| 915 | + "consummativeness" => consummativeness, | |
| 916 | + "disdiapason" => disdiapason, | |
| 917 | + "egestive" => egestive, | |
| 918 | + "enchylema" => enchylema, | |
| 919 | + "gasconade" => gasconade, | |
| 920 | + "holidayer" => holidayer, | |
| 921 | + "homocerc" => homocerc, | |
| 922 | + "intuitionalism" => intuitionalism, | |
| 923 | + "lophiostomate" => lophiostomate, | |
| 924 | + "trust" => monotheistically_trust, | |
| 925 | + "nonbookish" => nonbookish, | |
| 926 | + "nonvolition" => nonvolition, | |
| 927 | + "palatableness" => palatableness, | |
| 928 | + "pimpery" => pimpery, | |
| 929 | + "previolation" => previolation, | |
| 930 | + "reconveyance" => reconveyance, | |
| 931 | + "registership" => registership, | |
| 932 | + "rhyacolite" => rhyacolite, | |
| 933 | + "smithereens" => smithereens, | |
| 934 | + "superedification" => superedification, | |
| 935 | + "whitestone" => whitestone, | |
| 936 | + } | |
| 937 | + end | |
| 938 | + | |
| 939 | + def to_json(options = nil) | |
| 940 | + JSON.generate(to_dynamic, options) | |
| 941 | + end | |
| 942 | +end | |
| 943 | + | |
| 944 | +class MonotheisticallyElement < Dry::Struct | |
| 945 | + attribute :monotheistically_class, MonotheisticallyClass.optional | |
| 946 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 947 | + | |
| 948 | + def self.from_dynamic!(d) | |
| 949 | + begin | |
| 950 | + value = MonotheisticallyClass.from_dynamic!(d) | |
| 951 | + if schema[:monotheistically_class].right.valid? value | |
| 952 | + return new(monotheistically_class: value, null_array: nil) | |
| 953 | + end | |
| 954 | + rescue | |
| 955 | + end | |
| 956 | + if schema[:null_array].right.valid? d | |
| 957 | + return new(null_array: d, monotheistically_class: nil) | |
| 958 | + end | |
| 959 | + raise "Invalid union" | |
| 960 | + end | |
| 961 | + | |
| 962 | + def self.from_json!(json) | |
| 963 | + from_dynamic!(JSON.parse(json)) | |
| 964 | + end | |
| 965 | + | |
| 966 | + def to_dynamic | |
| 967 | + if monotheistically_class != nil | |
| 968 | + monotheistically_class.to_dynamic | |
| 969 | + elsif null_array != nil | |
| 970 | + null_array | |
| 971 | + end | |
| 972 | + end | |
| 973 | + | |
| 974 | + def to_json(options = nil) | |
| 975 | + JSON.generate(to_dynamic, options) | |
| 976 | + end | |
| 977 | +end | |
| 978 | + | |
| 979 | +class Montage < Dry::Struct | |
| 980 | + attribute :double, Types::Double.optional | |
| 981 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 982 | + attribute :string, Types::String.optional | |
| 983 | + | |
| 984 | + def self.from_dynamic!(d) | |
| 985 | + if schema[:double].right.valid? d | |
| 986 | + return new(double: d, null_array: nil, string: nil) | |
| 987 | + end | |
| 988 | + if schema[:null_array].right.valid? d | |
| 989 | + return new(null_array: d, double: nil, string: nil) | |
| 990 | + end | |
| 991 | + if schema[:string].right.valid? d | |
| 992 | + return new(string: d, null_array: nil, double: nil) | |
| 993 | + end | |
| 994 | + raise "Invalid union" | |
| 995 | + end | |
| 996 | + | |
| 997 | + def self.from_json!(json) | |
| 998 | + from_dynamic!(JSON.parse(json)) | |
| 999 | + end | |
| 1000 | + | |
| 1001 | + def to_dynamic | |
| 1002 | + if double != nil | |
| 1003 | + double | |
| 1004 | + elsif null_array != nil | |
| 1005 | + null_array | |
| 1006 | + elsif string != nil | |
| 1007 | + string | |
| 1008 | + end | |
| 1009 | + end | |
| 1010 | + | |
| 1011 | + def to_json(options = nil) | |
| 1012 | + JSON.generate(to_dynamic, options) | |
| 1013 | + end | |
| 1014 | +end | |
| 1015 | + | |
| 1016 | +class Moralness < Dry::Struct | |
| 1017 | + attribute :double, Types::Double.optional | |
| 1018 | + attribute :null, Types::Nil.optional | |
| 1019 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1020 | + | |
| 1021 | + def self.from_dynamic!(d) | |
| 1022 | + if schema[:double].right.valid? d | |
| 1023 | + return new(double: d, null_array: nil, null: nil) | |
| 1024 | + end | |
| 1025 | + if schema[:null].right.valid? d | |
| 1026 | + return new(null: d, null_array: nil, double: nil) | |
| 1027 | + end | |
| 1028 | + if schema[:null_array].right.valid? d | |
| 1029 | + return new(null_array: d, double: nil, null: nil) | |
| 1030 | + end | |
| 1031 | + raise "Invalid union" | |
| 1032 | + end | |
| 1033 | + | |
| 1034 | + def self.from_json!(json) | |
| 1035 | + from_dynamic!(JSON.parse(json)) | |
| 1036 | + end | |
| 1037 | + | |
| 1038 | + def to_dynamic | |
| 1039 | + if double != nil | |
| 1040 | + double | |
| 1041 | + elsif null_array != nil | |
| 1042 | + null_array | |
| 1043 | + else | |
| 1044 | + nil | |
| 1045 | + end | |
| 1046 | + end | |
| 1047 | + | |
| 1048 | + def to_json(options = nil) | |
| 1049 | + JSON.generate(to_dynamic, options) | |
| 1050 | + end | |
| 1051 | +end | |
| 1052 | + | |
| 1053 | +class Mulishly < Dry::Struct | |
| 1054 | + attribute :double, Types::Double.optional | |
| 1055 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1056 | + attribute :null, Types::Nil.optional | |
| 1057 | + | |
| 1058 | + def self.from_dynamic!(d) | |
| 1059 | + if schema[:double].right.valid? d | |
| 1060 | + return new(double: d, integer_array: nil, null: nil) | |
| 1061 | + end | |
| 1062 | + if schema[:integer_array].right.valid? d | |
| 1063 | + return new(integer_array: d, double: nil, null: nil) | |
| 1064 | + end | |
| 1065 | + if schema[:null].right.valid? d | |
| 1066 | + return new(null: d, integer_array: nil, double: nil) | |
| 1067 | + end | |
| 1068 | + raise "Invalid union" | |
| 1069 | + end | |
| 1070 | + | |
| 1071 | + def self.from_json!(json) | |
| 1072 | + from_dynamic!(JSON.parse(json)) | |
| 1073 | + end | |
| 1074 | + | |
| 1075 | + def to_dynamic | |
| 1076 | + if double != nil | |
| 1077 | + double | |
| 1078 | + elsif integer_array != nil | |
| 1079 | + integer_array | |
| 1080 | + else | |
| 1081 | + nil | |
| 1082 | + end | |
| 1083 | + end | |
| 1084 | + | |
| 1085 | + def to_json(options = nil) | |
| 1086 | + JSON.generate(to_dynamic, options) | |
| 1087 | + end | |
| 1088 | +end | |
| 1089 | + | |
| 1090 | +class Myoscope < Dry::Struct | |
| 1091 | + attribute :bool, Types::Bool.optional | |
| 1092 | + attribute :integer, Types::Integer.optional | |
| 1093 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1094 | + | |
| 1095 | + def self.from_dynamic!(d) | |
| 1096 | + if schema[:bool].right.valid? d | |
| 1097 | + return new(bool: d, null_array: nil, integer: nil) | |
| 1098 | + end | |
| 1099 | + if schema[:integer].right.valid? d | |
| 1100 | + return new(integer: d, null_array: nil, bool: nil) | |
| 1101 | + end | |
| 1102 | + if schema[:null_array].right.valid? d | |
| 1103 | + return new(null_array: d, bool: nil, integer: nil) | |
| 1104 | + end | |
| 1105 | + raise "Invalid union" | |
| 1106 | + end | |
| 1107 | + | |
| 1108 | + def self.from_json!(json) | |
| 1109 | + from_dynamic!(JSON.parse(json)) | |
| 1110 | + end | |
| 1111 | + | |
| 1112 | + def to_dynamic | |
| 1113 | + if bool != nil | |
| 1114 | + bool | |
| 1115 | + elsif integer != nil | |
| 1116 | + integer | |
| 1117 | + elsif null_array != nil | |
| 1118 | + null_array | |
| 1119 | + end | |
| 1120 | + end | |
| 1121 | + | |
| 1122 | + def to_json(options = nil) | |
| 1123 | + JSON.generate(to_dynamic, options) | |
| 1124 | + end | |
| 1125 | +end | |
| 1126 | + | |
| 1127 | +class Neuromastic < Dry::Struct | |
| 1128 | + attribute :double, Types::Double.optional | |
| 1129 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1130 | + | |
| 1131 | + def self.from_dynamic!(d) | |
| 1132 | + if schema[:double].right.valid? d | |
| 1133 | + return new(double: d, null_array: nil) | |
| 1134 | + end | |
| 1135 | + if schema[:null_array].right.valid? d | |
| 1136 | + return new(null_array: d, double: nil) | |
| 1137 | + end | |
| 1138 | + raise "Invalid union" | |
| 1139 | + end | |
| 1140 | + | |
| 1141 | + def self.from_json!(json) | |
| 1142 | + from_dynamic!(JSON.parse(json)) | |
| 1143 | + end | |
| 1144 | + | |
| 1145 | + def to_dynamic | |
| 1146 | + if double != nil | |
| 1147 | + double | |
| 1148 | + elsif null_array != nil | |
| 1149 | + null_array | |
| 1150 | + end | |
| 1151 | + end | |
| 1152 | + | |
| 1153 | + def to_json(options = nil) | |
| 1154 | + JSON.generate(to_dynamic, options) | |
| 1155 | + end | |
| 1156 | +end | |
| 1157 | + | |
| 1158 | +class Noncontributing < Dry::Struct | |
| 1159 | + attribute :estevin, Types::String | |
| 1160 | + attribute :jolterhead, Types::Double | |
| 1161 | + attribute :sauternes, Types::Integer | |
| 1162 | + attribute :sparsely, Types::Bool | |
| 1163 | + attribute :unrequested, Types::Nil | |
| 1164 | + | |
| 1165 | + def self.from_dynamic!(d) | |
| 1166 | + d = Types::Hash[d] | |
| 1167 | + new( | |
| 1168 | + estevin: d.fetch("estevin"), | |
| 1169 | + jolterhead: d.fetch("jolterhead"), | |
| 1170 | + sauternes: d.fetch("sauternes"), | |
| 1171 | + sparsely: d.fetch("sparsely"), | |
| 1172 | + unrequested: d.fetch("unrequested"), | |
| 1173 | + ) | |
| 1174 | + end | |
| 1175 | + | |
| 1176 | + def self.from_json!(json) | |
| 1177 | + from_dynamic!(JSON.parse(json)) | |
| 1178 | + end | |
| 1179 | + | |
| 1180 | + def to_dynamic | |
| 1181 | + { | |
| 1182 | + "estevin" => estevin, | |
| 1183 | + "jolterhead" => jolterhead, | |
| 1184 | + "sauternes" => sauternes, | |
| 1185 | + "sparsely" => sparsely, | |
| 1186 | + "unrequested" => unrequested, | |
| 1187 | + } | |
| 1188 | + end | |
| 1189 | + | |
| 1190 | + def to_json(options = nil) | |
| 1191 | + JSON.generate(to_dynamic, options) | |
| 1192 | + end | |
| 1193 | +end | |
| 1194 | + | |
| 1195 | +class Nonnervous < Dry::Struct | |
| 1196 | + attribute :bool, Types::Bool.optional | |
| 1197 | + attribute :integer, Types::Integer.optional | |
| 1198 | + | |
| 1199 | + def self.from_dynamic!(d) | |
| 1200 | + if schema[:bool].right.valid? d | |
| 1201 | + return new(bool: d, integer: nil) | |
| 1202 | + end | |
| 1203 | + if schema[:integer].right.valid? d | |
| 1204 | + return new(integer: d, bool: nil) | |
| 1205 | + end | |
| 1206 | + raise "Invalid union" | |
| 1207 | + end | |
| 1208 | + | |
| 1209 | + def self.from_json!(json) | |
| 1210 | + from_dynamic!(JSON.parse(json)) | |
| 1211 | + end | |
| 1212 | + | |
| 1213 | + def to_dynamic | |
| 1214 | + if bool != nil | |
| 1215 | + bool | |
| 1216 | + elsif integer != nil | |
| 1217 | + integer | |
| 1218 | + end | |
| 1219 | + end | |
| 1220 | + | |
| 1221 | + def to_json(options = nil) | |
| 1222 | + JSON.generate(to_dynamic, options) | |
| 1223 | + end | |
| 1224 | +end | |
| 1225 | + | |
| 1226 | +class Nonvaluation < Dry::Struct | |
| 1227 | + attribute :bool, Types::Bool.optional | |
| 1228 | + attribute :double, Types::Double.optional | |
| 1229 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1230 | + | |
| 1231 | + def self.from_dynamic!(d) | |
| 1232 | + if schema[:bool].right.valid? d | |
| 1233 | + return new(bool: d, null_array: nil, double: nil) | |
| 1234 | + end | |
| 1235 | + if schema[:double].right.valid? d | |
| 1236 | + return new(double: d, null_array: nil, bool: nil) | |
| 1237 | + end | |
| 1238 | + if schema[:null_array].right.valid? d | |
| 1239 | + return new(null_array: d, bool: nil, double: nil) | |
| 1240 | + end | |
| 1241 | + raise "Invalid union" | |
| 1242 | + end | |
| 1243 | + | |
| 1244 | + def self.from_json!(json) | |
| 1245 | + from_dynamic!(JSON.parse(json)) | |
| 1246 | + end | |
| 1247 | + | |
| 1248 | + def to_dynamic | |
| 1249 | + if bool != nil | |
| 1250 | + bool | |
| 1251 | + elsif double != nil | |
| 1252 | + double | |
| 1253 | + elsif null_array != nil | |
| 1254 | + null_array | |
| 1255 | + end | |
| 1256 | + end | |
| 1257 | + | |
| 1258 | + def to_json(options = nil) | |
| 1259 | + JSON.generate(to_dynamic, options) | |
| 1260 | + end | |
| 1261 | +end | |
| 1262 | + | |
| 1263 | +class OccupationalistClass < Dry::Struct | |
| 1264 | + attribute :beholdable, Types::Nil | |
| 1265 | + attribute :brotuliform, Types::Nil | |
| 1266 | + attribute :chimakum, Types::Nil | |
| 1267 | + attribute :doodler, Types::Nil | |
| 1268 | + attribute :emulsin, Types::Nil | |
| 1269 | + attribute :fin, Types::Nil | |
| 1270 | + attribute :flourishing, Types::Nil | |
| 1271 | + attribute :flueless, Types::Nil | |
| 1272 | + attribute :furtively, Types::Nil | |
| 1273 | + attribute :gritter, Types::Nil | |
| 1274 | + attribute :interwish, Types::Nil | |
| 1275 | + attribute :monoxylic, Types::Nil | |
| 1276 | + attribute :myristic, Types::Nil | |
| 1277 | + attribute :nightwear, Types::Nil | |
| 1278 | + attribute :peruser, Types::Nil | |
| 1279 | + attribute :theoastrological, Types::Nil | |
| 1280 | + attribute :thumby, Types::Nil | |
| 1281 | + attribute :tingitid, Types::Nil | |
| 1282 | + attribute :trailless, Types::Nil | |
| 1283 | + attribute :unpocketed, Types::Nil | |
| 1284 | + | |
| 1285 | + def self.from_dynamic!(d) | |
| 1286 | + d = Types::Hash[d] | |
| 1287 | + new( | |
| 1288 | + beholdable: d.fetch("beholdable"), | |
| 1289 | + brotuliform: d.fetch("brotuliform"), | |
| 1290 | + chimakum: d.fetch("Chimakum"), | |
| 1291 | + doodler: d.fetch("doodler"), | |
| 1292 | + emulsin: d.fetch("emulsin"), | |
| 1293 | + fin: d.fetch("Fin"), | |
| 1294 | + flourishing: d.fetch("flourishing"), | |
| 1295 | + flueless: d.fetch("flueless"), | |
| 1296 | + furtively: d.fetch("furtively"), | |
| 1297 | + gritter: d.fetch("gritter"), | |
| 1298 | + interwish: d.fetch("interwish"), | |
| 1299 | + monoxylic: d.fetch("monoxylic"), | |
| 1300 | + myristic: d.fetch("myristic"), | |
| 1301 | + nightwear: d.fetch("nightwear"), | |
| 1302 | + peruser: d.fetch("peruser"), | |
| 1303 | + theoastrological: d.fetch("theoastrological"), | |
| 1304 | + thumby: d.fetch("thumby"), | |
| 1305 | + tingitid: d.fetch("tingitid"), | |
| 1306 | + trailless: d.fetch("trailless"), | |
| 1307 | + unpocketed: d.fetch("unpocketed"), | |
| 1308 | + ) | |
| 1309 | + end | |
| 1310 | + | |
| 1311 | + def self.from_json!(json) | |
| 1312 | + from_dynamic!(JSON.parse(json)) | |
| 1313 | + end | |
| 1314 | + | |
| 1315 | + def to_dynamic | |
| 1316 | + { | |
| 1317 | + "beholdable" => beholdable, | |
| 1318 | + "brotuliform" => brotuliform, | |
| 1319 | + "Chimakum" => chimakum, | |
| 1320 | + "doodler" => doodler, | |
| 1321 | + "emulsin" => emulsin, | |
| 1322 | + "Fin" => fin, | |
| 1323 | + "flourishing" => flourishing, | |
| 1324 | + "flueless" => flueless, | |
| 1325 | + "furtively" => furtively, | |
| 1326 | + "gritter" => gritter, | |
| 1327 | + "interwish" => interwish, | |
| 1328 | + "monoxylic" => monoxylic, | |
| 1329 | + "myristic" => myristic, | |
| 1330 | + "nightwear" => nightwear, | |
| 1331 | + "peruser" => peruser, | |
| 1332 | + "theoastrological" => theoastrological, | |
| 1333 | + "thumby" => thumby, | |
| 1334 | + "tingitid" => tingitid, | |
| 1335 | + "trailless" => trailless, | |
| 1336 | + "unpocketed" => unpocketed, | |
| 1337 | + } | |
| 1338 | + end | |
| 1339 | + | |
| 1340 | + def to_json(options = nil) | |
| 1341 | + JSON.generate(to_dynamic, options) | |
| 1342 | + end | |
| 1343 | +end | |
| 1344 | + | |
| 1345 | +class OccupationalistElement < Dry::Struct | |
| 1346 | + attribute :null, Types::Nil.optional | |
| 1347 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1348 | + attribute :occupationalist_class, OccupationalistClass.optional | |
| 1349 | + | |
| 1350 | + def self.from_dynamic!(d) | |
| 1351 | + if schema[:null].right.valid? d | |
| 1352 | + return new(null: d, null_array: nil, occupationalist_class: nil) | |
| 1353 | + end | |
| 1354 | + if schema[:null_array].right.valid? d | |
| 1355 | + return new(null_array: d, occupationalist_class: nil, null: nil) | |
| 1356 | + end | |
| 1357 | + begin | |
| 1358 | + value = OccupationalistClass.from_dynamic!(d) | |
| 1359 | + if schema[:occupationalist_class].right.valid? value | |
| 1360 | + return new(occupationalist_class: value, null_array: nil, null: nil) | |
| 1361 | + end | |
| 1362 | + rescue | |
| 1363 | + end | |
| 1364 | + raise "Invalid union" | |
| 1365 | + end | |
| 1366 | + | |
| 1367 | + def self.from_json!(json) | |
| 1368 | + from_dynamic!(JSON.parse(json)) | |
| 1369 | + end | |
| 1370 | + | |
| 1371 | + def to_dynamic | |
| 1372 | + if null_array != nil | |
| 1373 | + null_array | |
| 1374 | + elsif occupationalist_class != nil | |
| 1375 | + occupationalist_class.to_dynamic | |
| 1376 | + else | |
| 1377 | + nil | |
| 1378 | + end | |
| 1379 | + end | |
| 1380 | + | |
| 1381 | + def to_json(options = nil) | |
| 1382 | + JSON.generate(to_dynamic, options) | |
| 1383 | + end | |
| 1384 | +end | |
| 1385 | + | |
| 1386 | +class OutrivalClass < Dry::Struct | |
| 1387 | + attribute :adroitly, Types::Nil | |
| 1388 | + attribute :bridehood, Types::Nil | |
| 1389 | + attribute :castoroides, Types::Nil | |
| 1390 | + attribute :czechoslovak, Types::Nil | |
| 1391 | + attribute :diagenesis, Types::Nil | |
| 1392 | + attribute :dihexahedron, Types::Nil | |
| 1393 | + attribute :dopester, Types::Nil | |
| 1394 | + attribute :eumerism, Types::Nil | |
| 1395 | + attribute :flyness, Types::Nil | |
| 1396 | + attribute :fouler, Types::Nil | |
| 1397 | + attribute :laudanosine, Types::Nil | |
| 1398 | + attribute :lingulidae, Types::Nil | |
| 1399 | + attribute :minutary, Types::Nil | |
| 1400 | + attribute :mitra, Types::Nil | |
| 1401 | + attribute :opisthorchiasis, Types::Nil | |
| 1402 | + attribute :pensively, Types::Nil | |
| 1403 | + attribute :pubigerous, Types::Nil | |
| 1404 | + attribute :rebellious, Types::Nil | |
| 1405 | + attribute :recodify, Types::Nil | |
| 1406 | + attribute :unpaced, Types::Nil | |
| 1407 | + | |
| 1408 | + def self.from_dynamic!(d) | |
| 1409 | + d = Types::Hash[d] | |
| 1410 | + new( | |
| 1411 | + adroitly: d.fetch("adroitly"), | |
| 1412 | + bridehood: d.fetch("bridehood"), | |
| 1413 | + castoroides: d.fetch("Castoroides"), | |
| 1414 | + czechoslovak: d.fetch("Czechoslovak"), | |
| 1415 | + diagenesis: d.fetch("diagenesis"), | |
| 1416 | + dihexahedron: d.fetch("dihexahedron"), | |
| 1417 | + dopester: d.fetch("dopester"), | |
| 1418 | + eumerism: d.fetch("eumerism"), | |
| 1419 | + flyness: d.fetch("flyness"), | |
| 1420 | + fouler: d.fetch("fouler"), | |
| 1421 | + laudanosine: d.fetch("laudanosine"), | |
| 1422 | + lingulidae: d.fetch("Lingulidae"), | |
| 1423 | + minutary: d.fetch("minutary"), | |
| 1424 | + mitra: d.fetch("mitra"), | |
| 1425 | + opisthorchiasis: d.fetch("opisthorchiasis"), | |
| 1426 | + pensively: d.fetch("pensively"), | |
| 1427 | + pubigerous: d.fetch("pubigerous"), | |
| 1428 | + rebellious: d.fetch("rebellious"), | |
| 1429 | + recodify: d.fetch("recodify"), | |
| 1430 | + unpaced: d.fetch("unpaced"), | |
| 1431 | + ) | |
| 1432 | + end | |
| 1433 | + | |
| 1434 | + def self.from_json!(json) | |
| 1435 | + from_dynamic!(JSON.parse(json)) | |
| 1436 | + end | |
| 1437 | + | |
| 1438 | + def to_dynamic | |
| 1439 | + { | |
| 1440 | + "adroitly" => adroitly, | |
| 1441 | + "bridehood" => bridehood, | |
| 1442 | + "Castoroides" => castoroides, | |
| 1443 | + "Czechoslovak" => czechoslovak, | |
| 1444 | + "diagenesis" => diagenesis, | |
| 1445 | + "dihexahedron" => dihexahedron, | |
| 1446 | + "dopester" => dopester, | |
| 1447 | + "eumerism" => eumerism, | |
| 1448 | + "flyness" => flyness, | |
| 1449 | + "fouler" => fouler, | |
| 1450 | + "laudanosine" => laudanosine, | |
| 1451 | + "Lingulidae" => lingulidae, | |
| 1452 | + "minutary" => minutary, | |
| 1453 | + "mitra" => mitra, | |
| 1454 | + "opisthorchiasis" => opisthorchiasis, | |
| 1455 | + "pensively" => pensively, | |
| 1456 | + "pubigerous" => pubigerous, | |
| 1457 | + "rebellious" => rebellious, | |
| 1458 | + "recodify" => recodify, | |
| 1459 | + "unpaced" => unpaced, | |
| 1460 | + } | |
| 1461 | + end | |
| 1462 | + | |
| 1463 | + def to_json(options = nil) | |
| 1464 | + JSON.generate(to_dynamic, options) | |
| 1465 | + end | |
| 1466 | +end | |
| 1467 | + | |
| 1468 | +class OutrivalElement < Dry::Struct | |
| 1469 | + attribute :double, Types::Double.optional | |
| 1470 | + attribute :null, Types::Nil.optional | |
| 1471 | + attribute :outrival_class, OutrivalClass.optional | |
| 1472 | + | |
| 1473 | + def self.from_dynamic!(d) | |
| 1474 | + if schema[:double].right.valid? d | |
| 1475 | + return new(double: d, outrival_class: nil, null: nil) | |
| 1476 | + end | |
| 1477 | + if schema[:null].right.valid? d | |
| 1478 | + return new(null: d, outrival_class: nil, double: nil) | |
| 1479 | + end | |
| 1480 | + begin | |
| 1481 | + value = OutrivalClass.from_dynamic!(d) | |
| 1482 | + if schema[:outrival_class].right.valid? value | |
| 1483 | + return new(outrival_class: value, double: nil, null: nil) | |
| 1484 | + end | |
| 1485 | + rescue | |
| 1486 | + end | |
| 1487 | + raise "Invalid union" | |
| 1488 | + end | |
| 1489 | + | |
| 1490 | + def self.from_json!(json) | |
| 1491 | + from_dynamic!(JSON.parse(json)) | |
| 1492 | + end | |
| 1493 | + | |
| 1494 | + def to_dynamic | |
| 1495 | + if double != nil | |
| 1496 | + double | |
| 1497 | + elsif outrival_class != nil | |
| 1498 | + outrival_class.to_dynamic | |
| 1499 | + else | |
| 1500 | + nil | |
| 1501 | + end | |
| 1502 | + end | |
| 1503 | + | |
| 1504 | + def to_json(options = nil) | |
| 1505 | + JSON.generate(to_dynamic, options) | |
| 1506 | + end | |
| 1507 | +end | |
| 1508 | + | |
| 1509 | +class Paleographically < Dry::Struct | |
| 1510 | + attribute :double, Types::Double.optional | |
| 1511 | + attribute :union_map, Types::Hash.meta(of: Types::Integer.optional).optional | |
| 1512 | + | |
| 1513 | + def self.from_dynamic!(d) | |
| 1514 | + if schema[:double].right.valid? d | |
| 1515 | + return new(double: d, union_map: nil) | |
| 1516 | + end | |
| 1517 | + begin | |
| 1518 | + value = Types::Hash[d].map { |k, v| [k, v] }.to_h | |
| 1519 | + if schema[:union_map].right.valid? value | |
| 1520 | + return new(union_map: value, double: nil) | |
| 1521 | + end | |
| 1522 | + rescue | |
| 1523 | + end | |
| 1524 | + raise "Invalid union" | |
| 1525 | + end | |
| 1526 | + | |
| 1527 | + def self.from_json!(json) | |
| 1528 | + from_dynamic!(JSON.parse(json)) | |
| 1529 | + end | |
| 1530 | + | |
| 1531 | + def to_dynamic | |
| 1532 | + if double != nil | |
| 1533 | + double | |
| 1534 | + elsif union_map != nil | |
| 1535 | + union_map | |
| 1536 | + end | |
| 1537 | + end | |
| 1538 | + | |
| 1539 | + def to_json(options = nil) | |
| 1540 | + JSON.generate(to_dynamic, options) | |
| 1541 | + end | |
| 1542 | +end | |
| 1543 | + | |
| 1544 | +class Pamphletwise < Dry::Struct | |
| 1545 | + attribute :integer, Types::Integer.optional | |
| 1546 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1547 | + attribute :string, Types::String.optional | |
| 1548 | + | |
| 1549 | + def self.from_dynamic!(d) | |
| 1550 | + if schema[:integer].right.valid? d | |
| 1551 | + return new(integer: d, integer_map: nil, string: nil) | |
| 1552 | + end | |
| 1553 | + begin | |
| 1554 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1555 | + if schema[:integer_map].right.valid? value | |
| 1556 | + return new(integer_map: value, integer: nil, string: nil) | |
| 1557 | + end | |
| 1558 | + rescue | |
| 1559 | + end | |
| 1560 | + if schema[:string].right.valid? d | |
| 1561 | + return new(string: d, integer: nil, integer_map: nil) | |
| 1562 | + end | |
| 1563 | + raise "Invalid union" | |
| 1564 | + end | |
| 1565 | + | |
| 1566 | + def self.from_json!(json) | |
| 1567 | + from_dynamic!(JSON.parse(json)) | |
| 1568 | + end | |
| 1569 | + | |
| 1570 | + def to_dynamic | |
| 1571 | + if integer != nil | |
| 1572 | + integer | |
| 1573 | + elsif integer_map != nil | |
| 1574 | + integer_map | |
| 1575 | + elsif string != nil | |
| 1576 | + string | |
| 1577 | + end | |
| 1578 | + end | |
| 1579 | + | |
| 1580 | + def to_json(options = nil) | |
| 1581 | + JSON.generate(to_dynamic, options) | |
| 1582 | + end | |
| 1583 | +end | |
| 1584 | + | |
| 1585 | +class Pediatric < Dry::Struct | |
| 1586 | + attribute :bool, Types::Bool.optional | |
| 1587 | + attribute :double, Types::Double.optional | |
| 1588 | + attribute :null, Types::Nil.optional | |
| 1589 | + | |
| 1590 | + def self.from_dynamic!(d) | |
| 1591 | + if schema[:bool].right.valid? d | |
| 1592 | + return new(bool: d, double: nil, null: nil) | |
| 1593 | + end | |
| 1594 | + if schema[:double].right.valid? d | |
| 1595 | + return new(double: d, bool: nil, null: nil) | |
| 1596 | + end | |
| 1597 | + if schema[:null].right.valid? d | |
| 1598 | + return new(null: d, bool: nil, double: nil) | |
| 1599 | + end | |
| 1600 | + raise "Invalid union" | |
| 1601 | + end | |
| 1602 | + | |
| 1603 | + def self.from_json!(json) | |
| 1604 | + from_dynamic!(JSON.parse(json)) | |
| 1605 | + end | |
| 1606 | + | |
| 1607 | + def to_dynamic | |
| 1608 | + if bool != nil | |
| 1609 | + bool | |
| 1610 | + elsif double != nil | |
| 1611 | + double | |
| 1612 | + else | |
| 1613 | + nil | |
| 1614 | + end | |
| 1615 | + end | |
| 1616 | + | |
| 1617 | + def to_json(options = nil) | |
| 1618 | + JSON.generate(to_dynamic, options) | |
| 1619 | + end | |
| 1620 | +end | |
| 1621 | + | |
| 1622 | +class PiaculumClass < Dry::Struct | |
| 1623 | + attribute :alada, Types::Integer.optional | |
| 1624 | + attribute :amphistomous, Types::Integer.optional | |
| 1625 | + attribute :boysenberry, Types::Integer.optional | |
| 1626 | + attribute :catharticalness, Types::Double.optional | |
| 1627 | + attribute :chirotherium, Types::Integer.optional | |
| 1628 | + attribute :decardinalize, Types::Integer.optional | |
| 1629 | + attribute :discouragement, Types::Integer.optional | |
| 1630 | + attribute :disdiapason, Types::String.optional | |
| 1631 | + attribute :doitrified, Types::Integer.optional | |
| 1632 | + attribute :hexaspermous, Types::Integer.optional | |
| 1633 | + attribute :homocerc, Types::Bool.optional | |
| 1634 | + attribute :insinking, Types::Integer.optional | |
| 1635 | + attribute :loathfulness, Types::Integer.optional | |
| 1636 | + attribute :miasmatical, Types::Integer.optional | |
| 1637 | + attribute :neurofibril, Types::Integer.optional | |
| 1638 | + attribute :nonbookish, Types::Nil.optional | |
| 1639 | + attribute :phonendoscope, Types::Integer.optional | |
| 1640 | + attribute :pilferment, Types::Integer.optional | |
| 1641 | + attribute :predismissory, Types::Integer.optional | |
| 1642 | + attribute :preinscription, Types::Integer.optional | |
| 1643 | + attribute :quotative, Types::Integer.optional | |
| 1644 | + attribute :sienna, Types::Integer.optional | |
| 1645 | + attribute :thorax, Types::Integer.optional | |
| 1646 | + attribute :yachting, Types::Integer.optional | |
| 1647 | + attribute :zipper, Types::Integer.optional | |
| 1648 | + | |
| 1649 | + def self.from_dynamic!(d) | |
| 1650 | + d = Types::Hash[d] | |
| 1651 | + new( | |
| 1652 | + alada: d["alada"], | |
| 1653 | + amphistomous: d["amphistomous"], | |
| 1654 | + boysenberry: d["boysenberry"], | |
| 1655 | + catharticalness: d["catharticalness"], | |
| 1656 | + chirotherium: d["Chirotherium"], | |
| 1657 | + decardinalize: d["decardinalize"], | |
| 1658 | + discouragement: d["discouragement"], | |
| 1659 | + disdiapason: d["disdiapason"], | |
| 1660 | + doitrified: d["doitrified"], | |
| 1661 | + hexaspermous: d["hexaspermous"], | |
| 1662 | + homocerc: d["homocerc"], | |
| 1663 | + insinking: d["insinking"], | |
| 1664 | + loathfulness: d["loathfulness"], | |
| 1665 | + miasmatical: d["miasmatical"], | |
| 1666 | + neurofibril: d["neurofibril"], | |
| 1667 | + nonbookish: d["nonbookish"], | |
| 1668 | + phonendoscope: d["phonendoscope"], | |
| 1669 | + pilferment: d["pilferment"], | |
| 1670 | + predismissory: d["predismissory"], | |
| 1671 | + preinscription: d["preinscription"], | |
| 1672 | + quotative: d["quotative"], | |
| 1673 | + sienna: d["sienna"], | |
| 1674 | + thorax: d["thorax"], | |
| 1675 | + yachting: d["yachting"], | |
| 1676 | + zipper: d["Zipper"], | |
| 1677 | + ) | |
| 1678 | + end | |
| 1679 | + | |
| 1680 | + def self.from_json!(json) | |
| 1681 | + from_dynamic!(JSON.parse(json)) | |
| 1682 | + end | |
| 1683 | + | |
| 1684 | + def to_dynamic | |
| 1685 | + { | |
| 1686 | + "alada" => alada, | |
| 1687 | + "amphistomous" => amphistomous, | |
| 1688 | + "boysenberry" => boysenberry, | |
| 1689 | + "catharticalness" => catharticalness, | |
| 1690 | + "Chirotherium" => chirotherium, | |
| 1691 | + "decardinalize" => decardinalize, | |
| 1692 | + "discouragement" => discouragement, | |
| 1693 | + "disdiapason" => disdiapason, | |
| 1694 | + "doitrified" => doitrified, | |
| 1695 | + "hexaspermous" => hexaspermous, | |
| 1696 | + "homocerc" => homocerc, | |
| 1697 | + "insinking" => insinking, | |
| 1698 | + "loathfulness" => loathfulness, | |
| 1699 | + "miasmatical" => miasmatical, | |
| 1700 | + "neurofibril" => neurofibril, | |
| 1701 | + "nonbookish" => nonbookish, | |
| 1702 | + "phonendoscope" => phonendoscope, | |
| 1703 | + "pilferment" => pilferment, | |
| 1704 | + "predismissory" => predismissory, | |
| 1705 | + "preinscription" => preinscription, | |
| 1706 | + "quotative" => quotative, | |
| 1707 | + "sienna" => sienna, | |
| 1708 | + "thorax" => thorax, | |
| 1709 | + "yachting" => yachting, | |
| 1710 | + "Zipper" => zipper, | |
| 1711 | + } | |
| 1712 | + end | |
| 1713 | + | |
| 1714 | + def to_json(options = nil) | |
| 1715 | + JSON.generate(to_dynamic, options) | |
| 1716 | + end | |
| 1717 | +end | |
| 1718 | + | |
| 1719 | +class PiaculumElement < Dry::Struct | |
| 1720 | + attribute :double, Types::Double.optional | |
| 1721 | + attribute :piaculum_class, PiaculumClass.optional | |
| 1722 | + | |
| 1723 | + def self.from_dynamic!(d) | |
| 1724 | + if schema[:double].right.valid? d | |
| 1725 | + return new(double: d, piaculum_class: nil) | |
| 1726 | + end | |
| 1727 | + begin | |
| 1728 | + value = PiaculumClass.from_dynamic!(d) | |
| 1729 | + if schema[:piaculum_class].right.valid? value | |
| 1730 | + return new(piaculum_class: value, double: nil) | |
| 1731 | + end | |
| 1732 | + rescue | |
| 1733 | + end | |
| 1734 | + raise "Invalid union" | |
| 1735 | + end | |
| 1736 | + | |
| 1737 | + def self.from_json!(json) | |
| 1738 | + from_dynamic!(JSON.parse(json)) | |
| 1739 | + end | |
| 1740 | + | |
| 1741 | + def to_dynamic | |
| 1742 | + if double != nil | |
| 1743 | + double | |
| 1744 | + elsif piaculum_class != nil | |
| 1745 | + piaculum_class.to_dynamic | |
| 1746 | + end | |
| 1747 | + end | |
| 1748 | + | |
| 1749 | + def to_json(options = nil) | |
| 1750 | + JSON.generate(to_dynamic, options) | |
| 1751 | + end | |
| 1752 | +end | |
| 1753 | + | |
| 1754 | +class Piccadilly < Dry::Struct | |
| 1755 | + attribute :double, Types::Double.optional | |
| 1756 | + attribute :null, Types::Nil.optional | |
| 1757 | + attribute :string, Types::String.optional | |
| 1758 | + | |
| 1759 | + def self.from_dynamic!(d) | |
| 1760 | + if schema[:double].right.valid? d | |
| 1761 | + return new(double: d, null: nil, string: nil) | |
| 1762 | + end | |
| 1763 | + if schema[:null].right.valid? d | |
| 1764 | + return new(null: d, double: nil, string: nil) | |
| 1765 | + end | |
| 1766 | + if schema[:string].right.valid? d | |
| 1767 | + return new(string: d, double: nil, null: nil) | |
| 1768 | + end | |
| 1769 | + raise "Invalid union" | |
| 1770 | + end | |
| 1771 | + | |
| 1772 | + def self.from_json!(json) | |
| 1773 | + from_dynamic!(JSON.parse(json)) | |
| 1774 | + end | |
| 1775 | + | |
| 1776 | + def to_dynamic | |
| 1777 | + if double != nil | |
| 1778 | + double | |
| 1779 | + elsif string != nil | |
| 1780 | + string | |
| 1781 | + else | |
| 1782 | + nil | |
| 1783 | + end | |
| 1784 | + end | |
| 1785 | + | |
| 1786 | + def to_json(options = nil) | |
| 1787 | + JSON.generate(to_dynamic, options) | |
| 1788 | + end | |
| 1789 | +end | |
| 1790 | + | |
| 1791 | +class Piffler < Dry::Struct | |
| 1792 | + attribute :monazite_class, MonaziteClass.optional | |
| 1793 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1794 | + | |
| 1795 | + def self.from_dynamic!(d) | |
| 1796 | + begin | |
| 1797 | + value = MonaziteClass.from_dynamic!(d) | |
| 1798 | + if schema[:monazite_class].right.valid? value | |
| 1799 | + return new(monazite_class: value, null_array: nil) | |
| 1800 | + end | |
| 1801 | + rescue | |
| 1802 | + end | |
| 1803 | + if schema[:null_array].right.valid? d | |
| 1804 | + return new(null_array: d, monazite_class: nil) | |
| 1805 | + end | |
| 1806 | + raise "Invalid union" | |
| 1807 | + end | |
| 1808 | + | |
| 1809 | + def self.from_json!(json) | |
| 1810 | + from_dynamic!(JSON.parse(json)) | |
| 1811 | + end | |
| 1812 | + | |
| 1813 | + def to_dynamic | |
| 1814 | + if monazite_class != nil | |
| 1815 | + monazite_class.to_dynamic | |
| 1816 | + elsif null_array != nil | |
| 1817 | + null_array | |
| 1818 | + end | |
| 1819 | + end | |
| 1820 | + | |
| 1821 | + def to_json(options = nil) | |
| 1822 | + JSON.generate(to_dynamic, options) | |
| 1823 | + end | |
| 1824 | +end | |
| 1825 | + | |
| 1826 | +class Pithful < Dry::Struct | |
| 1827 | + attribute :bool, Types::Bool.optional | |
| 1828 | + attribute :integer, Types::Integer.optional | |
| 1829 | + attribute :null, Types::Nil.optional | |
| 1830 | + | |
| 1831 | + def self.from_dynamic!(d) | |
| 1832 | + if schema[:bool].right.valid? d | |
| 1833 | + return new(bool: d, integer: nil, null: nil) | |
| 1834 | + end | |
| 1835 | + if schema[:integer].right.valid? d | |
| 1836 | + return new(integer: d, bool: nil, null: nil) | |
| 1837 | + end | |
| 1838 | + if schema[:null].right.valid? d | |
| 1839 | + return new(null: d, bool: nil, integer: nil) | |
| 1840 | + end | |
| 1841 | + raise "Invalid union" | |
| 1842 | + end | |
| 1843 | + | |
| 1844 | + def self.from_json!(json) | |
| 1845 | + from_dynamic!(JSON.parse(json)) | |
| 1846 | + end | |
| 1847 | + | |
| 1848 | + def to_dynamic | |
| 1849 | + if bool != nil | |
| 1850 | + bool | |
| 1851 | + elsif integer != nil | |
| 1852 | + integer | |
| 1853 | + else | |
| 1854 | + nil | |
| 1855 | + end | |
| 1856 | + end | |
| 1857 | + | |
| 1858 | + def to_json(options = nil) | |
| 1859 | + JSON.generate(to_dynamic, options) | |
| 1860 | + end | |
| 1861 | +end | |
| 1862 | + | |
| 1863 | +class Placuntiti < Dry::Struct | |
| 1864 | + attribute :integer, Types::Integer.optional | |
| 1865 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1866 | + | |
| 1867 | + def self.from_dynamic!(d) | |
| 1868 | + if schema[:integer].right.valid? d | |
| 1869 | + return new(integer: d, integer_map: nil) | |
| 1870 | + end | |
| 1871 | + begin | |
| 1872 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1873 | + if schema[:integer_map].right.valid? value | |
| 1874 | + return new(integer_map: value, integer: nil) | |
| 1875 | + end | |
| 1876 | + rescue | |
| 1877 | + end | |
| 1878 | + raise "Invalid union" | |
| 1879 | + end | |
| 1880 | + | |
| 1881 | + def self.from_json!(json) | |
| 1882 | + from_dynamic!(JSON.parse(json)) | |
| 1883 | + end | |
| 1884 | + | |
| 1885 | + def to_dynamic | |
| 1886 | + if integer != nil | |
| 1887 | + integer | |
| 1888 | + elsif integer_map != nil | |
| 1889 | + integer_map | |
| 1890 | + end | |
| 1891 | + end | |
| 1892 | + | |
| 1893 | + def to_json(options = nil) | |
| 1894 | + JSON.generate(to_dynamic, options) | |
| 1895 | + end | |
| 1896 | +end | |
| 1897 | + | |
| 1898 | +class Plectopterous < Dry::Struct | |
| 1899 | + attribute :double, Types::Double.optional | |
| 1900 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1901 | + | |
| 1902 | + def self.from_dynamic!(d) | |
| 1903 | + if schema[:double].right.valid? d | |
| 1904 | + return new(double: d, integer_map: nil) | |
| 1905 | + end | |
| 1906 | + begin | |
| 1907 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1908 | + if schema[:integer_map].right.valid? value | |
| 1909 | + return new(integer_map: value, double: nil) | |
| 1910 | + end | |
| 1911 | + rescue | |
| 1912 | + end | |
| 1913 | + raise "Invalid union" | |
| 1914 | + end | |
| 1915 | + | |
| 1916 | + def self.from_json!(json) | |
| 1917 | + from_dynamic!(JSON.parse(json)) | |
| 1918 | + end | |
| 1919 | + | |
| 1920 | + def to_dynamic | |
| 1921 | + if double != nil | |
| 1922 | + double | |
| 1923 | + elsif integer_map != nil | |
| 1924 | + integer_map | |
| 1925 | + end | |
| 1926 | + end | |
| 1927 | + | |
| 1928 | + def to_json(options = nil) | |
| 1929 | + JSON.generate(to_dynamic, options) | |
| 1930 | + end | |
| 1931 | +end | |
| 1932 | + | |
| 1933 | +class Pneumocele < Dry::Struct | |
| 1934 | + attribute :carbonarism, Types::Nil.optional | |
| 1935 | + attribute :catharticalness, Types::Double.optional | |
| 1936 | + attribute :chirotherium, Types::Integer.optional | |
| 1937 | + attribute :cineolic, Types::Nil.optional | |
| 1938 | + attribute :cobbly, Types::Nil.optional | |
| 1939 | + attribute :conchyliferous, Types::Nil.optional | |
| 1940 | + attribute :congregation, Types::Nil.optional | |
| 1941 | + attribute :disdiapason, Types::String.optional | |
| 1942 | + attribute :enterotomy, Types::Nil.optional | |
| 1943 | + attribute :entophytal, Types::Nil.optional | |
| 1944 | + attribute :fewtrils, Types::Nil.optional | |
| 1945 | + attribute :herem, Types::Nil.optional | |
| 1946 | + attribute :homocerc, Types::Bool.optional | |
| 1947 | + attribute :koniga, Types::Nil.optional | |
| 1948 | + attribute :meticulosity, Types::Nil.optional | |
| 1949 | + attribute :micky, Types::Nil.optional | |
| 1950 | + attribute :mismarriage, Types::Nil.optional | |
| 1951 | + attribute :neurotrophic, Types::Nil.optional | |
| 1952 | + attribute :nonbookish, Types::Nil.optional | |
| 1953 | + attribute :persuasively, Types::Nil.optional | |
| 1954 | + attribute :replaceable, Types::Nil.optional | |
| 1955 | + attribute :silex, Types::Nil.optional | |
| 1956 | + attribute :taillight, Types::Nil.optional | |
| 1957 | + attribute :unjealous, Types::Nil.optional | |
| 1958 | + attribute :visitorial, Types::Nil.optional | |
| 1959 | + | |
| 1960 | + def self.from_dynamic!(d) | |
| 1961 | + d = Types::Hash[d] | |
| 1962 | + new( | |
| 1963 | + carbonarism: d["Carbonarism"], | |
| 1964 | + catharticalness: d["catharticalness"], | |
| 1965 | + chirotherium: d["Chirotherium"], | |
| 1966 | + cineolic: d["cineolic"], | |
| 1967 | + cobbly: d["cobbly"], | |
| 1968 | + conchyliferous: d["conchyliferous"], | |
| 1969 | + congregation: d["congregation"], | |
| 1970 | + disdiapason: d["disdiapason"], | |
| 1971 | + enterotomy: d["enterotomy"], | |
| 1972 | + entophytal: d["entophytal"], | |
| 1973 | + fewtrils: d["fewtrils"], | |
| 1974 | + herem: d["herem"], | |
| 1975 | + homocerc: d["homocerc"], | |
| 1976 | + koniga: d["Koniga"], | |
| 1977 | + meticulosity: d["meticulosity"], | |
| 1978 | + micky: d["Micky"], | |
| 1979 | + mismarriage: d["mismarriage"], | |
| 1980 | + neurotrophic: d["neurotrophic"], | |
| 1981 | + nonbookish: d["nonbookish"], | |
| 1982 | + persuasively: d["persuasively"], | |
| 1983 | + replaceable: d["replaceable"], | |
| 1984 | + silex: d["silex"], | |
| 1985 | + taillight: d["taillight"], | |
| 1986 | + unjealous: d["unjealous"], | |
| 1987 | + visitorial: d["visitorial"], | |
| 1988 | + ) | |
| 1989 | + end | |
| 1990 | + | |
| 1991 | + def self.from_json!(json) | |
| 1992 | + from_dynamic!(JSON.parse(json)) | |
| 1993 | + end | |
| 1994 | + | |
| 1995 | + def to_dynamic | |
| 1996 | + { | |
| 1997 | + "Carbonarism" => carbonarism, | |
| 1998 | + "catharticalness" => catharticalness, | |
| 1999 | + "Chirotherium" => chirotherium, | |
| 2000 | + "cineolic" => cineolic, | |
| 2001 | + "cobbly" => cobbly, | |
| 2002 | + "conchyliferous" => conchyliferous, | |
| 2003 | + "congregation" => congregation, | |
| 2004 | + "disdiapason" => disdiapason, | |
| 2005 | + "enterotomy" => enterotomy, | |
| 2006 | + "entophytal" => entophytal, | |
| 2007 | + "fewtrils" => fewtrils, | |
| 2008 | + "herem" => herem, | |
| 2009 | + "homocerc" => homocerc, | |
| 2010 | + "Koniga" => koniga, | |
| 2011 | + "meticulosity" => meticulosity, | |
| 2012 | + "Micky" => micky, | |
| 2013 | + "mismarriage" => mismarriage, | |
| 2014 | + "neurotrophic" => neurotrophic, | |
| 2015 | + "nonbookish" => nonbookish, | |
| 2016 | + "persuasively" => persuasively, | |
| 2017 | + "replaceable" => replaceable, | |
| 2018 | + "silex" => silex, | |
| 2019 | + "taillight" => taillight, | |
| 2020 | + "unjealous" => unjealous, | |
| 2021 | + "visitorial" => visitorial, | |
| 2022 | + } | |
| 2023 | + end | |
| 2024 | + | |
| 2025 | + def to_json(options = nil) | |
| 2026 | + JSON.generate(to_dynamic, options) | |
| 2027 | + end | |
| 2028 | +end | |
| 2029 | + | |
| 2030 | +class Poliorcetic < Dry::Struct | |
| 2031 | + attribute :bool, Types::Bool.optional | |
| 2032 | + attribute :monazite_class, MonaziteClass.optional | |
| 2033 | + | |
| 2034 | + def self.from_dynamic!(d) | |
| 2035 | + if schema[:bool].right.valid? d | |
| 2036 | + return new(bool: d, monazite_class: nil) | |
| 2037 | + end | |
| 2038 | + begin | |
| 2039 | + value = MonaziteClass.from_dynamic!(d) | |
| 2040 | + if schema[:monazite_class].right.valid? value | |
| 2041 | + return new(monazite_class: value, bool: nil) | |
| 2042 | + end | |
| 2043 | + rescue | |
| 2044 | + end | |
| 2045 | + raise "Invalid union" | |
| 2046 | + end | |
| 2047 | + | |
| 2048 | + def self.from_json!(json) | |
| 2049 | + from_dynamic!(JSON.parse(json)) | |
| 2050 | + end | |
| 2051 | + | |
| 2052 | + def to_dynamic | |
| 2053 | + if bool != nil | |
| 2054 | + bool | |
| 2055 | + elsif monazite_class != nil | |
| 2056 | + monazite_class.to_dynamic | |
| 2057 | + end | |
| 2058 | + end | |
| 2059 | + | |
| 2060 | + def to_json(options = nil) | |
| 2061 | + JSON.generate(to_dynamic, options) | |
| 2062 | + end | |
| 2063 | +end | |
| 2064 | + | |
| 2065 | +class Poormaster < Dry::Struct | |
| 2066 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 2067 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2068 | + attribute :null, Types::Nil.optional | |
| 2069 | + | |
| 2070 | + def self.from_dynamic!(d) | |
| 2071 | + if schema[:integer_array].right.valid? d | |
| 2072 | + return new(integer_array: d, integer_map: nil, null: nil) | |
| 2073 | + end | |
| 2074 | + begin | |
| 2075 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2076 | + if schema[:integer_map].right.valid? value | |
| 2077 | + return new(integer_map: value, integer_array: nil, null: nil) | |
| 2078 | + end | |
| 2079 | + rescue | |
| 2080 | + end | |
| 2081 | + if schema[:null].right.valid? d | |
| 2082 | + return new(null: d, integer_array: nil, integer_map: nil) | |
| 2083 | + end | |
| 2084 | + raise "Invalid union" | |
| 2085 | + end | |
| 2086 | + | |
| 2087 | + def self.from_json!(json) | |
| 2088 | + from_dynamic!(JSON.parse(json)) | |
| 2089 | + end | |
| 2090 | + | |
| 2091 | + def to_dynamic | |
| 2092 | + if integer_array != nil | |
| 2093 | + integer_array | |
| 2094 | + elsif integer_map != nil | |
| 2095 | + integer_map | |
| 2096 | + else | |
| 2097 | + nil | |
| 2098 | + end | |
| 2099 | + end | |
| 2100 | + | |
| 2101 | + def to_json(options = nil) | |
| 2102 | + JSON.generate(to_dynamic, options) | |
| 2103 | + end | |
| 2104 | +end | |
| 2105 | + | |
| 2106 | +class PotwhiskyClass < Dry::Struct | |
| 2107 | + attribute :arciform, Types::Nil | |
| 2108 | + attribute :cresolin, Types::Nil | |
| 2109 | + attribute :disheartener, Types::Nil | |
| 2110 | + attribute :disproportionable, Types::Nil | |
| 2111 | + attribute :euchorda, Types::Nil | |
| 2112 | + attribute :ferryway, Types::Nil | |
| 2113 | + attribute :filamentiferous, Types::Nil | |
| 2114 | + attribute :flemish, Types::Nil | |
| 2115 | + attribute :forgainst, Types::Nil | |
| 2116 | + attribute :grainering, Types::Nil | |
| 2117 | + attribute :irrevoluble, Types::Nil | |
| 2118 | + attribute :kindredship, Types::Nil | |
| 2119 | + attribute :pinguitudinous, Types::Nil | |
| 2120 | + attribute :simpletonic, Types::Nil | |
| 2121 | + attribute :singsong, Types::Nil | |
| 2122 | + attribute :submergement, Types::Nil | |
| 2123 | + attribute :supraoesophagal, Types::Nil | |
| 2124 | + attribute :thrashel, Types::Nil | |
| 2125 | + attribute :tyremesis, Types::Nil | |
| 2126 | + attribute :yoruba, Types::Nil | |
| 2127 | + | |
| 2128 | + def self.from_dynamic!(d) | |
| 2129 | + d = Types::Hash[d] | |
| 2130 | + new( | |
| 2131 | + arciform: d.fetch("arciform"), | |
| 2132 | + cresolin: d.fetch("cresolin"), | |
| 2133 | + disheartener: d.fetch("disheartener"), | |
| 2134 | + disproportionable: d.fetch("disproportionable"), | |
| 2135 | + euchorda: d.fetch("Euchorda"), | |
| 2136 | + ferryway: d.fetch("ferryway"), | |
| 2137 | + filamentiferous: d.fetch("filamentiferous"), | |
| 2138 | + flemish: d.fetch("flemish"), | |
| 2139 | + forgainst: d.fetch("forgainst"), | |
| 2140 | + grainering: d.fetch("grainering"), | |
| 2141 | + irrevoluble: d.fetch("irrevoluble"), | |
| 2142 | + kindredship: d.fetch("kindredship"), | |
| 2143 | + pinguitudinous: d.fetch("pinguitudinous"), | |
| 2144 | + simpletonic: d.fetch("simpletonic"), | |
| 2145 | + singsong: d.fetch("singsong"), | |
| 2146 | + submergement: d.fetch("submergement"), | |
| 2147 | + supraoesophagal: d.fetch("supraoesophagal"), | |
| 2148 | + thrashel: d.fetch("thrashel"), | |
| 2149 | + tyremesis: d.fetch("tyremesis"), | |
| 2150 | + yoruba: d.fetch("Yoruba"), | |
| 2151 | + ) | |
| 2152 | + end | |
| 2153 | + | |
| 2154 | + def self.from_json!(json) | |
| 2155 | + from_dynamic!(JSON.parse(json)) | |
| 2156 | + end | |
| 2157 | + | |
| 2158 | + def to_dynamic | |
| 2159 | + { | |
| 2160 | + "arciform" => arciform, | |
| 2161 | + "cresolin" => cresolin, | |
| 2162 | + "disheartener" => disheartener, | |
| 2163 | + "disproportionable" => disproportionable, | |
| 2164 | + "Euchorda" => euchorda, | |
| 2165 | + "ferryway" => ferryway, | |
| 2166 | + "filamentiferous" => filamentiferous, | |
| 2167 | + "flemish" => flemish, | |
| 2168 | + "forgainst" => forgainst, | |
| 2169 | + "grainering" => grainering, | |
| 2170 | + "irrevoluble" => irrevoluble, | |
| 2171 | + "kindredship" => kindredship, | |
| 2172 | + "pinguitudinous" => pinguitudinous, | |
| 2173 | + "simpletonic" => simpletonic, | |
| 2174 | + "singsong" => singsong, | |
| 2175 | + "submergement" => submergement, | |
| 2176 | + "supraoesophagal" => supraoesophagal, | |
| 2177 | + "thrashel" => thrashel, | |
| 2178 | + "tyremesis" => tyremesis, | |
| 2179 | + "Yoruba" => yoruba, | |
| 2180 | + } | |
| 2181 | + end | |
| 2182 | + | |
| 2183 | + def to_json(options = nil) | |
| 2184 | + JSON.generate(to_dynamic, options) | |
| 2185 | + end | |
| 2186 | +end | |
| 2187 | + | |
| 2188 | +class PotwhiskyElement < Dry::Struct | |
| 2189 | + attribute :integer, Types::Integer.optional | |
| 2190 | + attribute :null, Types::Nil.optional | |
| 2191 | + attribute :potwhisky_class, PotwhiskyClass.optional | |
| 2192 | + | |
| 2193 | + def self.from_dynamic!(d) | |
| 2194 | + if schema[:integer].right.valid? d | |
| 2195 | + return new(integer: d, potwhisky_class: nil, null: nil) | |
| 2196 | + end | |
| 2197 | + if schema[:null].right.valid? d | |
| 2198 | + return new(null: d, potwhisky_class: nil, integer: nil) | |
| 2199 | + end | |
| 2200 | + begin | |
| 2201 | + value = PotwhiskyClass.from_dynamic!(d) | |
| 2202 | + if schema[:potwhisky_class].right.valid? value | |
| 2203 | + return new(potwhisky_class: value, integer: nil, null: nil) | |
| 2204 | + end | |
| 2205 | + rescue | |
| 2206 | + end | |
| 2207 | + raise "Invalid union" | |
| 2208 | + end | |
| 2209 | + | |
| 2210 | + def self.from_json!(json) | |
| 2211 | + from_dynamic!(JSON.parse(json)) | |
| 2212 | + end | |
| 2213 | + | |
| 2214 | + def to_dynamic | |
| 2215 | + if integer != nil | |
| 2216 | + integer | |
| 2217 | + elsif potwhisky_class != nil | |
| 2218 | + potwhisky_class.to_dynamic | |
| 2219 | + else | |
| 2220 | + nil | |
| 2221 | + end | |
| 2222 | + end | |
| 2223 | + | |
| 2224 | + def to_json(options = nil) | |
| 2225 | + JSON.generate(to_dynamic, options) | |
| 2226 | + end | |
| 2227 | +end | |
| 2228 | + | |
| 2229 | +class Practicalizer < Dry::Struct | |
| 2230 | + attribute :monazite_class, MonaziteClass.optional | |
| 2231 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2232 | + attribute :string, Types::String.optional | |
| 2233 | + | |
| 2234 | + def self.from_dynamic!(d) | |
| 2235 | + begin | |
| 2236 | + value = MonaziteClass.from_dynamic!(d) | |
| 2237 | + if schema[:monazite_class].right.valid? value | |
| 2238 | + return new(monazite_class: value, null_array: nil, string: nil) | |
| 2239 | + end | |
| 2240 | + rescue | |
| 2241 | + end | |
| 2242 | + if schema[:null_array].right.valid? d | |
| 2243 | + return new(null_array: d, monazite_class: nil, string: nil) | |
| 2244 | + end | |
| 2245 | + if schema[:string].right.valid? d | |
| 2246 | + return new(string: d, null_array: nil, monazite_class: nil) | |
| 2247 | + end | |
| 2248 | + raise "Invalid union" | |
| 2249 | + end | |
| 2250 | + | |
| 2251 | + def self.from_json!(json) | |
| 2252 | + from_dynamic!(JSON.parse(json)) | |
| 2253 | + end | |
| 2254 | + | |
| 2255 | + def to_dynamic | |
| 2256 | + if monazite_class != nil | |
| 2257 | + monazite_class.to_dynamic | |
| 2258 | + elsif null_array != nil | |
| 2259 | + null_array | |
| 2260 | + elsif string != nil | |
| 2261 | + string | |
| 2262 | + end | |
| 2263 | + end | |
| 2264 | + | |
| 2265 | + def to_json(options = nil) | |
| 2266 | + JSON.generate(to_dynamic, options) | |
| 2267 | + end | |
| 2268 | +end | |
| 2269 | + | |
| 2270 | +class PrefreshmanClass < Dry::Struct | |
| 2271 | + attribute :azorubine, Types::Nil | |
| 2272 | + attribute :choroiditis, Types::Nil | |
| 2273 | + attribute :coagulatory, Types::Nil | |
| 2274 | + attribute :cyclorama, Types::Nil | |
| 2275 | + attribute :dolphus, Types::Nil | |
| 2276 | + attribute :duckhearted, Types::Nil | |
| 2277 | + attribute :ficus, Types::Nil | |
| 2278 | + attribute :gemaric, Types::Nil | |
| 2279 | + attribute :jugation, Types::Nil | |
| 2280 | + attribute :myoliposis, Types::Nil | |
| 2281 | + attribute :nonnomination, Types::Nil | |
| 2282 | + attribute :palay, Types::Nil | |
| 2283 | + attribute :pentactinal, Types::Nil | |
| 2284 | + attribute :phaet, Types::Nil | |
| 2285 | + attribute :piquant, Types::Nil | |
| 2286 | + attribute :registration, Types::Nil | |
| 2287 | + attribute :remancipation, Types::Nil | |
| 2288 | + attribute :scutatiform, Types::Nil | |
| 2289 | + attribute :theodolite, Types::Nil | |
| 2290 | + attribute :underward, Types::Nil | |
| 2291 | + | |
| 2292 | + def self.from_dynamic!(d) | |
| 2293 | + d = Types::Hash[d] | |
| 2294 | + new( | |
| 2295 | + azorubine: d.fetch("azorubine"), | |
| 2296 | + choroiditis: d.fetch("choroiditis"), | |
| 2297 | + coagulatory: d.fetch("coagulatory"), | |
| 2298 | + cyclorama: d.fetch("cyclorama"), | |
| 2299 | + dolphus: d.fetch("Dolphus"), | |
| 2300 | + duckhearted: d.fetch("duckhearted"), | |
| 2301 | + ficus: d.fetch("Ficus"), | |
| 2302 | + gemaric: d.fetch("Gemaric"), | |
| 2303 | + jugation: d.fetch("jugation"), | |
| 2304 | + myoliposis: d.fetch("myoliposis"), | |
| 2305 | + nonnomination: d.fetch("nonnomination"), | |
| 2306 | + palay: d.fetch("palay"), | |
| 2307 | + pentactinal: d.fetch("pentactinal"), | |
| 2308 | + phaet: d.fetch("Phaet"), | |
| 2309 | + piquant: d.fetch("piquant"), | |
| 2310 | + registration: d.fetch("registration"), | |
| 2311 | + remancipation: d.fetch("remancipation"), | |
| 2312 | + scutatiform: d.fetch("scutatiform"), | |
| 2313 | + theodolite: d.fetch("theodolite"), | |
| 2314 | + underward: d.fetch("underward"), | |
| 2315 | + ) | |
| 2316 | + end | |
| 2317 | + | |
| 2318 | + def self.from_json!(json) | |
| 2319 | + from_dynamic!(JSON.parse(json)) | |
| 2320 | + end | |
| 2321 | + | |
| 2322 | + def to_dynamic | |
| 2323 | + { | |
| 2324 | + "azorubine" => azorubine, | |
| 2325 | + "choroiditis" => choroiditis, | |
| 2326 | + "coagulatory" => coagulatory, | |
| 2327 | + "cyclorama" => cyclorama, | |
| 2328 | + "Dolphus" => dolphus, | |
| 2329 | + "duckhearted" => duckhearted, | |
| 2330 | + "Ficus" => ficus, | |
| 2331 | + "Gemaric" => gemaric, | |
| 2332 | + "jugation" => jugation, | |
| 2333 | + "myoliposis" => myoliposis, | |
| 2334 | + "nonnomination" => nonnomination, | |
| 2335 | + "palay" => palay, | |
| 2336 | + "pentactinal" => pentactinal, | |
| 2337 | + "Phaet" => phaet, | |
| 2338 | + "piquant" => piquant, | |
| 2339 | + "registration" => registration, | |
| 2340 | + "remancipation" => remancipation, | |
| 2341 | + "scutatiform" => scutatiform, | |
| 2342 | + "theodolite" => theodolite, | |
| 2343 | + "underward" => underward, | |
| 2344 | + } | |
| 2345 | + end | |
| 2346 | + | |
| 2347 | + def to_json(options = nil) | |
| 2348 | + JSON.generate(to_dynamic, options) | |
| 2349 | + end | |
| 2350 | +end | |
| 2351 | + | |
| 2352 | +class PrefreshmanElement < Dry::Struct | |
| 2353 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2354 | + attribute :prefreshman_class, PrefreshmanClass.optional | |
| 2355 | + attribute :string, Types::String.optional | |
| 2356 | + | |
| 2357 | + def self.from_dynamic!(d) | |
| 2358 | + if schema[:null_array].right.valid? d | |
| 2359 | + return new(null_array: d, prefreshman_class: nil, string: nil) | |
| 2360 | + end | |
| 2361 | + begin | |
| 2362 | + value = PrefreshmanClass.from_dynamic!(d) | |
| 2363 | + if schema[:prefreshman_class].right.valid? value | |
| 2364 | + return new(prefreshman_class: value, null_array: nil, string: nil) | |
| 2365 | + end | |
| 2366 | + rescue | |
| 2367 | + end | |
| 2368 | + if schema[:string].right.valid? d | |
| 2369 | + return new(string: d, null_array: nil, prefreshman_class: nil) | |
| 2370 | + end | |
| 2371 | + raise "Invalid union" | |
| 2372 | + end | |
| 2373 | + | |
| 2374 | + def self.from_json!(json) | |
| 2375 | + from_dynamic!(JSON.parse(json)) | |
| 2376 | + end | |
| 2377 | + | |
| 2378 | + def to_dynamic | |
| 2379 | + if null_array != nil | |
| 2380 | + null_array | |
| 2381 | + elsif prefreshman_class != nil | |
| 2382 | + prefreshman_class.to_dynamic | |
| 2383 | + elsif string != nil | |
| 2384 | + string | |
| 2385 | + end | |
| 2386 | + end | |
| 2387 | + | |
| 2388 | + def to_json(options = nil) | |
| 2389 | + JSON.generate(to_dynamic, options) | |
| 2390 | + end | |
| 2391 | +end | |
| 2392 | + | |
| 2393 | +class Prehensility < Dry::Struct | |
| 2394 | + attribute :bool, Types::Bool.optional | |
| 2395 | + attribute :monazite_class, MonaziteClass.optional | |
| 2396 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2397 | + | |
| 2398 | + def self.from_dynamic!(d) | |
| 2399 | + if schema[:bool].right.valid? d | |
| 2400 | + return new(bool: d, null_array: nil, monazite_class: nil) | |
| 2401 | + end | |
| 2402 | + begin | |
| 2403 | + value = MonaziteClass.from_dynamic!(d) | |
| 2404 | + if schema[:monazite_class].right.valid? value | |
| 2405 | + return new(monazite_class: value, null_array: nil, bool: nil) | |
| 2406 | + end | |
| 2407 | + rescue | |
| 2408 | + end | |
| 2409 | + if schema[:null_array].right.valid? d | |
| 2410 | + return new(null_array: d, bool: nil, monazite_class: nil) | |
| 2411 | + end | |
| 2412 | + raise "Invalid union" | |
| 2413 | + end | |
| 2414 | + | |
| 2415 | + def self.from_json!(json) | |
| 2416 | + from_dynamic!(JSON.parse(json)) | |
| 2417 | + end | |
| 2418 | + | |
| 2419 | + def to_dynamic | |
| 2420 | + if bool != nil | |
| 2421 | + bool | |
| 2422 | + elsif monazite_class != nil | |
| 2423 | + monazite_class.to_dynamic | |
| 2424 | + elsif null_array != nil | |
| 2425 | + null_array | |
| 2426 | + end | |
| 2427 | + end | |
| 2428 | + | |
| 2429 | + def to_json(options = nil) | |
| 2430 | + JSON.generate(to_dynamic, options) | |
| 2431 | + end | |
| 2432 | +end | |
| 2433 | + | |
| 2434 | +class Prevoidance < Dry::Struct | |
| 2435 | + attribute :integer, Types::Integer.optional | |
| 2436 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 2437 | + attribute :monazite_class, MonaziteClass.optional | |
| 2438 | + | |
| 2439 | + def self.from_dynamic!(d) | |
| 2440 | + if schema[:integer].right.valid? d | |
| 2441 | + return new(integer: d, integer_array: nil, monazite_class: nil) | |
| 2442 | + end | |
| 2443 | + if schema[:integer_array].right.valid? d | |
| 2444 | + return new(integer_array: d, monazite_class: nil, integer: nil) | |
| 2445 | + end | |
| 2446 | + begin | |
| 2447 | + value = MonaziteClass.from_dynamic!(d) | |
| 2448 | + if schema[:monazite_class].right.valid? value | |
| 2449 | + return new(monazite_class: value, integer_array: nil, integer: nil) | |
| 2450 | + end | |
| 2451 | + rescue | |
| 2452 | + end | |
| 2453 | + raise "Invalid union" | |
| 2454 | + end | |
| 2455 | + | |
| 2456 | + def self.from_json!(json) | |
| 2457 | + from_dynamic!(JSON.parse(json)) | |
| 2458 | + end | |
| 2459 | + | |
| 2460 | + def to_dynamic | |
| 2461 | + if integer != nil | |
| 2462 | + integer | |
| 2463 | + elsif integer_array != nil | |
| 2464 | + integer_array | |
| 2465 | + elsif monazite_class != nil | |
| 2466 | + monazite_class.to_dynamic | |
| 2467 | + end | |
| 2468 | + end | |
| 2469 | + | |
| 2470 | + def to_json(options = nil) | |
| 2471 | + JSON.generate(to_dynamic, options) | |
| 2472 | + end | |
| 2473 | +end | |
| 2474 | + | |
| 2475 | +class Protext < Dry::Struct | |
| 2476 | + attribute :bool, Types::Bool.optional | |
| 2477 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 2478 | + attribute :monazite_class, MonaziteClass.optional | |
| 2479 | + | |
| 2480 | + def self.from_dynamic!(d) | |
| 2481 | + if schema[:bool].right.valid? d | |
| 2482 | + return new(bool: d, integer_array: nil, monazite_class: nil) | |
| 2483 | + end | |
| 2484 | + if schema[:integer_array].right.valid? d | |
| 2485 | + return new(integer_array: d, bool: nil, monazite_class: nil) | |
| 2486 | + end | |
| 2487 | + begin | |
| 2488 | + value = MonaziteClass.from_dynamic!(d) | |
| 2489 | + if schema[:monazite_class].right.valid? value | |
| 2490 | + return new(monazite_class: value, integer_array: nil, bool: nil) | |
| 2491 | + end | |
| 2492 | + rescue | |
| 2493 | + end | |
| 2494 | + raise "Invalid union" | |
| 2495 | + end | |
| 2496 | + | |
| 2497 | + def self.from_json!(json) | |
| 2498 | + from_dynamic!(JSON.parse(json)) | |
| 2499 | + end | |
| 2500 | + | |
| 2501 | + def to_dynamic | |
| 2502 | + if bool != nil | |
| 2503 | + bool | |
| 2504 | + elsif integer_array != nil | |
| 2505 | + integer_array | |
| 2506 | + elsif monazite_class != nil | |
| 2507 | + monazite_class.to_dynamic | |
| 2508 | + end | |
| 2509 | + end | |
| 2510 | + | |
| 2511 | + def to_json(options = nil) | |
| 2512 | + JSON.generate(to_dynamic, options) | |
| 2513 | + end | |
| 2514 | +end | |
| 2515 | + | |
| 2516 | +class TopLevel < Dry::Struct | |
| 2517 | + attribute :juror, Types.Array(Types.Instance(JurorElement)) | |
| 2518 | + attribute :kongoni, Types.Array(Types.Instance(Kongoni)) | |
| 2519 | + attribute :ladronism, Types.Array(Types.Instance(LadronismElement)) | |
| 2520 | + attribute :landlubberly, Types.Array(Types.Instance(LandlubberlyElement)) | |
| 2521 | + attribute :listener, Types.Array(Types.Instance(Listener)) | |
| 2522 | + attribute :lupus, Types.Array(Types.Instance(LupusElement)) | |
| 2523 | + attribute :maslin, Types.Array(Maslin) | |
| 2524 | + attribute :monazite, Types.Array(Types.Instance(MonaziteElement)) | |
| 2525 | + attribute :monoliteral, Types.Array(Types.Instance(Monoliteral)) | |
| 2526 | + attribute :monotheistically, Types.Array(Types.Instance(MonotheisticallyElement)) | |
| 2527 | + attribute :montage, Types.Array(Types.Instance(Montage)) | |
| 2528 | + attribute :moralness, Types.Array(Types.Instance(Moralness)) | |
| 2529 | + attribute :mowra, Types.Array(MonaziteClass.optional) | |
| 2530 | + attribute :mulishly, Types.Array(Types.Instance(Mulishly)) | |
| 2531 | + attribute :myoscope, Types.Array(Types.Instance(Myoscope)) | |
| 2532 | + attribute :nach, Types.Array(Types.Array(Types::Integer.optional).optional) | |
| 2533 | + attribute :neuromastic, Types.Array(Types.Instance(Neuromastic)) | |
| 2534 | + attribute :noncontributing, Types.Array(Noncontributing) | |
| 2535 | + attribute :nonnervous, Types.Array(Types.Instance(Nonnervous)) | |
| 2536 | + attribute :nonvaluation, Types.Array(Types.Instance(Nonvaluation)) | |
| 2537 | + attribute :occupationalist, Types.Array(Types.Instance(OccupationalistElement)) | |
| 2538 | + attribute :outrival, Types.Array(Types.Instance(OutrivalElement)) | |
| 2539 | + attribute :paleographically, Types.Array(Types.Instance(Paleographically)) | |
| 2540 | + attribute :pamphletwise, Types.Array(Types.Instance(Pamphletwise)) | |
| 2541 | + attribute :pediatrics, Types.Array(Types.Instance(Pediatric)) | |
| 2542 | + attribute :perceptive, Types.Array(Types::Bool) | |
| 2543 | + attribute :piaculum, Types.Array(Types.Instance(PiaculumElement)) | |
| 2544 | + attribute :piccadilly, Types.Array(Types.Instance(Piccadilly)) | |
| 2545 | + attribute :piffler, Types.Array(Types.Instance(Piffler)) | |
| 2546 | + attribute :pithful, Types.Array(Types.Instance(Pithful)) | |
| 2547 | + attribute :placuntitis, Types.Array(Types.Instance(Placuntiti)) | |
| 2548 | + attribute :plectopterous, Types.Array(Types.Instance(Plectopterous)) | |
| 2549 | + attribute :pneumocele, Types.Array(Pneumocele.optional) | |
| 2550 | + attribute :poliorcetic, Types.Array(Types.Instance(Poliorcetic)) | |
| 2551 | + attribute :poormaster, Types.Array(Types.Instance(Poormaster)) | |
| 2552 | + attribute :potwhisky, Types.Array(Types.Instance(PotwhiskyElement)) | |
| 2553 | + attribute :practicalizer, Types.Array(Types.Instance(Practicalizer)) | |
| 2554 | + attribute :prefreshman, Types.Array(Types.Instance(PrefreshmanElement)) | |
| 2555 | + attribute :prehensility, Types.Array(Types.Instance(Prehensility)) | |
| 2556 | + attribute :prevoidance, Types.Array(Types.Instance(Prevoidance)) | |
| 2557 | + attribute :probant, Types.Array(Types::Hash.meta(of: Types::Integer.optional)) | |
| 2558 | + attribute :protext, Types.Array(Types.Instance(Protext)) | |
| 2559 | + | |
| 2560 | + def self.from_dynamic!(d) | |
| 2561 | + d = Types::Hash[d] | |
| 2562 | + new( | |
| 2563 | + juror: d.fetch("juror").map { |x| JurorElement.from_dynamic!(x) }, | |
| 2564 | + kongoni: d.fetch("kongoni").map { |x| Kongoni.from_dynamic!(x) }, | |
| 2565 | + ladronism: d.fetch("ladronism").map { |x| LadronismElement.from_dynamic!(x) }, | |
| 2566 | + landlubberly: d.fetch("landlubberly").map { |x| LandlubberlyElement.from_dynamic!(x) }, | |
| 2567 | + listener: d.fetch("listener").map { |x| Listener.from_dynamic!(x) }, | |
| 2568 | + lupus: d.fetch("lupus").map { |x| LupusElement.from_dynamic!(x) }, | |
| 2569 | + maslin: d.fetch("maslin").map { |x| Maslin.from_dynamic!(x) }, | |
| 2570 | + monazite: d.fetch("monazite").map { |x| MonaziteElement.from_dynamic!(x) }, | |
| 2571 | + monoliteral: d.fetch("monoliteral").map { |x| Monoliteral.from_dynamic!(x) }, | |
| 2572 | + monotheistically: d.fetch("monotheistically").map { |x| MonotheisticallyElement.from_dynamic!(x) }, | |
| 2573 | + montage: d.fetch("montage").map { |x| Montage.from_dynamic!(x) }, | |
| 2574 | + moralness: d.fetch("moralness").map { |x| Moralness.from_dynamic!(x) }, | |
| 2575 | + mowra: d.fetch("mowra").map { |x| x ? MonaziteClass.from_dynamic!(x) : nil }, | |
| 2576 | + mulishly: d.fetch("mulishly").map { |x| Mulishly.from_dynamic!(x) }, | |
| 2577 | + myoscope: d.fetch("myoscope").map { |x| Myoscope.from_dynamic!(x) }, | |
| 2578 | + nach: d.fetch("nach"), | |
| 2579 | + neuromastic: d.fetch("neuromastic").map { |x| Neuromastic.from_dynamic!(x) }, | |
| 2580 | + noncontributing: d.fetch("noncontributing").map { |x| Noncontributing.from_dynamic!(x) }, | |
| 2581 | + nonnervous: d.fetch("nonnervous").map { |x| Nonnervous.from_dynamic!(x) }, | |
| 2582 | + nonvaluation: d.fetch("nonvaluation").map { |x| Nonvaluation.from_dynamic!(x) }, | |
| 2583 | + occupationalist: d.fetch("occupationalist").map { |x| OccupationalistElement.from_dynamic!(x) }, | |
| 2584 | + outrival: d.fetch("outrival").map { |x| OutrivalElement.from_dynamic!(x) }, | |
| 2585 | + paleographically: d.fetch("paleographically").map { |x| Paleographically.from_dynamic!(x) }, | |
| 2586 | + pamphletwise: d.fetch("pamphletwise").map { |x| Pamphletwise.from_dynamic!(x) }, | |
| 2587 | + pediatrics: d.fetch("pediatrics").map { |x| Pediatric.from_dynamic!(x) }, | |
| 2588 | + perceptive: d.fetch("perceptive"), | |
| 2589 | + piaculum: d.fetch("piaculum").map { |x| PiaculumElement.from_dynamic!(x) }, | |
| 2590 | + piccadilly: d.fetch("piccadilly").map { |x| Piccadilly.from_dynamic!(x) }, | |
| 2591 | + piffler: d.fetch("piffler").map { |x| Piffler.from_dynamic!(x) }, | |
| 2592 | + pithful: d.fetch("pithful").map { |x| Pithful.from_dynamic!(x) }, | |
| 2593 | + placuntitis: d.fetch("placuntitis").map { |x| Placuntiti.from_dynamic!(x) }, | |
| 2594 | + plectopterous: d.fetch("plectopterous").map { |x| Plectopterous.from_dynamic!(x) }, | |
| 2595 | + pneumocele: d.fetch("pneumocele").map { |x| x ? Pneumocele.from_dynamic!(x) : nil }, | |
| 2596 | + poliorcetic: d.fetch("poliorcetic").map { |x| Poliorcetic.from_dynamic!(x) }, | |
| 2597 | + poormaster: d.fetch("poormaster").map { |x| Poormaster.from_dynamic!(x) }, | |
| 2598 | + potwhisky: d.fetch("potwhisky").map { |x| PotwhiskyElement.from_dynamic!(x) }, | |
| 2599 | + practicalizer: d.fetch("practicalizer").map { |x| Practicalizer.from_dynamic!(x) }, | |
| 2600 | + prefreshman: d.fetch("prefreshman").map { |x| PrefreshmanElement.from_dynamic!(x) }, | |
| 2601 | + prehensility: d.fetch("prehensility").map { |x| Prehensility.from_dynamic!(x) }, | |
| 2602 | + prevoidance: d.fetch("prevoidance").map { |x| Prevoidance.from_dynamic!(x) }, | |
| 2603 | + probant: d.fetch("probant").map { |x| Types::Hash[x].map { |k, v| [k, v] }.to_h }, | |
| 2604 | + protext: d.fetch("protext").map { |x| Protext.from_dynamic!(x) }, | |
| 2605 | + ) | |
| 2606 | + end | |
| 2607 | + | |
| 2608 | + def self.from_json!(json) | |
| 2609 | + from_dynamic!(JSON.parse(json)) | |
| 2610 | + end | |
| 2611 | + | |
| 2612 | + def to_dynamic | |
| 2613 | + { | |
| 2614 | + "juror" => juror.map { |x| x.to_dynamic }, | |
| 2615 | + "kongoni" => kongoni.map { |x| x.to_dynamic }, | |
| 2616 | + "ladronism" => ladronism.map { |x| x.to_dynamic }, | |
| 2617 | + "landlubberly" => landlubberly.map { |x| x.to_dynamic }, | |
| 2618 | + "listener" => listener.map { |x| x.to_dynamic }, | |
| 2619 | + "lupus" => lupus.map { |x| x.to_dynamic }, | |
| 2620 | + "maslin" => maslin.map { |x| x.to_dynamic }, | |
| 2621 | + "monazite" => monazite.map { |x| x.to_dynamic }, | |
| 2622 | + "monoliteral" => monoliteral.map { |x| x.to_dynamic }, | |
| 2623 | + "monotheistically" => monotheistically.map { |x| x.to_dynamic }, | |
| 2624 | + "montage" => montage.map { |x| x.to_dynamic }, | |
| 2625 | + "moralness" => moralness.map { |x| x.to_dynamic }, | |
| 2626 | + "mowra" => mowra.map { |x| x&.to_dynamic }, | |
| 2627 | + "mulishly" => mulishly.map { |x| x.to_dynamic }, | |
| 2628 | + "myoscope" => myoscope.map { |x| x.to_dynamic }, | |
| 2629 | + "nach" => nach, | |
| 2630 | + "neuromastic" => neuromastic.map { |x| x.to_dynamic }, | |
| 2631 | + "noncontributing" => noncontributing.map { |x| x.to_dynamic }, | |
| 2632 | + "nonnervous" => nonnervous.map { |x| x.to_dynamic }, | |
| 2633 | + "nonvaluation" => nonvaluation.map { |x| x.to_dynamic }, | |
| 2634 | + "occupationalist" => occupationalist.map { |x| x.to_dynamic }, | |
| 2635 | + "outrival" => outrival.map { |x| x.to_dynamic }, | |
| 2636 | + "paleographically" => paleographically.map { |x| x.to_dynamic }, | |
| 2637 | + "pamphletwise" => pamphletwise.map { |x| x.to_dynamic }, | |
| 2638 | + "pediatrics" => pediatrics.map { |x| x.to_dynamic }, | |
| 2639 | + "perceptive" => perceptive, | |
| 2640 | + "piaculum" => piaculum.map { |x| x.to_dynamic }, | |
| 2641 | + "piccadilly" => piccadilly.map { |x| x.to_dynamic }, | |
| 2642 | + "piffler" => piffler.map { |x| x.to_dynamic }, | |
| 2643 | + "pithful" => pithful.map { |x| x.to_dynamic }, | |
| 2644 | + "placuntitis" => placuntitis.map { |x| x.to_dynamic }, | |
| 2645 | + "plectopterous" => plectopterous.map { |x| x.to_dynamic }, | |
| 2646 | + "pneumocele" => pneumocele.map { |x| x&.to_dynamic }, | |
| 2647 | + "poliorcetic" => poliorcetic.map { |x| x.to_dynamic }, | |
| 2648 | + "poormaster" => poormaster.map { |x| x.to_dynamic }, | |
| 2649 | + "potwhisky" => potwhisky.map { |x| x.to_dynamic }, | |
| 2650 | + "practicalizer" => practicalizer.map { |x| x.to_dynamic }, | |
| 2651 | + "prefreshman" => prefreshman.map { |x| x.to_dynamic }, | |
| 2652 | + "prehensility" => prehensility.map { |x| x.to_dynamic }, | |
| 2653 | + "prevoidance" => prevoidance.map { |x| x.to_dynamic }, | |
| 2654 | + "probant" => probant, | |
| 2655 | + "protext" => protext.map { |x| x.to_dynamic }, | |
| 2656 | + } | |
| 2657 | + end | |
| 2658 | + | |
| 2659 | + def to_json(options = nil) | |
| 2660 | + JSON.generate(to_dynamic, options) | |
| 2661 | + end | |
| 2662 | +end |
Test case
1 generated file · +3,113 −0test/inputs/json/priority/combinations4.json
Arubydefault / TopLevel.rb+3,113 −0
| @@ -0,0 +1,3113 @@ | ||
| 1 | +# This code may look unusually verbose for Ruby (and it is), but | |
| 2 | +# it performs some subtle and complex validation of JSON data. | |
| 3 | +# | |
| 4 | +# To parse this JSON, add 'dry-struct' and 'dry-types' gems, then do: | |
| 5 | +# | |
| 6 | +# top_level = TopLevel.from_json! "{…}" | |
| 7 | +# puts top_level.wrothy.first | |
| 8 | +# | |
| 9 | +# If from_json! succeeds, the value returned matches the schema. | |
| 10 | + | |
| 11 | +require 'json' | |
| 12 | +require 'dry-types' | |
| 13 | +require 'dry-struct' | |
| 14 | + | |
| 15 | +module Types | |
| 16 | + include Dry.Types(default: :nominal) | |
| 17 | + | |
| 18 | + Integer = Strict::Integer | |
| 19 | + Nil = Strict::Nil | |
| 20 | + Bool = Strict::Bool | |
| 21 | + Hash = Strict::Hash | |
| 22 | + String = Strict::String | |
| 23 | + Double = Strict::Float | Strict::Integer | |
| 24 | +end | |
| 25 | + | |
| 26 | +class Protrusive < Dry::Struct | |
| 27 | + attribute :double, Types::Double.optional | |
| 28 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 29 | + | |
| 30 | + def self.from_dynamic!(d) | |
| 31 | + if schema[:double].right.valid? d | |
| 32 | + return new(double: d, union_array: nil) | |
| 33 | + end | |
| 34 | + if schema[:union_array].right.valid? d | |
| 35 | + return new(union_array: d, double: nil) | |
| 36 | + end | |
| 37 | + raise "Invalid union" | |
| 38 | + end | |
| 39 | + | |
| 40 | + def self.from_json!(json) | |
| 41 | + from_dynamic!(JSON.parse(json)) | |
| 42 | + end | |
| 43 | + | |
| 44 | + def to_dynamic | |
| 45 | + if double != nil | |
| 46 | + double | |
| 47 | + elsif union_array != nil | |
| 48 | + union_array | |
| 49 | + end | |
| 50 | + end | |
| 51 | + | |
| 52 | + def to_json(options = nil) | |
| 53 | + JSON.generate(to_dynamic, options) | |
| 54 | + end | |
| 55 | +end | |
| 56 | + | |
| 57 | +class PulpitismClass < Dry::Struct | |
| 58 | + attribute :abnet, Types::Nil | |
| 59 | + attribute :buckhorn, Types::Nil | |
| 60 | + attribute :calciform, Types::Nil | |
| 61 | + attribute :chelophore, Types::Nil | |
| 62 | + attribute :cogitation, Types::Nil | |
| 63 | + attribute :decreeable, Types::Nil | |
| 64 | + attribute :despicable, Types::Nil | |
| 65 | + attribute :isodiazo, Types::Nil | |
| 66 | + attribute :jadedly, Types::Nil | |
| 67 | + attribute :leptochlorite, Types::Nil | |
| 68 | + attribute :nursling, Types::Nil | |
| 69 | + attribute :palamedean, Types::Nil | |
| 70 | + attribute :photoheliograph, Types::Nil | |
| 71 | + attribute :pipewood, Types::Nil | |
| 72 | + attribute :roberd, Types::Nil | |
| 73 | + attribute :statable, Types::Nil | |
| 74 | + attribute :superassume, Types::Nil | |
| 75 | + attribute :syllabe, Types::Nil | |
| 76 | + attribute :toughhead, Types::Nil | |
| 77 | + attribute :underburn, Types::Nil | |
| 78 | + | |
| 79 | + def self.from_dynamic!(d) | |
| 80 | + d = Types::Hash[d] | |
| 81 | + new( | |
| 82 | + abnet: d.fetch("abnet"), | |
| 83 | + buckhorn: d.fetch("buckhorn"), | |
| 84 | + calciform: d.fetch("calciform"), | |
| 85 | + chelophore: d.fetch("chelophore"), | |
| 86 | + cogitation: d.fetch("cogitation"), | |
| 87 | + decreeable: d.fetch("decreeable"), | |
| 88 | + despicable: d.fetch("despicable"), | |
| 89 | + isodiazo: d.fetch("isodiazo"), | |
| 90 | + jadedly: d.fetch("jadedly"), | |
| 91 | + leptochlorite: d.fetch("leptochlorite"), | |
| 92 | + nursling: d.fetch("nursling"), | |
| 93 | + palamedean: d.fetch("palamedean"), | |
| 94 | + photoheliograph: d.fetch("photoheliograph"), | |
| 95 | + pipewood: d.fetch("pipewood"), | |
| 96 | + roberd: d.fetch("roberd"), | |
| 97 | + statable: d.fetch("statable"), | |
| 98 | + superassume: d.fetch("superassume"), | |
| 99 | + syllabe: d.fetch("syllabe"), | |
| 100 | + toughhead: d.fetch("toughhead"), | |
| 101 | + underburn: d.fetch("underburn"), | |
| 102 | + ) | |
| 103 | + end | |
| 104 | + | |
| 105 | + def self.from_json!(json) | |
| 106 | + from_dynamic!(JSON.parse(json)) | |
| 107 | + end | |
| 108 | + | |
| 109 | + def to_dynamic | |
| 110 | + { | |
| 111 | + "abnet" => abnet, | |
| 112 | + "buckhorn" => buckhorn, | |
| 113 | + "calciform" => calciform, | |
| 114 | + "chelophore" => chelophore, | |
| 115 | + "cogitation" => cogitation, | |
| 116 | + "decreeable" => decreeable, | |
| 117 | + "despicable" => despicable, | |
| 118 | + "isodiazo" => isodiazo, | |
| 119 | + "jadedly" => jadedly, | |
| 120 | + "leptochlorite" => leptochlorite, | |
| 121 | + "nursling" => nursling, | |
| 122 | + "palamedean" => palamedean, | |
| 123 | + "photoheliograph" => photoheliograph, | |
| 124 | + "pipewood" => pipewood, | |
| 125 | + "roberd" => roberd, | |
| 126 | + "statable" => statable, | |
| 127 | + "superassume" => superassume, | |
| 128 | + "syllabe" => syllabe, | |
| 129 | + "toughhead" => toughhead, | |
| 130 | + "underburn" => underburn, | |
| 131 | + } | |
| 132 | + end | |
| 133 | + | |
| 134 | + def to_json(options = nil) | |
| 135 | + JSON.generate(to_dynamic, options) | |
| 136 | + end | |
| 137 | +end | |
| 138 | + | |
| 139 | +class PulpitismElement < Dry::Struct | |
| 140 | + attribute :double, Types::Double.optional | |
| 141 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 142 | + attribute :pulpitism_class, PulpitismClass.optional | |
| 143 | + | |
| 144 | + def self.from_dynamic!(d) | |
| 145 | + if schema[:double].right.valid? d | |
| 146 | + return new(double: d, integer_array: nil, pulpitism_class: nil) | |
| 147 | + end | |
| 148 | + if schema[:integer_array].right.valid? d | |
| 149 | + return new(integer_array: d, pulpitism_class: nil, double: nil) | |
| 150 | + end | |
| 151 | + begin | |
| 152 | + value = PulpitismClass.from_dynamic!(d) | |
| 153 | + if schema[:pulpitism_class].right.valid? value | |
| 154 | + return new(pulpitism_class: value, integer_array: nil, double: nil) | |
| 155 | + end | |
| 156 | + rescue | |
| 157 | + end | |
| 158 | + raise "Invalid union" | |
| 159 | + end | |
| 160 | + | |
| 161 | + def self.from_json!(json) | |
| 162 | + from_dynamic!(JSON.parse(json)) | |
| 163 | + end | |
| 164 | + | |
| 165 | + def to_dynamic | |
| 166 | + if double != nil | |
| 167 | + double | |
| 168 | + elsif integer_array != nil | |
| 169 | + integer_array | |
| 170 | + elsif pulpitism_class != nil | |
| 171 | + pulpitism_class.to_dynamic | |
| 172 | + end | |
| 173 | + end | |
| 174 | + | |
| 175 | + def to_json(options = nil) | |
| 176 | + JSON.generate(to_dynamic, options) | |
| 177 | + end | |
| 178 | +end | |
| 179 | + | |
| 180 | +class PyodermiaClass < Dry::Struct | |
| 181 | + attribute :aphoristically, Types::Nil | |
| 182 | + attribute :apophyllous, Types::Nil | |
| 183 | + attribute :cognize, Types::Nil | |
| 184 | + attribute :dermonosology, Types::Nil | |
| 185 | + attribute :gyppo, Types::Nil | |
| 186 | + attribute :ither, Types::Nil | |
| 187 | + attribute :juglandaceous, Types::Nil | |
| 188 | + attribute :litho, Types::Nil | |
| 189 | + attribute :macropterous, Types::Nil | |
| 190 | + attribute :photographer, Types::Nil | |
| 191 | + attribute :romancing, Types::Nil | |
| 192 | + attribute :rumness, Types::Nil | |
| 193 | + attribute :somniloquist, Types::Nil | |
| 194 | + attribute :stressfully, Types::Nil | |
| 195 | + attribute :tactically, Types::Nil | |
| 196 | + attribute :tracheophony, Types::Nil | |
| 197 | + attribute :unappositely, Types::Nil | |
| 198 | + attribute :unclothedly, Types::Nil | |
| 199 | + attribute :unimplied, Types::Nil | |
| 200 | + attribute :unsyncopated, Types::Nil | |
| 201 | + | |
| 202 | + def self.from_dynamic!(d) | |
| 203 | + d = Types::Hash[d] | |
| 204 | + new( | |
| 205 | + aphoristically: d.fetch("aphoristically"), | |
| 206 | + apophyllous: d.fetch("apophyllous"), | |
| 207 | + cognize: d.fetch("cognize"), | |
| 208 | + dermonosology: d.fetch("dermonosology"), | |
| 209 | + gyppo: d.fetch("Gyppo"), | |
| 210 | + ither: d.fetch("ither"), | |
| 211 | + juglandaceous: d.fetch("juglandaceous"), | |
| 212 | + litho: d.fetch("litho"), | |
| 213 | + macropterous: d.fetch("macropterous"), | |
| 214 | + photographer: d.fetch("photographer"), | |
| 215 | + romancing: d.fetch("romancing"), | |
| 216 | + rumness: d.fetch("rumness"), | |
| 217 | + somniloquist: d.fetch("somniloquist"), | |
| 218 | + stressfully: d.fetch("stressfully"), | |
| 219 | + tactically: d.fetch("tactically"), | |
| 220 | + tracheophony: d.fetch("tracheophony"), | |
| 221 | + unappositely: d.fetch("unappositely"), | |
| 222 | + unclothedly: d.fetch("unclothedly"), | |
| 223 | + unimplied: d.fetch("unimplied"), | |
| 224 | + unsyncopated: d.fetch("unsyncopated"), | |
| 225 | + ) | |
| 226 | + end | |
| 227 | + | |
| 228 | + def self.from_json!(json) | |
| 229 | + from_dynamic!(JSON.parse(json)) | |
| 230 | + end | |
| 231 | + | |
| 232 | + def to_dynamic | |
| 233 | + { | |
| 234 | + "aphoristically" => aphoristically, | |
| 235 | + "apophyllous" => apophyllous, | |
| 236 | + "cognize" => cognize, | |
| 237 | + "dermonosology" => dermonosology, | |
| 238 | + "Gyppo" => gyppo, | |
| 239 | + "ither" => ither, | |
| 240 | + "juglandaceous" => juglandaceous, | |
| 241 | + "litho" => litho, | |
| 242 | + "macropterous" => macropterous, | |
| 243 | + "photographer" => photographer, | |
| 244 | + "romancing" => romancing, | |
| 245 | + "rumness" => rumness, | |
| 246 | + "somniloquist" => somniloquist, | |
| 247 | + "stressfully" => stressfully, | |
| 248 | + "tactically" => tactically, | |
| 249 | + "tracheophony" => tracheophony, | |
| 250 | + "unappositely" => unappositely, | |
| 251 | + "unclothedly" => unclothedly, | |
| 252 | + "unimplied" => unimplied, | |
| 253 | + "unsyncopated" => unsyncopated, | |
| 254 | + } | |
| 255 | + end | |
| 256 | + | |
| 257 | + def to_json(options = nil) | |
| 258 | + JSON.generate(to_dynamic, options) | |
| 259 | + end | |
| 260 | +end | |
| 261 | + | |
| 262 | +class PyodermiaElement < Dry::Struct | |
| 263 | + attribute :integer, Types::Integer.optional | |
| 264 | + attribute :pyodermia_class, PyodermiaClass.optional | |
| 265 | + | |
| 266 | + def self.from_dynamic!(d) | |
| 267 | + if schema[:integer].right.valid? d | |
| 268 | + return new(integer: d, pyodermia_class: nil) | |
| 269 | + end | |
| 270 | + begin | |
| 271 | + value = PyodermiaClass.from_dynamic!(d) | |
| 272 | + if schema[:pyodermia_class].right.valid? value | |
| 273 | + return new(pyodermia_class: value, integer: nil) | |
| 274 | + end | |
| 275 | + rescue | |
| 276 | + end | |
| 277 | + raise "Invalid union" | |
| 278 | + end | |
| 279 | + | |
| 280 | + def self.from_json!(json) | |
| 281 | + from_dynamic!(JSON.parse(json)) | |
| 282 | + end | |
| 283 | + | |
| 284 | + def to_dynamic | |
| 285 | + if integer != nil | |
| 286 | + integer | |
| 287 | + elsif pyodermia_class != nil | |
| 288 | + pyodermia_class.to_dynamic | |
| 289 | + end | |
| 290 | + end | |
| 291 | + | |
| 292 | + def to_json(options = nil) | |
| 293 | + JSON.generate(to_dynamic, options) | |
| 294 | + end | |
| 295 | +end | |
| 296 | + | |
| 297 | +class QuebrachineClass < Dry::Struct | |
| 298 | + attribute :catharticalness, Types::Double | |
| 299 | + attribute :chirotherium, Types::Integer | |
| 300 | + attribute :disdiapason, Types::String | |
| 301 | + attribute :homocerc, Types::Bool | |
| 302 | + attribute :nonbookish, Types::Nil | |
| 303 | + | |
| 304 | + def self.from_dynamic!(d) | |
| 305 | + d = Types::Hash[d] | |
| 306 | + new( | |
| 307 | + catharticalness: d.fetch("catharticalness"), | |
| 308 | + chirotherium: d.fetch("Chirotherium"), | |
| 309 | + disdiapason: d.fetch("disdiapason"), | |
| 310 | + homocerc: d.fetch("homocerc"), | |
| 311 | + nonbookish: d.fetch("nonbookish"), | |
| 312 | + ) | |
| 313 | + end | |
| 314 | + | |
| 315 | + def self.from_json!(json) | |
| 316 | + from_dynamic!(JSON.parse(json)) | |
| 317 | + end | |
| 318 | + | |
| 319 | + def to_dynamic | |
| 320 | + { | |
| 321 | + "catharticalness" => catharticalness, | |
| 322 | + "Chirotherium" => chirotherium, | |
| 323 | + "disdiapason" => disdiapason, | |
| 324 | + "homocerc" => homocerc, | |
| 325 | + "nonbookish" => nonbookish, | |
| 326 | + } | |
| 327 | + end | |
| 328 | + | |
| 329 | + def to_json(options = nil) | |
| 330 | + JSON.generate(to_dynamic, options) | |
| 331 | + end | |
| 332 | +end | |
| 333 | + | |
| 334 | +class QuebrachineElement < Dry::Struct | |
| 335 | + attribute :bool, Types::Bool.optional | |
| 336 | + attribute :null, Types::Nil.optional | |
| 337 | + attribute :quebrachine_class, QuebrachineClass.optional | |
| 338 | + | |
| 339 | + def self.from_dynamic!(d) | |
| 340 | + if schema[:bool].right.valid? d | |
| 341 | + return new(bool: d, quebrachine_class: nil, null: nil) | |
| 342 | + end | |
| 343 | + if schema[:null].right.valid? d | |
| 344 | + return new(null: d, bool: nil, quebrachine_class: nil) | |
| 345 | + end | |
| 346 | + begin | |
| 347 | + value = QuebrachineClass.from_dynamic!(d) | |
| 348 | + if schema[:quebrachine_class].right.valid? value | |
| 349 | + return new(quebrachine_class: value, bool: nil, null: nil) | |
| 350 | + end | |
| 351 | + rescue | |
| 352 | + end | |
| 353 | + raise "Invalid union" | |
| 354 | + end | |
| 355 | + | |
| 356 | + def self.from_json!(json) | |
| 357 | + from_dynamic!(JSON.parse(json)) | |
| 358 | + end | |
| 359 | + | |
| 360 | + def to_dynamic | |
| 361 | + if bool != nil | |
| 362 | + bool | |
| 363 | + elsif quebrachine_class != nil | |
| 364 | + quebrachine_class.to_dynamic | |
| 365 | + else | |
| 366 | + nil | |
| 367 | + end | |
| 368 | + end | |
| 369 | + | |
| 370 | + def to_json(options = nil) | |
| 371 | + JSON.generate(to_dynamic, options) | |
| 372 | + end | |
| 373 | +end | |
| 374 | + | |
| 375 | +class Querier < Dry::Struct | |
| 376 | + attribute :bool, Types::Bool.optional | |
| 377 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 378 | + | |
| 379 | + def self.from_dynamic!(d) | |
| 380 | + if schema[:bool].right.valid? d | |
| 381 | + return new(bool: d, integer_map: nil) | |
| 382 | + end | |
| 383 | + begin | |
| 384 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 385 | + if schema[:integer_map].right.valid? value | |
| 386 | + return new(integer_map: value, bool: nil) | |
| 387 | + end | |
| 388 | + rescue | |
| 389 | + end | |
| 390 | + raise "Invalid union" | |
| 391 | + end | |
| 392 | + | |
| 393 | + def self.from_json!(json) | |
| 394 | + from_dynamic!(JSON.parse(json)) | |
| 395 | + end | |
| 396 | + | |
| 397 | + def to_dynamic | |
| 398 | + if bool != nil | |
| 399 | + bool | |
| 400 | + elsif integer_map != nil | |
| 401 | + integer_map | |
| 402 | + end | |
| 403 | + end | |
| 404 | + | |
| 405 | + def to_json(options = nil) | |
| 406 | + JSON.generate(to_dynamic, options) | |
| 407 | + end | |
| 408 | +end | |
| 409 | + | |
| 410 | +class Rebarbative < Dry::Struct | |
| 411 | + attribute :bool, Types::Bool.optional | |
| 412 | + attribute :double, Types::Double.optional | |
| 413 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 414 | + | |
| 415 | + def self.from_dynamic!(d) | |
| 416 | + if schema[:bool].right.valid? d | |
| 417 | + return new(bool: d, integer_array: nil, double: nil) | |
| 418 | + end | |
| 419 | + if schema[:double].right.valid? d | |
| 420 | + return new(double: d, integer_array: nil, bool: nil) | |
| 421 | + end | |
| 422 | + if schema[:integer_array].right.valid? d | |
| 423 | + return new(integer_array: d, bool: nil, double: nil) | |
| 424 | + end | |
| 425 | + raise "Invalid union" | |
| 426 | + end | |
| 427 | + | |
| 428 | + def self.from_json!(json) | |
| 429 | + from_dynamic!(JSON.parse(json)) | |
| 430 | + end | |
| 431 | + | |
| 432 | + def to_dynamic | |
| 433 | + if bool != nil | |
| 434 | + bool | |
| 435 | + elsif double != nil | |
| 436 | + double | |
| 437 | + elsif integer_array != nil | |
| 438 | + integer_array | |
| 439 | + end | |
| 440 | + end | |
| 441 | + | |
| 442 | + def to_json(options = nil) | |
| 443 | + JSON.generate(to_dynamic, options) | |
| 444 | + end | |
| 445 | +end | |
| 446 | + | |
| 447 | +class Reimagine < Dry::Struct | |
| 448 | + attribute :adducible, Types::Nil.optional | |
| 449 | + attribute :anabolin, Types::Nil.optional | |
| 450 | + attribute :brainy, Types::Nil.optional | |
| 451 | + attribute :catharticalness, Types::Double.optional | |
| 452 | + attribute :chirotherium, Types::Integer.optional | |
| 453 | + attribute :chrysamine, Types::Nil.optional | |
| 454 | + attribute :disdiapason, Types::String.optional | |
| 455 | + attribute :fluxweed, Types::Nil.optional | |
| 456 | + attribute :glaucine, Types::Nil.optional | |
| 457 | + attribute :grobianism, Types::Nil.optional | |
| 458 | + attribute :hermo, Types::Nil.optional | |
| 459 | + attribute :hieroglyphist, Types::Nil.optional | |
| 460 | + attribute :homocerc, Types::Bool.optional | |
| 461 | + attribute :icteroid, Types::Nil.optional | |
| 462 | + attribute :immortal, Types::Nil.optional | |
| 463 | + attribute :impetulant, Types::Nil.optional | |
| 464 | + attribute :irrigate, Types::Nil.optional | |
| 465 | + attribute :myxedema, Types::Nil.optional | |
| 466 | + attribute :nonbookish, Types::Nil.optional | |
| 467 | + attribute :onyx, Types::Nil.optional | |
| 468 | + attribute :repasser, Types::Nil.optional | |
| 469 | + attribute :septomarginal, Types::Nil.optional | |
| 470 | + attribute :subdie, Types::Nil.optional | |
| 471 | + attribute :tibiometatarsal, Types::Nil.optional | |
| 472 | + attribute :waltzlike, Types::Nil.optional | |
| 473 | + | |
| 474 | + def self.from_dynamic!(d) | |
| 475 | + d = Types::Hash[d] | |
| 476 | + new( | |
| 477 | + adducible: d["adducible"], | |
| 478 | + anabolin: d["anabolin"], | |
| 479 | + brainy: d["brainy"], | |
| 480 | + catharticalness: d["catharticalness"], | |
| 481 | + chirotherium: d["Chirotherium"], | |
| 482 | + chrysamine: d["chrysamine"], | |
| 483 | + disdiapason: d["disdiapason"], | |
| 484 | + fluxweed: d["fluxweed"], | |
| 485 | + glaucine: d["glaucine"], | |
| 486 | + grobianism: d["grobianism"], | |
| 487 | + hermo: d["Hermo"], | |
| 488 | + hieroglyphist: d["hieroglyphist"], | |
| 489 | + homocerc: d["homocerc"], | |
| 490 | + icteroid: d["icteroid"], | |
| 491 | + immortal: d["immortal"], | |
| 492 | + impetulant: d["impetulant"], | |
| 493 | + irrigate: d["irrigate"], | |
| 494 | + myxedema: d["myxedema"], | |
| 495 | + nonbookish: d["nonbookish"], | |
| 496 | + onyx: d["onyx"], | |
| 497 | + repasser: d["repasser"], | |
| 498 | + septomarginal: d["septomarginal"], | |
| 499 | + subdie: d["subdie"], | |
| 500 | + tibiometatarsal: d["tibiometatarsal"], | |
| 501 | + waltzlike: d["waltzlike"], | |
| 502 | + ) | |
| 503 | + end | |
| 504 | + | |
| 505 | + def self.from_json!(json) | |
| 506 | + from_dynamic!(JSON.parse(json)) | |
| 507 | + end | |
| 508 | + | |
| 509 | + def to_dynamic | |
| 510 | + { | |
| 511 | + "adducible" => adducible, | |
| 512 | + "anabolin" => anabolin, | |
| 513 | + "brainy" => brainy, | |
| 514 | + "catharticalness" => catharticalness, | |
| 515 | + "Chirotherium" => chirotherium, | |
| 516 | + "chrysamine" => chrysamine, | |
| 517 | + "disdiapason" => disdiapason, | |
| 518 | + "fluxweed" => fluxweed, | |
| 519 | + "glaucine" => glaucine, | |
| 520 | + "grobianism" => grobianism, | |
| 521 | + "Hermo" => hermo, | |
| 522 | + "hieroglyphist" => hieroglyphist, | |
| 523 | + "homocerc" => homocerc, | |
| 524 | + "icteroid" => icteroid, | |
| 525 | + "immortal" => immortal, | |
| 526 | + "impetulant" => impetulant, | |
| 527 | + "irrigate" => irrigate, | |
| 528 | + "myxedema" => myxedema, | |
| 529 | + "nonbookish" => nonbookish, | |
| 530 | + "onyx" => onyx, | |
| 531 | + "repasser" => repasser, | |
| 532 | + "septomarginal" => septomarginal, | |
| 533 | + "subdie" => subdie, | |
| 534 | + "tibiometatarsal" => tibiometatarsal, | |
| 535 | + "waltzlike" => waltzlike, | |
| 536 | + } | |
| 537 | + end | |
| 538 | + | |
| 539 | + def to_json(options = nil) | |
| 540 | + JSON.generate(to_dynamic, options) | |
| 541 | + end | |
| 542 | +end | |
| 543 | + | |
| 544 | +class Ressaut < Dry::Struct | |
| 545 | + attribute :apperceptive, Types::String | |
| 546 | + attribute :cuttoo, Types::String | |
| 547 | + attribute :douser, Types::String | |
| 548 | + attribute :drinkproof, Types::String | |
| 549 | + attribute :forementioned, Types::String | |
| 550 | + attribute :freesia, Types::String | |
| 551 | + attribute :genevieve, Types::String | |
| 552 | + attribute :hyperdiabolical, Types::String | |
| 553 | + attribute :hypocone, Types::String | |
| 554 | + attribute :irreverentially, Types::String | |
| 555 | + attribute :jumart, Types::String | |
| 556 | + attribute :mimosaceae, Types::String | |
| 557 | + attribute :mollicrush, Types::String | |
| 558 | + attribute :nedder, Types::String | |
| 559 | + attribute :retinasphalt, Types::String | |
| 560 | + attribute :sough, Types::String | |
| 561 | + attribute :steading, Types::String | |
| 562 | + attribute :theopaschitism, Types::String | |
| 563 | + attribute :undurableness, Types::String | |
| 564 | + attribute :unmingleable, Types::String | |
| 565 | + | |
| 566 | + def self.from_dynamic!(d) | |
| 567 | + d = Types::Hash[d] | |
| 568 | + new( | |
| 569 | + apperceptive: d.fetch("apperceptive"), | |
| 570 | + cuttoo: d.fetch("cuttoo"), | |
| 571 | + douser: d.fetch("douser"), | |
| 572 | + drinkproof: d.fetch("drinkproof"), | |
| 573 | + forementioned: d.fetch("forementioned"), | |
| 574 | + freesia: d.fetch("Freesia"), | |
| 575 | + genevieve: d.fetch("Genevieve"), | |
| 576 | + hyperdiabolical: d.fetch("hyperdiabolical"), | |
| 577 | + hypocone: d.fetch("hypocone"), | |
| 578 | + irreverentially: d.fetch("irreverentially"), | |
| 579 | + jumart: d.fetch("jumart"), | |
| 580 | + mimosaceae: d.fetch("Mimosaceae"), | |
| 581 | + mollicrush: d.fetch("mollicrush"), | |
| 582 | + nedder: d.fetch("nedder"), | |
| 583 | + retinasphalt: d.fetch("retinasphalt"), | |
| 584 | + sough: d.fetch("sough"), | |
| 585 | + steading: d.fetch("steading"), | |
| 586 | + theopaschitism: d.fetch("Theopaschitism"), | |
| 587 | + undurableness: d.fetch("undurableness"), | |
| 588 | + unmingleable: d.fetch("unmingleable"), | |
| 589 | + ) | |
| 590 | + end | |
| 591 | + | |
| 592 | + def self.from_json!(json) | |
| 593 | + from_dynamic!(JSON.parse(json)) | |
| 594 | + end | |
| 595 | + | |
| 596 | + def to_dynamic | |
| 597 | + { | |
| 598 | + "apperceptive" => apperceptive, | |
| 599 | + "cuttoo" => cuttoo, | |
| 600 | + "douser" => douser, | |
| 601 | + "drinkproof" => drinkproof, | |
| 602 | + "forementioned" => forementioned, | |
| 603 | + "Freesia" => freesia, | |
| 604 | + "Genevieve" => genevieve, | |
| 605 | + "hyperdiabolical" => hyperdiabolical, | |
| 606 | + "hypocone" => hypocone, | |
| 607 | + "irreverentially" => irreverentially, | |
| 608 | + "jumart" => jumart, | |
| 609 | + "Mimosaceae" => mimosaceae, | |
| 610 | + "mollicrush" => mollicrush, | |
| 611 | + "nedder" => nedder, | |
| 612 | + "retinasphalt" => retinasphalt, | |
| 613 | + "sough" => sough, | |
| 614 | + "steading" => steading, | |
| 615 | + "Theopaschitism" => theopaschitism, | |
| 616 | + "undurableness" => undurableness, | |
| 617 | + "unmingleable" => unmingleable, | |
| 618 | + } | |
| 619 | + end | |
| 620 | + | |
| 621 | + def to_json(options = nil) | |
| 622 | + JSON.generate(to_dynamic, options) | |
| 623 | + end | |
| 624 | +end | |
| 625 | + | |
| 626 | +class Retrocervical < Dry::Struct | |
| 627 | + attribute :integer, Types::Integer.optional | |
| 628 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 629 | + | |
| 630 | + def self.from_dynamic!(d) | |
| 631 | + if schema[:integer].right.valid? d | |
| 632 | + return new(integer: d, union_array: nil) | |
| 633 | + end | |
| 634 | + if schema[:union_array].right.valid? d | |
| 635 | + return new(union_array: d, integer: nil) | |
| 636 | + end | |
| 637 | + raise "Invalid union" | |
| 638 | + end | |
| 639 | + | |
| 640 | + def self.from_json!(json) | |
| 641 | + from_dynamic!(JSON.parse(json)) | |
| 642 | + end | |
| 643 | + | |
| 644 | + def to_dynamic | |
| 645 | + if integer != nil | |
| 646 | + integer | |
| 647 | + elsif union_array != nil | |
| 648 | + union_array | |
| 649 | + end | |
| 650 | + end | |
| 651 | + | |
| 652 | + def to_json(options = nil) | |
| 653 | + JSON.generate(to_dynamic, options) | |
| 654 | + end | |
| 655 | +end | |
| 656 | + | |
| 657 | +class Revert < Dry::Struct | |
| 658 | + attribute :bool, Types::Bool.optional | |
| 659 | + attribute :string, Types::String.optional | |
| 660 | + | |
| 661 | + def self.from_dynamic!(d) | |
| 662 | + if schema[:bool].right.valid? d | |
| 663 | + return new(bool: d, string: nil) | |
| 664 | + end | |
| 665 | + if schema[:string].right.valid? d | |
| 666 | + return new(string: d, bool: nil) | |
| 667 | + end | |
| 668 | + raise "Invalid union" | |
| 669 | + end | |
| 670 | + | |
| 671 | + def self.from_json!(json) | |
| 672 | + from_dynamic!(JSON.parse(json)) | |
| 673 | + end | |
| 674 | + | |
| 675 | + def to_dynamic | |
| 676 | + if bool != nil | |
| 677 | + bool | |
| 678 | + elsif string != nil | |
| 679 | + string | |
| 680 | + end | |
| 681 | + end | |
| 682 | + | |
| 683 | + def to_json(options = nil) | |
| 684 | + JSON.generate(to_dynamic, options) | |
| 685 | + end | |
| 686 | +end | |
| 687 | + | |
| 688 | +class RewriteClass < Dry::Struct | |
| 689 | + attribute :accountancy, Types::Nil | |
| 690 | + attribute :cacotrophic, Types::Nil | |
| 691 | + attribute :contest, Types::Nil | |
| 692 | + attribute :couthily, Types::Nil | |
| 693 | + attribute :falculate, Types::Nil | |
| 694 | + attribute :foreseize, Types::Nil | |
| 695 | + attribute :hyades, Types::Nil | |
| 696 | + attribute :lemnad, Types::Nil | |
| 697 | + attribute :monotheistically, Types::Nil | |
| 698 | + attribute :nonflying, Types::Nil | |
| 699 | + attribute :ptenoglossa, Types::Nil | |
| 700 | + attribute :repatch, Types::Nil | |
| 701 | + attribute :rodman, Types::Nil | |
| 702 | + attribute :strung, Types::Nil | |
| 703 | + attribute :titmal, Types::Nil | |
| 704 | + attribute :twalpennyworth, Types::Nil | |
| 705 | + attribute :unblamable, Types::Nil | |
| 706 | + attribute :vertical, Types::Nil | |
| 707 | + attribute :whiggification, Types::Nil | |
| 708 | + attribute :yardman, Types::Nil | |
| 709 | + | |
| 710 | + def self.from_dynamic!(d) | |
| 711 | + d = Types::Hash[d] | |
| 712 | + new( | |
| 713 | + accountancy: d.fetch("accountancy"), | |
| 714 | + cacotrophic: d.fetch("cacotrophic"), | |
| 715 | + contest: d.fetch("contest"), | |
| 716 | + couthily: d.fetch("couthily"), | |
| 717 | + falculate: d.fetch("falculate"), | |
| 718 | + foreseize: d.fetch("foreseize"), | |
| 719 | + hyades: d.fetch("Hyades"), | |
| 720 | + lemnad: d.fetch("lemnad"), | |
| 721 | + monotheistically: d.fetch("monotheistically"), | |
| 722 | + nonflying: d.fetch("nonflying"), | |
| 723 | + ptenoglossa: d.fetch("Ptenoglossa"), | |
| 724 | + repatch: d.fetch("repatch"), | |
| 725 | + rodman: d.fetch("rodman"), | |
| 726 | + strung: d.fetch("strung"), | |
| 727 | + titmal: d.fetch("titmal"), | |
| 728 | + twalpennyworth: d.fetch("twalpennyworth"), | |
| 729 | + unblamable: d.fetch("unblamable"), | |
| 730 | + vertical: d.fetch("vertical"), | |
| 731 | + whiggification: d.fetch("Whiggification"), | |
| 732 | + yardman: d.fetch("yardman"), | |
| 733 | + ) | |
| 734 | + end | |
| 735 | + | |
| 736 | + def self.from_json!(json) | |
| 737 | + from_dynamic!(JSON.parse(json)) | |
| 738 | + end | |
| 739 | + | |
| 740 | + def to_dynamic | |
| 741 | + { | |
| 742 | + "accountancy" => accountancy, | |
| 743 | + "cacotrophic" => cacotrophic, | |
| 744 | + "contest" => contest, | |
| 745 | + "couthily" => couthily, | |
| 746 | + "falculate" => falculate, | |
| 747 | + "foreseize" => foreseize, | |
| 748 | + "Hyades" => hyades, | |
| 749 | + "lemnad" => lemnad, | |
| 750 | + "monotheistically" => monotheistically, | |
| 751 | + "nonflying" => nonflying, | |
| 752 | + "Ptenoglossa" => ptenoglossa, | |
| 753 | + "repatch" => repatch, | |
| 754 | + "rodman" => rodman, | |
| 755 | + "strung" => strung, | |
| 756 | + "titmal" => titmal, | |
| 757 | + "twalpennyworth" => twalpennyworth, | |
| 758 | + "unblamable" => unblamable, | |
| 759 | + "vertical" => vertical, | |
| 760 | + "Whiggification" => whiggification, | |
| 761 | + "yardman" => yardman, | |
| 762 | + } | |
| 763 | + end | |
| 764 | + | |
| 765 | + def to_json(options = nil) | |
| 766 | + JSON.generate(to_dynamic, options) | |
| 767 | + end | |
| 768 | +end | |
| 769 | + | |
| 770 | +class RewriteElement < Dry::Struct | |
| 771 | + attribute :double, Types::Double.optional | |
| 772 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 773 | + attribute :rewrite_class, RewriteClass.optional | |
| 774 | + | |
| 775 | + def self.from_dynamic!(d) | |
| 776 | + if schema[:double].right.valid? d | |
| 777 | + return new(double: d, null_array: nil, rewrite_class: nil) | |
| 778 | + end | |
| 779 | + if schema[:null_array].right.valid? d | |
| 780 | + return new(null_array: d, rewrite_class: nil, double: nil) | |
| 781 | + end | |
| 782 | + begin | |
| 783 | + value = RewriteClass.from_dynamic!(d) | |
| 784 | + if schema[:rewrite_class].right.valid? value | |
| 785 | + return new(rewrite_class: value, null_array: nil, double: nil) | |
| 786 | + end | |
| 787 | + rescue | |
| 788 | + end | |
| 789 | + raise "Invalid union" | |
| 790 | + end | |
| 791 | + | |
| 792 | + def self.from_json!(json) | |
| 793 | + from_dynamic!(JSON.parse(json)) | |
| 794 | + end | |
| 795 | + | |
| 796 | + def to_dynamic | |
| 797 | + if double != nil | |
| 798 | + double | |
| 799 | + elsif null_array != nil | |
| 800 | + null_array | |
| 801 | + elsif rewrite_class != nil | |
| 802 | + rewrite_class.to_dynamic | |
| 803 | + end | |
| 804 | + end | |
| 805 | + | |
| 806 | + def to_json(options = nil) | |
| 807 | + JSON.generate(to_dynamic, options) | |
| 808 | + end | |
| 809 | +end | |
| 810 | + | |
| 811 | +class Saccoderm < Dry::Struct | |
| 812 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 813 | + attribute :null, Types::Nil.optional | |
| 814 | + attribute :string, Types::String.optional | |
| 815 | + | |
| 816 | + def self.from_dynamic!(d) | |
| 817 | + if schema[:integer_array].right.valid? d | |
| 818 | + return new(integer_array: d, null: nil, string: nil) | |
| 819 | + end | |
| 820 | + if schema[:null].right.valid? d | |
| 821 | + return new(null: d, integer_array: nil, string: nil) | |
| 822 | + end | |
| 823 | + if schema[:string].right.valid? d | |
| 824 | + return new(string: d, integer_array: nil, null: nil) | |
| 825 | + end | |
| 826 | + raise "Invalid union" | |
| 827 | + end | |
| 828 | + | |
| 829 | + def self.from_json!(json) | |
| 830 | + from_dynamic!(JSON.parse(json)) | |
| 831 | + end | |
| 832 | + | |
| 833 | + def to_dynamic | |
| 834 | + if integer_array != nil | |
| 835 | + integer_array | |
| 836 | + elsif string != nil | |
| 837 | + string | |
| 838 | + else | |
| 839 | + nil | |
| 840 | + end | |
| 841 | + end | |
| 842 | + | |
| 843 | + def to_json(options = nil) | |
| 844 | + JSON.generate(to_dynamic, options) | |
| 845 | + end | |
| 846 | +end | |
| 847 | + | |
| 848 | +class SantirClass < Dry::Struct | |
| 849 | + attribute :admiredly, Types::Nil | |
| 850 | + attribute :demicaponier, Types::Nil | |
| 851 | + attribute :epitympanic, Types::Nil | |
| 852 | + attribute :investitor, Types::Nil | |
| 853 | + attribute :lupiform, Types::Nil | |
| 854 | + attribute :monoflagellate, Types::Nil | |
| 855 | + attribute :paleoethnic, Types::Nil | |
| 856 | + attribute :prediscountable, Types::Nil | |
| 857 | + attribute :rhetoricals, Types::Nil | |
| 858 | + attribute :roomth, Types::Nil | |
| 859 | + attribute :saccharose, Types::Nil | |
| 860 | + attribute :septonasal, Types::Nil | |
| 861 | + attribute :serpenticide, Types::Nil | |
| 862 | + attribute :setarious, Types::Nil | |
| 863 | + attribute :spaework, Types::Nil | |
| 864 | + attribute :stylite, Types::Nil | |
| 865 | + attribute :suessiones, Types::Nil | |
| 866 | + attribute :timelily, Types::Nil | |
| 867 | + attribute :unprofaned, Types::Nil | |
| 868 | + attribute :vorticular, Types::Nil | |
| 869 | + | |
| 870 | + def self.from_dynamic!(d) | |
| 871 | + d = Types::Hash[d] | |
| 872 | + new( | |
| 873 | + admiredly: d.fetch("admiredly"), | |
| 874 | + demicaponier: d.fetch("demicaponier"), | |
| 875 | + epitympanic: d.fetch("epitympanic"), | |
| 876 | + investitor: d.fetch("investitor"), | |
| 877 | + lupiform: d.fetch("lupiform"), | |
| 878 | + monoflagellate: d.fetch("monoflagellate"), | |
| 879 | + paleoethnic: d.fetch("paleoethnic"), | |
| 880 | + prediscountable: d.fetch("prediscountable"), | |
| 881 | + rhetoricals: d.fetch("rhetoricals"), | |
| 882 | + roomth: d.fetch("roomth"), | |
| 883 | + saccharose: d.fetch("saccharose"), | |
| 884 | + septonasal: d.fetch("septonasal"), | |
| 885 | + serpenticide: d.fetch("serpenticide"), | |
| 886 | + setarious: d.fetch("setarious"), | |
| 887 | + spaework: d.fetch("spaework"), | |
| 888 | + stylite: d.fetch("stylite"), | |
| 889 | + suessiones: d.fetch("Suessiones"), | |
| 890 | + timelily: d.fetch("timelily"), | |
| 891 | + unprofaned: d.fetch("unprofaned"), | |
| 892 | + vorticular: d.fetch("vorticular"), | |
| 893 | + ) | |
| 894 | + end | |
| 895 | + | |
| 896 | + def self.from_json!(json) | |
| 897 | + from_dynamic!(JSON.parse(json)) | |
| 898 | + end | |
| 899 | + | |
| 900 | + def to_dynamic | |
| 901 | + { | |
| 902 | + "admiredly" => admiredly, | |
| 903 | + "demicaponier" => demicaponier, | |
| 904 | + "epitympanic" => epitympanic, | |
| 905 | + "investitor" => investitor, | |
| 906 | + "lupiform" => lupiform, | |
| 907 | + "monoflagellate" => monoflagellate, | |
| 908 | + "paleoethnic" => paleoethnic, | |
| 909 | + "prediscountable" => prediscountable, | |
| 910 | + "rhetoricals" => rhetoricals, | |
| 911 | + "roomth" => roomth, | |
| 912 | + "saccharose" => saccharose, | |
| 913 | + "septonasal" => septonasal, | |
| 914 | + "serpenticide" => serpenticide, | |
| 915 | + "setarious" => setarious, | |
| 916 | + "spaework" => spaework, | |
| 917 | + "stylite" => stylite, | |
| 918 | + "Suessiones" => suessiones, | |
| 919 | + "timelily" => timelily, | |
| 920 | + "unprofaned" => unprofaned, | |
| 921 | + "vorticular" => vorticular, | |
| 922 | + } | |
| 923 | + end | |
| 924 | + | |
| 925 | + def to_json(options = nil) | |
| 926 | + JSON.generate(to_dynamic, options) | |
| 927 | + end | |
| 928 | +end | |
| 929 | + | |
| 930 | +class SantirElement < Dry::Struct | |
| 931 | + attribute :double, Types::Double.optional | |
| 932 | + attribute :santir_class, SantirClass.optional | |
| 933 | + | |
| 934 | + def self.from_dynamic!(d) | |
| 935 | + if schema[:double].right.valid? d | |
| 936 | + return new(double: d, santir_class: nil) | |
| 937 | + end | |
| 938 | + begin | |
| 939 | + value = SantirClass.from_dynamic!(d) | |
| 940 | + if schema[:santir_class].right.valid? value | |
| 941 | + return new(santir_class: value, double: nil) | |
| 942 | + end | |
| 943 | + rescue | |
| 944 | + end | |
| 945 | + raise "Invalid union" | |
| 946 | + end | |
| 947 | + | |
| 948 | + def self.from_json!(json) | |
| 949 | + from_dynamic!(JSON.parse(json)) | |
| 950 | + end | |
| 951 | + | |
| 952 | + def to_dynamic | |
| 953 | + if double != nil | |
| 954 | + double | |
| 955 | + elsif santir_class != nil | |
| 956 | + santir_class.to_dynamic | |
| 957 | + end | |
| 958 | + end | |
| 959 | + | |
| 960 | + def to_json(options = nil) | |
| 961 | + JSON.generate(to_dynamic, options) | |
| 962 | + end | |
| 963 | +end | |
| 964 | + | |
| 965 | +class Saprophilous < Dry::Struct | |
| 966 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 967 | + attribute :null, Types::Nil.optional | |
| 968 | + attribute :string, Types::String.optional | |
| 969 | + | |
| 970 | + def self.from_dynamic!(d) | |
| 971 | + begin | |
| 972 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 973 | + if schema[:integer_map].right.valid? value | |
| 974 | + return new(integer_map: value, null: nil, string: nil) | |
| 975 | + end | |
| 976 | + rescue | |
| 977 | + end | |
| 978 | + if schema[:null].right.valid? d | |
| 979 | + return new(null: d, integer_map: nil, string: nil) | |
| 980 | + end | |
| 981 | + if schema[:string].right.valid? d | |
| 982 | + return new(string: d, integer_map: nil, null: nil) | |
| 983 | + end | |
| 984 | + raise "Invalid union" | |
| 985 | + end | |
| 986 | + | |
| 987 | + def self.from_json!(json) | |
| 988 | + from_dynamic!(JSON.parse(json)) | |
| 989 | + end | |
| 990 | + | |
| 991 | + def to_dynamic | |
| 992 | + if integer_map != nil | |
| 993 | + integer_map | |
| 994 | + elsif string != nil | |
| 995 | + string | |
| 996 | + else | |
| 997 | + nil | |
| 998 | + end | |
| 999 | + end | |
| 1000 | + | |
| 1001 | + def to_json(options = nil) | |
| 1002 | + JSON.generate(to_dynamic, options) | |
| 1003 | + end | |
| 1004 | +end | |
| 1005 | + | |
| 1006 | +class SaxtenClass < Dry::Struct | |
| 1007 | + attribute :algarrobilla, Types::Nil.optional | |
| 1008 | + attribute :bowgrace, Types::Nil.optional | |
| 1009 | + attribute :catharticalness, Types::Double.optional | |
| 1010 | + attribute :centaurid, Types::Nil.optional | |
| 1011 | + attribute :chirotherium, Types::Integer.optional | |
| 1012 | + attribute :disdiapason, Types::String.optional | |
| 1013 | + attribute :flix, Types::Nil.optional | |
| 1014 | + attribute :germanely, Types::Nil.optional | |
| 1015 | + attribute :homocerc, Types::Bool.optional | |
| 1016 | + attribute :inhume, Types::Nil.optional | |
| 1017 | + attribute :lepidote, Types::Nil.optional | |
| 1018 | + attribute :megalochirous, Types::Nil.optional | |
| 1019 | + attribute :ninepenny, Types::Nil.optional | |
| 1020 | + attribute :nonbookish, Types::Nil.optional | |
| 1021 | + attribute :nondeist, Types::Nil.optional | |
| 1022 | + attribute :nymphaeaceous, Types::Nil.optional | |
| 1023 | + attribute :parietofrontal, Types::Nil.optional | |
| 1024 | + attribute :sancyite, Types::Nil.optional | |
| 1025 | + attribute :subjectivist, Types::Nil.optional | |
| 1026 | + attribute :tibiad, Types::Nil.optional | |
| 1027 | + attribute :transonic, Types::Nil.optional | |
| 1028 | + attribute :tripetalous, Types::Nil.optional | |
| 1029 | + attribute :trunchman, Types::Nil.optional | |
| 1030 | + attribute :urger, Types::Nil.optional | |
| 1031 | + attribute :withdrawnness, Types::Nil.optional | |
| 1032 | + | |
| 1033 | + def self.from_dynamic!(d) | |
| 1034 | + d = Types::Hash[d] | |
| 1035 | + new( | |
| 1036 | + algarrobilla: d["algarrobilla"], | |
| 1037 | + bowgrace: d["bowgrace"], | |
| 1038 | + catharticalness: d["catharticalness"], | |
| 1039 | + centaurid: d["Centaurid"], | |
| 1040 | + chirotherium: d["Chirotherium"], | |
| 1041 | + disdiapason: d["disdiapason"], | |
| 1042 | + flix: d["flix"], | |
| 1043 | + germanely: d["germanely"], | |
| 1044 | + homocerc: d["homocerc"], | |
| 1045 | + inhume: d["inhume"], | |
| 1046 | + lepidote: d["lepidote"], | |
| 1047 | + megalochirous: d["megalochirous"], | |
| 1048 | + ninepenny: d["ninepenny"], | |
| 1049 | + nonbookish: d["nonbookish"], | |
| 1050 | + nondeist: d["nondeist"], | |
| 1051 | + nymphaeaceous: d["nymphaeaceous"], | |
| 1052 | + parietofrontal: d["parietofrontal"], | |
| 1053 | + sancyite: d["sancyite"], | |
| 1054 | + subjectivist: d["subjectivist"], | |
| 1055 | + tibiad: d["tibiad"], | |
| 1056 | + transonic: d["transonic"], | |
| 1057 | + tripetalous: d["tripetalous"], | |
| 1058 | + trunchman: d["trunchman"], | |
| 1059 | + urger: d["urger"], | |
| 1060 | + withdrawnness: d["withdrawnness"], | |
| 1061 | + ) | |
| 1062 | + end | |
| 1063 | + | |
| 1064 | + def self.from_json!(json) | |
| 1065 | + from_dynamic!(JSON.parse(json)) | |
| 1066 | + end | |
| 1067 | + | |
| 1068 | + def to_dynamic | |
| 1069 | + { | |
| 1070 | + "algarrobilla" => algarrobilla, | |
| 1071 | + "bowgrace" => bowgrace, | |
| 1072 | + "catharticalness" => catharticalness, | |
| 1073 | + "Centaurid" => centaurid, | |
| 1074 | + "Chirotherium" => chirotherium, | |
| 1075 | + "disdiapason" => disdiapason, | |
| 1076 | + "flix" => flix, | |
| 1077 | + "germanely" => germanely, | |
| 1078 | + "homocerc" => homocerc, | |
| 1079 | + "inhume" => inhume, | |
| 1080 | + "lepidote" => lepidote, | |
| 1081 | + "megalochirous" => megalochirous, | |
| 1082 | + "ninepenny" => ninepenny, | |
| 1083 | + "nonbookish" => nonbookish, | |
| 1084 | + "nondeist" => nondeist, | |
| 1085 | + "nymphaeaceous" => nymphaeaceous, | |
| 1086 | + "parietofrontal" => parietofrontal, | |
| 1087 | + "sancyite" => sancyite, | |
| 1088 | + "subjectivist" => subjectivist, | |
| 1089 | + "tibiad" => tibiad, | |
| 1090 | + "transonic" => transonic, | |
| 1091 | + "tripetalous" => tripetalous, | |
| 1092 | + "trunchman" => trunchman, | |
| 1093 | + "urger" => urger, | |
| 1094 | + "withdrawnness" => withdrawnness, | |
| 1095 | + } | |
| 1096 | + end | |
| 1097 | + | |
| 1098 | + def to_json(options = nil) | |
| 1099 | + JSON.generate(to_dynamic, options) | |
| 1100 | + end | |
| 1101 | +end | |
| 1102 | + | |
| 1103 | +class SaxtenElement < Dry::Struct | |
| 1104 | + attribute :saxten_class, SaxtenClass.optional | |
| 1105 | + attribute :string, Types::String.optional | |
| 1106 | + | |
| 1107 | + def self.from_dynamic!(d) | |
| 1108 | + begin | |
| 1109 | + value = SaxtenClass.from_dynamic!(d) | |
| 1110 | + if schema[:saxten_class].right.valid? value | |
| 1111 | + return new(saxten_class: value, string: nil) | |
| 1112 | + end | |
| 1113 | + rescue | |
| 1114 | + end | |
| 1115 | + if schema[:string].right.valid? d | |
| 1116 | + return new(string: d, saxten_class: nil) | |
| 1117 | + end | |
| 1118 | + raise "Invalid union" | |
| 1119 | + end | |
| 1120 | + | |
| 1121 | + def self.from_json!(json) | |
| 1122 | + from_dynamic!(JSON.parse(json)) | |
| 1123 | + end | |
| 1124 | + | |
| 1125 | + def to_dynamic | |
| 1126 | + if saxten_class != nil | |
| 1127 | + saxten_class.to_dynamic | |
| 1128 | + elsif string != nil | |
| 1129 | + string | |
| 1130 | + end | |
| 1131 | + end | |
| 1132 | + | |
| 1133 | + def to_json(options = nil) | |
| 1134 | + JSON.generate(to_dynamic, options) | |
| 1135 | + end | |
| 1136 | +end | |
| 1137 | + | |
| 1138 | +class Scatty < Dry::Struct | |
| 1139 | + attribute :aeriferous, Types::Nil | |
| 1140 | + attribute :antical, Types::Nil | |
| 1141 | + attribute :antighostism, Types::Nil | |
| 1142 | + attribute :arcanum, Types::Nil | |
| 1143 | + attribute :autotrophy, Types::Nil | |
| 1144 | + attribute :baronial, Types::Nil | |
| 1145 | + attribute :caffeine, Types::Nil | |
| 1146 | + attribute :gorgoniacean, Types::Nil | |
| 1147 | + attribute :heroical, Types::Nil | |
| 1148 | + attribute :hydropical, Types::Nil | |
| 1149 | + attribute :mechanology, Types::Nil | |
| 1150 | + attribute :musicopoetic, Types::Nil | |
| 1151 | + attribute :officiality, Types::Nil | |
| 1152 | + attribute :oftentimes, Types::Nil | |
| 1153 | + attribute :ophthalmotonometer, Types::Nil | |
| 1154 | + attribute :reflectively, Types::Nil | |
| 1155 | + attribute :springer, Types::Nil | |
| 1156 | + attribute :tabasco, Types::Nil | |
| 1157 | + attribute :teleianthous, Types::Nil | |
| 1158 | + attribute :uncombated, Types::Nil | |
| 1159 | + | |
| 1160 | + def self.from_dynamic!(d) | |
| 1161 | + d = Types::Hash[d] | |
| 1162 | + new( | |
| 1163 | + aeriferous: d.fetch("aeriferous"), | |
| 1164 | + antical: d.fetch("antical"), | |
| 1165 | + antighostism: d.fetch("antighostism"), | |
| 1166 | + arcanum: d.fetch("arcanum"), | |
| 1167 | + autotrophy: d.fetch("autotrophy"), | |
| 1168 | + baronial: d.fetch("baronial"), | |
| 1169 | + caffeine: d.fetch("caffeine"), | |
| 1170 | + gorgoniacean: d.fetch("gorgoniacean"), | |
| 1171 | + heroical: d.fetch("heroical"), | |
| 1172 | + hydropical: d.fetch("hydropical"), | |
| 1173 | + mechanology: d.fetch("mechanology"), | |
| 1174 | + musicopoetic: d.fetch("musicopoetic"), | |
| 1175 | + officiality: d.fetch("officiality"), | |
| 1176 | + oftentimes: d.fetch("oftentimes"), | |
| 1177 | + ophthalmotonometer: d.fetch("ophthalmotonometer"), | |
| 1178 | + reflectively: d.fetch("reflectively"), | |
| 1179 | + springer: d.fetch("springer"), | |
| 1180 | + tabasco: d.fetch("Tabasco"), | |
| 1181 | + teleianthous: d.fetch("teleianthous"), | |
| 1182 | + uncombated: d.fetch("uncombated"), | |
| 1183 | + ) | |
| 1184 | + end | |
| 1185 | + | |
| 1186 | + def self.from_json!(json) | |
| 1187 | + from_dynamic!(JSON.parse(json)) | |
| 1188 | + end | |
| 1189 | + | |
| 1190 | + def to_dynamic | |
| 1191 | + { | |
| 1192 | + "aeriferous" => aeriferous, | |
| 1193 | + "antical" => antical, | |
| 1194 | + "antighostism" => antighostism, | |
| 1195 | + "arcanum" => arcanum, | |
| 1196 | + "autotrophy" => autotrophy, | |
| 1197 | + "baronial" => baronial, | |
| 1198 | + "caffeine" => caffeine, | |
| 1199 | + "gorgoniacean" => gorgoniacean, | |
| 1200 | + "heroical" => heroical, | |
| 1201 | + "hydropical" => hydropical, | |
| 1202 | + "mechanology" => mechanology, | |
| 1203 | + "musicopoetic" => musicopoetic, | |
| 1204 | + "officiality" => officiality, | |
| 1205 | + "oftentimes" => oftentimes, | |
| 1206 | + "ophthalmotonometer" => ophthalmotonometer, | |
| 1207 | + "reflectively" => reflectively, | |
| 1208 | + "springer" => springer, | |
| 1209 | + "Tabasco" => tabasco, | |
| 1210 | + "teleianthous" => teleianthous, | |
| 1211 | + "uncombated" => uncombated, | |
| 1212 | + } | |
| 1213 | + end | |
| 1214 | + | |
| 1215 | + def to_json(options = nil) | |
| 1216 | + JSON.generate(to_dynamic, options) | |
| 1217 | + end | |
| 1218 | +end | |
| 1219 | + | |
| 1220 | +class Scoffer < Dry::Struct | |
| 1221 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1222 | + attribute :null, Types::Nil.optional | |
| 1223 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1224 | + | |
| 1225 | + def self.from_dynamic!(d) | |
| 1226 | + begin | |
| 1227 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1228 | + if schema[:integer_map].right.valid? value | |
| 1229 | + return new(integer_map: value, null_array: nil, null: nil) | |
| 1230 | + end | |
| 1231 | + rescue | |
| 1232 | + end | |
| 1233 | + if schema[:null].right.valid? d | |
| 1234 | + return new(null: d, null_array: nil, integer_map: nil) | |
| 1235 | + end | |
| 1236 | + if schema[:null_array].right.valid? d | |
| 1237 | + return new(null_array: d, integer_map: nil, null: nil) | |
| 1238 | + end | |
| 1239 | + raise "Invalid union" | |
| 1240 | + end | |
| 1241 | + | |
| 1242 | + def self.from_json!(json) | |
| 1243 | + from_dynamic!(JSON.parse(json)) | |
| 1244 | + end | |
| 1245 | + | |
| 1246 | + def to_dynamic | |
| 1247 | + if integer_map != nil | |
| 1248 | + integer_map | |
| 1249 | + elsif null_array != nil | |
| 1250 | + null_array | |
| 1251 | + else | |
| 1252 | + nil | |
| 1253 | + end | |
| 1254 | + end | |
| 1255 | + | |
| 1256 | + def to_json(options = nil) | |
| 1257 | + JSON.generate(to_dynamic, options) | |
| 1258 | + end | |
| 1259 | +end | |
| 1260 | + | |
| 1261 | +class Scrampum < Dry::Struct | |
| 1262 | + attribute :bool, Types::Bool.optional | |
| 1263 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1264 | + attribute :null, Types::Nil.optional | |
| 1265 | + | |
| 1266 | + def self.from_dynamic!(d) | |
| 1267 | + if schema[:bool].right.valid? d | |
| 1268 | + return new(bool: d, integer_array: nil, null: nil) | |
| 1269 | + end | |
| 1270 | + if schema[:integer_array].right.valid? d | |
| 1271 | + return new(integer_array: d, bool: nil, null: nil) | |
| 1272 | + end | |
| 1273 | + if schema[:null].right.valid? d | |
| 1274 | + return new(null: d, integer_array: nil, bool: nil) | |
| 1275 | + end | |
| 1276 | + raise "Invalid union" | |
| 1277 | + end | |
| 1278 | + | |
| 1279 | + def self.from_json!(json) | |
| 1280 | + from_dynamic!(JSON.parse(json)) | |
| 1281 | + end | |
| 1282 | + | |
| 1283 | + def to_dynamic | |
| 1284 | + if bool != nil | |
| 1285 | + bool | |
| 1286 | + elsif integer_array != nil | |
| 1287 | + integer_array | |
| 1288 | + else | |
| 1289 | + nil | |
| 1290 | + end | |
| 1291 | + end | |
| 1292 | + | |
| 1293 | + def to_json(options = nil) | |
| 1294 | + JSON.generate(to_dynamic, options) | |
| 1295 | + end | |
| 1296 | +end | |
| 1297 | + | |
| 1298 | +class Serpentinic < Dry::Struct | |
| 1299 | + attribute :double, Types::Double.optional | |
| 1300 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 1301 | + | |
| 1302 | + def self.from_dynamic!(d) | |
| 1303 | + if schema[:double].right.valid? d | |
| 1304 | + return new(double: d, integer_array: nil) | |
| 1305 | + end | |
| 1306 | + if schema[:integer_array].right.valid? d | |
| 1307 | + return new(integer_array: d, double: nil) | |
| 1308 | + end | |
| 1309 | + raise "Invalid union" | |
| 1310 | + end | |
| 1311 | + | |
| 1312 | + def self.from_json!(json) | |
| 1313 | + from_dynamic!(JSON.parse(json)) | |
| 1314 | + end | |
| 1315 | + | |
| 1316 | + def to_dynamic | |
| 1317 | + if double != nil | |
| 1318 | + double | |
| 1319 | + elsif integer_array != nil | |
| 1320 | + integer_array | |
| 1321 | + end | |
| 1322 | + end | |
| 1323 | + | |
| 1324 | + def to_json(options = nil) | |
| 1325 | + JSON.generate(to_dynamic, options) | |
| 1326 | + end | |
| 1327 | +end | |
| 1328 | + | |
| 1329 | +class Shadowable < Dry::Struct | |
| 1330 | + attribute :bool, Types::Bool.optional | |
| 1331 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 1332 | + | |
| 1333 | + def self.from_dynamic!(d) | |
| 1334 | + if schema[:bool].right.valid? d | |
| 1335 | + return new(bool: d, union_array: nil) | |
| 1336 | + end | |
| 1337 | + if schema[:union_array].right.valid? d | |
| 1338 | + return new(union_array: d, bool: nil) | |
| 1339 | + end | |
| 1340 | + raise "Invalid union" | |
| 1341 | + end | |
| 1342 | + | |
| 1343 | + def self.from_json!(json) | |
| 1344 | + from_dynamic!(JSON.parse(json)) | |
| 1345 | + end | |
| 1346 | + | |
| 1347 | + def to_dynamic | |
| 1348 | + if bool != nil | |
| 1349 | + bool | |
| 1350 | + elsif union_array != nil | |
| 1351 | + union_array | |
| 1352 | + end | |
| 1353 | + end | |
| 1354 | + | |
| 1355 | + def to_json(options = nil) | |
| 1356 | + JSON.generate(to_dynamic, options) | |
| 1357 | + end | |
| 1358 | +end | |
| 1359 | + | |
| 1360 | +class SisteringClass < Dry::Struct | |
| 1361 | + attribute :amphicarpic, Types::Nil | |
| 1362 | + attribute :chianti, Types::Nil | |
| 1363 | + attribute :frigorific, Types::Nil | |
| 1364 | + attribute :haplomi, Types::Nil | |
| 1365 | + attribute :hyperkinesis, Types::Nil | |
| 1366 | + attribute :laudable, Types::Nil | |
| 1367 | + attribute :madwoman, Types::Nil | |
| 1368 | + attribute :maimedly, Types::Nil | |
| 1369 | + attribute :micropterygidae, Types::Nil | |
| 1370 | + attribute :microrhabdus, Types::Nil | |
| 1371 | + attribute :nondense, Types::Nil | |
| 1372 | + attribute :phlebemphraxis, Types::Nil | |
| 1373 | + attribute :redsear, Types::Nil | |
| 1374 | + attribute :schismatical, Types::Nil | |
| 1375 | + attribute :tartryl, Types::Nil | |
| 1376 | + attribute :unabhorred, Types::Nil | |
| 1377 | + attribute :undeliberateness, Types::Nil | |
| 1378 | + attribute :unmixable, Types::Nil | |
| 1379 | + attribute :untruckling, Types::Nil | |
| 1380 | + attribute :vineal, Types::Nil | |
| 1381 | + | |
| 1382 | + def self.from_dynamic!(d) | |
| 1383 | + d = Types::Hash[d] | |
| 1384 | + new( | |
| 1385 | + amphicarpic: d.fetch("amphicarpic"), | |
| 1386 | + chianti: d.fetch("Chianti"), | |
| 1387 | + frigorific: d.fetch("frigorific"), | |
| 1388 | + haplomi: d.fetch("Haplomi"), | |
| 1389 | + hyperkinesis: d.fetch("hyperkinesis"), | |
| 1390 | + laudable: d.fetch("laudable"), | |
| 1391 | + madwoman: d.fetch("madwoman"), | |
| 1392 | + maimedly: d.fetch("maimedly"), | |
| 1393 | + micropterygidae: d.fetch("Micropterygidae"), | |
| 1394 | + microrhabdus: d.fetch("microrhabdus"), | |
| 1395 | + nondense: d.fetch("nondense"), | |
| 1396 | + phlebemphraxis: d.fetch("phlebemphraxis"), | |
| 1397 | + redsear: d.fetch("redsear"), | |
| 1398 | + schismatical: d.fetch("schismatical"), | |
| 1399 | + tartryl: d.fetch("tartryl"), | |
| 1400 | + unabhorred: d.fetch("unabhorred"), | |
| 1401 | + undeliberateness: d.fetch("undeliberateness"), | |
| 1402 | + unmixable: d.fetch("unmixable"), | |
| 1403 | + untruckling: d.fetch("untruckling"), | |
| 1404 | + vineal: d.fetch("vineal"), | |
| 1405 | + ) | |
| 1406 | + end | |
| 1407 | + | |
| 1408 | + def self.from_json!(json) | |
| 1409 | + from_dynamic!(JSON.parse(json)) | |
| 1410 | + end | |
| 1411 | + | |
| 1412 | + def to_dynamic | |
| 1413 | + { | |
| 1414 | + "amphicarpic" => amphicarpic, | |
| 1415 | + "Chianti" => chianti, | |
| 1416 | + "frigorific" => frigorific, | |
| 1417 | + "Haplomi" => haplomi, | |
| 1418 | + "hyperkinesis" => hyperkinesis, | |
| 1419 | + "laudable" => laudable, | |
| 1420 | + "madwoman" => madwoman, | |
| 1421 | + "maimedly" => maimedly, | |
| 1422 | + "Micropterygidae" => micropterygidae, | |
| 1423 | + "microrhabdus" => microrhabdus, | |
| 1424 | + "nondense" => nondense, | |
| 1425 | + "phlebemphraxis" => phlebemphraxis, | |
| 1426 | + "redsear" => redsear, | |
| 1427 | + "schismatical" => schismatical, | |
| 1428 | + "tartryl" => tartryl, | |
| 1429 | + "unabhorred" => unabhorred, | |
| 1430 | + "undeliberateness" => undeliberateness, | |
| 1431 | + "unmixable" => unmixable, | |
| 1432 | + "untruckling" => untruckling, | |
| 1433 | + "vineal" => vineal, | |
| 1434 | + } | |
| 1435 | + end | |
| 1436 | + | |
| 1437 | + def to_json(options = nil) | |
| 1438 | + JSON.generate(to_dynamic, options) | |
| 1439 | + end | |
| 1440 | +end | |
| 1441 | + | |
| 1442 | +class SisteringElement < Dry::Struct | |
| 1443 | + attribute :integer, Types::Integer.optional | |
| 1444 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1445 | + attribute :sistering_class, SisteringClass.optional | |
| 1446 | + | |
| 1447 | + def self.from_dynamic!(d) | |
| 1448 | + if schema[:integer].right.valid? d | |
| 1449 | + return new(integer: d, null_array: nil, sistering_class: nil) | |
| 1450 | + end | |
| 1451 | + if schema[:null_array].right.valid? d | |
| 1452 | + return new(null_array: d, sistering_class: nil, integer: nil) | |
| 1453 | + end | |
| 1454 | + begin | |
| 1455 | + value = SisteringClass.from_dynamic!(d) | |
| 1456 | + if schema[:sistering_class].right.valid? value | |
| 1457 | + return new(sistering_class: value, null_array: nil, integer: nil) | |
| 1458 | + end | |
| 1459 | + rescue | |
| 1460 | + end | |
| 1461 | + raise "Invalid union" | |
| 1462 | + end | |
| 1463 | + | |
| 1464 | + def self.from_json!(json) | |
| 1465 | + from_dynamic!(JSON.parse(json)) | |
| 1466 | + end | |
| 1467 | + | |
| 1468 | + def to_dynamic | |
| 1469 | + if integer != nil | |
| 1470 | + integer | |
| 1471 | + elsif null_array != nil | |
| 1472 | + null_array | |
| 1473 | + elsif sistering_class != nil | |
| 1474 | + sistering_class.to_dynamic | |
| 1475 | + end | |
| 1476 | + end | |
| 1477 | + | |
| 1478 | + def to_json(options = nil) | |
| 1479 | + JSON.generate(to_dynamic, options) | |
| 1480 | + end | |
| 1481 | +end | |
| 1482 | + | |
| 1483 | +class Staghunting < Dry::Struct | |
| 1484 | + attribute :calorimetric, Types::Integer.optional | |
| 1485 | + attribute :canid, Types::Integer.optional | |
| 1486 | + attribute :catharticalness, Types::Double.optional | |
| 1487 | + attribute :chirotherium, Types::Integer.optional | |
| 1488 | + attribute :disdiapason, Types::String.optional | |
| 1489 | + attribute :ditriglyphic, Types::Integer.optional | |
| 1490 | + attribute :floriferousness, Types::Integer.optional | |
| 1491 | + attribute :gamelike, Types::Integer.optional | |
| 1492 | + attribute :grig, Types::Integer.optional | |
| 1493 | + attribute :homocerc, Types::Bool.optional | |
| 1494 | + attribute :interloan, Types::Integer.optional | |
| 1495 | + attribute :lithotomy, Types::Integer.optional | |
| 1496 | + attribute :loric, Types::Integer.optional | |
| 1497 | + attribute :membranocoriaceous, Types::Integer.optional | |
| 1498 | + attribute :membranogenic, Types::Integer.optional | |
| 1499 | + attribute :nonbookish, Types::Nil.optional | |
| 1500 | + attribute :overtrump, Types::Integer.optional | |
| 1501 | + attribute :scotino, Types::Integer.optional | |
| 1502 | + attribute :seasonable, Types::Integer.optional | |
| 1503 | + attribute :sephen, Types::Integer.optional | |
| 1504 | + attribute :stigmarioid, Types::Integer.optional | |
| 1505 | + attribute :tired, Types::Integer.optional | |
| 1506 | + attribute :trifid, Types::Integer.optional | |
| 1507 | + attribute :undefeatedly, Types::Integer.optional | |
| 1508 | + attribute :ungirlish, Types::Integer.optional | |
| 1509 | + | |
| 1510 | + def self.from_dynamic!(d) | |
| 1511 | + d = Types::Hash[d] | |
| 1512 | + new( | |
| 1513 | + calorimetric: d["calorimetric"], | |
| 1514 | + canid: d["canid"], | |
| 1515 | + catharticalness: d["catharticalness"], | |
| 1516 | + chirotherium: d["Chirotherium"], | |
| 1517 | + disdiapason: d["disdiapason"], | |
| 1518 | + ditriglyphic: d["ditriglyphic"], | |
| 1519 | + floriferousness: d["floriferousness"], | |
| 1520 | + gamelike: d["gamelike"], | |
| 1521 | + grig: d["grig"], | |
| 1522 | + homocerc: d["homocerc"], | |
| 1523 | + interloan: d["interloan"], | |
| 1524 | + lithotomy: d["lithotomy"], | |
| 1525 | + loric: d["loric"], | |
| 1526 | + membranocoriaceous: d["membranocoriaceous"], | |
| 1527 | + membranogenic: d["membranogenic"], | |
| 1528 | + nonbookish: d["nonbookish"], | |
| 1529 | + overtrump: d["overtrump"], | |
| 1530 | + scotino: d["scotino"], | |
| 1531 | + seasonable: d["seasonable"], | |
| 1532 | + sephen: d["sephen"], | |
| 1533 | + stigmarioid: d["stigmarioid"], | |
| 1534 | + tired: d["tired"], | |
| 1535 | + trifid: d["trifid"], | |
| 1536 | + undefeatedly: d["undefeatedly"], | |
| 1537 | + ungirlish: d["ungirlish"], | |
| 1538 | + ) | |
| 1539 | + end | |
| 1540 | + | |
| 1541 | + def self.from_json!(json) | |
| 1542 | + from_dynamic!(JSON.parse(json)) | |
| 1543 | + end | |
| 1544 | + | |
| 1545 | + def to_dynamic | |
| 1546 | + { | |
| 1547 | + "calorimetric" => calorimetric, | |
| 1548 | + "canid" => canid, | |
| 1549 | + "catharticalness" => catharticalness, | |
| 1550 | + "Chirotherium" => chirotherium, | |
| 1551 | + "disdiapason" => disdiapason, | |
| 1552 | + "ditriglyphic" => ditriglyphic, | |
| 1553 | + "floriferousness" => floriferousness, | |
| 1554 | + "gamelike" => gamelike, | |
| 1555 | + "grig" => grig, | |
| 1556 | + "homocerc" => homocerc, | |
| 1557 | + "interloan" => interloan, | |
| 1558 | + "lithotomy" => lithotomy, | |
| 1559 | + "loric" => loric, | |
| 1560 | + "membranocoriaceous" => membranocoriaceous, | |
| 1561 | + "membranogenic" => membranogenic, | |
| 1562 | + "nonbookish" => nonbookish, | |
| 1563 | + "overtrump" => overtrump, | |
| 1564 | + "scotino" => scotino, | |
| 1565 | + "seasonable" => seasonable, | |
| 1566 | + "sephen" => sephen, | |
| 1567 | + "stigmarioid" => stigmarioid, | |
| 1568 | + "tired" => tired, | |
| 1569 | + "trifid" => trifid, | |
| 1570 | + "undefeatedly" => undefeatedly, | |
| 1571 | + "ungirlish" => ungirlish, | |
| 1572 | + } | |
| 1573 | + end | |
| 1574 | + | |
| 1575 | + def to_json(options = nil) | |
| 1576 | + JSON.generate(to_dynamic, options) | |
| 1577 | + end | |
| 1578 | +end | |
| 1579 | + | |
| 1580 | +class Stagmometer < Dry::Struct | |
| 1581 | + attribute :string, Types::String.optional | |
| 1582 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 1583 | + | |
| 1584 | + def self.from_dynamic!(d) | |
| 1585 | + if schema[:string].right.valid? d | |
| 1586 | + return new(string: d, union_array: nil) | |
| 1587 | + end | |
| 1588 | + if schema[:union_array].right.valid? d | |
| 1589 | + return new(union_array: d, string: nil) | |
| 1590 | + end | |
| 1591 | + raise "Invalid union" | |
| 1592 | + end | |
| 1593 | + | |
| 1594 | + def self.from_json!(json) | |
| 1595 | + from_dynamic!(JSON.parse(json)) | |
| 1596 | + end | |
| 1597 | + | |
| 1598 | + def to_dynamic | |
| 1599 | + if string != nil | |
| 1600 | + string | |
| 1601 | + elsif union_array != nil | |
| 1602 | + union_array | |
| 1603 | + end | |
| 1604 | + end | |
| 1605 | + | |
| 1606 | + def to_json(options = nil) | |
| 1607 | + JSON.generate(to_dynamic, options) | |
| 1608 | + end | |
| 1609 | +end | |
| 1610 | + | |
| 1611 | +class Stimulability < Dry::Struct | |
| 1612 | + attribute :bool, Types::Bool.optional | |
| 1613 | + attribute :integer, Types::Integer.optional | |
| 1614 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 1615 | + | |
| 1616 | + def self.from_dynamic!(d) | |
| 1617 | + if schema[:bool].right.valid? d | |
| 1618 | + return new(bool: d, integer: nil, integer_map: nil) | |
| 1619 | + end | |
| 1620 | + if schema[:integer].right.valid? d | |
| 1621 | + return new(integer: d, bool: nil, integer_map: nil) | |
| 1622 | + end | |
| 1623 | + begin | |
| 1624 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 1625 | + if schema[:integer_map].right.valid? value | |
| 1626 | + return new(integer_map: value, bool: nil, integer: nil) | |
| 1627 | + end | |
| 1628 | + rescue | |
| 1629 | + end | |
| 1630 | + raise "Invalid union" | |
| 1631 | + end | |
| 1632 | + | |
| 1633 | + def self.from_json!(json) | |
| 1634 | + from_dynamic!(JSON.parse(json)) | |
| 1635 | + end | |
| 1636 | + | |
| 1637 | + def to_dynamic | |
| 1638 | + if bool != nil | |
| 1639 | + bool | |
| 1640 | + elsif integer != nil | |
| 1641 | + integer | |
| 1642 | + elsif integer_map != nil | |
| 1643 | + integer_map | |
| 1644 | + end | |
| 1645 | + end | |
| 1646 | + | |
| 1647 | + def to_json(options = nil) | |
| 1648 | + JSON.generate(to_dynamic, options) | |
| 1649 | + end | |
| 1650 | +end | |
| 1651 | + | |
| 1652 | +class Strangleable < Dry::Struct | |
| 1653 | + attribute :double, Types::Double.optional | |
| 1654 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1655 | + | |
| 1656 | + def self.from_dynamic!(d) | |
| 1657 | + if schema[:double].right.valid? d | |
| 1658 | + return new(double: d, null_array: nil) | |
| 1659 | + end | |
| 1660 | + if schema[:null_array].right.valid? d | |
| 1661 | + return new(null_array: d, double: nil) | |
| 1662 | + end | |
| 1663 | + raise "Invalid union" | |
| 1664 | + end | |
| 1665 | + | |
| 1666 | + def self.from_json!(json) | |
| 1667 | + from_dynamic!(JSON.parse(json)) | |
| 1668 | + end | |
| 1669 | + | |
| 1670 | + def to_dynamic | |
| 1671 | + if double != nil | |
| 1672 | + double | |
| 1673 | + elsif null_array != nil | |
| 1674 | + null_array | |
| 1675 | + end | |
| 1676 | + end | |
| 1677 | + | |
| 1678 | + def to_json(options = nil) | |
| 1679 | + JSON.generate(to_dynamic, options) | |
| 1680 | + end | |
| 1681 | +end | |
| 1682 | + | |
| 1683 | +class StrenuosityClass < Dry::Struct | |
| 1684 | + attribute :bliss, Types::Integer.optional | |
| 1685 | + attribute :buccate, Types::Integer.optional | |
| 1686 | + attribute :bulletproof, Types::Integer.optional | |
| 1687 | + attribute :catharticalness, Types::Double.optional | |
| 1688 | + attribute :chirotherium, Types::Integer.optional | |
| 1689 | + attribute :crumblingness, Types::Integer.optional | |
| 1690 | + attribute :disdiapason, Types::String.optional | |
| 1691 | + attribute :engagedly, Types::Integer.optional | |
| 1692 | + attribute :fightable, Types::Integer.optional | |
| 1693 | + attribute :hoariness, Types::Integer.optional | |
| 1694 | + attribute :homocerc, Types::Bool.optional | |
| 1695 | + attribute :hypopodium, Types::Integer.optional | |
| 1696 | + attribute :luxurist, Types::Integer.optional | |
| 1697 | + attribute :mechanician, Types::Integer.optional | |
| 1698 | + attribute :nonbookish, Types::Nil.optional | |
| 1699 | + attribute :onopordon, Types::Integer.optional | |
| 1700 | + attribute :podgily, Types::Integer.optional | |
| 1701 | + attribute :reformableness, Types::Integer.optional | |
| 1702 | + attribute :scatterbrains, Types::Integer.optional | |
| 1703 | + attribute :seminuria, Types::Integer.optional | |
| 1704 | + attribute :sodomite, Types::Integer.optional | |
| 1705 | + attribute :tramp, Types::Integer.optional | |
| 1706 | + attribute :undueness, Types::Integer.optional | |
| 1707 | + attribute :worthily, Types::Integer.optional | |
| 1708 | + attribute :yankeeist, Types::Integer.optional | |
| 1709 | + | |
| 1710 | + def self.from_dynamic!(d) | |
| 1711 | + d = Types::Hash[d] | |
| 1712 | + new( | |
| 1713 | + bliss: d["bliss"], | |
| 1714 | + buccate: d["buccate"], | |
| 1715 | + bulletproof: d["bulletproof"], | |
| 1716 | + catharticalness: d["catharticalness"], | |
| 1717 | + chirotherium: d["Chirotherium"], | |
| 1718 | + crumblingness: d["crumblingness"], | |
| 1719 | + disdiapason: d["disdiapason"], | |
| 1720 | + engagedly: d["engagedly"], | |
| 1721 | + fightable: d["fightable"], | |
| 1722 | + hoariness: d["hoariness"], | |
| 1723 | + homocerc: d["homocerc"], | |
| 1724 | + hypopodium: d["hypopodium"], | |
| 1725 | + luxurist: d["luxurist"], | |
| 1726 | + mechanician: d["mechanician"], | |
| 1727 | + nonbookish: d["nonbookish"], | |
| 1728 | + onopordon: d["Onopordon"], | |
| 1729 | + podgily: d["podgily"], | |
| 1730 | + reformableness: d["reformableness"], | |
| 1731 | + scatterbrains: d["scatterbrains"], | |
| 1732 | + seminuria: d["seminuria"], | |
| 1733 | + sodomite: d["Sodomite"], | |
| 1734 | + tramp: d["tramp"], | |
| 1735 | + undueness: d["undueness"], | |
| 1736 | + worthily: d["worthily"], | |
| 1737 | + yankeeist: d["Yankeeist"], | |
| 1738 | + ) | |
| 1739 | + end | |
| 1740 | + | |
| 1741 | + def self.from_json!(json) | |
| 1742 | + from_dynamic!(JSON.parse(json)) | |
| 1743 | + end | |
| 1744 | + | |
| 1745 | + def to_dynamic | |
| 1746 | + { | |
| 1747 | + "bliss" => bliss, | |
| 1748 | + "buccate" => buccate, | |
| 1749 | + "bulletproof" => bulletproof, | |
| 1750 | + "catharticalness" => catharticalness, | |
| 1751 | + "Chirotherium" => chirotherium, | |
| 1752 | + "crumblingness" => crumblingness, | |
| 1753 | + "disdiapason" => disdiapason, | |
| 1754 | + "engagedly" => engagedly, | |
| 1755 | + "fightable" => fightable, | |
| 1756 | + "hoariness" => hoariness, | |
| 1757 | + "homocerc" => homocerc, | |
| 1758 | + "hypopodium" => hypopodium, | |
| 1759 | + "luxurist" => luxurist, | |
| 1760 | + "mechanician" => mechanician, | |
| 1761 | + "nonbookish" => nonbookish, | |
| 1762 | + "Onopordon" => onopordon, | |
| 1763 | + "podgily" => podgily, | |
| 1764 | + "reformableness" => reformableness, | |
| 1765 | + "scatterbrains" => scatterbrains, | |
| 1766 | + "seminuria" => seminuria, | |
| 1767 | + "Sodomite" => sodomite, | |
| 1768 | + "tramp" => tramp, | |
| 1769 | + "undueness" => undueness, | |
| 1770 | + "worthily" => worthily, | |
| 1771 | + "Yankeeist" => yankeeist, | |
| 1772 | + } | |
| 1773 | + end | |
| 1774 | + | |
| 1775 | + def to_json(options = nil) | |
| 1776 | + JSON.generate(to_dynamic, options) | |
| 1777 | + end | |
| 1778 | +end | |
| 1779 | + | |
| 1780 | +class StrenuosityElement < Dry::Struct | |
| 1781 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 1782 | + attribute :strenuosity_class, StrenuosityClass.optional | |
| 1783 | + | |
| 1784 | + def self.from_dynamic!(d) | |
| 1785 | + if schema[:null_array].right.valid? d | |
| 1786 | + return new(null_array: d, strenuosity_class: nil) | |
| 1787 | + end | |
| 1788 | + begin | |
| 1789 | + value = StrenuosityClass.from_dynamic!(d) | |
| 1790 | + if schema[:strenuosity_class].right.valid? value | |
| 1791 | + return new(strenuosity_class: value, null_array: nil) | |
| 1792 | + end | |
| 1793 | + rescue | |
| 1794 | + end | |
| 1795 | + raise "Invalid union" | |
| 1796 | + end | |
| 1797 | + | |
| 1798 | + def self.from_json!(json) | |
| 1799 | + from_dynamic!(JSON.parse(json)) | |
| 1800 | + end | |
| 1801 | + | |
| 1802 | + def to_dynamic | |
| 1803 | + if null_array != nil | |
| 1804 | + null_array | |
| 1805 | + elsif strenuosity_class != nil | |
| 1806 | + strenuosity_class.to_dynamic | |
| 1807 | + end | |
| 1808 | + end | |
| 1809 | + | |
| 1810 | + def to_json(options = nil) | |
| 1811 | + JSON.generate(to_dynamic, options) | |
| 1812 | + end | |
| 1813 | +end | |
| 1814 | + | |
| 1815 | +class Tabaxir < Dry::Struct | |
| 1816 | + attribute :bool, Types::Bool.optional | |
| 1817 | + attribute :double, Types::Double.optional | |
| 1818 | + | |
| 1819 | + def self.from_dynamic!(d) | |
| 1820 | + if schema[:bool].right.valid? d | |
| 1821 | + return new(bool: d, double: nil) | |
| 1822 | + end | |
| 1823 | + if schema[:double].right.valid? d | |
| 1824 | + return new(double: d, bool: nil) | |
| 1825 | + end | |
| 1826 | + raise "Invalid union" | |
| 1827 | + end | |
| 1828 | + | |
| 1829 | + def self.from_json!(json) | |
| 1830 | + from_dynamic!(JSON.parse(json)) | |
| 1831 | + end | |
| 1832 | + | |
| 1833 | + def to_dynamic | |
| 1834 | + if bool != nil | |
| 1835 | + bool | |
| 1836 | + elsif double != nil | |
| 1837 | + double | |
| 1838 | + end | |
| 1839 | + end | |
| 1840 | + | |
| 1841 | + def to_json(options = nil) | |
| 1842 | + JSON.generate(to_dynamic, options) | |
| 1843 | + end | |
| 1844 | +end | |
| 1845 | + | |
| 1846 | +class Talpiform < Dry::Struct | |
| 1847 | + attribute :double, Types::Double.optional | |
| 1848 | + attribute :null, Types::Nil.optional | |
| 1849 | + attribute :quebrachine_class, QuebrachineClass.optional | |
| 1850 | + | |
| 1851 | + def self.from_dynamic!(d) | |
| 1852 | + if schema[:double].right.valid? d | |
| 1853 | + return new(double: d, quebrachine_class: nil, null: nil) | |
| 1854 | + end | |
| 1855 | + if schema[:null].right.valid? d | |
| 1856 | + return new(null: d, quebrachine_class: nil, double: nil) | |
| 1857 | + end | |
| 1858 | + begin | |
| 1859 | + value = QuebrachineClass.from_dynamic!(d) | |
| 1860 | + if schema[:quebrachine_class].right.valid? value | |
| 1861 | + return new(quebrachine_class: value, double: nil, null: nil) | |
| 1862 | + end | |
| 1863 | + rescue | |
| 1864 | + end | |
| 1865 | + raise "Invalid union" | |
| 1866 | + end | |
| 1867 | + | |
| 1868 | + def self.from_json!(json) | |
| 1869 | + from_dynamic!(JSON.parse(json)) | |
| 1870 | + end | |
| 1871 | + | |
| 1872 | + def to_dynamic | |
| 1873 | + if double != nil | |
| 1874 | + double | |
| 1875 | + elsif quebrachine_class != nil | |
| 1876 | + quebrachine_class.to_dynamic | |
| 1877 | + else | |
| 1878 | + nil | |
| 1879 | + end | |
| 1880 | + end | |
| 1881 | + | |
| 1882 | + def to_json(options = nil) | |
| 1883 | + JSON.generate(to_dynamic, options) | |
| 1884 | + end | |
| 1885 | +end | |
| 1886 | + | |
| 1887 | +class Thwack < Dry::Struct | |
| 1888 | + attribute :bool, Types::Bool.optional | |
| 1889 | + attribute :double, Types::Double.optional | |
| 1890 | + attribute :quebrachine_class, QuebrachineClass.optional | |
| 1891 | + | |
| 1892 | + def self.from_dynamic!(d) | |
| 1893 | + if schema[:bool].right.valid? d | |
| 1894 | + return new(bool: d, quebrachine_class: nil, double: nil) | |
| 1895 | + end | |
| 1896 | + if schema[:double].right.valid? d | |
| 1897 | + return new(double: d, bool: nil, quebrachine_class: nil) | |
| 1898 | + end | |
| 1899 | + begin | |
| 1900 | + value = QuebrachineClass.from_dynamic!(d) | |
| 1901 | + if schema[:quebrachine_class].right.valid? value | |
| 1902 | + return new(quebrachine_class: value, bool: nil, double: nil) | |
| 1903 | + end | |
| 1904 | + rescue | |
| 1905 | + end | |
| 1906 | + raise "Invalid union" | |
| 1907 | + end | |
| 1908 | + | |
| 1909 | + def self.from_json!(json) | |
| 1910 | + from_dynamic!(JSON.parse(json)) | |
| 1911 | + end | |
| 1912 | + | |
| 1913 | + def to_dynamic | |
| 1914 | + if bool != nil | |
| 1915 | + bool | |
| 1916 | + elsif double != nil | |
| 1917 | + double | |
| 1918 | + elsif quebrachine_class != nil | |
| 1919 | + quebrachine_class.to_dynamic | |
| 1920 | + end | |
| 1921 | + end | |
| 1922 | + | |
| 1923 | + def to_json(options = nil) | |
| 1924 | + JSON.generate(to_dynamic, options) | |
| 1925 | + end | |
| 1926 | +end | |
| 1927 | + | |
| 1928 | +class Tortricine < Dry::Struct | |
| 1929 | + attribute :quebrachine_class, QuebrachineClass.optional | |
| 1930 | + attribute :union_array, Types.Array(Types::Integer.optional).optional | |
| 1931 | + | |
| 1932 | + def self.from_dynamic!(d) | |
| 1933 | + begin | |
| 1934 | + value = QuebrachineClass.from_dynamic!(d) | |
| 1935 | + if schema[:quebrachine_class].right.valid? value | |
| 1936 | + return new(quebrachine_class: value, union_array: nil) | |
| 1937 | + end | |
| 1938 | + rescue | |
| 1939 | + end | |
| 1940 | + if schema[:union_array].right.valid? d | |
| 1941 | + return new(union_array: d, quebrachine_class: nil) | |
| 1942 | + end | |
| 1943 | + raise "Invalid union" | |
| 1944 | + end | |
| 1945 | + | |
| 1946 | + def self.from_json!(json) | |
| 1947 | + from_dynamic!(JSON.parse(json)) | |
| 1948 | + end | |
| 1949 | + | |
| 1950 | + def to_dynamic | |
| 1951 | + if quebrachine_class != nil | |
| 1952 | + quebrachine_class.to_dynamic | |
| 1953 | + elsif union_array != nil | |
| 1954 | + union_array | |
| 1955 | + end | |
| 1956 | + end | |
| 1957 | + | |
| 1958 | + def to_json(options = nil) | |
| 1959 | + JSON.generate(to_dynamic, options) | |
| 1960 | + end | |
| 1961 | +end | |
| 1962 | + | |
| 1963 | +class TruantcyClass < Dry::Struct | |
| 1964 | + attribute :alfiona, Types::Nil.optional | |
| 1965 | + attribute :ascaridiasis, Types::Nil.optional | |
| 1966 | + attribute :bungey, Types::Nil.optional | |
| 1967 | + attribute :catharticalness, Types::Double.optional | |
| 1968 | + attribute :ceroxyle, Types::Nil.optional | |
| 1969 | + attribute :chirotherium, Types::Integer.optional | |
| 1970 | + attribute :chorology, Types::Nil.optional | |
| 1971 | + attribute :disdiapason, Types::String.optional | |
| 1972 | + attribute :enmarble, Types::Nil.optional | |
| 1973 | + attribute :epeira, Types::Nil.optional | |
| 1974 | + attribute :eurylaimi, Types::Nil.optional | |
| 1975 | + attribute :germination, Types::Nil.optional | |
| 1976 | + attribute :hallelujah, Types::Nil.optional | |
| 1977 | + attribute :homocerc, Types::Bool.optional | |
| 1978 | + attribute :lev, Types::Nil.optional | |
| 1979 | + attribute :mouthing, Types::Nil.optional | |
| 1980 | + attribute :nonbookish, Types::Nil.optional | |
| 1981 | + attribute :philliloo, Types::Nil.optional | |
| 1982 | + attribute :planetal, Types::Nil.optional | |
| 1983 | + attribute :poney, Types::Nil.optional | |
| 1984 | + attribute :punctualist, Types::Nil.optional | |
| 1985 | + attribute :returnlessly, Types::Nil.optional | |
| 1986 | + attribute :skelder, Types::Nil.optional | |
| 1987 | + attribute :windwaywardly, Types::Nil.optional | |
| 1988 | + attribute :yuman, Types::Nil.optional | |
| 1989 | + | |
| 1990 | + def self.from_dynamic!(d) | |
| 1991 | + d = Types::Hash[d] | |
| 1992 | + new( | |
| 1993 | + alfiona: d["alfiona"], | |
| 1994 | + ascaridiasis: d["ascaridiasis"], | |
| 1995 | + bungey: d["bungey"], | |
| 1996 | + catharticalness: d["catharticalness"], | |
| 1997 | + ceroxyle: d["ceroxyle"], | |
| 1998 | + chirotherium: d["Chirotherium"], | |
| 1999 | + chorology: d["chorology"], | |
| 2000 | + disdiapason: d["disdiapason"], | |
| 2001 | + enmarble: d["enmarble"], | |
| 2002 | + epeira: d["Epeira"], | |
| 2003 | + eurylaimi: d["Eurylaimi"], | |
| 2004 | + germination: d["germination"], | |
| 2005 | + hallelujah: d["hallelujah"], | |
| 2006 | + homocerc: d["homocerc"], | |
| 2007 | + lev: d["lev"], | |
| 2008 | + mouthing: d["mouthing"], | |
| 2009 | + nonbookish: d["nonbookish"], | |
| 2010 | + philliloo: d["philliloo"], | |
| 2011 | + planetal: d["planetal"], | |
| 2012 | + poney: d["poney"], | |
| 2013 | + punctualist: d["punctualist"], | |
| 2014 | + returnlessly: d["returnlessly"], | |
| 2015 | + skelder: d["skelder"], | |
| 2016 | + windwaywardly: d["windwaywardly"], | |
| 2017 | + yuman: d["Yuman"], | |
| 2018 | + ) | |
| 2019 | + end | |
| 2020 | + | |
| 2021 | + def self.from_json!(json) | |
| 2022 | + from_dynamic!(JSON.parse(json)) | |
| 2023 | + end | |
| 2024 | + | |
| 2025 | + def to_dynamic | |
| 2026 | + { | |
| 2027 | + "alfiona" => alfiona, | |
| 2028 | + "ascaridiasis" => ascaridiasis, | |
| 2029 | + "bungey" => bungey, | |
| 2030 | + "catharticalness" => catharticalness, | |
| 2031 | + "ceroxyle" => ceroxyle, | |
| 2032 | + "Chirotherium" => chirotherium, | |
| 2033 | + "chorology" => chorology, | |
| 2034 | + "disdiapason" => disdiapason, | |
| 2035 | + "enmarble" => enmarble, | |
| 2036 | + "Epeira" => epeira, | |
| 2037 | + "Eurylaimi" => eurylaimi, | |
| 2038 | + "germination" => germination, | |
| 2039 | + "hallelujah" => hallelujah, | |
| 2040 | + "homocerc" => homocerc, | |
| 2041 | + "lev" => lev, | |
| 2042 | + "mouthing" => mouthing, | |
| 2043 | + "nonbookish" => nonbookish, | |
| 2044 | + "philliloo" => philliloo, | |
| 2045 | + "planetal" => planetal, | |
| 2046 | + "poney" => poney, | |
| 2047 | + "punctualist" => punctualist, | |
| 2048 | + "returnlessly" => returnlessly, | |
| 2049 | + "skelder" => skelder, | |
| 2050 | + "windwaywardly" => windwaywardly, | |
| 2051 | + "Yuman" => yuman, | |
| 2052 | + } | |
| 2053 | + end | |
| 2054 | + | |
| 2055 | + def to_json(options = nil) | |
| 2056 | + JSON.generate(to_dynamic, options) | |
| 2057 | + end | |
| 2058 | +end | |
| 2059 | + | |
| 2060 | +class TruantcyElement < Dry::Struct | |
| 2061 | + attribute :bool, Types::Bool.optional | |
| 2062 | + attribute :truantcy_class, TruantcyClass.optional | |
| 2063 | + | |
| 2064 | + def self.from_dynamic!(d) | |
| 2065 | + if schema[:bool].right.valid? d | |
| 2066 | + return new(bool: d, truantcy_class: nil) | |
| 2067 | + end | |
| 2068 | + begin | |
| 2069 | + value = TruantcyClass.from_dynamic!(d) | |
| 2070 | + if schema[:truantcy_class].right.valid? value | |
| 2071 | + return new(truantcy_class: value, bool: nil) | |
| 2072 | + end | |
| 2073 | + rescue | |
| 2074 | + end | |
| 2075 | + raise "Invalid union" | |
| 2076 | + end | |
| 2077 | + | |
| 2078 | + def self.from_json!(json) | |
| 2079 | + from_dynamic!(JSON.parse(json)) | |
| 2080 | + end | |
| 2081 | + | |
| 2082 | + def to_dynamic | |
| 2083 | + if bool != nil | |
| 2084 | + bool | |
| 2085 | + elsif truantcy_class != nil | |
| 2086 | + truantcy_class.to_dynamic | |
| 2087 | + end | |
| 2088 | + end | |
| 2089 | + | |
| 2090 | + def to_json(options = nil) | |
| 2091 | + JSON.generate(to_dynamic, options) | |
| 2092 | + end | |
| 2093 | +end | |
| 2094 | + | |
| 2095 | +class Unbeginning < Dry::Struct | |
| 2096 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2097 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2098 | + attribute :string, Types::String.optional | |
| 2099 | + | |
| 2100 | + def self.from_dynamic!(d) | |
| 2101 | + begin | |
| 2102 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2103 | + if schema[:integer_map].right.valid? value | |
| 2104 | + return new(integer_map: value, null_array: nil, string: nil) | |
| 2105 | + end | |
| 2106 | + rescue | |
| 2107 | + end | |
| 2108 | + if schema[:null_array].right.valid? d | |
| 2109 | + return new(null_array: d, integer_map: nil, string: nil) | |
| 2110 | + end | |
| 2111 | + if schema[:string].right.valid? d | |
| 2112 | + return new(string: d, null_array: nil, integer_map: nil) | |
| 2113 | + end | |
| 2114 | + raise "Invalid union" | |
| 2115 | + end | |
| 2116 | + | |
| 2117 | + def self.from_json!(json) | |
| 2118 | + from_dynamic!(JSON.parse(json)) | |
| 2119 | + end | |
| 2120 | + | |
| 2121 | + def to_dynamic | |
| 2122 | + if integer_map != nil | |
| 2123 | + integer_map | |
| 2124 | + elsif null_array != nil | |
| 2125 | + null_array | |
| 2126 | + elsif string != nil | |
| 2127 | + string | |
| 2128 | + end | |
| 2129 | + end | |
| 2130 | + | |
| 2131 | + def to_json(options = nil) | |
| 2132 | + JSON.generate(to_dynamic, options) | |
| 2133 | + end | |
| 2134 | +end | |
| 2135 | + | |
| 2136 | +class Undesirability < Dry::Struct | |
| 2137 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 2138 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2139 | + attribute :string, Types::String.optional | |
| 2140 | + | |
| 2141 | + def self.from_dynamic!(d) | |
| 2142 | + if schema[:integer_array].right.valid? d | |
| 2143 | + return new(integer_array: d, integer_map: nil, string: nil) | |
| 2144 | + end | |
| 2145 | + begin | |
| 2146 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2147 | + if schema[:integer_map].right.valid? value | |
| 2148 | + return new(integer_map: value, integer_array: nil, string: nil) | |
| 2149 | + end | |
| 2150 | + rescue | |
| 2151 | + end | |
| 2152 | + if schema[:string].right.valid? d | |
| 2153 | + return new(string: d, integer_array: nil, integer_map: nil) | |
| 2154 | + end | |
| 2155 | + raise "Invalid union" | |
| 2156 | + end | |
| 2157 | + | |
| 2158 | + def self.from_json!(json) | |
| 2159 | + from_dynamic!(JSON.parse(json)) | |
| 2160 | + end | |
| 2161 | + | |
| 2162 | + def to_dynamic | |
| 2163 | + if integer_array != nil | |
| 2164 | + integer_array | |
| 2165 | + elsif integer_map != nil | |
| 2166 | + integer_map | |
| 2167 | + elsif string != nil | |
| 2168 | + string | |
| 2169 | + end | |
| 2170 | + end | |
| 2171 | + | |
| 2172 | + def to_json(options = nil) | |
| 2173 | + JSON.generate(to_dynamic, options) | |
| 2174 | + end | |
| 2175 | +end | |
| 2176 | + | |
| 2177 | +class Unerasing < Dry::Struct | |
| 2178 | + attribute :integer, Types::Integer.optional | |
| 2179 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2180 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2181 | + | |
| 2182 | + def self.from_dynamic!(d) | |
| 2183 | + if schema[:integer].right.valid? d | |
| 2184 | + return new(integer: d, null_array: nil, integer_map: nil) | |
| 2185 | + end | |
| 2186 | + begin | |
| 2187 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2188 | + if schema[:integer_map].right.valid? value | |
| 2189 | + return new(integer_map: value, null_array: nil, integer: nil) | |
| 2190 | + end | |
| 2191 | + rescue | |
| 2192 | + end | |
| 2193 | + if schema[:null_array].right.valid? d | |
| 2194 | + return new(null_array: d, integer: nil, integer_map: nil) | |
| 2195 | + end | |
| 2196 | + raise "Invalid union" | |
| 2197 | + end | |
| 2198 | + | |
| 2199 | + def self.from_json!(json) | |
| 2200 | + from_dynamic!(JSON.parse(json)) | |
| 2201 | + end | |
| 2202 | + | |
| 2203 | + def to_dynamic | |
| 2204 | + if integer != nil | |
| 2205 | + integer | |
| 2206 | + elsif integer_map != nil | |
| 2207 | + integer_map | |
| 2208 | + elsif null_array != nil | |
| 2209 | + null_array | |
| 2210 | + end | |
| 2211 | + end | |
| 2212 | + | |
| 2213 | + def to_json(options = nil) | |
| 2214 | + JSON.generate(to_dynamic, options) | |
| 2215 | + end | |
| 2216 | +end | |
| 2217 | + | |
| 2218 | +class Unguentarium < Dry::Struct | |
| 2219 | + attribute :integer, Types::Integer.optional | |
| 2220 | + attribute :null, Types::Nil.optional | |
| 2221 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2222 | + | |
| 2223 | + def self.from_dynamic!(d) | |
| 2224 | + if schema[:integer].right.valid? d | |
| 2225 | + return new(integer: d, null_array: nil, null: nil) | |
| 2226 | + end | |
| 2227 | + if schema[:null].right.valid? d | |
| 2228 | + return new(null: d, null_array: nil, integer: nil) | |
| 2229 | + end | |
| 2230 | + if schema[:null_array].right.valid? d | |
| 2231 | + return new(null_array: d, integer: nil, null: nil) | |
| 2232 | + end | |
| 2233 | + raise "Invalid union" | |
| 2234 | + end | |
| 2235 | + | |
| 2236 | + def self.from_json!(json) | |
| 2237 | + from_dynamic!(JSON.parse(json)) | |
| 2238 | + end | |
| 2239 | + | |
| 2240 | + def to_dynamic | |
| 2241 | + if integer != nil | |
| 2242 | + integer | |
| 2243 | + elsif null_array != nil | |
| 2244 | + null_array | |
| 2245 | + else | |
| 2246 | + nil | |
| 2247 | + end | |
| 2248 | + end | |
| 2249 | + | |
| 2250 | + def to_json(options = nil) | |
| 2251 | + JSON.generate(to_dynamic, options) | |
| 2252 | + end | |
| 2253 | +end | |
| 2254 | + | |
| 2255 | +class UnimpeachablyClass < Dry::Struct | |
| 2256 | + attribute :acerin, Types::Integer.optional | |
| 2257 | + attribute :bobadil, Types::Integer.optional | |
| 2258 | + attribute :catharticalness, Types::Double.optional | |
| 2259 | + attribute :chirotherium, Types::Integer.optional | |
| 2260 | + attribute :chlorophylligenous, Types::Integer.optional | |
| 2261 | + attribute :conversational, Types::Integer.optional | |
| 2262 | + attribute :demiowl, Types::Integer.optional | |
| 2263 | + attribute :disdiapason, Types::String.optional | |
| 2264 | + attribute :ectorhinal, Types::Integer.optional | |
| 2265 | + attribute :gamblesomeness, Types::Integer.optional | |
| 2266 | + attribute :homocerc, Types::Bool.optional | |
| 2267 | + attribute :irrorate, Types::Integer.optional | |
| 2268 | + attribute :kindergartening, Types::Integer.optional | |
| 2269 | + attribute :lateritic, Types::Integer.optional | |
| 2270 | + attribute :mespil, Types::Integer.optional | |
| 2271 | + attribute :misconfiguration, Types::Integer.optional | |
| 2272 | + attribute :nonbookish, Types::Nil.optional | |
| 2273 | + attribute :planometry, Types::Integer.optional | |
| 2274 | + attribute :quiina, Types::Integer.optional | |
| 2275 | + attribute :robert, Types::Integer.optional | |
| 2276 | + attribute :rot, Types::Integer.optional | |
| 2277 | + attribute :subcinctorium, Types::Integer.optional | |
| 2278 | + attribute :tussocker, Types::Integer.optional | |
| 2279 | + attribute :ultraproud, Types::Integer.optional | |
| 2280 | + attribute :unsuggestedness, Types::Integer.optional | |
| 2281 | + | |
| 2282 | + def self.from_dynamic!(d) | |
| 2283 | + d = Types::Hash[d] | |
| 2284 | + new( | |
| 2285 | + acerin: d["acerin"], | |
| 2286 | + bobadil: d["Bobadil"], | |
| 2287 | + catharticalness: d["catharticalness"], | |
| 2288 | + chirotherium: d["Chirotherium"], | |
| 2289 | + chlorophylligenous: d["chlorophylligenous"], | |
| 2290 | + conversational: d["conversational"], | |
| 2291 | + demiowl: d["demiowl"], | |
| 2292 | + disdiapason: d["disdiapason"], | |
| 2293 | + ectorhinal: d["ectorhinal"], | |
| 2294 | + gamblesomeness: d["gamblesomeness"], | |
| 2295 | + homocerc: d["homocerc"], | |
| 2296 | + irrorate: d["irrorate"], | |
| 2297 | + kindergartening: d["kindergartening"], | |
| 2298 | + lateritic: d["lateritic"], | |
| 2299 | + mespil: d["mespil"], | |
| 2300 | + misconfiguration: d["misconfiguration"], | |
| 2301 | + nonbookish: d["nonbookish"], | |
| 2302 | + planometry: d["planometry"], | |
| 2303 | + quiina: d["Quiina"], | |
| 2304 | + robert: d["Robert"], | |
| 2305 | + rot: d["rot"], | |
| 2306 | + subcinctorium: d["subcinctorium"], | |
| 2307 | + tussocker: d["tussocker"], | |
| 2308 | + ultraproud: d["ultraproud"], | |
| 2309 | + unsuggestedness: d["unsuggestedness"], | |
| 2310 | + ) | |
| 2311 | + end | |
| 2312 | + | |
| 2313 | + def self.from_json!(json) | |
| 2314 | + from_dynamic!(JSON.parse(json)) | |
| 2315 | + end | |
| 2316 | + | |
| 2317 | + def to_dynamic | |
| 2318 | + { | |
| 2319 | + "acerin" => acerin, | |
| 2320 | + "Bobadil" => bobadil, | |
| 2321 | + "catharticalness" => catharticalness, | |
| 2322 | + "Chirotherium" => chirotherium, | |
| 2323 | + "chlorophylligenous" => chlorophylligenous, | |
| 2324 | + "conversational" => conversational, | |
| 2325 | + "demiowl" => demiowl, | |
| 2326 | + "disdiapason" => disdiapason, | |
| 2327 | + "ectorhinal" => ectorhinal, | |
| 2328 | + "gamblesomeness" => gamblesomeness, | |
| 2329 | + "homocerc" => homocerc, | |
| 2330 | + "irrorate" => irrorate, | |
| 2331 | + "kindergartening" => kindergartening, | |
| 2332 | + "lateritic" => lateritic, | |
| 2333 | + "mespil" => mespil, | |
| 2334 | + "misconfiguration" => misconfiguration, | |
| 2335 | + "nonbookish" => nonbookish, | |
| 2336 | + "planometry" => planometry, | |
| 2337 | + "Quiina" => quiina, | |
| 2338 | + "Robert" => robert, | |
| 2339 | + "rot" => rot, | |
| 2340 | + "subcinctorium" => subcinctorium, | |
| 2341 | + "tussocker" => tussocker, | |
| 2342 | + "ultraproud" => ultraproud, | |
| 2343 | + "unsuggestedness" => unsuggestedness, | |
| 2344 | + } | |
| 2345 | + end | |
| 2346 | + | |
| 2347 | + def to_json(options = nil) | |
| 2348 | + JSON.generate(to_dynamic, options) | |
| 2349 | + end | |
| 2350 | +end | |
| 2351 | + | |
| 2352 | +class UnimpeachablyElement < Dry::Struct | |
| 2353 | + attribute :bool, Types::Bool.optional | |
| 2354 | + attribute :unimpeachably_class, UnimpeachablyClass.optional | |
| 2355 | + | |
| 2356 | + def self.from_dynamic!(d) | |
| 2357 | + if schema[:bool].right.valid? d | |
| 2358 | + return new(bool: d, unimpeachably_class: nil) | |
| 2359 | + end | |
| 2360 | + begin | |
| 2361 | + value = UnimpeachablyClass.from_dynamic!(d) | |
| 2362 | + if schema[:unimpeachably_class].right.valid? value | |
| 2363 | + return new(unimpeachably_class: value, bool: nil) | |
| 2364 | + end | |
| 2365 | + rescue | |
| 2366 | + end | |
| 2367 | + raise "Invalid union" | |
| 2368 | + end | |
| 2369 | + | |
| 2370 | + def self.from_json!(json) | |
| 2371 | + from_dynamic!(JSON.parse(json)) | |
| 2372 | + end | |
| 2373 | + | |
| 2374 | + def to_dynamic | |
| 2375 | + if bool != nil | |
| 2376 | + bool | |
| 2377 | + elsif unimpeachably_class != nil | |
| 2378 | + unimpeachably_class.to_dynamic | |
| 2379 | + end | |
| 2380 | + end | |
| 2381 | + | |
| 2382 | + def to_json(options = nil) | |
| 2383 | + JSON.generate(to_dynamic, options) | |
| 2384 | + end | |
| 2385 | +end | |
| 2386 | + | |
| 2387 | +class Unmortgaged < Dry::Struct | |
| 2388 | + attribute :double, Types::Double.optional | |
| 2389 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2390 | + attribute :null, Types::Nil.optional | |
| 2391 | + | |
| 2392 | + def self.from_dynamic!(d) | |
| 2393 | + if schema[:double].right.valid? d | |
| 2394 | + return new(double: d, integer_map: nil, null: nil) | |
| 2395 | + end | |
| 2396 | + begin | |
| 2397 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2398 | + if schema[:integer_map].right.valid? value | |
| 2399 | + return new(integer_map: value, double: nil, null: nil) | |
| 2400 | + end | |
| 2401 | + rescue | |
| 2402 | + end | |
| 2403 | + if schema[:null].right.valid? d | |
| 2404 | + return new(null: d, double: nil, integer_map: nil) | |
| 2405 | + end | |
| 2406 | + raise "Invalid union" | |
| 2407 | + end | |
| 2408 | + | |
| 2409 | + def self.from_json!(json) | |
| 2410 | + from_dynamic!(JSON.parse(json)) | |
| 2411 | + end | |
| 2412 | + | |
| 2413 | + def to_dynamic | |
| 2414 | + if double != nil | |
| 2415 | + double | |
| 2416 | + elsif integer_map != nil | |
| 2417 | + integer_map | |
| 2418 | + else | |
| 2419 | + nil | |
| 2420 | + end | |
| 2421 | + end | |
| 2422 | + | |
| 2423 | + def to_json(options = nil) | |
| 2424 | + JSON.generate(to_dynamic, options) | |
| 2425 | + end | |
| 2426 | +end | |
| 2427 | + | |
| 2428 | +class Unobstructed < Dry::Struct | |
| 2429 | + attribute :integer, Types::Integer.optional | |
| 2430 | + attribute :null, Types::Nil.optional | |
| 2431 | + attribute :quebrachine_class, QuebrachineClass.optional | |
| 2432 | + | |
| 2433 | + def self.from_dynamic!(d) | |
| 2434 | + if schema[:integer].right.valid? d | |
| 2435 | + return new(integer: d, quebrachine_class: nil, null: nil) | |
| 2436 | + end | |
| 2437 | + if schema[:null].right.valid? d | |
| 2438 | + return new(null: d, quebrachine_class: nil, integer: nil) | |
| 2439 | + end | |
| 2440 | + begin | |
| 2441 | + value = QuebrachineClass.from_dynamic!(d) | |
| 2442 | + if schema[:quebrachine_class].right.valid? value | |
| 2443 | + return new(quebrachine_class: value, integer: nil, null: nil) | |
| 2444 | + end | |
| 2445 | + rescue | |
| 2446 | + end | |
| 2447 | + raise "Invalid union" | |
| 2448 | + end | |
| 2449 | + | |
| 2450 | + def self.from_json!(json) | |
| 2451 | + from_dynamic!(JSON.parse(json)) | |
| 2452 | + end | |
| 2453 | + | |
| 2454 | + def to_dynamic | |
| 2455 | + if integer != nil | |
| 2456 | + integer | |
| 2457 | + elsif quebrachine_class != nil | |
| 2458 | + quebrachine_class.to_dynamic | |
| 2459 | + else | |
| 2460 | + nil | |
| 2461 | + end | |
| 2462 | + end | |
| 2463 | + | |
| 2464 | + def to_json(options = nil) | |
| 2465 | + JSON.generate(to_dynamic, options) | |
| 2466 | + end | |
| 2467 | +end | |
| 2468 | + | |
| 2469 | +class Unreceptivity < Dry::Struct | |
| 2470 | + attribute :integer, Types::Integer.optional | |
| 2471 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2472 | + attribute :string, Types::String.optional | |
| 2473 | + | |
| 2474 | + def self.from_dynamic!(d) | |
| 2475 | + if schema[:integer].right.valid? d | |
| 2476 | + return new(integer: d, null_array: nil, string: nil) | |
| 2477 | + end | |
| 2478 | + if schema[:null_array].right.valid? d | |
| 2479 | + return new(null_array: d, integer: nil, string: nil) | |
| 2480 | + end | |
| 2481 | + if schema[:string].right.valid? d | |
| 2482 | + return new(string: d, null_array: nil, integer: nil) | |
| 2483 | + end | |
| 2484 | + raise "Invalid union" | |
| 2485 | + end | |
| 2486 | + | |
| 2487 | + def self.from_json!(json) | |
| 2488 | + from_dynamic!(JSON.parse(json)) | |
| 2489 | + end | |
| 2490 | + | |
| 2491 | + def to_dynamic | |
| 2492 | + if integer != nil | |
| 2493 | + integer | |
| 2494 | + elsif null_array != nil | |
| 2495 | + null_array | |
| 2496 | + elsif string != nil | |
| 2497 | + string | |
| 2498 | + end | |
| 2499 | + end | |
| 2500 | + | |
| 2501 | + def to_json(options = nil) | |
| 2502 | + JSON.generate(to_dynamic, options) | |
| 2503 | + end | |
| 2504 | +end | |
| 2505 | + | |
| 2506 | +class Unsatisfactoriness < Dry::Struct | |
| 2507 | + attribute :bool, Types::Bool.optional | |
| 2508 | + attribute :integer, Types::Integer.optional | |
| 2509 | + attribute :integer_array, Types.Array(Types::Integer).optional | |
| 2510 | + | |
| 2511 | + def self.from_dynamic!(d) | |
| 2512 | + if schema[:bool].right.valid? d | |
| 2513 | + return new(bool: d, integer_array: nil, integer: nil) | |
| 2514 | + end | |
| 2515 | + if schema[:integer].right.valid? d | |
| 2516 | + return new(integer: d, integer_array: nil, bool: nil) | |
| 2517 | + end | |
| 2518 | + if schema[:integer_array].right.valid? d | |
| 2519 | + return new(integer_array: d, bool: nil, integer: nil) | |
| 2520 | + end | |
| 2521 | + raise "Invalid union" | |
| 2522 | + end | |
| 2523 | + | |
| 2524 | + def self.from_json!(json) | |
| 2525 | + from_dynamic!(JSON.parse(json)) | |
| 2526 | + end | |
| 2527 | + | |
| 2528 | + def to_dynamic | |
| 2529 | + if bool != nil | |
| 2530 | + bool | |
| 2531 | + elsif integer != nil | |
| 2532 | + integer | |
| 2533 | + elsif integer_array != nil | |
| 2534 | + integer_array | |
| 2535 | + end | |
| 2536 | + end | |
| 2537 | + | |
| 2538 | + def to_json(options = nil) | |
| 2539 | + JSON.generate(to_dynamic, options) | |
| 2540 | + end | |
| 2541 | +end | |
| 2542 | + | |
| 2543 | +class UnstressedClass < Dry::Struct | |
| 2544 | + attribute :alain, Types::Nil | |
| 2545 | + attribute :amphirhina, Types::Nil | |
| 2546 | + attribute :antimachinery, Types::Nil | |
| 2547 | + attribute :coldish, Types::Nil | |
| 2548 | + attribute :crantara, Types::Nil | |
| 2549 | + attribute :distinguishing, Types::Nil | |
| 2550 | + attribute :elytroposis, Types::Nil | |
| 2551 | + attribute :gentianwort, Types::Nil | |
| 2552 | + attribute :heliosis, Types::Nil | |
| 2553 | + attribute :instrumental, Types::Nil | |
| 2554 | + attribute :introinflection, Types::Nil | |
| 2555 | + attribute :kala, Types::Nil | |
| 2556 | + attribute :lincolnian, Types::Nil | |
| 2557 | + attribute :metad, Types::Nil | |
| 2558 | + attribute :sarcophilus, Types::Nil | |
| 2559 | + attribute :swingingly, Types::Nil | |
| 2560 | + attribute :unconformity, Types::Nil | |
| 2561 | + attribute :undecreed, Types::Nil | |
| 2562 | + attribute :venerable, Types::Nil | |
| 2563 | + attribute :vowellessness, Types::Nil | |
| 2564 | + | |
| 2565 | + def self.from_dynamic!(d) | |
| 2566 | + d = Types::Hash[d] | |
| 2567 | + new( | |
| 2568 | + alain: d.fetch("Alain"), | |
| 2569 | + amphirhina: d.fetch("Amphirhina"), | |
| 2570 | + antimachinery: d.fetch("antimachinery"), | |
| 2571 | + coldish: d.fetch("coldish"), | |
| 2572 | + crantara: d.fetch("crantara"), | |
| 2573 | + distinguishing: d.fetch("distinguishing"), | |
| 2574 | + elytroposis: d.fetch("elytroposis"), | |
| 2575 | + gentianwort: d.fetch("gentianwort"), | |
| 2576 | + heliosis: d.fetch("heliosis"), | |
| 2577 | + instrumental: d.fetch("instrumental"), | |
| 2578 | + introinflection: d.fetch("introinflection"), | |
| 2579 | + kala: d.fetch("kala"), | |
| 2580 | + lincolnian: d.fetch("Lincolnian"), | |
| 2581 | + metad: d.fetch("metad"), | |
| 2582 | + sarcophilus: d.fetch("Sarcophilus"), | |
| 2583 | + swingingly: d.fetch("swingingly"), | |
| 2584 | + unconformity: d.fetch("unconformity"), | |
| 2585 | + undecreed: d.fetch("undecreed"), | |
| 2586 | + venerable: d.fetch("venerable"), | |
| 2587 | + vowellessness: d.fetch("vowellessness"), | |
| 2588 | + ) | |
| 2589 | + end | |
| 2590 | + | |
| 2591 | + def self.from_json!(json) | |
| 2592 | + from_dynamic!(JSON.parse(json)) | |
| 2593 | + end | |
| 2594 | + | |
| 2595 | + def to_dynamic | |
| 2596 | + { | |
| 2597 | + "Alain" => alain, | |
| 2598 | + "Amphirhina" => amphirhina, | |
| 2599 | + "antimachinery" => antimachinery, | |
| 2600 | + "coldish" => coldish, | |
| 2601 | + "crantara" => crantara, | |
| 2602 | + "distinguishing" => distinguishing, | |
| 2603 | + "elytroposis" => elytroposis, | |
| 2604 | + "gentianwort" => gentianwort, | |
| 2605 | + "heliosis" => heliosis, | |
| 2606 | + "instrumental" => instrumental, | |
| 2607 | + "introinflection" => introinflection, | |
| 2608 | + "kala" => kala, | |
| 2609 | + "Lincolnian" => lincolnian, | |
| 2610 | + "metad" => metad, | |
| 2611 | + "Sarcophilus" => sarcophilus, | |
| 2612 | + "swingingly" => swingingly, | |
| 2613 | + "unconformity" => unconformity, | |
| 2614 | + "undecreed" => undecreed, | |
| 2615 | + "venerable" => venerable, | |
| 2616 | + "vowellessness" => vowellessness, | |
| 2617 | + } | |
| 2618 | + end | |
| 2619 | + | |
| 2620 | + def to_json(options = nil) | |
| 2621 | + JSON.generate(to_dynamic, options) | |
| 2622 | + end | |
| 2623 | +end | |
| 2624 | + | |
| 2625 | +class UnstressedElement < Dry::Struct | |
| 2626 | + attribute :bool, Types::Bool.optional | |
| 2627 | + attribute :string, Types::String.optional | |
| 2628 | + attribute :unstressed_class, UnstressedClass.optional | |
| 2629 | + | |
| 2630 | + def self.from_dynamic!(d) | |
| 2631 | + if schema[:bool].right.valid? d | |
| 2632 | + return new(bool: d, unstressed_class: nil, string: nil) | |
| 2633 | + end | |
| 2634 | + if schema[:string].right.valid? d | |
| 2635 | + return new(string: d, bool: nil, unstressed_class: nil) | |
| 2636 | + end | |
| 2637 | + begin | |
| 2638 | + value = UnstressedClass.from_dynamic!(d) | |
| 2639 | + if schema[:unstressed_class].right.valid? value | |
| 2640 | + return new(unstressed_class: value, bool: nil, string: nil) | |
| 2641 | + end | |
| 2642 | + rescue | |
| 2643 | + end | |
| 2644 | + raise "Invalid union" | |
| 2645 | + end | |
| 2646 | + | |
| 2647 | + def self.from_json!(json) | |
| 2648 | + from_dynamic!(JSON.parse(json)) | |
| 2649 | + end | |
| 2650 | + | |
| 2651 | + def to_dynamic | |
| 2652 | + if bool != nil | |
| 2653 | + bool | |
| 2654 | + elsif string != nil | |
| 2655 | + string | |
| 2656 | + elsif unstressed_class != nil | |
| 2657 | + unstressed_class.to_dynamic | |
| 2658 | + end | |
| 2659 | + end | |
| 2660 | + | |
| 2661 | + def to_json(options = nil) | |
| 2662 | + JSON.generate(to_dynamic, options) | |
| 2663 | + end | |
| 2664 | +end | |
| 2665 | + | |
| 2666 | +class Untasked < Dry::Struct | |
| 2667 | + attribute :double, Types::Double.optional | |
| 2668 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2669 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2670 | + | |
| 2671 | + def self.from_dynamic!(d) | |
| 2672 | + if schema[:double].right.valid? d | |
| 2673 | + return new(double: d, null_array: nil, integer_map: nil) | |
| 2674 | + end | |
| 2675 | + begin | |
| 2676 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2677 | + if schema[:integer_map].right.valid? value | |
| 2678 | + return new(integer_map: value, null_array: nil, double: nil) | |
| 2679 | + end | |
| 2680 | + rescue | |
| 2681 | + end | |
| 2682 | + if schema[:null_array].right.valid? d | |
| 2683 | + return new(null_array: d, double: nil, integer_map: nil) | |
| 2684 | + end | |
| 2685 | + raise "Invalid union" | |
| 2686 | + end | |
| 2687 | + | |
| 2688 | + def self.from_json!(json) | |
| 2689 | + from_dynamic!(JSON.parse(json)) | |
| 2690 | + end | |
| 2691 | + | |
| 2692 | + def to_dynamic | |
| 2693 | + if double != nil | |
| 2694 | + double | |
| 2695 | + elsif integer_map != nil | |
| 2696 | + integer_map | |
| 2697 | + elsif null_array != nil | |
| 2698 | + null_array | |
| 2699 | + end | |
| 2700 | + end | |
| 2701 | + | |
| 2702 | + def to_json(options = nil) | |
| 2703 | + JSON.generate(to_dynamic, options) | |
| 2704 | + end | |
| 2705 | +end | |
| 2706 | + | |
| 2707 | +class Unvarying < Dry::Struct | |
| 2708 | + attribute :bool, Types::Bool.optional | |
| 2709 | + attribute :double, Types::Double.optional | |
| 2710 | + attribute :integer_map, Types::Hash.meta(of: Types::Integer).optional | |
| 2711 | + | |
| 2712 | + def self.from_dynamic!(d) | |
| 2713 | + if schema[:bool].right.valid? d | |
| 2714 | + return new(bool: d, double: nil, integer_map: nil) | |
| 2715 | + end | |
| 2716 | + if schema[:double].right.valid? d | |
| 2717 | + return new(double: d, bool: nil, integer_map: nil) | |
| 2718 | + end | |
| 2719 | + begin | |
| 2720 | + value = Types::Hash[d].map { |k, v| [k, Types::Integer[v]] }.to_h | |
| 2721 | + if schema[:integer_map].right.valid? value | |
| 2722 | + return new(integer_map: value, bool: nil, double: nil) | |
| 2723 | + end | |
| 2724 | + rescue | |
| 2725 | + end | |
| 2726 | + raise "Invalid union" | |
| 2727 | + end | |
| 2728 | + | |
| 2729 | + def self.from_json!(json) | |
| 2730 | + from_dynamic!(JSON.parse(json)) | |
| 2731 | + end | |
| 2732 | + | |
| 2733 | + def to_dynamic | |
| 2734 | + if bool != nil | |
| 2735 | + bool | |
| 2736 | + elsif double != nil | |
| 2737 | + double | |
| 2738 | + elsif integer_map != nil | |
| 2739 | + integer_map | |
| 2740 | + end | |
| 2741 | + end | |
| 2742 | + | |
| 2743 | + def to_json(options = nil) | |
| 2744 | + JSON.generate(to_dynamic, options) | |
| 2745 | + end | |
| 2746 | +end | |
| 2747 | + | |
| 2748 | +class Vehemently < Dry::Struct | |
| 2749 | + attribute :bool, Types::Bool.optional | |
| 2750 | + attribute :null, Types::Nil.optional | |
| 2751 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2752 | + | |
| 2753 | + def self.from_dynamic!(d) | |
| 2754 | + if schema[:bool].right.valid? d | |
| 2755 | + return new(bool: d, null_array: nil, null: nil) | |
| 2756 | + end | |
| 2757 | + if schema[:null].right.valid? d | |
| 2758 | + return new(null: d, null_array: nil, bool: nil) | |
| 2759 | + end | |
| 2760 | + if schema[:null_array].right.valid? d | |
| 2761 | + return new(null_array: d, bool: nil, null: nil) | |
| 2762 | + end | |
| 2763 | + raise "Invalid union" | |
| 2764 | + end | |
| 2765 | + | |
| 2766 | + def self.from_json!(json) | |
| 2767 | + from_dynamic!(JSON.parse(json)) | |
| 2768 | + end | |
| 2769 | + | |
| 2770 | + def to_dynamic | |
| 2771 | + if bool != nil | |
| 2772 | + bool | |
| 2773 | + elsif null_array != nil | |
| 2774 | + null_array | |
| 2775 | + else | |
| 2776 | + nil | |
| 2777 | + end | |
| 2778 | + end | |
| 2779 | + | |
| 2780 | + def to_json(options = nil) | |
| 2781 | + JSON.generate(to_dynamic, options) | |
| 2782 | + end | |
| 2783 | +end | |
| 2784 | + | |
| 2785 | +class Whitepot < Dry::Struct | |
| 2786 | + attribute :double, Types::Double.optional | |
| 2787 | + attribute :quebrachine_class, QuebrachineClass.optional | |
| 2788 | + | |
| 2789 | + def self.from_dynamic!(d) | |
| 2790 | + if schema[:double].right.valid? d | |
| 2791 | + return new(double: d, quebrachine_class: nil) | |
| 2792 | + end | |
| 2793 | + begin | |
| 2794 | + value = QuebrachineClass.from_dynamic!(d) | |
| 2795 | + if schema[:quebrachine_class].right.valid? value | |
| 2796 | + return new(quebrachine_class: value, double: nil) | |
| 2797 | + end | |
| 2798 | + rescue | |
| 2799 | + end | |
| 2800 | + raise "Invalid union" | |
| 2801 | + end | |
| 2802 | + | |
| 2803 | + def self.from_json!(json) | |
| 2804 | + from_dynamic!(JSON.parse(json)) | |
| 2805 | + end | |
| 2806 | + | |
| 2807 | + def to_dynamic | |
| 2808 | + if double != nil | |
| 2809 | + double | |
| 2810 | + elsif quebrachine_class != nil | |
| 2811 | + quebrachine_class.to_dynamic | |
| 2812 | + end | |
| 2813 | + end | |
| 2814 | + | |
| 2815 | + def to_json(options = nil) | |
| 2816 | + JSON.generate(to_dynamic, options) | |
| 2817 | + end | |
| 2818 | +end | |
| 2819 | + | |
| 2820 | +class WrothyClass < Dry::Struct | |
| 2821 | + attribute :aeschynanthus, Types::Nil | |
| 2822 | + attribute :aquiferous, Types::Nil | |
| 2823 | + attribute :cheapener, Types::Nil | |
| 2824 | + attribute :enumeration, Types::Nil | |
| 2825 | + attribute :ephesine, Types::Nil | |
| 2826 | + attribute :escadrille, Types::Nil | |
| 2827 | + attribute :estrous, Types::Nil | |
| 2828 | + attribute :interestedly, Types::Nil | |
| 2829 | + attribute :katakinetomer, Types::Nil | |
| 2830 | + attribute :mortification, Types::Nil | |
| 2831 | + attribute :morula, Types::Nil | |
| 2832 | + attribute :orthosymmetrical, Types::Nil | |
| 2833 | + attribute :overbark, Types::Nil | |
| 2834 | + attribute :politist, Types::Nil | |
| 2835 | + attribute :qualified, Types::Nil | |
| 2836 | + attribute :sphenomalar, Types::Nil | |
| 2837 | + attribute :throatful, Types::Nil | |
| 2838 | + attribute :transhumance, Types::Nil | |
| 2839 | + attribute :triandrian, Types::Nil | |
| 2840 | + attribute :unbooked, Types::Nil | |
| 2841 | + | |
| 2842 | + def self.from_dynamic!(d) | |
| 2843 | + d = Types::Hash[d] | |
| 2844 | + new( | |
| 2845 | + aeschynanthus: d.fetch("Aeschynanthus"), | |
| 2846 | + aquiferous: d.fetch("aquiferous"), | |
| 2847 | + cheapener: d.fetch("cheapener"), | |
| 2848 | + enumeration: d.fetch("enumeration"), | |
| 2849 | + ephesine: d.fetch("Ephesine"), | |
| 2850 | + escadrille: d.fetch("escadrille"), | |
| 2851 | + estrous: d.fetch("estrous"), | |
| 2852 | + interestedly: d.fetch("interestedly"), | |
| 2853 | + katakinetomer: d.fetch("katakinetomer"), | |
| 2854 | + mortification: d.fetch("mortification"), | |
| 2855 | + morula: d.fetch("morula"), | |
| 2856 | + orthosymmetrical: d.fetch("orthosymmetrical"), | |
| 2857 | + overbark: d.fetch("overbark"), | |
| 2858 | + politist: d.fetch("politist"), | |
| 2859 | + qualified: d.fetch("qualified"), | |
| 2860 | + sphenomalar: d.fetch("sphenomalar"), | |
| 2861 | + throatful: d.fetch("throatful"), | |
| 2862 | + transhumance: d.fetch("transhumance"), | |
| 2863 | + triandrian: d.fetch("triandrian"), | |
| 2864 | + unbooked: d.fetch("unbooked"), | |
| 2865 | + ) | |
| 2866 | + end | |
| 2867 | + | |
| 2868 | + def self.from_json!(json) | |
| 2869 | + from_dynamic!(JSON.parse(json)) | |
| 2870 | + end | |
| 2871 | + | |
| 2872 | + def to_dynamic | |
| 2873 | + { | |
| 2874 | + "Aeschynanthus" => aeschynanthus, | |
| 2875 | + "aquiferous" => aquiferous, | |
| 2876 | + "cheapener" => cheapener, | |
| 2877 | + "enumeration" => enumeration, | |
| 2878 | + "Ephesine" => ephesine, | |
| 2879 | + "escadrille" => escadrille, | |
| 2880 | + "estrous" => estrous, | |
| 2881 | + "interestedly" => interestedly, | |
| 2882 | + "katakinetomer" => katakinetomer, | |
| 2883 | + "mortification" => mortification, | |
| 2884 | + "morula" => morula, | |
| 2885 | + "orthosymmetrical" => orthosymmetrical, | |
| 2886 | + "overbark" => overbark, | |
| 2887 | + "politist" => politist, | |
| 2888 | + "qualified" => qualified, | |
| 2889 | + "sphenomalar" => sphenomalar, | |
| 2890 | + "throatful" => throatful, | |
| 2891 | + "transhumance" => transhumance, | |
| 2892 | + "triandrian" => triandrian, | |
| 2893 | + "unbooked" => unbooked, | |
| 2894 | + } | |
| 2895 | + end | |
| 2896 | + | |
| 2897 | + def to_json(options = nil) | |
| 2898 | + JSON.generate(to_dynamic, options) | |
| 2899 | + end | |
| 2900 | +end | |
| 2901 | + | |
| 2902 | +class WrothyElement < Dry::Struct | |
| 2903 | + attribute :null_array, Types.Array(Types::Nil).optional | |
| 2904 | + attribute :wrothy_class, WrothyClass.optional | |
| 2905 | + | |
| 2906 | + def self.from_dynamic!(d) | |
| 2907 | + if schema[:null_array].right.valid? d | |
| 2908 | + return new(null_array: d, wrothy_class: nil) | |
| 2909 | + end | |
| 2910 | + begin | |
| 2911 | + value = WrothyClass.from_dynamic!(d) | |
| 2912 | + if schema[:wrothy_class].right.valid? value | |
| 2913 | + return new(wrothy_class: value, null_array: nil) | |
| 2914 | + end | |
| 2915 | + rescue | |
| 2916 | + end | |
| 2917 | + raise "Invalid union" | |
| 2918 | + end | |
| 2919 | + | |
| 2920 | + def self.from_json!(json) | |
| 2921 | + from_dynamic!(JSON.parse(json)) | |
| 2922 | + end | |
| 2923 | + | |
| 2924 | + def to_dynamic | |
| 2925 | + if null_array != nil | |
| 2926 | + null_array | |
| 2927 | + elsif wrothy_class != nil | |
| 2928 | + wrothy_class.to_dynamic | |
| 2929 | + end | |
| 2930 | + end | |
| 2931 | + | |
| 2932 | + def to_json(options = nil) | |
| 2933 | + JSON.generate(to_dynamic, options) | |
| 2934 | + end | |
| 2935 | +end | |
| 2936 | + | |
| 2937 | +class TopLevel < Dry::Struct | |
| 2938 | + attribute :protrusive, Types.Array(Types.Instance(Protrusive)) | |
| 2939 | + attribute :pulpitism, Types.Array(Types.Instance(PulpitismElement)) | |
| 2940 | + attribute :pyodermia, Types.Array(Types.Instance(PyodermiaElement)) | |
| 2941 | + attribute :quebrachine, Types.Array(Types.Instance(QuebrachineElement)) | |
| 2942 | + attribute :querier, Types.Array(Types.Instance(Querier)) | |
| 2943 | + attribute :rebarbative, Types.Array(Types.Instance(Rebarbative)) | |
| 2944 | + attribute :reimagine, Types.Array(Reimagine) | |
| 2945 | + attribute :ressaut, Ressaut | |
| 2946 | + attribute :retrocervical, Types.Array(Types.Instance(Retrocervical)) | |
| 2947 | + attribute :revert, Types.Array(Types.Instance(Revert)) | |
| 2948 | + attribute :rewrite, Types.Array(Types.Instance(RewriteElement)) | |
| 2949 | + attribute :saccoderm, Types.Array(Types.Instance(Saccoderm)) | |
| 2950 | + attribute :santir, Types.Array(Types.Instance(SantirElement)) | |
| 2951 | + attribute :saprophilous, Types.Array(Types.Instance(Saprophilous)) | |
| 2952 | + attribute :saxten, Types.Array(Types.Instance(SaxtenElement)) | |
| 2953 | + attribute :scatty, Types.Array(Scatty.optional) | |
| 2954 | + attribute :scoffer, Types.Array(Types.Instance(Scoffer)) | |
| 2955 | + attribute :scrampum, Types.Array(Types.Instance(Scrampum)) | |
| 2956 | + attribute :semantic, Types::Double | |
| 2957 | + attribute :serpentinic, Types.Array(Types.Instance(Serpentinic)) | |
| 2958 | + attribute :shadowable, Types.Array(Types.Instance(Shadowable)) | |
| 2959 | + attribute :sistering, Types.Array(Types.Instance(SisteringElement)) | |
| 2960 | + attribute :staghunting, Types.Array(Staghunting) | |
| 2961 | + attribute :stagmometer, Types.Array(Types.Instance(Stagmometer)) | |
| 2962 | + attribute :stimulability, Types.Array(Types.Instance(Stimulability)) | |
| 2963 | + attribute :strangleable, Types.Array(Types.Instance(Strangleable)) | |
| 2964 | + attribute :strenuosity, Types.Array(Types.Instance(StrenuosityElement)) | |
| 2965 | + attribute :tabaxir, Types.Array(Types.Instance(Tabaxir)) | |
| 2966 | + attribute :talpiform, Types.Array(Types.Instance(Talpiform)) | |
| 2967 | + attribute :thwack, Types.Array(Types.Instance(Thwack)) | |
| 2968 | + attribute :to, Types.Array(Types::Double.optional) | |
| 2969 | + attribute :tortricine, Types.Array(Types.Instance(Tortricine)) | |
| 2970 | + attribute :truantcy, Types.Array(Types.Instance(TruantcyElement)) | |
| 2971 | + attribute :turgesce, Types.Array(Types::String) | |
| 2972 | + attribute :unbeginning, Types.Array(Types.Instance(Unbeginning)) | |
| 2973 | + attribute :underdunged, Types.Array(Types::Double) | |
| 2974 | + attribute :undesirability, Types.Array(Types.Instance(Undesirability)) | |
| 2975 | + attribute :unerasing, Types.Array(Types.Instance(Unerasing)) | |
| 2976 | + attribute :unguentarium, Types.Array(Types.Instance(Unguentarium)) | |
| 2977 | + attribute :unimpeachably, Types.Array(Types.Instance(UnimpeachablyElement)) | |
| 2978 | + attribute :unmortgaged, Types.Array(Types.Instance(Unmortgaged)) | |
| 2979 | + attribute :unobstructed, Types.Array(Types.Instance(Unobstructed)) | |
| 2980 | + attribute :unreceptivity, Types.Array(Types.Instance(Unreceptivity)) | |
| 2981 | + attribute :unsatisfactoriness, Types.Array(Types.Instance(Unsatisfactoriness)) | |
| 2982 | + attribute :unsecurity, Types.Array(Types::Integer) | |
| 2983 | + attribute :unstressed, Types.Array(Types.Instance(UnstressedElement)) | |
| 2984 | + attribute :untasked, Types.Array(Types.Instance(Untasked)) | |
| 2985 | + attribute :unvarying, Types.Array(Types.Instance(Unvarying)) | |
| 2986 | + attribute :vehemently, Types.Array(Types.Instance(Vehemently)) | |
| 2987 | + attribute :warriorship, Types::Hash.meta(of: Types::Bool) | |
| 2988 | + attribute :whitepot, Types.Array(Types.Instance(Whitepot)) | |
| 2989 | + attribute :wrothy, Types.Array(Types.Instance(WrothyElement)) | |
| 2990 | + | |
| 2991 | + def self.from_dynamic!(d) | |
| 2992 | + d = Types::Hash[d] | |
| 2993 | + new( | |
| 2994 | + protrusive: d.fetch("protrusive").map { |x| Protrusive.from_dynamic!(x) }, | |
| 2995 | + pulpitism: d.fetch("pulpitism").map { |x| PulpitismElement.from_dynamic!(x) }, | |
| 2996 | + pyodermia: d.fetch("pyodermia").map { |x| PyodermiaElement.from_dynamic!(x) }, | |
| 2997 | + quebrachine: d.fetch("quebrachine").map { |x| QuebrachineElement.from_dynamic!(x) }, | |
| 2998 | + querier: d.fetch("querier").map { |x| Querier.from_dynamic!(x) }, | |
| 2999 | + rebarbative: d.fetch("rebarbative").map { |x| Rebarbative.from_dynamic!(x) }, | |
| 3000 | + reimagine: d.fetch("reimagine").map { |x| Reimagine.from_dynamic!(x) }, | |
| 3001 | + ressaut: Ressaut.from_dynamic!(d.fetch("ressaut")), | |
| 3002 | + retrocervical: d.fetch("retrocervical").map { |x| Retrocervical.from_dynamic!(x) }, | |
| 3003 | + revert: d.fetch("revert").map { |x| Revert.from_dynamic!(x) }, | |
| 3004 | + rewrite: d.fetch("rewrite").map { |x| RewriteElement.from_dynamic!(x) }, | |
| 3005 | + saccoderm: d.fetch("saccoderm").map { |x| Saccoderm.from_dynamic!(x) }, | |
| 3006 | + santir: d.fetch("santir").map { |x| SantirElement.from_dynamic!(x) }, | |
| 3007 | + saprophilous: d.fetch("saprophilous").map { |x| Saprophilous.from_dynamic!(x) }, | |
| 3008 | + saxten: d.fetch("saxten").map { |x| SaxtenElement.from_dynamic!(x) }, | |
| 3009 | + scatty: d.fetch("scatty").map { |x| x ? Scatty.from_dynamic!(x) : nil }, | |
| 3010 | + scoffer: d.fetch("scoffer").map { |x| Scoffer.from_dynamic!(x) }, | |
| 3011 | + scrampum: d.fetch("scrampum").map { |x| Scrampum.from_dynamic!(x) }, | |
| 3012 | + semantic: d.fetch("semantic"), | |
| 3013 | + serpentinic: d.fetch("serpentinic").map { |x| Serpentinic.from_dynamic!(x) }, | |
| 3014 | + shadowable: d.fetch("shadowable").map { |x| Shadowable.from_dynamic!(x) }, | |
| 3015 | + sistering: d.fetch("sistering").map { |x| SisteringElement.from_dynamic!(x) }, | |
| 3016 | + staghunting: d.fetch("staghunting").map { |x| Staghunting.from_dynamic!(x) }, | |
| 3017 | + stagmometer: d.fetch("stagmometer").map { |x| Stagmometer.from_dynamic!(x) }, | |
| 3018 | + stimulability: d.fetch("stimulability").map { |x| Stimulability.from_dynamic!(x) }, | |
| 3019 | + strangleable: d.fetch("strangleable").map { |x| Strangleable.from_dynamic!(x) }, | |
| 3020 | + strenuosity: d.fetch("strenuosity").map { |x| StrenuosityElement.from_dynamic!(x) }, | |
| 3021 | + tabaxir: d.fetch("tabaxir").map { |x| Tabaxir.from_dynamic!(x) }, | |
| 3022 | + talpiform: d.fetch("talpiform").map { |x| Talpiform.from_dynamic!(x) }, | |
| 3023 | + thwack: d.fetch("thwack").map { |x| Thwack.from_dynamic!(x) }, | |
| 3024 | + to: d.fetch("to"), | |
| 3025 | + tortricine: d.fetch("tortricine").map { |x| Tortricine.from_dynamic!(x) }, | |
| 3026 | + truantcy: d.fetch("truantcy").map { |x| TruantcyElement.from_dynamic!(x) }, | |
| 3027 | + turgesce: d.fetch("turgesce"), | |
| 3028 | + unbeginning: d.fetch("unbeginning").map { |x| Unbeginning.from_dynamic!(x) }, | |
| 3029 | + underdunged: d.fetch("underdunged"), | |
| 3030 | + undesirability: d.fetch("undesirability").map { |x| Undesirability.from_dynamic!(x) }, | |
| 3031 | + unerasing: d.fetch("unerasing").map { |x| Unerasing.from_dynamic!(x) }, | |
| 3032 | + unguentarium: d.fetch("unguentarium").map { |x| Unguentarium.from_dynamic!(x) }, | |
| 3033 | + unimpeachably: d.fetch("unimpeachably").map { |x| UnimpeachablyElement.from_dynamic!(x) }, | |
| 3034 | + unmortgaged: d.fetch("unmortgaged").map { |x| Unmortgaged.from_dynamic!(x) }, | |
| 3035 | + unobstructed: d.fetch("unobstructed").map { |x| Unobstructed.from_dynamic!(x) }, | |
| 3036 | + unreceptivity: d.fetch("unreceptivity").map { |x| Unreceptivity.from_dynamic!(x) }, | |
| 3037 | + unsatisfactoriness: d.fetch("unsatisfactoriness").map { |x| Unsatisfactoriness.from_dynamic!(x) }, | |
| 3038 | + unsecurity: d.fetch("unsecurity"), | |
| 3039 | + unstressed: d.fetch("unstressed").map { |x| UnstressedElement.from_dynamic!(x) }, | |
| 3040 | + untasked: d.fetch("untasked").map { |x| Untasked.from_dynamic!(x) }, | |
| 3041 | + unvarying: d.fetch("unvarying").map { |x| Unvarying.from_dynamic!(x) }, | |
| 3042 | + vehemently: d.fetch("vehemently").map { |x| Vehemently.from_dynamic!(x) }, | |
| 3043 | + warriorship: Types::Hash[d.fetch("warriorship")].map { |k, v| [k, Types::Bool[v]] }.to_h, | |
| 3044 | + whitepot: d.fetch("whitepot").map { |x| Whitepot.from_dynamic!(x) }, | |
| 3045 | + wrothy: d.fetch("wrothy").map { |x| WrothyElement.from_dynamic!(x) }, | |
| 3046 | + ) | |
| 3047 | + end | |
| 3048 | + | |
| 3049 | + def self.from_json!(json) | |
| 3050 | + from_dynamic!(JSON.parse(json)) | |
| 3051 | + end | |
| 3052 | + | |
| 3053 | + def to_dynamic | |
| 3054 | + { | |
| 3055 | + "protrusive" => protrusive.map { |x| x.to_dynamic }, | |
| 3056 | + "pulpitism" => pulpitism.map { |x| x.to_dynamic }, | |
| 3057 | + "pyodermia" => pyodermia.map { |x| x.to_dynamic }, | |
| 3058 | + "quebrachine" => quebrachine.map { |x| x.to_dynamic }, | |
| 3059 | + "querier" => querier.map { |x| x.to_dynamic }, | |
| 3060 | + "rebarbative" => rebarbative.map { |x| x.to_dynamic }, | |
| 3061 | + "reimagine" => reimagine.map { |x| x.to_dynamic }, | |
| 3062 | + "ressaut" => ressaut.to_dynamic, | |
| 3063 | + "retrocervical" => retrocervical.map { |x| x.to_dynamic }, | |
| 3064 | + "revert" => revert.map { |x| x.to_dynamic }, | |
| 3065 | + "rewrite" => rewrite.map { |x| x.to_dynamic }, | |
| 3066 | + "saccoderm" => saccoderm.map { |x| x.to_dynamic }, | |
| 3067 | + "santir" => santir.map { |x| x.to_dynamic }, | |
| 3068 | + "saprophilous" => saprophilous.map { |x| x.to_dynamic }, | |
| 3069 | + "saxten" => saxten.map { |x| x.to_dynamic }, | |
| 3070 | + "scatty" => scatty.map { |x| x&.to_dynamic }, | |
| 3071 | + "scoffer" => scoffer.map { |x| x.to_dynamic }, | |
| 3072 | + "scrampum" => scrampum.map { |x| x.to_dynamic }, | |
| 3073 | + "semantic" => semantic, | |
| 3074 | + "serpentinic" => serpentinic.map { |x| x.to_dynamic }, | |
| 3075 | + "shadowable" => shadowable.map { |x| x.to_dynamic }, | |
| 3076 | + "sistering" => sistering.map { |x| x.to_dynamic }, | |
| 3077 | + "staghunting" => staghunting.map { |x| x.to_dynamic }, | |
| 3078 | + "stagmometer" => stagmometer.map { |x| x.to_dynamic }, | |
| 3079 | + "stimulability" => stimulability.map { |x| x.to_dynamic }, | |
| 3080 | + "strangleable" => strangleable.map { |x| x.to_dynamic }, | |
| 3081 | + "strenuosity" => strenuosity.map { |x| x.to_dynamic }, | |
| 3082 | + "tabaxir" => tabaxir.map { |x| x.to_dynamic }, | |
| 3083 | + "talpiform" => talpiform.map { |x| x.to_dynamic }, | |
| 3084 | + "thwack" => thwack.map { |x| x.to_dynamic }, | |
| 3085 | + "to" => to, | |
| 3086 | + "tortricine" => tortricine.map { |x| x.to_dynamic }, | |
| 3087 | + "truantcy" => truantcy.map { |x| x.to_dynamic }, | |
| 3088 | + "turgesce" => turgesce, | |
| 3089 | + "unbeginning" => unbeginning.map { |x| x.to_dynamic }, | |
| 3090 | + "underdunged" => underdunged, | |
| 3091 | + "undesirability" => undesirability.map { |x| x.to_dynamic }, | |
| 3092 | + "unerasing" => unerasing.map { |x| x.to_dynamic }, | |
| 3093 | + "unguentarium" => unguentarium.map { |x| x.to_dynamic }, | |
| 3094 | + "unimpeachably" => unimpeachably.map { |x| x.to_dynamic }, | |
| 3095 | + "unmortgaged" => unmortgaged.map { |x| x.to_dynamic }, | |
| 3096 | + "unobstructed" => unobstructed.map { |x| x.to_dynamic }, | |
| 3097 | + "unreceptivity" => unreceptivity.map { |x| x.to_dynamic }, | |
| 3098 | + "unsatisfactoriness" => unsatisfactoriness.map { |x| x.to_dynamic }, | |
| 3099 | + "unsecurity" => unsecurity, | |
| 3100 | + "unstressed" => unstressed.map { |x| x.to_dynamic }, | |
| 3101 | + "untasked" => untasked.map { |x| x.to_dynamic }, | |
| 3102 | + "unvarying" => unvarying.map { |x| x.to_dynamic }, | |
| 3103 | + "vehemently" => vehemently.map { |x| x.to_dynamic }, | |
| 3104 | + "warriorship" => warriorship, | |
| 3105 | + "whitepot" => whitepot.map { |x| x.to_dynamic }, | |
| 3106 | + "wrothy" => wrothy.map { |x| x.to_dynamic }, | |
| 3107 | + } | |
| 3108 | + end | |
| 3109 | + | |
| 3110 | + def to_json(options = nil) | |
| 3111 | + JSON.generate(to_dynamic, options) | |
| 3112 | + end | |
| 3113 | +end |
Test case
1 generated file · +5 −5test/inputs/schema/class-map-union.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+5 −5
| @@ -55,11 +55,11 @@ sealed class UnionValue { | ||
| 55 | 55 | |
| 56 | 56 | companion object { |
| 57 | 57 | fun fromJson(jn: JsonNode): UnionValue = when (jn) { |
| 58 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 59 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 60 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 61 | - is ObjectNode -> UnionClassValue(mapper.treeToValue(jn)) | |
| 62 | - else -> throw IllegalArgumentException() | |
| 58 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 59 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 60 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 61 | + is ObjectNode -> UnionClassValue(mapper.treeToValue(jn)) | |
| 62 | + else -> throw IllegalArgumentException() | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | } |
Test case
1 generated file · +3 −3test/inputs/schema/class-with-additional.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+3 −3
| @@ -51,9 +51,9 @@ sealed class MapValue { | ||
| 51 | 51 | |
| 52 | 52 | companion object { |
| 53 | 53 | fun fromJson(jn: JsonNode): MapValue = when (jn) { |
| 54 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 55 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 56 | - else -> throw IllegalArgumentException() | |
| 54 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 55 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 56 | + else -> throw IllegalArgumentException() | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
Test case
1 generated file · +3 −3test/inputs/schema/constructor.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+3 −3
| @@ -51,9 +51,9 @@ sealed class UnionConstructor { | ||
| 51 | 51 | |
| 52 | 52 | companion object { |
| 53 | 53 | fun fromJson(jn: JsonNode): UnionConstructor = when (jn) { |
| 54 | - is ObjectNode -> ConstructorValue(mapper.treeToValue(jn)) | |
| 55 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 56 | - else -> throw IllegalArgumentException() | |
| 54 | + is ObjectNode -> ConstructorValue(mapper.treeToValue(jn)) | |
| 55 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 56 | + else -> throw IllegalArgumentException() | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
Test case
1 generated file · +3 −3test/inputs/schema/integer-before-number.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+3 −3
| @@ -44,9 +44,9 @@ sealed class TopLevel { | ||
| 44 | 44 | |
| 45 | 45 | companion object { |
| 46 | 46 | fun fromJson(jn: JsonNode): TopLevel = when (jn) { |
| 47 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 48 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 49 | - else -> throw IllegalArgumentException() | |
| 47 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 48 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 49 | + else -> throw IllegalArgumentException() | |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | } |
Test case
1 generated file · +3 −3test/inputs/schema/integer-float-union.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+3 −3
| @@ -52,9 +52,9 @@ sealed class Number { | ||
| 52 | 52 | |
| 53 | 53 | companion object { |
| 54 | 54 | fun fromJson(jn: JsonNode): Number = when (jn) { |
| 55 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 56 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 57 | - else -> throw IllegalArgumentException() | |
| 55 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 56 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 57 | + else -> throw IllegalArgumentException() | |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
Test case
1 generated file · +3 −3test/inputs/schema/minmaxlength.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+3 −3
| @@ -73,9 +73,9 @@ sealed class InUnion { | ||
| 73 | 73 | |
| 74 | 74 | companion object { |
| 75 | 75 | fun fromJson(jn: JsonNode): InUnion = when (jn) { |
| 76 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 77 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 78 | - else -> throw IllegalArgumentException() | |
| 76 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 77 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 78 | + else -> throw IllegalArgumentException() | |
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | } |
Test case
1 generated file · +5 −5test/inputs/schema/multi-type-enum.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+5 −5
| @@ -57,11 +57,11 @@ sealed class FooUnion { | ||
| 57 | 57 | |
| 58 | 58 | companion object { |
| 59 | 59 | fun fromJson(jn: JsonNode): FooUnion = when (jn) { |
| 60 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 61 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 62 | - is TextNode -> EnumValue(mapper.treeToValue(jn)) | |
| 63 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 64 | - else -> throw IllegalArgumentException() | |
| 60 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 61 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 62 | + is TextNode -> EnumValue(mapper.treeToValue(jn)) | |
| 63 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 64 | + else -> throw IllegalArgumentException() | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | } |
Test case
1 generated file · +32 −32test/inputs/schema/recursive-union-flattening.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+32 −32
| @@ -54,14 +54,14 @@ sealed class TopLevel { | ||
| 54 | 54 | |
| 55 | 55 | companion object { |
| 56 | 56 | fun fromJson(jn: JsonNode): TopLevel = when (jn) { |
| 57 | - is ObjectNode -> AnythingMapValue(mapper.treeToValue(jn)) | |
| 58 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 59 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 60 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 61 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 62 | - is ArrayNode -> UnionArrayValue(mapper.treeToValue(jn)) | |
| 63 | - null -> NullValue() | |
| 64 | - else -> throw IllegalArgumentException() | |
| 57 | + is ObjectNode -> AnythingMapValue(mapper.treeToValue(jn)) | |
| 58 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 59 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 60 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 61 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 62 | + is ArrayNode -> UnionArrayValue(mapper.treeToValue(jn)) | |
| 63 | + null -> NullValue() | |
| 64 | + else -> throw IllegalArgumentException() | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | } |
| @@ -87,14 +87,14 @@ sealed class TopLevelElement { | ||
| 87 | 87 | |
| 88 | 88 | companion object { |
| 89 | 89 | fun fromJson(jn: JsonNode): TopLevelElement = when (jn) { |
| 90 | - is ArrayNode -> AnythingArrayValue(mapper.treeToValue(jn)) | |
| 91 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 92 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 93 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 94 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 95 | - is ObjectNode -> TopLevelClassValue(mapper.treeToValue(jn)) | |
| 96 | - null -> NullValue() | |
| 97 | - else -> throw IllegalArgumentException() | |
| 90 | + is ArrayNode -> AnythingArrayValue(mapper.treeToValue(jn)) | |
| 91 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 92 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 93 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 94 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 95 | + is ObjectNode -> TopLevelClassValue(mapper.treeToValue(jn)) | |
| 96 | + null -> NullValue() | |
| 97 | + else -> throw IllegalArgumentException() | |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } |
| @@ -128,14 +128,14 @@ sealed class XElement { | ||
| 128 | 128 | |
| 129 | 129 | companion object { |
| 130 | 130 | fun fromJson(jn: JsonNode): XElement = when (jn) { |
| 131 | - is ArrayNode -> AnythingArrayValue(mapper.treeToValue(jn)) | |
| 132 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 133 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 134 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 135 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 136 | - is ObjectNode -> XClassValue(mapper.treeToValue(jn)) | |
| 137 | - null -> NullValue() | |
| 138 | - else -> throw IllegalArgumentException() | |
| 131 | + is ArrayNode -> AnythingArrayValue(mapper.treeToValue(jn)) | |
| 132 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 133 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 134 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 135 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 136 | + is ObjectNode -> XClassValue(mapper.treeToValue(jn)) | |
| 137 | + null -> NullValue() | |
| 138 | + else -> throw IllegalArgumentException() | |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | } |
| @@ -161,14 +161,14 @@ sealed class X { | ||
| 161 | 161 | |
| 162 | 162 | companion object { |
| 163 | 163 | fun fromJson(jn: JsonNode): X = when (jn) { |
| 164 | - is ObjectNode -> AnythingMapValue(mapper.treeToValue(jn)) | |
| 165 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 166 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 167 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 168 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 169 | - is ArrayNode -> UnionArrayValue(mapper.treeToValue(jn)) | |
| 170 | - null -> NullValue() | |
| 171 | - else -> throw IllegalArgumentException() | |
| 164 | + is ObjectNode -> AnythingMapValue(mapper.treeToValue(jn)) | |
| 165 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 166 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 167 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 168 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 169 | + is ArrayNode -> UnionArrayValue(mapper.treeToValue(jn)) | |
| 170 | + null -> NullValue() | |
| 171 | + else -> throw IllegalArgumentException() | |
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
Test case
1 generated file · +8 −8test/inputs/schema/unevaluated-properties.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+8 −8
| @@ -67,14 +67,14 @@ sealed class Closed { | ||
| 67 | 67 | |
| 68 | 68 | companion object { |
| 69 | 69 | fun fromJson(jn: JsonNode): Closed = when (jn) { |
| 70 | - is ArrayNode -> AnythingArrayValue(mapper.treeToValue(jn)) | |
| 71 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 72 | - is ObjectNode -> ClosedClassValue(mapper.treeToValue(jn)) | |
| 73 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 74 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 75 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 76 | - null -> NullValue() | |
| 77 | - else -> throw IllegalArgumentException() | |
| 70 | + is ArrayNode -> AnythingArrayValue(mapper.treeToValue(jn)) | |
| 71 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 72 | + is ObjectNode -> ClosedClassValue(mapper.treeToValue(jn)) | |
| 73 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 74 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 75 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 76 | + null -> NullValue() | |
| 77 | + else -> throw IllegalArgumentException() | |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } |
Test case
1 generated file · +4 −4test/inputs/schema/union-int-double.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+4 −4
| @@ -54,10 +54,10 @@ sealed class Value { | ||
| 54 | 54 | |
| 55 | 55 | companion object { |
| 56 | 56 | fun fromJson(jn: JsonNode): Value = when (jn) { |
| 57 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 58 | - is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 59 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 60 | - else -> throw IllegalArgumentException() | |
| 57 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 58 | + is IntNode, is LongNode -> IntegerValue(mapper.treeToValue(jn)) | |
| 59 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 60 | + else -> throw IllegalArgumentException() | |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | } |
Test case
1 generated file · +48 −48test/inputs/schema/vega-lite.schema
Mschema-kotlin-jacksondefault / TopLevel.kt+48 −48
| @@ -1026,9 +1026,9 @@ sealed class FontWeightUnion { | ||
| 1026 | 1026 | |
| 1027 | 1027 | companion object { |
| 1028 | 1028 | fun fromJson(jn: JsonNode): FontWeightUnion = when (jn) { |
| 1029 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1030 | - is TextNode -> EnumValue(mapper.treeToValue(jn)) | |
| 1031 | - else -> throw IllegalArgumentException() | |
| 1029 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1030 | + is TextNode -> EnumValue(mapper.treeToValue(jn)) | |
| 1031 | + else -> throw IllegalArgumentException() | |
| 1032 | 1032 | } |
| 1033 | 1033 | } |
| 1034 | 1034 | } |
| @@ -1405,9 +1405,9 @@ sealed class Label { | ||
| 1405 | 1405 | |
| 1406 | 1406 | companion object { |
| 1407 | 1407 | fun fromJson(jn: JsonNode): Label = when (jn) { |
| 1408 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 1409 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1410 | - else -> throw IllegalArgumentException() | |
| 1408 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 1409 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1410 | + else -> throw IllegalArgumentException() | |
| 1411 | 1411 | } |
| 1412 | 1412 | } |
| 1413 | 1413 | } |
| @@ -1459,9 +1459,9 @@ sealed class TitleFontWeight { | ||
| 1459 | 1459 | |
| 1460 | 1460 | companion object { |
| 1461 | 1461 | fun fromJson(jn: JsonNode): TitleFontWeight = when (jn) { |
| 1462 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1463 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 1464 | - else -> throw IllegalArgumentException() | |
| 1462 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 1463 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 1464 | + else -> throw IllegalArgumentException() | |
| 1465 | 1465 | } |
| 1466 | 1466 | } |
| 1467 | 1467 | } |
| @@ -2248,9 +2248,9 @@ sealed class Padding { | ||
| 2248 | 2248 | |
| 2249 | 2249 | companion object { |
| 2250 | 2250 | fun fromJson(jn: JsonNode): Padding = when (jn) { |
| 2251 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 2252 | - is ObjectNode -> PaddingClassValue(mapper.treeToValue(jn)) | |
| 2253 | - else -> throw IllegalArgumentException() | |
| 2251 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 2252 | + is ObjectNode -> PaddingClassValue(mapper.treeToValue(jn)) | |
| 2253 | + else -> throw IllegalArgumentException() | |
| 2254 | 2254 | } |
| 2255 | 2255 | } |
| 2256 | 2256 | } |
| @@ -4047,11 +4047,11 @@ sealed class ValuesValue { | ||
| 4047 | 4047 | |
| 4048 | 4048 | companion object { |
| 4049 | 4049 | fun fromJson(jn: JsonNode): ValuesValue = when (jn) { |
| 4050 | - is ObjectNode -> AnythingMapValue(mapper.treeToValue(jn)) | |
| 4051 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 4052 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4053 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4054 | - else -> throw IllegalArgumentException() | |
| 4050 | + is ObjectNode -> AnythingMapValue(mapper.treeToValue(jn)) | |
| 4051 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 4052 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4053 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4054 | + else -> throw IllegalArgumentException() | |
| 4055 | 4055 | } |
| 4056 | 4056 | } |
| 4057 | 4057 | } |
| @@ -4597,11 +4597,11 @@ sealed class Equal { | ||
| 4597 | 4597 | |
| 4598 | 4598 | companion object { |
| 4599 | 4599 | fun fromJson(jn: JsonNode): Equal = when (jn) { |
| 4600 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 4601 | - is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 4602 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4603 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4604 | - else -> throw IllegalArgumentException() | |
| 4600 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 4601 | + is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 4602 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4603 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4604 | + else -> throw IllegalArgumentException() | |
| 4605 | 4605 | } |
| 4606 | 4606 | } |
| 4607 | 4607 | } |
| @@ -4689,9 +4689,9 @@ sealed class Day { | ||
| 4689 | 4689 | |
| 4690 | 4690 | companion object { |
| 4691 | 4691 | fun fromJson(jn: JsonNode): Day = when (jn) { |
| 4692 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4693 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4694 | - else -> throw IllegalArgumentException() | |
| 4692 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4693 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4694 | + else -> throw IllegalArgumentException() | |
| 4695 | 4695 | } |
| 4696 | 4696 | } |
| 4697 | 4697 | } |
| @@ -4712,9 +4712,9 @@ sealed class Month { | ||
| 4712 | 4712 | |
| 4713 | 4713 | companion object { |
| 4714 | 4714 | fun fromJson(jn: JsonNode): Month = when (jn) { |
| 4715 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4716 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4717 | - else -> throw IllegalArgumentException() | |
| 4715 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4716 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4717 | + else -> throw IllegalArgumentException() | |
| 4718 | 4718 | } |
| 4719 | 4719 | } |
| 4720 | 4720 | } |
| @@ -4732,10 +4732,10 @@ sealed class RangeElement { | ||
| 4732 | 4732 | |
| 4733 | 4733 | companion object { |
| 4734 | 4734 | fun fromJson(jn: JsonNode): RangeElement = when (jn) { |
| 4735 | - is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 4736 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4737 | - null -> NullValue() | |
| 4738 | - else -> throw IllegalArgumentException() | |
| 4735 | + is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 4736 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4737 | + null -> NullValue() | |
| 4738 | + else -> throw IllegalArgumentException() | |
| 4739 | 4739 | } |
| 4740 | 4740 | } |
| 4741 | 4741 | } |
| @@ -4868,10 +4868,10 @@ sealed class ConditionalValueDefValue { | ||
| 4868 | 4868 | |
| 4869 | 4869 | companion object { |
| 4870 | 4870 | fun fromJson(jn: JsonNode): ConditionalValueDefValue = when (jn) { |
| 4871 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 4872 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4873 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4874 | - else -> throw IllegalArgumentException() | |
| 4871 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 4872 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 4873 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 4874 | + else -> throw IllegalArgumentException() | |
| 4875 | 4875 | } |
| 4876 | 4876 | } |
| 4877 | 4877 | } |
| @@ -5125,10 +5125,10 @@ sealed class LegendValue { | ||
| 5125 | 5125 | |
| 5126 | 5126 | companion object { |
| 5127 | 5127 | fun fromJson(jn: JsonNode): LegendValue = when (jn) { |
| 5128 | - is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 5129 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 5130 | - is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 5131 | - else -> throw IllegalArgumentException() | |
| 5128 | + is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 5129 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 5130 | + is TextNode -> StringValue(mapper.treeToValue(jn)) | |
| 5131 | + else -> throw IllegalArgumentException() | |
| 5132 | 5132 | } |
| 5133 | 5133 | } |
| 5134 | 5134 | } |
| @@ -5518,11 +5518,11 @@ sealed class NiceUnion { | ||
| 5518 | 5518 | |
| 5519 | 5519 | companion object { |
| 5520 | 5520 | fun fromJson(jn: JsonNode): NiceUnion = when (jn) { |
| 5521 | - is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 5522 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 5523 | - is TextNode -> EnumValue(mapper.treeToValue(jn)) | |
| 5524 | - is ObjectNode -> NiceClassValue(mapper.treeToValue(jn)) | |
| 5525 | - else -> throw IllegalArgumentException() | |
| 5521 | + is BooleanNode -> BoolValue(mapper.treeToValue(jn)) | |
| 5522 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 5523 | + is TextNode -> EnumValue(mapper.treeToValue(jn)) | |
| 5524 | + is ObjectNode -> NiceClassValue(mapper.treeToValue(jn)) | |
| 5525 | + else -> throw IllegalArgumentException() | |
| 5526 | 5526 | } |
| 5527 | 5527 | } |
| 5528 | 5528 | } |
| @@ -6695,9 +6695,9 @@ sealed class AxisValue { | ||
| 6695 | 6695 | |
| 6696 | 6696 | companion object { |
| 6697 | 6697 | fun fromJson(jn: JsonNode): AxisValue = when (jn) { |
| 6698 | - is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 6699 | - is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 6700 | - else -> throw IllegalArgumentException() | |
| 6698 | + is ObjectNode -> DateTimeValue(mapper.treeToValue(jn)) | |
| 6699 | + is IntNode, is LongNode, is DoubleNode -> DoubleValue(mapper.treeToValue(jn)) | |
| 6700 | + else -> throw IllegalArgumentException() | |
| 6701 | 6701 | } |
| 6702 | 6702 | } |
| 6703 | 6703 | } |
No generated files match these filters.