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