deimos-ruby 2.1.12 → 2.2.0.pre.beta1

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 (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +1 -1
  3. data/CHANGELOG.md +6 -0
  4. data/README.md +13 -6
  5. data/deimos-ruby.gemspec +1 -0
  6. data/docs/CONFIGURATION.md +14 -14
  7. data/lib/deimos/active_record_consume/message_consumption.rb +5 -1
  8. data/lib/deimos/config/configuration.rb +3 -1
  9. data/lib/deimos/consume/message_consumption.rb +21 -9
  10. data/lib/deimos/ext/producer_middleware.rb +25 -4
  11. data/lib/deimos/ext/schema_route.rb +5 -0
  12. data/lib/deimos/message.rb +3 -2
  13. data/lib/deimos/producer.rb +8 -3
  14. data/lib/deimos/schema_backends/avro_base.rb +9 -0
  15. data/lib/deimos/schema_backends/avro_schema_registry.rb +1 -1
  16. data/lib/deimos/schema_backends/base.rb +10 -0
  17. data/lib/deimos/schema_backends/proto_base.rb +92 -0
  18. data/lib/deimos/schema_backends/proto_schema_registry.rb +33 -0
  19. data/lib/deimos/transcoder.rb +6 -2
  20. data/lib/deimos/version.rb +1 -1
  21. data/lib/deimos.rb +9 -7
  22. data/lib/generators/deimos/schema_class_generator.rb +17 -6
  23. data/spec/gen/sample/v1/sample_pb.rb +20 -0
  24. data/spec/generators/schema_class/my_schema_with_complex_types_spec.rb +6 -5
  25. data/spec/protos/sample/v1/sample.proto +24 -0
  26. data/spec/schema_backends/proto_schema_registry_spec.rb +50 -0
  27. data/spec/schemas/com/my-namespace/MySchemaWithComplexTypes.avsc +5 -0
  28. data/spec/schemas/my_namespace/generated.rb +10 -3
  29. data/spec/schemas/my_namespace/my_schema_with_complex_type.rb +35 -9
  30. data/spec/snapshots/consumers-no-nest.snap +5 -0
  31. data/spec/snapshots/consumers.snap +5 -0
  32. data/spec/snapshots/consumers_and_producers-no-nest.snap +5 -0
  33. data/spec/snapshots/consumers_and_producers.snap +5 -0
  34. data/spec/snapshots/consumers_circular-no-nest.snap +5 -0
  35. data/spec/snapshots/consumers_circular.snap +5 -0
  36. data/spec/snapshots/consumers_complex_types-no-nest.snap +5 -0
  37. data/spec/snapshots/consumers_complex_types.snap +5 -0
  38. data/spec/snapshots/consumers_nested-no-nest.snap +5 -0
  39. data/spec/snapshots/consumers_nested.snap +5 -0
  40. data/spec/snapshots/namespace_folders.snap +5 -0
  41. data/spec/snapshots/namespace_map.snap +5 -0
  42. data/spec/snapshots/producers_with_key-no-nest.snap +5 -0
  43. data/spec/snapshots/producers_with_key.snap +5 -0
  44. metadata +23 -1
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: sample/v1/sample.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/protobuf/timestamp_pb'
8
+
9
+
10
+ descriptor_data = "\n\x16sample/v1/sample.proto\x12\tsample.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"7\n\rNestedMessage\x12\x12\n\nnested_str\x18\x01 \x01(\t\x12\x12\n\nnested_num\x18\x02 \x01(\x05\"\xdb\x02\n\rSampleMessage\x12\x0b\n\x03str\x18\x01 \x01(\t\x12\x0b\n\x03num\x18\x02 \x01(\x05\x12\x0f\n\x07str_arr\x18\x03 \x03(\t\x12\x0c\n\x04\x66lag\x18\x04 \x01(\x08\x12-\n\ttimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12*\n\x06nested\x18\x06 \x01(\x0b\x32\x18.sample.v1.NestedMessageH\x00\x12\x13\n\tunion_str\x18\x07 \x01(\tH\x00\x12\x32\n\x10non_union_nested\x18\x08 \x01(\x0b\x32\x18.sample.v1.NestedMessage\x12\x35\n\x07str_map\x18\t \x03(\x0b\x32$.sample.v1.SampleMessage.StrMapEntry\x1a-\n\x0bStrMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x07\n\x05unionb\x06proto3"
11
+
12
+ pool = Google::Protobuf::DescriptorPool.generated_pool
13
+ pool.add_serialized_file(descriptor_data)
14
+
15
+ module Sample
16
+ module V1
17
+ NestedMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sample.v1.NestedMessage").msgclass
18
+ SampleMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("sample.v1.SampleMessage").msgclass
19
+ end
20
+ end
@@ -67,7 +67,7 @@ RSpec.describe Schemas::MyNamespace::MySchemaWithComplexType do
67
67
  let(:schema_fields) do
68
68
  %w(test_id test_float test_int_array test_optional_int test_string_array some_integer_map
69
69
  some_record some_optional_record some_record_array some_record_map some_enum_array
70
- some_optional_enum some_enum_with_default)
70
+ some_optional_enum some_enum_with_default union_string)
71
71
  end
72
72
 
73
73
  it 'should return the name of the schema and namespace' do
@@ -101,14 +101,15 @@ RSpec.describe Schemas::MyNamespace::MySchemaWithComplexType do
101
101
  'record_2' => { 'a_record_field' => 'field 6' }
102
102
  },
103
103
  'some_enum_array' => %w(sym1 sym2),
104
- 'some_enum_with_default' => 'sym6'
104
+ 'some_enum_with_default' => 'sym6',
105
+ 'union_string' => ''
105
106
  }
