deimos-ruby 1.15.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/deimos/active_record_producer.rb +1 -1
  4. data/lib/deimos/consumer.rb +3 -1
  5. data/lib/deimos/schema_class/base.rb +2 -25
  6. data/lib/deimos/schema_class/enum.rb +23 -0
  7. data/lib/deimos/schema_class/record.rb +15 -4
  8. data/lib/deimos/test_helpers.rb +3 -2
  9. data/lib/deimos/tracing/datadog.rb +11 -0
  10. data/lib/deimos/tracing/mock.rb +10 -0
  11. data/lib/deimos/tracing/provider.rb +13 -0
  12. data/lib/deimos/utils/db_poller.rb +1 -2
  13. data/lib/deimos/utils/schema_class.rb +16 -2
  14. data/lib/deimos/utils/schema_controller_mixin.rb +7 -1
  15. data/lib/deimos/version.rb +1 -1
  16. data/lib/deimos.rb +1 -2
  17. data/lib/generators/deimos/schema_class/templates/schema_enum.rb.tt +0 -11
  18. data/lib/generators/deimos/schema_class/templates/schema_record.rb.tt +2 -2
  19. data/lib/generators/deimos/schema_class_generator.rb +6 -10
  20. data/spec/batch_consumer_spec.rb +13 -10
  21. data/spec/generators/schema_class/my_schema_with_circular_reference_spec.rb +19 -19
  22. data/spec/generators/schema_class/my_schema_with_complex_types_spec.rb +2 -2
  23. data/spec/schemas/generated.rb +5 -5
  24. data/spec/schemas/my_nested_schema.rb +4 -4
  25. data/spec/schemas/my_schema.rb +2 -2
  26. data/spec/schemas/my_schema_key.rb +1 -1
  27. data/spec/schemas/my_schema_with_circular_reference.rb +3 -3
  28. data/spec/schemas/my_schema_with_complex_type.rb +11 -22
  29. data/spec/snapshots/consumers-no-nest.snap +34 -67
  30. data/spec/snapshots/consumers.snap +35 -79
  31. data/spec/snapshots/consumers_and_producers-no-nest.snap +35 -68
  32. data/spec/snapshots/consumers_and_producers.snap +36 -80
  33. data/spec/snapshots/consumers_circular-no-nest.snap +34 -67
  34. data/spec/snapshots/consumers_circular.snap +35 -79
  35. data/spec/snapshots/consumers_complex_types-no-nest.snap +34 -67
  36. data/spec/snapshots/consumers_complex_types.snap +35 -79
  37. data/spec/snapshots/consumers_nested-no-nest.snap +34 -67
  38. data/spec/snapshots/consumers_nested.snap +35 -79
  39. data/spec/snapshots/namespace_folders.snap +53 -97
  40. data/spec/snapshots/producers_with_key-no-nest.snap +35 -68
  41. data/spec/snapshots/producers_with_key.snap +36 -80
  42. metadata +3 -3
@@ -31,7 +31,7 @@ module Schemas
31
31
  end
32
32
 
33
33
  # @override
34
- def to_h
34
+ def as_json(_opts={})
35
35
  {
36
36
  'a_record_field' => @a_record_field
37
37
  }
@@ -43,21 +43,10 @@ module Schemas
43
43
  # @return ['sym1', 'sym2']
44
44
  attr_accessor :an_enum
45
45
 
46
- # :nodoc:
47
- def initialize(an_enum)
48
- super
49
- self.an_enum = an_enum
50
- end
51
-
52
46
  # @override
53
47
  def symbols
54
48
  %w(sym1 sym2)
55
49
  end
56
-
57
- # @override
58
- def to_h
59
- @an_enum
60
- end
61
50
  end
62
51
 
63
52
  # Autogenerated Schema for Enum at com.my-namespace.AnotherEnum
@@ -77,7 +66,7 @@ module Schemas
77
66
  end
78
67
 
79
68
  # @override
80
- def to_h
69
+ def as_json(_opts={})
81
70
  @another_enum
82
71
  end
83
72
  end
@@ -99,7 +88,7 @@ module Schemas
99
88
  end
100
89
 
101
90
  # @override
102
- def to_h
91
+ def as_json(_opts={})
103
92
  @yet_another_enum
104
93
  end
105
94
  end
@@ -218,7 +207,7 @@ module Schemas
218
207
  end
219
208
 
220
209
  # @override
