deimos-ruby 1.14.4 → 1.14.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/lib/deimos/consume/batch_consumption.rb +12 -12
- data/lib/deimos/version.rb +1 -1
- data/lib/generators/deimos/schema_class_generator.rb +20 -1
- data/spec/generators/schema_class_generator_spec.rb +0 -1
- data/spec/schemas/com/my-namespace/MySchemaId_key.avsc +1 -1
- data/spec/snapshots/consumers-no-nest.snap +1150 -0
- data/spec/snapshots/consumers.snap +1177 -0
- data/spec/snapshots/consumers_and_producers-no-nest.snap +941 -0
- data/spec/snapshots/consumers_and_producers.snap +974 -0
- data/spec/snapshots/consumers_circular-no-nest.snap +1255 -15
- data/spec/snapshots/consumers_circular.snap +1280 -21
- data/spec/snapshots/consumers_complex_types-no-nest.snap +1138 -84
- data/spec/snapshots/consumers_complex_types.snap +1208 -111
- data/spec/snapshots/consumers_nested-no-nest.snap +1200 -0
- data/spec/snapshots/consumers_nested.snap +1219 -0
- data/spec/snapshots/producers_with_key-no-nest.snap +1250 -7
- data/spec/snapshots/producers_with_key.snap +1256 -0
- metadata +3 -3
@@ -1,3 +1,413 @@
|
|
1
|
+
spec/app/lib/schema_classes/a_record.rb:
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
5
|
+
module Schemas
|
6
|
+
### Primary Schema Class ###
|
7
|
+
# Autogenerated Schema for Record at com.my-namespace.ARecord
|
8
|
+
class ARecord < Deimos::SchemaClass::Record
|
9
|
+
|
10
|
+
### Attribute Accessors ###
|
11
|
+
# @param value [String]
|
12
|
+
attr_accessor :a_record_field
|
13
|
+
|
14
|
+
# @override
|
15
|
+
def initialize(a_record_field: nil)
|
16
|
+
super
|
17
|
+
self.a_record_field = a_record_field
|
18
|
+
end
|
19
|
+
|
20
|
+
# @override
|
21
|
+
def schema
|
22
|
+
'ARecord'
|
23
|
+
end
|
24
|
+
|
25
|
+
# @override
|
26
|
+
def namespace
|
27
|
+
'com.my-namespace'
|
28
|
+
end
|
29
|
+
|
30
|
+
# @override
|
31
|
+
def to_h
|
32
|
+
{
|
33
|
+
'a_record_field' => @a_record_field
|
34
|
+
}
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
spec/app/lib/schema_classes/an_enum.rb:
|
41
|
+
# frozen_string_literal: true
|
42
|
+
|
43
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
44
|
+
module Schemas
|
45
|
+
### Primary Schema Class ###
|
46
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnEnum
|
47
|
+
class AnEnum < Deimos::SchemaClass::Enum
|
48
|
+
# @return ['sym1', 'sym2']
|
49
|
+
attr_accessor :an_enum
|
50
|
+
|
51
|
+
# :nodoc:
|
52
|
+
def initialize(an_enum)
|
53
|
+
super
|
54
|
+
self.an_enum = an_enum
|
55
|
+
end
|
56
|
+
|
57
|
+
# @override
|
58
|
+
def symbols
|
59
|
+
%w(sym1 sym2)
|
60
|
+
end
|
61
|
+
|
62
|
+
# @override
|
63
|
+
def to_h
|
64
|
+
@an_enum
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
spec/app/lib/schema_classes/another_enum.rb:
|
71
|
+
# frozen_string_literal: true
|
72
|
+
|
73
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
74
|
+
module Schemas
|
75
|
+
### Primary Schema Class ###
|
76
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnotherEnum
|
77
|
+
class AnotherEnum < Deimos::SchemaClass::Enum
|
78
|
+
# @return ['sym3', 'sym4']
|
79
|
+
attr_accessor :another_enum
|
80
|
+
|
81
|
+
# :nodoc:
|
82
|
+
def initialize(another_enum)
|
83
|
+
super
|
84
|
+
self.another_enum = another_enum
|
85
|
+
end
|
86
|
+
|
87
|
+
# @override
|
88
|
+
def symbols
|
89
|
+
%w(sym3 sym4)
|
90
|
+
end
|
91
|
+
|
92
|
+
# @override
|
93
|
+
def to_h
|
94
|
+
@another_enum
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
|
100
|
+
spec/app/lib/schema_classes/create_topic.rb:
|
101
|
+
# frozen_string_literal: true
|
102
|
+
|
103
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
104
|
+
module Schemas
|
105
|
+
### Primary Schema Class ###
|
106
|
+
# Autogenerated Schema for Record at com.my-namespace.response.CreateTopic
|
107
|
+
class CreateTopic < Deimos::SchemaClass::Record
|
108
|
+
|
109
|
+
### Attribute Accessors ###
|
110
|
+
# @param value [String]
|
111
|
+
attr_accessor :response_id
|
112
|
+
|
113
|
+
# @override
|
114
|
+
def initialize(response_id: nil)
|
115
|
+
super
|
116
|
+
self.response_id = response_id
|
117
|
+
end
|
118
|
+
|
119
|
+
# @override
|
120
|
+
def schema
|
121
|
+
'CreateTopic'
|
122
|
+
end
|
123
|
+
|
124
|
+
# @override
|
125
|
+
def namespace
|
126
|
+
'com.my-namespace.response'
|
127
|
+
end
|
128
|
+
|
129
|
+
# @override
|
130
|
+
def to_h
|
131
|
+
{
|
132
|
+
'response_id' => @response_id
|
133
|
+
}
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
|
139
|
+
spec/app/lib/schema_classes/generated.rb:
|
140
|
+
# frozen_string_literal: true
|
141
|
+
|
142
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
143
|
+
module Schemas
|
144
|
+
### Primary Schema Class ###
|
145
|
+
# Autogenerated Schema for Record at com.my-namespace.Generated
|
146
|
+
class Generated < Deimos::SchemaClass::Record
|
147
|
+
|
148
|
+
### Attribute Readers ###
|
149
|
+
# @return [AnEnum]
|
150
|
+
attr_reader :an_enum
|
151
|
+
# @return [ARecord]
|
152
|
+
attr_reader :a_record
|
153
|
+
|
154
|
+
### Attribute Accessors ###
|
155
|
+
# @param value [String]
|
156
|
+
attr_accessor :a_string
|
157
|
+
# @param value [Integer]
|
158
|
+
attr_accessor :a_int
|
159
|
+
# @param value [Integer]
|
160
|
+
attr_accessor :a_long
|
161
|
+
# @param value [Float]
|
162
|
+
attr_accessor :a_float
|
163
|
+
# @param value [Float]
|
164
|
+
attr_accessor :a_double
|
165
|
+
# @param value [nil, Integer]
|
166
|
+
attr_accessor :an_optional_int
|
167
|
+
# @param values [Array<Integer>]
|
168
|
+
attr_accessor :an_array
|
169
|
+
# @param values [Hash<String, String>]
|
170
|
+
attr_accessor :a_map
|
171
|
+
# @param value [String]
|
172
|
+
attr_accessor :timestamp
|
173
|
+
# @param value [String]
|
174
|
+
attr_accessor :message_id
|
175
|
+
|
176
|
+
### Attribute Writers ###
|
177
|
+
# @param value [AnEnum]
|
178
|
+
def an_enum=(value)
|
179
|
+
@an_enum = AnEnum.initialize_from_value(value)
|
180
|
+
end
|
181
|
+
|
182
|
+
# @param value [ARecord]
|
183
|
+
def a_record=(value)
|
184
|
+
@a_record = ARecord.initialize_from_value(value)
|
185
|
+
end
|
186
|
+
|
187
|
+
# @override
|
188
|
+
def initialize(a_string: nil,
|
189
|
+
a_int: nil,
|
190
|
+
a_long: nil,
|
191
|
+
a_float: nil,
|
192
|
+
a_double: nil,
|
193
|
+
an_optional_int: nil,
|
194
|
+
an_enum: nil,
|
195
|
+
an_array: nil,
|
196
|
+
a_map: nil,
|
197
|
+
timestamp: nil,
|
198
|
+
message_id: nil,
|
199
|
+
a_record: nil)
|
200
|
+
super
|
201
|
+
self.a_string = a_string
|
202
|
+
self.a_int = a_int
|
203
|
+
self.a_long = a_long
|
204
|
+
self.a_float = a_float
|
205
|
+
self.a_double = a_double
|
206
|
+
self.an_optional_int = an_optional_int
|
207
|
+
self.an_enum = an_enum
|
208
|
+
self.an_array = an_array
|
209
|
+
self.a_map = a_map
|
210
|
+
self.timestamp = timestamp
|
211
|
+
self.message_id = message_id
|
212
|
+
self.a_record = a_record
|
213
|
+
end
|
214
|
+
|
215
|
+
# @override
|
216
|
+
def schema
|
217
|
+
'Generated'
|
218
|
+
end
|
219
|
+
|
220
|
+
# @override
|
221
|
+
def namespace
|
222
|
+
'com.my-namespace'
|
223
|
+
end
|
224
|
+
|
225
|
+
# @override
|
226
|
+
def to_h
|
227
|
+
{
|
228
|
+
'a_string' => @a_string,
|
229
|
+
'a_int' => @a_int,
|
230
|
+
'a_long' => @a_long,
|
231
|
+
'a_float' => @a_float,
|
232
|
+
'a_double' => @a_double,
|
233
|
+
'an_optional_int' => @an_optional_int,
|
234
|
+
'an_enum' => @an_enum&.to_h,
|
235
|
+
'an_array' => @an_array,
|
236
|
+
'a_map' => @a_map,
|
237
|
+
'timestamp' => @timestamp,
|
238
|
+
'message_id' => @message_id,
|
239
|
+
'a_record' => @a_record&.to_h
|
240
|
+
}
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
|
246
|
+
spec/app/lib/schema_classes/index.rb:
|
247
|
+
# frozen_string_literal: true
|
248
|
+
|
249
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
250
|
+
module Schemas
|
251
|
+
### Primary Schema Class ###
|
252
|
+
# Autogenerated Schema for Record at com.my-namespace.response.Index
|
253
|
+
class Index < Deimos::SchemaClass::Record
|
254
|
+
|
255
|
+
### Attribute Accessors ###
|
256
|
+
# @param value [String]
|
257
|
+
attr_accessor :response_id
|
258
|
+
|
259
|
+
# @override
|
260
|
+
def initialize(response_id: nil)
|
261
|
+
super
|
262
|
+
self.response_id = response_id
|
263
|
+
end
|
264
|
+
|
265
|
+
# @override
|
266
|
+
def schema
|
267
|
+
'Index'
|
268
|
+
end
|
269
|
+
|
270
|
+
# @override
|
271
|
+
def namespace
|
272
|
+
'com.my-namespace.response'
|
273
|
+
end
|
274
|
+
|
275
|
+
# @override
|
276
|
+
def to_h
|
277
|
+
{
|
278
|
+
'response_id' => @response_id
|
279
|
+
}
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
|
285
|
+
spec/app/lib/schema_classes/my_nested_record.rb:
|
286
|
+
# frozen_string_literal: true
|
287
|
+
|
288
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
289
|
+
module Schemas
|
290
|
+
### Primary Schema Class ###
|
291
|
+
# Autogenerated Schema for Record at com.my-namespace.MyNestedRecord
|
292
|
+
class MyNestedRecord < Deimos::SchemaClass::Record
|
293
|
+
|
294
|
+
### Attribute Accessors ###
|
295
|
+
# @param value [Integer]
|
296
|
+
attr_accessor :some_int
|
297
|
+
# @param value [Float]
|
298
|
+
attr_accessor :some_float
|
299
|
+
# @param value [String]
|
300
|
+
attr_accessor :some_string
|
301
|
+
# @param value [nil, Integer]
|
302
|
+
attr_accessor :some_optional_int
|
303
|
+
|
304
|
+
# @override
|
305
|
+
def initialize(some_int: nil,
|
306
|
+
some_float: nil,
|
307
|
+
some_string: nil,
|
308
|
+
some_optional_int: nil)
|
309
|
+
super
|
310
|
+
self.some_int = some_int
|
311
|
+
self.some_float = some_float
|
312
|
+
self.some_string = some_string
|
313
|
+
self.some_optional_int = some_optional_int
|
314
|
+
end
|
315
|
+
|
316
|
+
# @override
|
317
|
+
def schema
|
318
|
+
'MyNestedRecord'
|
319
|
+
end
|
320
|
+
|
321
|
+
# @override
|
322
|
+
def namespace
|
323
|
+
'com.my-namespace'
|
324
|
+
end
|
325
|
+
|
326
|
+
# @override
|
327
|
+
def to_h
|
328
|
+
{
|
329
|
+
'some_int' => @some_int,
|
330
|
+
'some_float' => @some_float,
|
331
|
+
'some_string' => @some_string,
|
332
|
+
'some_optional_int' => @some_optional_int
|
333
|
+
}
|
334
|
+
end
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
338
|
+
|
339
|
+
spec/app/lib/schema_classes/my_nested_schema.rb:
|
340
|
+
# frozen_string_literal: true
|
341
|
+
|
342
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
343
|
+
module Schemas
|
344
|
+
### Primary Schema Class ###
|
345
|
+
# Autogenerated Schema for Record at com.my-namespace.MyNestedSchema
|
346
|
+
class MyNestedSchema < Deimos::SchemaClass::Record
|
347
|
+
|
348
|
+
### Attribute Readers ###
|
349
|
+
# @return [MyNestedRecord]
|
350
|
+
attr_reader :some_nested_record
|
351
|
+
# @return [nil, MyNestedRecord]
|
352
|
+
attr_reader :some_optional_record
|
353
|
+
|
354
|
+
### Attribute Accessors ###
|
355
|
+
# @param value [String]
|
356
|
+
attr_accessor :test_id
|
357
|
+
# @param value [Float]
|
358
|
+
attr_accessor :test_float
|
359
|
+
# @param values [Array<String>]
|
360
|
+
attr_accessor :test_array
|
361
|
+
|
362
|
+
### Attribute Writers ###
|
363
|
+
# @param value [MyNestedRecord]
|
364
|
+
def some_nested_record=(value)
|
365
|
+
@some_nested_record = MyNestedRecord.initialize_from_value(value)
|
366
|
+
end
|
367
|
+
|
368
|
+
# @param value [nil, MyNestedRecord]
|
369
|
+
def some_optional_record=(value)
|
370
|
+
@some_optional_record = MyNestedRecord.initialize_from_value(value)
|
371
|
+
end
|
372
|
+
|
373
|
+
# @override
|
374
|
+
def initialize(test_id: nil,
|
375
|
+
test_float: nil,
|
376
|
+
test_array: nil,
|
377
|
+
some_nested_record: nil,
|
378
|
+
some_optional_record: nil)
|
379
|
+
super
|
380
|
+
self.test_id = test_id
|
381
|
+
self.test_float = test_float
|
382
|
+
self.test_array = test_array
|
383
|
+
self.some_nested_record = some_nested_record
|
384
|
+
self.some_optional_record = some_optional_record
|
385
|
+
end
|
386
|
+
|
387
|
+
# @override
|
388
|
+
def schema
|
389
|
+
'MyNestedSchema'
|
390
|
+
end
|
391
|
+
|
392
|
+
# @override
|
393
|
+
def namespace
|
394
|
+
'com.my-namespace'
|
395
|
+
end
|
396
|
+
|
397
|
+
# @override
|
398
|
+
def to_h
|
399
|
+
{
|
400
|
+
'test_id' => @test_id,
|
401
|
+
'test_float' => @test_float,
|
402
|
+
'test_array' => @test_array,
|
403
|
+
'some_nested_record' => @some_nested_record&.to_h,
|
404
|
+
'some_optional_record' => @some_optional_record&.to_h
|
405
|
+
}
|
406
|
+
end
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
|
1
411
|
spec/app/lib/schema_classes/my_schema.rb:
|
2
412
|
# frozen_string_literal: true
|
3
413
|
|
@@ -55,28 +465,111 @@ module Schemas
|
|
55
465
|
end
|
56
466
|
|
57
467
|
|
58
|
-
spec/app/lib/schema_classes/
|
468
|
+
spec/app/lib/schema_classes/my_schema_compound_key.rb:
|
59
469
|
# frozen_string_literal: true
|
60
470
|
|
61
471
|
# This file is autogenerated by Deimos, Do NOT modify
|
62
472
|
module Schemas
|
63
473
|
### Primary Schema Class ###
|
64
|
-
# Autogenerated Schema for Record at com.my-namespace.
|
65
|
-
class
|
474
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaCompound_key
|
475
|
+
class MySchemaCompoundKey < Deimos::SchemaClass::Record
|
66
476
|
|
67
477
|
### Attribute Accessors ###
|
68
478
|
# @param value [String]
|
69
|
-
attr_accessor :
|
479
|
+
attr_accessor :part_one
|
480
|
+
# @param value [String]
|
481
|
+
attr_accessor :part_two
|
70
482
|
|
71
483
|
# @override
|
72
|
-
def initialize(
|
484
|
+
def initialize(part_one: nil,
|
485
|
+
part_two: nil)
|
73
486
|
super
|
74
|
-
self.
|
487
|
+
self.part_one = part_one
|
488
|
+
self.part_two = part_two
|
75
489
|
end
|
76
490
|
|
77
491
|
# @override
|
78
492
|
def schema
|
79
|
-
'
|
493
|
+
'MySchemaCompound_key'
|
494
|
+
end
|
495
|
+
|
496
|
+
# @override
|
497
|
+
def namespace
|
498
|
+
'com.my-namespace'
|
499
|
+
end
|
500
|
+
|
501
|
+
# @override
|
502
|
+
def to_h
|
503
|
+
{
|
504
|
+
'part_one' => @part_one,
|
505
|
+
'part_two' => @part_two
|
506
|
+
}
|
507
|
+
end
|
508
|
+
end
|
509
|
+
end
|
510
|
+
|
511
|
+
|
512
|
+
spec/app/lib/schema_classes/my_schema_id_key.rb:
|
513
|
+
# frozen_string_literal: true
|
514
|
+
|
515
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
516
|
+
module Schemas
|
517
|
+
### Primary Schema Class ###
|
518
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaId_key
|
519
|
+
class MySchemaIdKey < Deimos::SchemaClass::Record
|
520
|
+
|
521
|
+
### Attribute Accessors ###
|
522
|
+
# @param value [Integer]
|
523
|
+
attr_accessor :id
|
524
|
+
|
525
|
+
# @override
|
526
|
+
def initialize(id: nil)
|
527
|
+
super
|
528
|
+
self.id = id
|
529
|
+
end
|
530
|
+
|
531
|
+
# @override
|
532
|
+
def schema
|
533
|
+
'MySchemaId_key'
|
534
|
+
end
|
535
|
+
|
536
|
+
# @override
|
537
|
+
def namespace
|
538
|
+
'com.my-namespace'
|
539
|
+
end
|
540
|
+
|
541
|
+
# @override
|
542
|
+
def to_h
|
543
|
+
{
|
544
|
+
'id' => @id
|
545
|
+
}
|
546
|
+
end
|
547
|
+
end
|
548
|
+
end
|
549
|
+
|
550
|
+
|
551
|
+
spec/app/lib/schema_classes/my_schema_key.rb:
|
552
|
+
# frozen_string_literal: true
|
553
|
+
|
554
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
555
|
+
module Schemas
|
556
|
+
### Primary Schema Class ###
|
557
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchema_key
|
558
|
+
class MySchemaKey < Deimos::SchemaClass::Record
|
559
|
+
|
560
|
+
### Attribute Accessors ###
|
561
|
+
# @param value [String]
|
562
|
+
attr_accessor :test_id
|
563
|
+
|
564
|
+
# @override
|
565
|
+
def initialize(test_id: nil)
|
566
|
+
super
|
567
|
+
self.test_id = test_id
|
568
|
+
end
|
569
|
+
|
570
|
+
# @override
|
571
|
+
def schema
|
572
|
+
'MySchema_key'
|
80
573
|
end
|
81
574
|
|
82
575
|
# @override
|
@@ -93,3 +586,753 @@ module Schemas
|
|
93
586
|
end
|
94
587
|
end
|
95
588
|
|
589
|
+
|
590
|
+
spec/app/lib/schema_classes/my_schema_with_boolean.rb:
|
591
|
+
# frozen_string_literal: true
|
592
|
+
|
593
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
594
|
+
module Schemas
|
595
|
+
### Primary Schema Class ###
|
596
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithBooleans
|
597
|
+
class MySchemaWithBoolean < Deimos::SchemaClass::Record
|
598
|
+
|
599
|
+
### Attribute Accessors ###
|
600
|
+
# @param value [String]
|
601
|
+
attr_accessor :test_id
|
602
|
+
# @param value [Boolean]
|
603
|
+
attr_accessor :some_bool
|
604
|
+
|
605
|
+
# @override
|
606
|
+
def initialize(test_id: nil,
|
607
|
+
some_bool: nil)
|
608
|
+
super
|
609
|
+
self.test_id = test_id
|
610
|
+
self.some_bool = some_bool
|
611
|
+
end
|
612
|
+
|
613
|
+
# @override
|
614
|
+
def schema
|
615
|
+
'MySchemaWithBooleans'
|
616
|
+
end
|
617
|
+
|
618
|
+
# @override
|
619
|
+
def namespace
|
620
|
+
'com.my-namespace'
|
621
|
+
end
|
622
|
+
|
623
|
+
# @override
|
624
|
+
def to_h
|
625
|
+
{
|
626
|
+
'test_id' => @test_id,
|
627
|
+
'some_bool' => @some_bool
|
628
|
+
}
|
629
|
+
end
|
630
|
+
end
|
631
|
+
end
|
632
|
+
|
633
|
+
|
634
|
+
spec/app/lib/schema_classes/my_schema_with_circular_reference.rb:
|
635
|
+
# frozen_string_literal: true
|
636
|
+
|
637
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
638
|
+
module Schemas
|
639
|
+
### Primary Schema Class ###
|
640
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithCircularReference
|
641
|
+
class MySchemaWithCircularReference < Deimos::SchemaClass::Record
|
642
|
+
|
643
|
+
### Attribute Readers ###
|
644
|
+
# @return [Hash<String, Property>]
|
645
|
+
attr_reader :properties
|
646
|
+
|
647
|
+
### Attribute Writers ###
|
648
|
+
# @param values [Hash<String, Property>]
|
649
|
+
def properties=(values)
|
650
|
+
@properties = values.transform_values do |value|
|
651
|
+
Property.initialize_from_value(value)
|
652
|
+
end
|
653
|
+
end
|
654
|
+
|
655
|
+
# @override
|
656
|
+
def initialize(properties: {})
|
657
|
+
super
|
658
|
+
self.properties = properties
|
659
|
+
end
|
660
|
+
|
661
|
+
# @override
|
662
|
+
def schema
|
663
|
+
'MySchemaWithCircularReference'
|
664
|
+
end
|
665
|
+
|
666
|
+
# @override
|
667
|
+
def namespace
|
668
|
+
'com.my-namespace'
|
669
|
+
end
|
670
|
+
|
671
|
+
# @override
|
672
|
+
def to_h
|
673
|
+
{
|
674
|
+
'properties' => @properties.transform_values { |v| v&.to_h }
|
675
|
+
}
|
676
|
+
end
|
677
|
+
end
|
678
|
+
end
|
679
|
+
|
680
|
+
|
681
|
+
spec/app/lib/schema_classes/my_schema_with_complex_type.rb:
|
682
|
+
# frozen_string_literal: true
|
683
|
+
|
684
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
685
|
+
module Schemas
|
686
|
+
### Primary Schema Class ###
|
687
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithComplexTypes
|
688
|
+
class MySchemaWithComplexType < Deimos::SchemaClass::Record
|
689
|
+
|
690
|
+
### Attribute Readers ###
|
691
|
+
# @return [ARecord]
|
692
|
+
attr_reader :some_record
|
693
|
+
# @return [nil, ARecord]
|
694
|
+
attr_reader :some_optional_record
|
695
|
+
# @return [Array<ARecord>]
|
696
|
+
attr_reader :some_record_array
|
697
|
+
# @return [Hash<String, ARecord>]
|
698
|
+
attr_reader :some_record_map
|
699
|
+
# @return [Array<AnEnum>]
|
700
|
+
attr_reader :some_enum_array
|
701
|
+
# @return [nil, AnotherEnum]
|
702
|
+
attr_reader :some_optional_enum
|
703
|
+
# @return [YetAnotherEnum]
|
704
|
+
attr_reader :some_enum_with_default
|
705
|
+
|
706
|
+
### Attribute Accessors ###
|
707
|
+
# @param value [String]
|
708
|
+
attr_accessor :test_id
|
709
|
+
# @param value [Float]
|
710
|
+
attr_accessor :test_float
|
711
|
+
# @param values [Array<String>]
|
712
|
+
attr_accessor :test_string_array
|
713
|
+
# @param values [Array<Integer>]
|
714
|
+
attr_accessor :test_int_array
|
715
|
+
# @param value [Integer, nil]
|
716
|
+
attr_accessor :test_optional_int
|
717
|
+
# @param values [Hash<String, Integer>]
|
718
|
+
attr_accessor :some_integer_map
|
719
|
+
|
720
|
+
### Attribute Writers ###
|
721
|
+
# @param value [ARecord]
|
722
|
+
def some_record=(value)
|
723
|
+
@some_record = ARecord.initialize_from_value(value)
|
724
|
+
end
|
725
|
+
|
726
|
+
# @param value [nil, ARecord]
|
727
|
+
def some_optional_record=(value)
|
728
|
+
@some_optional_record = ARecord.initialize_from_value(value)
|
729
|
+
end
|
730
|
+
|
731
|
+
# @param values [Array<ARecord>]
|
732
|
+
def some_record_array=(values)
|
733
|
+
@some_record_array = values.map do |value|
|
734
|
+
ARecord.initialize_from_value(value)
|
735
|
+
end
|
736
|
+
end
|
737
|
+
|
738
|
+
# @param values [Hash<String, ARecord>]
|
739
|
+
def some_record_map=(values)
|
740
|
+
@some_record_map = values.transform_values do |value|
|
741
|
+
ARecord.initialize_from_value(value)
|
742
|
+
end
|
743
|
+
end
|
744
|
+
|
745
|
+
# @param values [Array<AnEnum>]
|
746
|
+
def some_enum_array=(values)
|
747
|
+
@some_enum_array = values.map do |value|
|
748
|
+
AnEnum.initialize_from_value(value)
|
749
|
+
end
|
750
|
+
end
|
751
|
+
|
752
|
+
# @param value [nil, AnotherEnum]
|
753
|
+
def some_optional_enum=(value)
|
754
|
+
@some_optional_enum = AnotherEnum.initialize_from_value(value)
|
755
|
+
end
|
756
|
+
|
757
|
+
# @param value [YetAnotherEnum]
|
758
|
+
def some_enum_with_default=(value)
|
759
|
+
@some_enum_with_default = YetAnotherEnum.initialize_from_value(value)
|
760
|
+
end
|
761
|
+
|
762
|
+
# @override
|
763
|
+
def initialize(test_id: nil,
|
764
|
+
test_float: nil,
|
765
|
+
test_string_array: ["test"],
|
766
|
+
test_int_array: [123],
|
767
|
+
test_optional_int: 123,
|
768
|
+
some_integer_map: {"abc"=>123},
|
769
|
+
some_record: {"a_record_field"=>"Test String"},
|
770
|
+
some_optional_record: nil,
|
771
|
+
some_record_array: nil,
|
772
|
+
some_record_map: nil,
|
773
|
+
some_enum_array: nil,
|
774
|
+
some_optional_enum: nil,
|
775
|
+
some_enum_with_default: "sym6")
|
776
|
+
super
|
777
|
+
self.test_id = test_id
|
778
|
+
self.test_float = test_float
|
779
|
+
self.test_string_array = test_string_array
|
780
|
+
self.test_int_array = test_int_array
|
781
|
+
self.test_optional_int = test_optional_int
|
782
|
+
self.some_integer_map = some_integer_map
|
783
|
+
self.some_record = some_record
|
784
|
+
self.some_optional_record = some_optional_record
|
785
|
+
self.some_record_array = some_record_array
|
786
|
+
self.some_record_map = some_record_map
|
787
|
+
self.some_enum_array = some_enum_array
|
788
|
+
self.some_optional_enum = some_optional_enum
|
789
|
+
self.some_enum_with_default = some_enum_with_default
|
790
|
+
end
|
791
|
+
|
792
|
+
# @override
|
793
|
+
def schema
|
794
|
+
'MySchemaWithComplexTypes'
|
795
|
+
end
|
796
|
+
|
797
|
+
# @override
|
798
|
+
def namespace
|
799
|
+
'com.my-namespace'
|
800
|
+
end
|
801
|
+
|
802
|
+
# @override
|
803
|
+
def to_h
|
804
|
+
{
|
805
|
+
'test_id' => @test_id,
|
806
|
+
'test_float' => @test_float,
|
807
|
+
'test_string_array' => @test_string_array,
|
808
|
+
'test_int_array' => @test_int_array,
|
809
|
+
'test_optional_int' => @test_optional_int,
|
810
|
+
'some_integer_map' => @some_integer_map,
|
811
|
+
'some_record' => @some_record&.to_h,
|
812
|
+
'some_optional_record' => @some_optional_record&.to_h,
|
813
|
+
'some_record_array' => @some_record_array.map { |v| v&.to_h },
|
814
|
+
'some_record_map' => @some_record_map.transform_values { |v| v&.to_h },
|
815
|
+
'some_enum_array' => @some_enum_array.map { |v| v&.to_h },
|
816
|
+
'some_optional_enum' => @some_optional_enum&.to_h,
|
817
|
+
'some_enum_with_default' => @some_enum_with_default&.to_h
|
818
|
+
}
|
819
|
+
end
|
820
|
+
end
|
821
|
+
end
|
822
|
+
|
823
|
+
|
824
|
+
spec/app/lib/schema_classes/my_schema_with_date_time.rb:
|
825
|
+
# frozen_string_literal: true
|
826
|
+
|
827
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
828
|
+
module Schemas
|
829
|
+
### Primary Schema Class ###
|
830
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithDateTimes
|
831
|
+
class MySchemaWithDateTime < Deimos::SchemaClass::Record
|
832
|
+
|
833
|
+
### Attribute Accessors ###
|
834
|
+
# @param value [String]
|
835
|
+
attr_accessor :test_id
|
836
|
+
# @param value [Integer, nil]
|
837
|
+
attr_accessor :updated_at
|
838
|
+
# @param value [nil, Integer]
|
839
|
+
attr_accessor :some_int
|
840
|
+
# @param value [nil, Integer]
|
841
|
+
attr_accessor :some_datetime_int
|
842
|
+
# @param value [String]
|
843
|
+
attr_accessor :timestamp
|
844
|
+
|
845
|
+
# @override
|
846
|
+
def initialize(test_id: nil,
|
847
|
+
updated_at: nil,
|
848
|
+
some_int: nil,
|
849
|
+
some_datetime_int: nil,
|
850
|
+
timestamp: nil)
|
851
|
+
super
|
852
|
+
self.test_id = test_id
|
853
|
+
self.updated_at = updated_at
|
854
|
+
self.some_int = some_int
|
855
|
+
self.some_datetime_int = some_datetime_int
|
856
|
+
self.timestamp = timestamp
|
857
|
+
end
|
858
|
+
|
859
|
+
# @override
|
860
|
+
def schema
|
861
|
+
'MySchemaWithDateTimes'
|
862
|
+
end
|
863
|
+
|
864
|
+
# @override
|
865
|
+
def namespace
|
866
|
+
'com.my-namespace'
|
867
|
+
end
|
868
|
+
|
869
|
+
# @override
|
870
|
+
def to_h
|
871
|
+
{
|
872
|
+
'test_id' => @test_id,
|
873
|
+
'updated_at' => @updated_at,
|
874
|
+
'some_int' => @some_int,
|
875
|
+
'some_datetime_int' => @some_datetime_int,
|
876
|
+
'timestamp' => @timestamp
|
877
|
+
}
|
878
|
+
end
|
879
|
+
end
|
880
|
+
end
|
881
|
+
|
882
|
+
|
883
|
+
spec/app/lib/schema_classes/my_schema_with_id.rb:
|
884
|
+
# frozen_string_literal: true
|
885
|
+
|
886
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
887
|
+
module Schemas
|
888
|
+
### Primary Schema Class ###
|
889
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithId
|
890
|
+
class MySchemaWithId < Deimos::SchemaClass::Record
|
891
|
+
|
892
|
+
### Attribute Accessors ###
|
893
|
+
# @param value [String]
|
894
|
+
attr_accessor :test_id
|
895
|
+
# @param value [Integer]
|
896
|
+
attr_accessor :some_int
|
897
|
+
# @param value [String]
|
898
|
+
attr_accessor :message_id
|
899
|
+
# @param value [String]
|
900
|
+
attr_accessor :timestamp
|
901
|
+
|
902
|
+
# @override
|
903
|
+
def initialize(test_id: nil,
|
904
|
+
some_int: nil,
|
905
|
+
message_id: nil,
|
906
|
+
timestamp: nil)
|
907
|
+
super
|
908
|
+
self.test_id = test_id
|
909
|
+
self.some_int = some_int
|
910
|
+
self.message_id = message_id
|
911
|
+
self.timestamp = timestamp
|
912
|
+
end
|
913
|
+
|
914
|
+
# @override
|
915
|
+
def schema
|
916
|
+
'MySchemaWithId'
|
917
|
+
end
|
918
|
+
|
919
|
+
# @override
|
920
|
+
def namespace
|
921
|
+
'com.my-namespace'
|
922
|
+
end
|
923
|
+
|
924
|
+
# @override
|
925
|
+
def to_h
|
926
|
+
{
|
927
|
+
'test_id' => @test_id,
|
928
|
+
'some_int' => @some_int,
|
929
|
+
'message_id' => @message_id,
|
930
|
+
'timestamp' => @timestamp
|
931
|
+
}
|
932
|
+
end
|
933
|
+
end
|
934
|
+
end
|
935
|
+
|
936
|
+
|
937
|
+
spec/app/lib/schema_classes/my_schema_with_unique_id.rb:
|
938
|
+
# frozen_string_literal: true
|
939
|
+
|
940
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
941
|
+
module Schemas
|
942
|
+
### Primary Schema Class ###
|
943
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithUniqueId
|
944
|
+
class MySchemaWithUniqueId < Deimos::SchemaClass::Record
|
945
|
+
|
946
|
+
### Attribute Accessors ###
|
947
|
+
# @param value [Integer]
|
948
|
+
attr_accessor :id
|
949
|
+
# @param value [String]
|
950
|
+
attr_accessor :test_id
|
951
|
+
# @param value [Integer]
|
952
|
+
attr_accessor :some_int
|
953
|
+
# @param value [String]
|
954
|
+
attr_accessor :message_id
|
955
|
+
# @param value [String]
|
956
|
+
attr_accessor :timestamp
|
957
|
+
|
958
|
+
# @override
|
959
|
+
def initialize(id: nil,
|
960
|
+
test_id: nil,
|
961
|
+
some_int: nil,
|
962
|
+
message_id: nil,
|
963
|
+
timestamp: nil)
|
964
|
+
super
|
965
|
+
self.id = id
|
966
|
+
self.test_id = test_id
|
967
|
+
self.some_int = some_int
|
968
|
+
self.message_id = message_id
|
969
|
+
self.timestamp = timestamp
|
970
|
+
end
|
971
|
+
|
972
|
+
# @override
|
973
|
+
def schema
|
974
|
+
'MySchemaWithUniqueId'
|
975
|
+
end
|
976
|
+
|
977
|
+
# @override
|
978
|
+
def namespace
|
979
|
+
'com.my-namespace'
|
980
|
+
end
|
981
|
+
|
982
|
+
# @override
|
983
|
+
def to_h
|
984
|
+
{
|
985
|
+
'id' => @id,
|
986
|
+
'test_id' => @test_id,
|
987
|
+
'some_int' => @some_int,
|
988
|
+
'message_id' => @message_id,
|
989
|
+
'timestamp' => @timestamp
|
990
|
+
}
|
991
|
+
end
|
992
|
+
end
|
993
|
+
end
|
994
|
+
|
995
|
+
|
996
|
+
spec/app/lib/schema_classes/property.rb:
|
997
|
+
# frozen_string_literal: true
|
998
|
+
|
999
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1000
|
+
module Schemas
|
1001
|
+
### Primary Schema Class ###
|
1002
|
+
# Autogenerated Schema for Record at com.my-namespace.Property
|
1003
|
+
class Property < Deimos::SchemaClass::Record
|
1004
|
+
|
1005
|
+
### Attribute Accessors ###
|
1006
|
+
# @param value [Boolean, Integer, Integer, Float, Float, String, Array<Property>, Hash<String, Property>]
|
1007
|
+
attr_accessor :property
|
1008
|
+
|
1009
|
+
# @override
|
1010
|
+
def initialize(property: nil)
|
1011
|
+
super
|
1012
|
+
self.property = property
|
1013
|
+
end
|
1014
|
+
|
1015
|
+
# @override
|
1016
|
+
def schema
|
1017
|
+
'Property'
|
1018
|
+
end
|
1019
|
+
|
1020
|
+
# @override
|
1021
|
+
def namespace
|
1022
|
+
'com.my-namespace'
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
# @override
|
1026
|
+
def to_h
|
1027
|
+
{
|
1028
|
+
'property' => @property
|
1029
|
+
}
|
1030
|
+
end
|
1031
|
+
end
|
1032
|
+
end
|
1033
|
+
|
1034
|
+
|
1035
|
+
spec/app/lib/schema_classes/update_request.rb:
|
1036
|
+
# frozen_string_literal: true
|
1037
|
+
|
1038
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1039
|
+
module Schemas
|
1040
|
+
### Primary Schema Class ###
|
1041
|
+
# Autogenerated Schema for Record at com.my-namespace.request.UpdateRequest
|
1042
|
+
class UpdateRequest < Deimos::SchemaClass::Record
|
1043
|
+
|
1044
|
+
### Attribute Accessors ###
|
1045
|
+
# @param value [String]
|
1046
|
+
attr_accessor :update_request_id
|
1047
|
+
|
1048
|
+
# @override
|
1049
|
+
def initialize(update_request_id: nil)
|
1050
|
+
super
|
1051
|
+
self.update_request_id = update_request_id
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
# @override
|
1055
|
+
def schema
|
1056
|
+
'UpdateRequest'
|
1057
|
+
end
|
1058
|
+
|
1059
|
+
# @override
|
1060
|
+
def namespace
|
1061
|
+
'com.my-namespace.request'
|
1062
|
+
end
|
1063
|
+
|
1064
|
+
# @override
|
1065
|
+
def to_h
|
1066
|
+
{
|
1067
|
+
'update_request_id' => @update_request_id
|
1068
|
+
}
|
1069
|
+
end
|
1070
|
+
end
|
1071
|
+
end
|
1072
|
+
|
1073
|
+
|
1074
|
+
spec/app/lib/schema_classes/update_response.rb:
|
1075
|
+
# frozen_string_literal: true
|
1076
|
+
|
1077
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1078
|
+
module Schemas
|
1079
|
+
### Primary Schema Class ###
|
1080
|
+
# Autogenerated Schema for Record at com.my-namespace.response.UpdateResponse
|
1081
|
+
class UpdateResponse < Deimos::SchemaClass::Record
|
1082
|
+
|
1083
|
+
### Attribute Accessors ###
|
1084
|
+
# @param value [String]
|
1085
|
+
attr_accessor :update_response_id
|
1086
|
+
|
1087
|
+
# @override
|
1088
|
+
def initialize(update_response_id: nil)
|
1089
|
+
super
|
1090
|
+
self.update_response_id = update_response_id
|
1091
|
+
end
|
1092
|
+
|
1093
|
+
# @override
|
1094
|
+
def schema
|
1095
|
+
'UpdateResponse'
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
# @override
|
1099
|
+
def namespace
|
1100
|
+
'com.my-namespace.response'
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
# @override
|
1104
|
+
def to_h
|
1105
|
+
{
|
1106
|
+
'update_response_id' => @update_response_id
|
1107
|
+
}
|
1108
|
+
end
|
1109
|
+
end
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
|
1113
|
+
spec/app/lib/schema_classes/wibble.rb:
|
1114
|
+
# frozen_string_literal: true
|
1115
|
+
|
1116
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1117
|
+
module Schemas
|
1118
|
+
### Primary Schema Class ###
|
1119
|
+
# Autogenerated Schema for Record at com.my-namespace.Wibble
|
1120
|
+
class Wibble < Deimos::SchemaClass::Record
|
1121
|
+
|
1122
|
+
### Attribute Accessors ###
|
1123
|
+
# @param value [Integer]
|
1124
|
+
attr_accessor :id
|
1125
|
+
# @param value [Integer]
|
1126
|
+
attr_accessor :wibble_id
|
1127
|
+
# @param value [String]
|
1128
|
+
attr_accessor :name
|
1129
|
+
# @param value [String]
|
1130
|
+
attr_accessor :floop
|
1131
|
+
# @param value [Integer]
|
1132
|
+
attr_accessor :birthday_int
|
1133
|
+
# @param value [Integer]
|
1134
|
+
attr_accessor :birthday_long
|
1135
|
+
# @param value [nil, Integer]
|
1136
|
+
attr_accessor :birthday_optional
|
1137
|
+
# @param value [Integer]
|
1138
|
+
attr_accessor :updated_at
|
1139
|
+
# @param value [Integer]
|
1140
|
+
attr_accessor :created_at
|
1141
|
+
|
1142
|
+
# @override
|
1143
|
+
def initialize(id: nil,
|
1144
|
+
wibble_id: nil,
|
1145
|
+
name: nil,
|
1146
|
+
floop: nil,
|
1147
|
+
birthday_int: nil,
|
1148
|
+
birthday_long: nil,
|
1149
|
+
birthday_optional: nil,
|
1150
|
+
updated_at: nil,
|
1151
|
+
created_at: nil)
|
1152
|
+
super
|
1153
|
+
self.id = id
|
1154
|
+
self.wibble_id = wibble_id
|
1155
|
+
self.name = name
|
1156
|
+
self.floop = floop
|
1157
|
+
self.birthday_int = birthday_int
|
1158
|
+
self.birthday_long = birthday_long
|
1159
|
+
self.birthday_optional = birthday_optional
|
1160
|
+
self.updated_at = updated_at
|
1161
|
+
self.created_at = created_at
|
1162
|
+
end
|
1163
|
+
|
1164
|
+
# @override
|
1165
|
+
def schema
|
1166
|
+
'Wibble'
|
1167
|
+
end
|
1168
|
+
|
1169
|
+
# @override
|
1170
|
+
def namespace
|
1171
|
+
'com.my-namespace'
|
1172
|
+
end
|
1173
|
+
|
1174
|
+
# @override
|
1175
|
+
def to_h
|
1176
|
+
{
|
1177
|
+
'id' => @id,
|
1178
|
+
'wibble_id' => @wibble_id,
|
1179
|
+
'name' => @name,
|
1180
|
+
'floop' => @floop,
|
1181
|
+
'birthday_int' => @birthday_int,
|
1182
|
+
'birthday_long' => @birthday_long,
|
1183
|
+
'birthday_optional' => @birthday_optional,
|
1184
|
+
'updated_at' => @updated_at,
|
1185
|
+
'created_at' => @created_at
|
1186
|
+
}
|
1187
|
+
end
|
1188
|
+
end
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
|
1192
|
+
spec/app/lib/schema_classes/widget.rb:
|
1193
|
+
# frozen_string_literal: true
|
1194
|
+
|
1195
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1196
|
+
module Schemas
|
1197
|
+
### Primary Schema Class ###
|
1198
|
+
# Autogenerated Schema for Record at com.my-namespace.Widget
|
1199
|
+
class Widget < Deimos::SchemaClass::Record
|
1200
|
+
|
1201
|
+
### Attribute Accessors ###
|
1202
|
+
# @param value [Integer]
|
1203
|
+
attr_accessor :id
|
1204
|
+
# @param value [Integer]
|
1205
|
+
attr_accessor :widget_id
|
1206
|
+
# @param value [String]
|
1207
|
+
attr_accessor :name
|
1208
|
+
# @param value [Integer]
|
1209
|
+
attr_accessor :updated_at
|
1210
|
+
# @param value [Integer]
|
1211
|
+
attr_accessor :created_at
|
1212
|
+
|
1213
|
+
# @override
|
1214
|
+
def initialize(id: nil,
|
1215
|
+
widget_id: nil,
|
1216
|
+
name: nil,
|
1217
|
+
updated_at: nil,
|
1218
|
+
created_at: nil)
|
1219
|
+
super
|
1220
|
+
self.id = id
|
1221
|
+
self.widget_id = widget_id
|
1222
|
+
self.name = name
|
1223
|
+
self.updated_at = updated_at
|
1224
|
+
self.created_at = created_at
|
1225
|
+
end
|
1226
|
+
|
1227
|
+
# @override
|
1228
|
+
def schema
|
1229
|
+
'Widget'
|
1230
|
+
end
|
1231
|
+
|
1232
|
+
# @override
|
1233
|
+
def namespace
|
1234
|
+
'com.my-namespace'
|
1235
|
+
end
|
1236
|
+
|
1237
|
+
# @override
|
1238
|
+
def to_h
|
1239
|
+
{
|
1240
|
+
'id' => @id,
|
1241
|
+
'widget_id' => @widget_id,
|
1242
|
+
'name' => @name,
|
1243
|
+
'updated_at' => @updated_at,
|
1244
|
+
'created_at' => @created_at
|
1245
|
+
}
|
1246
|
+
end
|
1247
|
+
end
|
1248
|
+
end
|
1249
|
+
|
1250
|
+
|
1251
|
+
spec/app/lib/schema_classes/widget_the_second.rb:
|
1252
|
+
# frozen_string_literal: true
|
1253
|
+
|
1254
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1255
|
+
module Schemas
|
1256
|
+
### Primary Schema Class ###
|
1257
|
+
# Autogenerated Schema for Record at com.my-namespace.WidgetTheSecond
|
1258
|
+
class WidgetTheSecond < Deimos::SchemaClass::Record
|
1259
|
+
|
1260
|
+
### Attribute Accessors ###
|
1261
|
+
# @param value [Integer]
|
1262
|
+
attr_accessor :id
|
1263
|
+
# @param value [Integer]
|
1264
|
+
attr_accessor :widget_id
|
1265
|
+
# @param value [String]
|
1266
|
+
attr_accessor :model_id
|
1267
|
+
# @param value [Integer]
|
1268
|
+
attr_accessor :updated_at
|
1269
|
+
# @param value [Integer]
|
1270
|
+
attr_accessor :created_at
|
1271
|
+
|
1272
|
+
# @override
|
1273
|
+
def initialize(id: nil,
|
1274
|
+
widget_id: nil,
|
1275
|
+
model_id: nil,
|
1276
|
+
updated_at: nil,
|
1277
|
+
created_at: nil)
|
1278
|
+
super
|
1279
|
+
self.id = id
|
1280
|
+
self.widget_id = widget_id
|
1281
|
+
self.model_id = model_id
|
1282
|
+
self.updated_at = updated_at
|
1283
|
+
self.created_at = created_at
|
1284
|
+
end
|
1285
|
+
|
1286
|
+
# @override
|
1287
|
+
def schema
|
1288
|
+
'WidgetTheSecond'
|
1289
|
+
end
|
1290
|
+
|
1291
|
+
# @override
|
1292
|
+
def namespace
|
1293
|
+
'com.my-namespace'
|
1294
|
+
end
|
1295
|
+
|
1296
|
+
# @override
|
1297
|
+
def to_h
|
1298
|
+
{
|
1299
|
+
'id' => @id,
|
1300
|
+
'widget_id' => @widget_id,
|
1301
|
+
'model_id' => @model_id,
|
1302
|
+
'updated_at' => @updated_at,
|
1303
|
+
'created_at' => @created_at
|
1304
|
+
}
|
1305
|
+
end
|
1306
|
+
end
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
|
1310
|
+
spec/app/lib/schema_classes/yet_another_enum.rb:
|
1311
|
+
# frozen_string_literal: true
|
1312
|
+
|
1313
|
+
# This file is autogenerated by Deimos, Do NOT modify
|
1314
|
+
module Schemas
|
1315
|
+
### Primary Schema Class ###
|
1316
|
+
# Autogenerated Schema for Enum at com.my-namespace.YetAnotherEnum
|
1317
|
+
class YetAnotherEnum < Deimos::SchemaClass::Enum
|
1318
|
+
# @return ['sym5', 'sym6']
|
1319
|
+
attr_accessor :yet_another_enum
|
1320
|
+
|
1321
|
+
# :nodoc:
|
1322
|
+
def initialize(yet_another_enum)
|
1323
|
+
super
|
1324
|
+
self.yet_another_enum = yet_another_enum
|
1325
|
+
end
|
1326
|
+
|
1327
|
+
# @override
|
1328
|
+
def symbols
|
1329
|
+
%w(sym5 sym6)
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
# @override
|
1333
|
+
def to_h
|
1334
|
+
@yet_another_enum
|
1335
|
+
end
|
1336
|
+
end
|
1337
|
+
end
|
1338
|
+
|