106
107
 
107
108
  expect(klass.as_json).to eq(payload_h)
108
109
  end
109
110
 
110
111
  it 'should return a JSON string of the payload' do
111
- s = '{"test_id":"test id","test_float":1.2,"test_string_array":["abc","def"],"test_int_array":[123,456],"test_optional_int":123,"some_integer_map":{"int_1":1,"int_2":2},"some_record":{"a_record_field":"field 1"},"some_optional_record":{"a_record_field":"field 2"},"some_record_array":[{"a_record_field":"field 3"},{"a_record_field":"field 4"}],"some_record_map":{"record_1":{"a_record_field":"field 5"},"record_2":{"a_record_field":"field 6"}},"some_enum_array":["sym1","sym2"],"some_optional_enum":null,"some_enum_with_default":"sym6"}'
112
+ s = '{"test_id":"test id","union_string":"","test_float":1.2,"test_string_array":["abc","def"],"test_int_array":[123,456],"test_optional_int":123,"some_integer_map":{"int_1":1,"int_2":2},"some_record":{"a_record_field":"field 1"},"some_optional_record":{"a_record_field":"field 2"},"some_record_array":[{"a_record_field":"field 3"},{"a_record_field":"field 4"}],"some_record_map":{"record_1":{"a_record_field":"field 5"},"record_2":{"a_record_field":"field 6"}},"some_enum_array":["sym1","sym2"],"some_optional_enum":null,"some_enum_with_default":"sym6"}'
112
113
  expect(klass.to_json).to eq(s)
113
114
  end
114
115
  end
@@ -209,9 +210,9 @@ RSpec.describe Schemas::MyNamespace::MySchemaWithComplexType do
209
210
  expect(klass.some_enum_array.first).
210
211
  to eq(described_class::AnEnum.new('new_sym'))
211
212
 
212
- klass.some_enum_array.second.an_enum = described_class::AnEnum.
213
+ klass.some_enum_array.second.value = described_class::AnEnum.
213
214
  new('other_sym')
214
- expect(klass.some_enum_array.second.an_enum).to eq('other_sym')
215
+ expect(klass.some_enum_array.second.value).to eq('other_sym')
215
216
  end