221
- def to_h
210
+ def as_json(_opts={})
222
211
  {
223
212
  'test_id' => @test_id,
224
213
  'test_float' => @test_float,
@@ -226,13 +215,13 @@ module Schemas
226
215
  'test_int_array' => @test_int_array,
227
216
  'test_optional_int' => @test_optional_int,
228
217
  'some_integer_map' => @some_integer_map,
229
- 'some_record' => @some_record&.to_h,
230
- 'some_optional_record' => @some_optional_record&.to_h,
231
- 'some_record_array' => @some_record_array.map { |v| v&.to_h },
232
- 'some_record_map' => @some_record_map.transform_values { |v| v&.to_h },
233
- 'some_enum_array' => @some_enum_array.map { |v| v&.to_h },
234
- 'some_optional_enum' => @some_optional_enum&.to_h,
235
- 'some_enum_with_default' => @some_enum_with_default&.to_h
218
+ 'some_record' => @some_record&.as_json,
219
+ 'some_optional_record' => @some_optional_record&.as_json,
220
+ 'some_record_array' => @some_record_array.map { |v| v&.as_json },
221
+ 'some_record_map' => @some_record_map.transform_values { |v| v&.as_json },
222
+ 'some_enum_array' => @some_enum_array.map { |v| v&.as_json },
223
+ 'some_optional_enum' => @some_optional_enum&.as_json,
224
+ 'some_enum_with_default' => @some_enum_with_default&.as_json
236
225
  }
237
226
  end
238
227
  end
@@ -28,7 +28,7 @@ module Schemas
28
28
  end
29
29
 
30
30
  # @override
31
- def to_h
31
+ def as_json(_opts={})
32
32
  {
33
33
  'a_record_field' => @a_record_field
34
34
  }
@@ -48,21 +48,10 @@ module Schemas
48
48
  # @return ['sym1', 'sym2']
49
49
  attr_accessor :an_enum
50
50
 
51
- # :nodoc:
52
- def initialize(an_enum)
53
- super
54
- self.an_enum = an_enum
55
- end
56
-
57
51
  # @override
58
52
  def symbols
59
53
  %w(sym1 sym2)
60
54
  end
61
-
62
- # @override
63
- def to_h
64
- @an_enum
65
- end
66
55
  end
67
56
  end
68
57
 
@@ -78,21 +67,10 @@ module Schemas
78
67
  # @return ['sym3', 'sym4']
79
68
  attr_accessor :another_enum
80
69
 
81
- # :nodoc:
82
- def initialize(another_enum)
83
- super
84
- self.another_enum = another_enum
85
- end
86
-
87
70
  # @override
88
71
  def symbols
89
72
  %w(sym3 sym4)
90
73
  end
91
-
92
- # @override
93
- def to_h
94
- @another_enum
95
- end
96
74
  end
97
75
  end
98
76
 
@@ -127,7 +105,7 @@ module Schemas
127
105
  end
128
106
 
129
107
  # @override
130
- def to_h
108
+ def as_json(_opts={})
131
109
  {
132
110
  'response_id' => @response_id
133
111
  }
@@ -223,7 +201,7 @@ module Schemas
223
201
  end
224
202
 
225
203
  # @override
226
- def to_h
204
+ def as_json(_opts={})
227
205
  {
228
206
  'a_string' => @a_string,
229
207
  'a_int' => @a_int,
@@ -231,12 +209,12 @@ module Schemas
231
209
  'a_float' => @a_float,
232
210
  'a_double' => @a_double,
233
211
  'an_optional_int' => @an_optional_int,
234
- 'an_enum' => @an_enum&.to_h,
212
+ 'an_enum' => @an_enum&.as_json,
235
213
  'an_array' => @an_array,
236
214
  'a_map' => @a_map,
237
215
  'timestamp' => @timestamp,
238
216
  'message_id' => @message_id,
239
- 'a_record' => @a_record&.to_h
217
+ 'a_record' => @a_record&.as_json
240
218
  }
241
219
  end
242
220
  end
@@ -273,7 +251,7 @@ module Schemas
273
251
  end
274
252
 
275
253
  # @override
276
- def to_h
254
+ def as_json(_opts={})
277
255
  {
278
256
  'response_id' => @response_id
279
257
  }
@@ -324,7 +302,7 @@ module Schemas
324
302
  end
325
303
 
326
304
  # @override