216
217
 
217
218
  it 'should modify the value of some_record_map' do
@@ -0,0 +1,24 @@
1
+ syntax = "proto3";
2
+
3
+ package sample.v1;
4
+
5
+ import "google/protobuf/timestamp.proto";
6
+
7
+ message NestedMessage {
8
+ string nested_str = 1;
9
+ int32 nested_num = 2;
10
+ }
11
+
12
+ message SampleMessage {
13
+ string str = 1;
14
+ int32 num = 2;
15
+ repeated string str_arr = 3;
16
+ bool flag = 4;
17
+ google.protobuf.Timestamp timestamp = 5;
18
+ oneof union {
19
+ NestedMessage nested = 6;
20
+ string union_str = 7;
21
+ }
22
+ NestedMessage non_union_nested = 8;
23
+ map<string, string> str_map = 9;
24
+ }
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'deimos/schema_backends/proto_schema_registry'
4
+ require_relative "#{__dir__}/../gen/sample/v1/sample_pb"
5
+
6
+ RSpec.describe Deimos::SchemaBackends::ProtoSchemaRegistry do
7
+ let(:payload) do
8
+ Sample::V1::SampleMessage.new(
9
+ str: "string",
10
+ num: 123,
11
+ str_arr: %w[one two],
12
+ flag: true,
13
+ timestamp: Time.utc(2017, 1, 1),
14
+ nested: Sample::V1::NestedMessage.new(nested_str: "string"),
15
+ non_union_nested: Sample::V1::NestedMessage.new(nested_num: 456),
16
+ str_map: {'foo' => 'bar'}
17
+ )
18
+ end
19
+
20
+ let(:backend) { described_class.new(schema: 'sample.v1.SampleMessage') }
21
+
22
+ specify('#encode_key') do
23
+ expect(backend.encode_key(nil, 789)).to eq('789')
24
+ expect(backend.encode_key(nil, 'string')).to eq('string')
25
+ expect(backend.encode_key(nil, {foo: 'bar'})).to eq('{"foo":"bar"}')
26
+ expect(backend.encode_key(:foo, 'bar')).to eq('bar')
27
+ end
28
+
29
+ specify('#decode_key') do
30
+ expect(backend.decode_key('789', nil)).to eq(789)
31
+ expect(backend.decode_key('{"foo":"bar"}', :foo)).to eq('bar')
32
+ expect(backend.decode_key('{"foo":"bar"}', nil)).to eq({"foo" => 'bar'})
33
+ end
34
+
35
+ it 'should encode and decode correctly' do
36
+ proto_turf = instance_double(ProtoTurf)
37
+ expect(proto_turf).to receive(:encode).
38
+ with(payload, subject: 'topic').
39
+ and_return('encoded-payload')
40
+ expect(proto_turf).to receive(:decode).
41
+ with('encoded-payload').
42
+ and_return(payload)
43
+ allow(described_class).to receive(:proto_turf).and_return(proto_turf)
44
+ results = backend.encode(payload, topic: 'topic')
45
+ expect(results).to eq('encoded-payload')
46
+ results = backend.decode(results)
47
+ expect(results).to eq(payload)
48
+ end
49
+
50
+ end
@@ -9,6 +9,11 @@
9
9
  "type": "string",
10
10
  "doc": "test string"
11
11
  },
12
+ {
13
+ "name": "union_string",
14
+ "type": ["string", "null"],
15
+ "default": ""
16
+ },
12
17
  {
13
18
  "name": "test_float",
14
19
  "type": "float",
@@ -41,13 +41,20 @@ module Schemas; module MyNamespace
41
41
 
42
42
  # Autogenerated Schema for Enum at com.my-namespace.AnEnum
43
43
  class AnEnum < Deimos::SchemaClass::Enum
44
- # @return ['sym1', 'sym2']
45
- attr_accessor :an_enum
46
-
47
44
  # @override
48
45
  def symbols
49
46
  %w(sym1 sym2)
50
47
  end
48
+
49
+
50
+ def sym1?
51
+ @value == 'sym1'
52
+ end
53
+
54
+ def sym2?
55
+ @value == 'sym2'
56
+ end
57
+
51
58
  end
52
59
 
53
60
 
@@ -41,35 +41,56 @@ module Schemas; module MyNamespace
41
41
 
42
42
  # Autogenerated Schema for Enum at com.my-namespace.AnEnum
43
43
  class AnEnum < Deimos::SchemaClass::Enum
44
- # @return ['sym1', 'sym2']
45
- attr_accessor :an_enum
46
-
47
44
  # @override
48
45
  def symbols
49
46
  %w(sym1 sym2)
50
47
  end
48
+
49
+
50
+ def sym1?
51
+ @value == 'sym1'
52
+ end
53
+
54
+ def sym2?
55
+ @value == 'sym2'
56
+ end
57
+
51
58
  end
52
59
 
53
60
  # Autogenerated Schema for Enum at com.my-namespace.AnotherEnum
54
61
  class AnotherEnum < Deimos::SchemaClass::Enum
55
- # @return ['sym3', 'sym4']
56
- attr_accessor :another_enum
57
-
58
62
  # @override
59
63
  def symbols
60
64
  %w(sym3 sym4)
61
65
  end
66
+
67
+
68
+ def sym3?
69
+ @value == 'sym3'
70
+ end
71
+
72
+ def sym4?
73
+ @value == 'sym4'
74
+ end
75
+
62
76
  end
63
77
 
64
78
  # Autogenerated Schema for Enum at com.my-namespace.YetAnotherEnum
65
79
  class YetAnotherEnum < Deimos::SchemaClass::Enum
66
- # @return ['sym5', 'sym6']
67
- attr_accessor :yet_another_enum
68
-
69
80
  # @override
70
81
  def symbols
71
82
  %w(sym5 sym6)
72
83
  end
84
+
85
+
86
+ def sym5?
87
+ @value == 'sym5'
88
+ end
89
+
90
+ def sym6?
91
+ @value == 'sym6'
92
+ end
93
+
73
94
  end
74
95
 
75
96
 
@@ -92,6 +113,8 @@ module Schemas; module MyNamespace
92
113
  ### Attribute Accessors ###
93
114
  # @return [String]
94
115
  attr_accessor :test_id
116
+ # @return [String, nil]
117
+ attr_accessor :union_string
95
118
  # @return [Float]
96
119
  attr_accessor :test_float
97
120
  # @return [Array<String>]
@@ -147,6 +170,7 @@ module Schemas; module MyNamespace
147
170
 
148
171
  # @override
149
172
  def initialize(_from_message: false, test_id: nil,
173
+ union_string: "",
150
174
  test_float: nil,
151
175
  test_string_array: ["test"],
152
176
  test_int_array: [123],
@@ -162,6 +186,7 @@ module Schemas; module MyNamespace
162
186
  @_from_message = _from_message
163
187
  super
164
188
  self.test_id = test_id
189
+ self.union_string = union_string
165
190
  self.test_float = test_float
166
191
  self.test_string_array = test_string_array
167
192
  self.test_int_array = test_int_array
@@ -197,6 +222,7 @@ module Schemas; module MyNamespace
197
222
  def as_json(_opts={})
198
223
  {
199
224
  'test_id' => @test_id,
225
+ 'union_string' => @union_string,
200
226
  'test_float' => @test_float,
201
227
  'test_string_array' => @test_string_array,
202
228
  'test_int_array' => @test_int_array,
@@ -749,6 +749,8 @@ module Schemas
749
749
  ### Attribute Accessors ###
750
750
  # @return [String]
751
751
  attr_accessor :test_id
752
+ # @return [String, nil]
753
+ attr_accessor :union_string
752
754
  # @return [Float]
753
755
  attr_accessor :test_float
754
756
  # @return [Array<String>]
@@ -804,6 +806,7 @@ module Schemas
804
806
 
805
807
  # @override
806
808
  def initialize(_from_message: false, test_id: nil,
809
+ union_string: "",
807
810
  test_float: nil,
808
811
  test_string_array: ["test"],
809
812
  test_int_array: [123],
@@ -819,6 +822,7 @@ module Schemas
819
822
  @_from_message = _from_message
820
823
  super
821
824
  self.test_id = test_id
825
+ self.union_string = union_string
822
826
  self.test_float = test_float
823
827
  self.test_string_array = test_string_array
824
828
  self.test_int_array = test_int_array
@@ -847,6 +851,7 @@ module Schemas
847
851
  def as_json(_opts={})
848
852
  {
849
853
  'test_id' => @test_id,
854
+ 'union_string' => @union_string,
850
855
  'test_float' => @test_float,
851
856
  'test_string_array' => @test_string_array,
852
857
  'test_int_array' => @test_int_array,
@@ -825,6 +825,8 @@ module Schemas
825
825
  ### Attribute Accessors ###
826
826
  # @return [String]
827
827
  attr_accessor :test_id
828
+ # @return [String, nil]
829
+ attr_accessor :union_string
828
830
  # @return [Float]
829
831
  attr_accessor :test_float
830
832
  # @return [Array<String>]
@@ -880,6 +882,7 @@ module Schemas
880
882
 
881
883
  # @override
882
884
  def initialize(_from_message: false, test_id: nil,
885
+ union_string: "",
883
886
  test_float: nil,
884
887
  test_string_array: ["test"],
885
888
  test_int_array: [123],
@@ -895,6 +898,7 @@ module Schemas
895
898
  @_from_message = _from_message
896
899
  super
897
900
  self.test_id = test_id
901
+ self.union_string = union_string
898
902
  self.test_float = test_float
899
903
  self.test_string_array = test_string_array
900
904
  self.test_int_array = test_int_array
@@ -923,6 +927,7 @@ module Schemas
923
927
  def as_json(_opts={})
924
928
  {
925
929
  'test_id' => @test_id,
930
+ 'union_string' => @union_string,
926
931
  'test_float' => @test_float,
927
932
  'test_string_array' => @test_string_array,
928
933
  'test_int_array' => @test_int_array,
@@ -749,6 +749,8 @@ module Schemas
749
749
  ### Attribute Accessors ###
750
750
  # @return [String]
751
751
  attr_accessor :test_id
752
+ # @return [String, nil]
753
+ attr_accessor :union_string
752
754
  # @return [Float]
753
755
  attr_accessor :test_float
754
756
  # @return [Array<String>]
@@ -804,6 +806,7 @@ module Schemas
804
806
 
805
807
  # @override
806
808
  def initialize(_from_message: false, test_id: nil,
809
+ union_string: "",
807
810
  test_float: nil,
808
811
  test_string_array: ["test"],
809
812
  test_int_array: [123],
@@ -819,6 +822,7 @@ module Schemas
819
822
  @_from_message = _from_message
820
823
  super
821
824
  self.test_id = test_id
825
+ self.union_string = union_string
822
826
  self.test_float = test_float
823
827
  self.test_string_array = test_string_array
824
828
  self.test_int_array = test_int_array
@@ -847,6 +851,7 @@ module Schemas
847
851
  def as_json(_opts={})
848
852
  {
849
853
  'test_id' => @test_id,
854
+ 'union_string' => @union_string,
850
855
  'test_float' => @test_float,
851
856
  'test_string_array' => @test_string_array,
852
857
  'test_int_array' => @test_int_array,
@@ -825,6 +825,8 @@ module Schemas
825
825
  ### Attribute Accessors ###
826
826
  # @return [String]
827
827
  attr_accessor :test_id
828
+ # @return [String, nil]
829
+ attr_accessor :union_string
828
830
  # @return [Float]
829
831
  attr_accessor :test_float
830
832
  # @return [Array<String>]
@@ -880,6 +882,7 @@ module Schemas
880
882
 
881
883
  # @override
882
884
  def initialize(_from_message: false, test_id: nil,
885
+ union_string: "",
883
886
  test_float: nil,
884
887
  test_string_array: ["test"],
885
888
  test_int_array: [123],
@@ -895,6 +898,7 @@ module Schemas
895
898
  @_from_message = _from_message
896
899
  super
897
900
  self.test_id = test_id
901
+ self.union_string = union_string
898
902
  self.test_float = test_float
899
903
  self.test_string_array = test_string_array
900
904
  self.test_int_array = test_int_array
@@ -923,6 +927,7 @@ module Schemas
923
927
  def as_json(_opts={})
924
928
  {
925
929
  'test_id' => @test_id,
930
+ 'union_string' => @union_string,
926
931
  'test_float' => @test_float,
927
932
  'test_string_array' => @test_string_array,
928
933
  'test_int_array' => @test_int_array,
@@ -749,6 +749,8 @@ module Schemas
749
749
  ### Attribute Accessors ###
750
750
  # @return [String]
751
751
  attr_accessor :test_id
752
+ # @return [String, nil]
753
+ attr_accessor :union_string
752
754
  # @return [Float]
753
755
  attr_accessor :test_float
754
756
  # @return [Array<String>]
@@ -804,6 +806,7 @@ module Schemas
804
806
 
805
807
  # @override
806
808
  def initialize(_from_message: false, test_id: nil,
809
+ union_string: "",
807
810
  test_float: nil,
808
811
  test_string_array: ["test"],
809
812
  test_int_array: [123],
@@ -819,6 +822,7 @@ module Schemas
819
822
  @_from_message = _from_message
820
823
  super
821
824
  self.test_id = test_id
825
+ self.union_string = union_string
822
826
  self.test_float = test_float
823
827
  self.test_string_array = test_string_array
824
828
  self.test_int_array = test_int_array
@@ -847,6 +851,7 @@ module Schemas
847
851
  def as_json(_opts={})
848
852
  {
849
853
  'test_id' => @test_id,
854
+ 'union_string' => @union_string,
850
855
  'test_float' => @test_float,
851
856
  'test_string_array' => @test_string_array,
852
857
  'test_int_array' => @test_int_array,
@@ -825,6 +825,8 @@ module Schemas
825
825
  ### Attribute Accessors ###
826
826
  # @return [String]
827
827
  attr_accessor :test_id
828
+ # @return [String, nil]
829
+ attr_accessor :union_string
828
830
  # @return [Float]
829
831
  attr_accessor :test_float
830
832
  # @return [Array<String>]
@@ -880,6 +882,7 @@ module Schemas
880
882
 
881
883
  # @override
882
884
  def initialize(_from_message: false, test_id: nil,
885
+ union_string: "",
883
886
  test_float: nil,
884
887
  test_string_array: ["test"],
885
888
  test_int_array: [123],
@@ -895,6 +898,7 @@ module Schemas
895
898
  @_from_message = _from_message
896
899
  super
897
900
  self.test_id = test_id
901
+ self.union_string = union_string
898
902
  self.test_float = test_float
899
903
  self.test_string_array = test_string_array
900
904
  self.test_int_array = test_int_array
@@ -923,6 +927,7 @@ module Schemas
923
927
  def as_json(_opts={})
924
928
  {
925
929
  'test_id' => @test_id,
930
+ 'union_string' => @union_string,
926
931
  'test_float' => @test_float,
927
932
  'test_string_array' => @test_string_array,
928
933
  'test_int_array' => @test_int_array,
@@ -749,6 +749,8 @@ module Schemas
749
749
  ### Attribute Accessors ###
750
750
  # @return [String]
751
751
  attr_accessor :test_id
752
+ # @return [String, nil]
753
+ attr_accessor :union_string
752
754
  # @return [Float]
753
755
  attr_accessor :test_float
754
756
  # @return [Array<String>]
@@ -804,6 +806,7 @@ module Schemas
804
806
 
805
807
  # @override
806
808
  def initialize(_from_message: false, test_id: nil,
809
+ union_string: "",
807
810
  test_float: nil,
808
811
  test_string_array: ["test"],
809
812
  test_int_array: [123],
@@ -819,6 +822,7 @@ module Schemas
819
822
  @_from_message = _from_message
820
823
  super
821
824
  self.test_id = test_id
825
+ self.union_string = union_string
822
826
  self.test_float = test_float
823
827
  self.test_string_array = test_string_array
824
828
  self.test_int_array = test_int_array
@@ -847,6 +851,7 @@ module Schemas
847
851
  def as_json(_opts={})
848
852
  {
849
853
  'test_id' => @test_id,
854
+ 'union_string' => @union_string,
850
855
  'test_float' => @test_float,
851
856
  'test_string_array' => @test_string_array,
852
857
  'test_int_array' => @test_int_array,
@@ -825,6 +825,8 @@ module Schemas
825
825
  ### Attribute Accessors ###
826
826
  # @return [String]
827
827
  attr_accessor :test_id
828
+ # @return [String, nil]
829
+ attr_accessor :union_string
828
830
  # @return [Float]
829
831
  attr_accessor :test_float
830
832
  # @return [Array<String>]
@@ -880,6 +882,7 @@ module Schemas
880
882
 
881
883
  # @override
882
884
  def initialize(_from_message: false, test_id: nil,
885
+ union_string: "",
883
886
  test_float: nil,
884
887
  test_string_array: ["test"],
885
888
  test_int_array: [123],
@@ -895,6 +898,7 @@ module Schemas
895
898
  @_from_message = _from_message
896
899
  super
897
900
  self.test_id = test_id
901
+ self.union_string = union_string
898
902
  self.test_float = test_float
899
903
  self.test_string_array = test_string_array
900
904
  self.test_int_array = test_int_array
@@ -923,6 +927,7 @@ module Schemas
923
927
  def as_json(_opts={})
924
928
  {
925
929
  'test_id' => @test_id,
930
+ 'union_string' => @union_string,
926
931
  'test_float' => @test_float,
927
932
  'test_string_array' => @test_string_array,
928
933
  'test_int_array' => @test_int_array,
@@ -749,6 +749,8 @@ module Schemas
749
749
  ### Attribute Accessors ###
750
750
  # @return [String]
751
751
  attr_accessor :test_id
752
+ # @return [String, nil]
753
+ attr_accessor :union_string
752
754
  # @return [Float]
753
755
  attr_accessor :test_float
754
756
  # @return [Array<String>]
@@ -804,6 +806,7 @@ module Schemas
804
806
 
805
807
  # @override
806
808
  def initialize(_from_message: false, test_id: nil,
809
+ union_string: "",
807
810
  test_float: nil,
808
811
  test_string_array: ["test"],
809
812
  test_int_array: [123],
@@ -819,6 +822,7 @@ module Schemas
819
822
  @_from_message = _from_message
820
823
  super
821
824
  self.test_id = test_id
825
+ self.union_string = union_string
822
826
  self.test_float = test_float
823
827
  self.test_string_array = test_string_array
824
828
  self.test_int_array = test_int_array
@@ -847,6 +851,7 @@ module Schemas
847
851
  def as_json(_opts={})
848
852
  {
849
853
  'test_id' => @test_id,
854
+ 'union_string' => @union_string,
850
855
  'test_float' => @test_float,
851
856
  'test_string_array' => @test_string_array,
852
857
  'test_int_array' => @test_int_array,
@@ -825,6 +825,8 @@ module Schemas
825
825
  ### Attribute Accessors ###
826
826
  # @return [String]
827
827
  attr_accessor :test_id
828
+ # @return [String, nil]
829
+ attr_accessor :union_string
828
830
  # @return [Float]
829
831
  attr_accessor :test_float
830
832
  # @return [Array<String>]
@@ -880,6 +882,7 @@ module Schemas
880
882
 
881
883
  # @override
882
884
  def initialize(_from_message: false, test_id: nil,
885
+ union_string: "",
883
886
  test_float: nil,
884
887
  test_string_array: ["test"],
885
888
  test_int_array: [123],
@@ -895,6 +898,7 @@ module Schemas
895
898
  @_from_message = _from_message
896
899
  super
897
900
  self.test_id = test_id
901
+ self.union_string = union_string
898
902
  self.test_float = test_float
899
903
  self.test_string_array = test_string_array
900
904
  self.test_int_array = test_int_array
@@ -923,6 +927,7 @@ module Schemas
923
927
  def as_json(_opts={})
924
928
  {
925
929
  'test_id' => @test_id,
930
+ 'union_string' => @union_string,
926
931
  'test_float' => @test_float,
927
932
  'test_string_array' => @test_string_array,
928
933
  'test_int_array' => @test_int_array,
@@ -700,6 +700,8 @@ module Schemas; module Com; module MyNamespace
700
700
  ### Attribute Accessors ###
701
701
  # @return [String]
702
702
  attr_accessor :test_id
703
+ # @return [String, nil]
704
+ attr_accessor :union_string
703
705
  # @return [Float]
704
706
  attr_accessor :test_float
705
707
  # @return [Array<String>]
@@ -755,6 +757,7 @@ module Schemas; module Com; module MyNamespace
755
757
 
756
758
  # @override
757
759
  def initialize(_from_message: false, test_id: nil,
760
+ union_string: "",
758
761
  test_float: nil,
759
762
  test_string_array: ["test"],
760
763
  test_int_array: [123],
@@ -770,6 +773,7 @@ module Schemas; module Com; module MyNamespace
770
773
  @_from_message = _from_message
771
774
  super
772
775
  self.test_id = test_id
776
+ self.union_string = union_string
773
777
  self.test_float = test_float
774
778
  self.test_string_array = test_string_array
775
779
  self.test_int_array = test_int_array
@@ -798,6 +802,7 @@ module Schemas; module Com; module MyNamespace
798
802
  def as_json(_opts={})
799
803
  {
800
804
  'test_id' => @test_id,
805
+ 'union_string' => @union_string,
801
806
  'test_float' => @test_float,
802
807
  'test_string_array' => @test_string_array,
803
808
  'test_int_array' => @test_int_array,
@@ -745,6 +745,8 @@ module Schemas; module MyNamespace
745
745
  ### Attribute Accessors ###
746
746
  # @return [String]
747
747
  attr_accessor :test_id
748
+ # @return [String, nil]
749
+ attr_accessor :union_string
748
750
  # @return [Float]
749
751
  attr_accessor :test_float
750
752
  # @return [Array<String>]
@@ -800,6 +802,7 @@ module Schemas; module MyNamespace
800
802
 
801
803
  # @override
802
804
  def initialize(_from_message: false, test_id: nil,
805
+ union_string: "",
803
806
  test_float: nil,
804
807
  test_string_array: ["test"],
805
808
  test_int_array: [123],
@@ -815,6 +818,7 @@ module Schemas; module MyNamespace
815
818
  @_from_message = _from_message
816
819
  super
817
820
  self.test_id = test_id
821
+ self.union_string = union_string
818
822
  self.test_float = test_float
819
823
  self.test_string_array = test_string_array
820
824
  self.test_int_array = test_int_array
@@ -843,6 +847,7 @@ module Schemas; module MyNamespace
843
847
  def as_json(_opts={})
844
848
  {
845
849
  'test_id' => @test_id,
850
+ 'union_string' => @union_string,
846
851
  'test_float' => @test_float,
847
852
  'test_string_array' => @test_string_array,
848
853
  'test_int_array' => @test_int_array,