327
- def to_h
305
+ def as_json(_opts={})
328
306
  {
329
307
  'some_int' => @some_int,
330
308
  'some_float' => @some_float,
@@ -395,13 +373,13 @@ module Schemas
395
373
  end
396
374
 
397
375
  # @override
398
- def to_h
376
+ def as_json(_opts={})
399
377
  {
400
378
  'test_id' => @test_id,
401
379
  'test_float' => @test_float,
402
380
  'test_array' => @test_array,
403
- 'some_nested_record' => @some_nested_record&.to_h,
404
- 'some_optional_record' => @some_optional_record&.to_h
381
+ 'some_nested_record' => @some_nested_record&.as_json,
382
+ 'some_optional_record' => @some_optional_record&.as_json
405
383
  }
406
384
  end
407
385
  end
@@ -442,7 +420,7 @@ module Schemas
442
420
  end
443
421
 
444
422
  # @override
445
- def to_h
423
+ def as_json(_opts={})
446
424
  {
447
425
  'test_id' => @test_id,
448
426
  'some_int' => @some_int
@@ -486,7 +464,7 @@ module Schemas
486
464
  end
487
465
 
488
466
  # @override
489
- def to_h
467
+ def as_json(_opts={})
490
468
  {
491
469
  'part_one' => @part_one,
492
470
  'part_two' => @part_two
@@ -526,7 +504,7 @@ module Schemas
526
504
  end
527
505
 
528
506
  # @override
529
- def to_h
507
+ def as_json(_opts={})
530
508
  {
531
509
  'id' => @id
532
510
  }
@@ -565,7 +543,7 @@ module Schemas
565
543
  end
566
544
 
567
545
  # @override
568
- def to_h
546
+ def as_json(_opts={})
569
547
  {
570
548
  'test_id' => @test_id
571
549
  }
@@ -608,7 +586,7 @@ module Schemas
608
586
  end
609
587
 
610
588
  # @override
611
- def to_h
589
+ def as_json(_opts={})
612
590
  {
613
591
  'test_id' => @test_id,
614
592
  'some_bool' => @some_bool
@@ -656,9 +634,9 @@ module Schemas
656
634
  end
657
635
 
658
636
  # @override
659
- def to_h
637
+ def as_json(_opts={})
660
638
  {
661
- 'properties' => @properties.transform_values { |v| v&.to_h }
639
+ 'properties' => @properties.transform_values { |v| v&.as_json }
662
640
  }
663
641
  end
664
642
  end
@@ -787,7 +765,7 @@ module Schemas
787
765
  end
788
766
 
789
767
  # @override
790
- def to_h
768
+ def as_json(_opts={})
791
769
  {
792
770
  'test_id' => @test_id,
793
771
  'test_float' => @test_float,
@@ -795,13 +773,13 @@ module Schemas
795
773
  'test_int_array' => @test_int_array,
796
774
  'test_optional_int' => @test_optional_int,
797
775
  'some_integer_map' => @some_integer_map,
798
- 'some_record' => @some_record&.to_h,
799
- 'some_optional_record' => @some_optional_record&.to_h,
800
- 'some_record_array' => @some_record_array.map { |v| v&.to_h },
801
- 'some_record_map' => @some_record_map.transform_values { |v| v&.to_h },
802
- 'some_enum_array' => @some_enum_array.map { |v| v&.to_h },
803
- 'some_optional_enum' => @some_optional_enum&.to_h,
804
- 'some_enum_with_default' => @some_enum_with_default&.to_h
776
+ 'some_record' => @some_record&.as_json,
777
+ 'some_optional_record' => @some_optional_record&.as_json,
778
+ 'some_record_array' => @some_record_array.map { |v| v&.as_json },
779
+ 'some_record_map' => @some_record_map.transform_values { |v| v&.as_json },
780
+ 'some_enum_array' => @some_enum_array.map { |v| v&.as_json },
781
+ 'some_optional_enum' => @some_optional_enum&.as_json,
782
+ 'some_enum_with_default' => @some_enum_with_default&.as_json
805
783
  }
806
784
  end
807
785
  end
@@ -854,7 +832,7 @@ module Schemas
854
832
  end
855
833
 
856
834
  # @override
857
- def to_h
835
+ def as_json(_opts={})
858
836
  {
859
837
  'test_id' => @test_id,
860
838
  'updated_at' => @updated_at,
@@ -909,7 +887,7 @@ module Schemas
909
887
  end
910
888
 
911
889
  # @override
912
- def to_h
890
+ def as_json(_opts={})
913
891
  {
914
892
  'test_id' => @test_id,
915
893
  'some_int' => @some_int,
@@ -967,7 +945,7 @@ module Schemas
967
945
  end
968
946
 
969
947
  # @override
970
- def to_h
948
+ def as_json(_opts={})
971
949
  {
972
950
  'id' => @id,
973
951
  'test_id' => @test_id,
@@ -1010,7 +988,7 @@ module Schemas
1010
988
  end
1011
989
 
1012
990
  # @override
1013
- def to_h
991
+ def as_json(_opts={})
1014
992
  {
1015
993
  'property' => @property
1016
994
  }
@@ -1049,7 +1027,7 @@ module Schemas
1049
1027
  end
1050
1028
 
1051
1029
  # @override
1052
- def to_h
1030
+ def as_json(_opts={})
1053
1031
  {
1054
1032
  'update_request_id' => @update_request_id
1055
1033
  }
@@ -1088,7 +1066,7 @@ module Schemas
1088
1066
  end
1089
1067
 
1090
1068
  # @override
1091
- def to_h
1069
+ def as_json(_opts={})
1092
1070
  {
1093
1071
  'update_response_id' => @update_response_id
1094
1072
  }
@@ -1159,7 +1137,7 @@ module Schemas
1159
1137
  end
1160
1138
 
1161
1139
  # @override
1162
- def to_h
1140
+ def as_json(_opts={})
1163
1141
  {
1164
1142
  'id' => @id,
1165
1143
  'wibble_id' => @wibble_id,
@@ -1222,7 +1200,7 @@ module Schemas
1222
1200
  end
1223
1201
 
1224
1202
  # @override
1225
- def to_h
1203
+ def as_json(_opts={})
1226
1204
  {
1227
1205
  'id' => @id,
1228
1206
  'widget_id' => @widget_id,
@@ -1281,7 +1259,7 @@ module Schemas
1281
1259
  end
1282
1260
 
1283
1261
  # @override
1284
- def to_h
1262
+ def as_json(_opts={})
1285
1263
  {
1286
1264
  'id' => @id,
1287
1265
  'widget_id' => @widget_id,
@@ -1305,21 +1283,10 @@ module Schemas
1305
1283
  # @return ['sym5', 'sym6']
1306
1284
  attr_accessor :yet_another_enum
1307
1285
 
1308
- # :nodoc:
1309
- def initialize(yet_another_enum)
1310
- super
1311
- self.yet_another_enum = yet_another_enum
1312
- end
1313
-
1314
1286
  # @override
1315
1287
  def symbols
1316
1288
  %w(sym5 sym6)
1317
1289
  end
1318
-
1319
- # @override
1320
- def to_h
1321
- @yet_another_enum
1322
- end
1323
1290
  end
1324
1291
  end
1325
1292
 
@@ -28,7 +28,7 @@ module Schemas
28
28
  end
29
29
 
30
30
  # @override
31
- def to_h
31
+ def as_json(_opts={})
32
32
  {
33
33
  'response_id' => @response_id
34
34
  }
@@ -71,7 +71,7 @@ module Schemas
71
71
  end
72
72
 
73
73
  # @override
74
- def to_h
74
+ def as_json(_opts={})
75
75
  {
76
76
  'a_record_field' => @a_record_field
77
77
  }
@@ -83,21 +83,10 @@ module Schemas
83
83
  # @return ['sym1', 'sym2']
84
84
  attr_accessor :an_enum
85
85
 
86
- # :nodoc:
87
- def initialize(an_enum)
88
- super
89
- self.an_enum = an_enum
90
- end
91
-
92
86
  # @override
93
87
  def symbols
94
88
  %w(sym1 sym2)
95
89
  end
96
-
97
- # @override
98
- def to_h
99
- @an_enum
100
- end
101
90
  end
102
91
 
103
92
 
@@ -179,7 +168,7 @@ module Schemas
179
168
  end
180
169
 
181
170
  # @override
182
- def to_h
171
+ def as_json(_opts={})
183
172
  {
184
173
  'a_string' => @a_string,
185
174
  'a_int' => @a_int,
@@ -187,12 +176,12 @@ module Schemas
187
176
  'a_float' => @a_float,
188
177
  'a_double' => @a_double,
189
178
  'an_optional_int' => @an_optional_int,
190
- 'an_enum' => @an_enum&.to_h,
179
+ 'an_enum' => @an_enum&.as_json,
191
180
  'an_array' => @an_array,
192
181
  'a_map' => @a_map,
193
182
  'timestamp' => @timestamp,
194
183
  'message_id' => @message_id,
195
- 'a_record' => @a_record&.to_h
184
+ 'a_record' => @a_record&.as_json
196
185
  }
197
186
  end
198
187
  end
@@ -229,7 +218,7 @@ module Schemas
229
218
  end
230
219
 
231
220
  # @override
232
- def to_h
221
+ def as_json(_opts={})
233
222
  {
234
223
  'response_id' => @response_id
235
224
  }
@@ -284,7 +273,7 @@ module Schemas
284
273
  end
285
274
 
286
275
  # @override
287
- def to_h
276
+ def as_json(_opts={})
288
277
  {
289
278
  'some_int' => @some_int,
290
279
  'some_float' => @some_float,
@@ -345,13 +334,13 @@ module Schemas
345
334
  end
346
335
 
347
336
  # @override
348
- def to_h
337
+ def as_json(_opts={})
349
338
  {
350
339
  'test_id' => @test_id,
351
340
  'test_float' => @test_float,
352
341
  'test_array' => @test_array,
353
- 'some_nested_record' => @some_nested_record&.to_h,
354
- 'some_optional_record' => @some_optional_record&.to_h
342
+ 'some_nested_record' => @some_nested_record&.as_json,
343
+ 'some_optional_record' => @some_optional_record&.as_json
355
344
  }
356
345
  end
357
346
  end
@@ -392,7 +381,7 @@ module Schemas
392
381
  end
393
382
 
394
383
  # @override
395
- def to_h
384
+ def as_json(_opts={})
396
385
  {
397
386
  'test_id' => @test_id,
398
387
  'some_int' => @some_int
@@ -436,7 +425,7 @@ module Schemas
436
425
  end
437
426
 
438
427
  # @override
439
- def to_h
428
+ def as_json(_opts={})
440
429
  {
441
430
  'part_one' => @part_one,
442
431
  'part_two' => @part_two
@@ -476,7 +465,7 @@ module Schemas
476
465
  end
477
466
 
478
467
  # @override
479
- def to_h
468
+ def as_json(_opts={})
480
469
  {
481
470
  'id' => @id
482
471
  }
@@ -515,7 +504,7 @@ module Schemas
515
504
  end
516
505
 
517
506
  # @override
518
- def to_h
507
+ def as_json(_opts={})
519
508
  {
520
509
  'test_id' => @test_id
521
510
  }
@@ -558,7 +547,7 @@ module Schemas
558
547
  end
559
548
 
560
549
  # @override
561
- def to_h
550
+ def as_json(_opts={})
562
551
  {
563
552
  'test_id' => @test_id,
564
553
  'some_bool' => @some_bool
@@ -602,7 +591,7 @@ module Schemas
602
591
  end
603
592
 
604
593
  # @override
605
- def to_h
594
+ def as_json(_opts={})
606
595
  {
607
596
  'property' => @property
608
597
  }
@@ -639,9 +628,9 @@ module Schemas
639
628
  end
640
629
 
641
630
  # @override
642
- def to_h
631
+ def as_json(_opts={})
643
632
  {
644
- 'properties' => @properties.transform_values { |v| v&.to_h }
633
+ 'properties' => @properties.transform_values { |v| v&.as_json }
645
634
  }
646
635
  end
647
636
  end
@@ -682,7 +671,7 @@ module Schemas
682
671
  end
683
672
 
684
673
  # @override
685
- def to_h
674
+ def as_json(_opts={})
686
675
  {
687
676
  'a_record_field' => @a_record_field
688
677
  }
@@ -694,21 +683,10 @@ module Schemas
694
683
  # @return ['sym1', 'sym2']
695
684
  attr_accessor :an_enum
696
685
 
697
- # :nodoc:
698
- def initialize(an_enum)
699
- super
700
- self.an_enum = an_enum
701
- end
702
-
703
686
  # @override
704
687
  def symbols
705
688
  %w(sym1 sym2)
706
689
  end
707
-
708
- # @override
709
- def to_h
710
- @an_enum
711
- end
712
690
  end
713
691
 
714
692
  # Autogenerated Schema for Enum at com.my-namespace.AnotherEnum
@@ -716,21 +694,10 @@ module Schemas
716
694
  # @return ['sym3', 'sym4']
717
695
  attr_accessor :another_enum
718
696
 
719
- # :nodoc:
720
- def initialize(another_enum)
721
- super
722
- self.another_enum = another_enum
723
- end
724
-
725
697
  # @override
726
698
  def symbols
727
699
  %w(sym3 sym4)
728
700
  end
729
-
730
- # @override
731
- def to_h
732
- @another_enum
733
- end
734
701
  end
735
702
 
736
703
  # Autogenerated Schema for Enum at com.my-namespace.YetAnotherEnum
@@ -738,21 +705,10 @@ module Schemas
738
705
  # @return ['sym5', 'sym6']
739
706
  attr_accessor :yet_another_enum
740
707
 
741
- # :nodoc:
742
- def initialize(yet_another_enum)
743
- super
744
- self.yet_another_enum = yet_another_enum
745
- end
746
-
747
708
  # @override
748
709
  def symbols
749
710
  %w(sym5 sym6)
750
711
  end
751
-
752
- # @override
753
- def to_h
754
- @yet_another_enum
755
- end
756
712
  end
757
713
 
758
714
 
@@ -869,7 +825,7 @@ module Schemas
869
825
  end
870
826
 
871
827
  # @override
872
- def to_h
828
+ def as_json(_opts={})
873
829
  {
874
830
  'test_id' => @test_id,
875
831
  'test_float' => @test_float,
@@ -877,13 +833,13 @@ module Schemas
877
833
  'test_int_array' => @test_int_array,
878
834
  'test_optional_int' => @test_optional_int,
879
835
  '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 },
883
- 'some_record_map' => @some_record_map.transform_values { |v| v&.to_h },
884
- 'some_enum_array' => @some_enum_array.map { |v| v&.to_h },
885
- 'some_optional_enum' => @some_optional_enum&.to_h,
886
- 'some_enum_with_default' => @some_enum_with_default&.to_h
836
+ 'some_record' => @some_record&.as_json,
837
+ 'some_optional_record' => @some_optional_record&.as_json,
838
+ 'some_record_array' => @some_record_array.map { |v| v&.as_json },
839
+ 'some_record_map' => @some_record_map.transform_values { |v| v&.as_json },
840
+ 'some_enum_array' => @some_enum_array.map { |v| v&.as_json },
841
+ 'some_optional_enum' => @some_optional_enum&.as_json,
842
+ 'some_enum_with_default' => @some_enum_with_default&.as_json
887
843
  }
888
844
  end
889
845
  end
@@ -936,7 +892,7 @@ module Schemas
936
892
  end
937
893
 
938
894
  # @override
939
- def to_h
895
+ def as_json(_opts={})
940
896
  {
941
897
  'test_id' => @test_id,
942
898
  'updated_at' => @updated_at,
@@ -991,7 +947,7 @@ module Schemas
991
947
  end
992
948
 
993
949
  # @override
994
- def to_h
950
+ def as_json(_opts={})
995
951
  {
996
952
  'test_id' => @test_id,
997
953
  'some_int' => @some_int,
@@ -1049,7 +1005,7 @@ module Schemas
1049
1005
  end
1050
1006
 
1051
1007
  # @override
1052
- def to_h
1008
+ def as_json(_opts={})
1053
1009
  {
1054
1010
  'id' => @id,
1055
1011
  'test_id' => @test_id,
@@ -1092,7 +1048,7 @@ module Schemas
1092
1048
  end
1093
1049
 
1094
1050
  # @override
1095
- def to_h
1051
+ def as_json(_opts={})
1096
1052
  {
1097
1053
  'update_request_id' => @update_request_id
1098
1054
  }
@@ -1131,7 +1087,7 @@ module Schemas
1131
1087
  end
1132
1088
 
1133
1089
  # @override
1134
- def to_h
1090
+ def as_json(_opts={})
1135
1091
  {
1136
1092
  'update_response_id' => @update_response_id
1137
1093
  }
@@ -1202,7 +1158,7 @@ module Schemas
1202
1158
  end
1203
1159
 
1204
1160
  # @override
1205
- def to_h
1161
+ def as_json(_opts={})
1206
1162
  {
1207
1163
  'id' => @id,
1208
1164
  'wibble_id' => @wibble_id,
@@ -1265,7 +1221,7 @@ module Schemas
1265
1221
  end
1266
1222
 
1267
1223
  # @override
1268
- def to_h
1224
+ def as_json(_opts={})
1269
1225
  {
1270
1226
  'id' => @id,
1271
1227
  'widget_id' => @widget_id,
@@ -1324,7 +1280,7 @@ module Schemas
1324
1280
  end
1325
1281
 
1326
1282
  # @override
1327
- def to_h
1283
+ def as_json(_opts={})
1328
1284
  {
1329
1285
  'id' => @id,
1330
1286
  'widget_id' => @widget_id,