avro-gen-ruby 0.1.0
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.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +34 -0
- data/.github/workflows/release.yml +31 -0
- data/.gitignore +6 -0
- data/.rspec +1 -0
- data/.rubocop.yml +100 -0
- data/Gemfile +5 -0
- data/LICENSE +21 -0
- data/README.md +61 -0
- data/Rakefile +11 -0
- data/avro-gen-ruby.gemspec +32 -0
- data/lib/avro_gen/avro_parser.rb +64 -0
- data/lib/avro_gen/configuration.rb +60 -0
- data/lib/avro_gen/errors.rb +6 -0
- data/lib/avro_gen/generator/templates/schema_class.rb.tt +8 -0
- data/lib/avro_gen/generator/templates/schema_enum.rb.tt +13 -0
- data/lib/avro_gen/generator/templates/schema_record.rb.tt +102 -0
- data/lib/avro_gen/generator.rb +375 -0
- data/lib/avro_gen/railtie.rb +12 -0
- data/lib/avro_gen/schema_class/base.rb +62 -0
- data/lib/avro_gen/schema_class/enum.rb +48 -0
- data/lib/avro_gen/schema_class/record.rb +108 -0
- data/lib/avro_gen/schema_class.rb +62 -0
- data/lib/avro_gen/schema_field.rb +26 -0
- data/lib/avro_gen/schema_validator.rb +80 -0
- data/lib/avro_gen/upgrader.rb +43 -0
- data/lib/avro_gen/version.rb +5 -0
- data/lib/avro_gen.rb +18 -0
- data/lib/tasks/avro.rake +18 -0
- data/regenerate_test_schema_classes.rb +32 -0
- data/spec/generator_spec.rb +92 -0
- data/spec/my_schema_spec.rb +18 -0
- data/spec/my_schema_with_circular_reference_spec.rb +97 -0
- data/spec/my_schema_with_complex_types_spec.rb +235 -0
- data/spec/schema_validator_spec.rb +42 -0
- data/spec/schemas/com/my-namespace/Generated.avsc +77 -0
- data/spec/schemas/com/my-namespace/MyNestedSchema.avsc +62 -0
- data/spec/schemas/com/my-namespace/MySchema.avsc +18 -0
- data/spec/schemas/com/my-namespace/MySchemaCompound_key.avsc +18 -0
- data/spec/schemas/com/my-namespace/MySchemaId_key.avsc +12 -0
- data/spec/schemas/com/my-namespace/MySchemaWithBooleans.avsc +18 -0
- data/spec/schemas/com/my-namespace/MySchemaWithCircularReference.avsc +39 -0
- data/spec/schemas/com/my-namespace/MySchemaWithComplexTypes.avsc +120 -0
- data/spec/schemas/com/my-namespace/MySchemaWithDateTimes.avsc +33 -0
- data/spec/schemas/com/my-namespace/MySchemaWithId.avsc +28 -0
- data/spec/schemas/com/my-namespace/MySchemaWithTitle.avsc +22 -0
- data/spec/schemas/com/my-namespace/MySchemaWithUnionType.avsc +91 -0
- data/spec/schemas/com/my-namespace/MySchemaWithUniqueId.avsc +32 -0
- data/spec/schemas/com/my-namespace/MySchema_key.avsc +13 -0
- data/spec/schemas/com/my-namespace/Wibble.avsc +43 -0
- data/spec/schemas/com/my-namespace/Widget.avsc +27 -0
- data/spec/schemas/com/my-namespace/WidgetTheSecond.avsc +27 -0
- data/spec/schemas/com/my-namespace/WidgetTheThird.avsc +27 -0
- data/spec/schemas/com/my-namespace/my-suborg/MyLongNamespaceSchema.avsc +18 -0
- data/spec/schemas/com/my-namespace/request/CreateTopic.avsc +11 -0
- data/spec/schemas/com/my-namespace/request/Index.avsc +11 -0
- data/spec/schemas/com/my-namespace/request/UpdateRequest.avsc +11 -0
- data/spec/schemas/com/my-namespace/response/CreateTopic.avsc +11 -0
- data/spec/schemas/com/my-namespace/response/Index.avsc +11 -0
- data/spec/schemas/com/my-namespace/response/UpdateResponse.avsc +11 -0
- data/spec/schemas/my_namespace/generated.rb +164 -0
- data/spec/schemas/my_namespace/my_long_namespace_schema.rb +49 -0
- data/spec/schemas/my_namespace/my_nested_schema.rb +126 -0
- data/spec/schemas/my_namespace/my_schema.rb +62 -0
- data/spec/schemas/my_namespace/my_schema_compound_key.rb +42 -0
- data/spec/schemas/my_namespace/my_schema_id_key.rb +37 -0
- data/spec/schemas/my_namespace/my_schema_key.rb +37 -0
- data/spec/schemas/my_namespace/my_schema_with_boolean.rb +42 -0
- data/spec/schemas/my_namespace/my_schema_with_circular_reference.rb +84 -0
- data/spec/schemas/my_namespace/my_schema_with_complex_type.rb +241 -0
- data/spec/schemas/my_namespace/my_schema_with_date_time.rb +57 -0
- data/spec/schemas/my_namespace/my_schema_with_id.rb +52 -0
- data/spec/schemas/my_namespace/my_schema_with_title.rb +47 -0
- data/spec/schemas/my_namespace/my_schema_with_union_type.rb +205 -0
- data/spec/schemas/my_namespace/my_schema_with_unique_id.rb +57 -0
- data/spec/schemas/my_namespace/request/create_topic.rb +37 -0
- data/spec/schemas/my_namespace/request/index.rb +37 -0
- data/spec/schemas/my_namespace/request/update_request.rb +37 -0
- data/spec/schemas/my_namespace/response/create_topic.rb +37 -0
- data/spec/schemas/my_namespace/response/index.rb +37 -0
- data/spec/schemas/my_namespace/response/update_response.rb +37 -0
- data/spec/schemas/my_namespace/wibble.rb +77 -0
- data/spec/schemas/my_namespace/widget.rb +57 -0
- data/spec/schemas/my_namespace/widget_the_second.rb +57 -0
- data/spec/schemas/my_namespace/widget_the_third.rb +57 -0
- data/spec/snapshots/consumers-no-nest.snap +1740 -0
- data/spec/snapshots/consumers.snap +1720 -0
- data/spec/snapshots/my_nested_schema.snap +121 -0
- data/spec/snapshots/my_schema_with_boolean.snap +44 -0
- data/spec/snapshots/my_schema_with_circular_reference.snap +81 -0
- data/spec/snapshots/my_schema_with_complex_type.snap +236 -0
- data/spec/snapshots/my_schema_with_date_time.snap +59 -0
- data/spec/snapshots/my_schema_with_union_type.snap +207 -0
- data/spec/snapshots/namespace_folders.snap +1800 -0
- data/spec/snapshots/namespace_map.snap +1800 -0
- data/spec/spec_helper.rb +23 -0
- metadata +265 -0
|
@@ -0,0 +1,1800 @@
|
|
|
1
|
+
spec/app/lib/schema_classes/schemas/my_namespace/generated.rb:
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
5
|
+
module Schemas; module MyNamespace
|
|
6
|
+
### Primary Schema Class ###
|
|
7
|
+
# Autogenerated Schema for Record at com.my-namespace.Generated
|
|
8
|
+
class Generated < AvroGen::SchemaClass::Record
|
|
9
|
+
|
|
10
|
+
### Secondary Schema Classes ###
|
|
11
|
+
# Autogenerated Schema for Record at com.my-namespace.ARecord
|
|
12
|
+
class ARecord < AvroGen::SchemaClass::Record
|
|
13
|
+
|
|
14
|
+
### Attribute Accessors ###
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_accessor :a_record_field
|
|
17
|
+
|
|
18
|
+
# @override
|
|
19
|
+
def initialize(_from_message: false, a_record_field: nil)
|
|
20
|
+
@_from_message = _from_message
|
|
21
|
+
super
|
|
22
|
+
self.a_record_field = a_record_field
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# @override
|
|
26
|
+
def schema
|
|
27
|
+
'ARecord'
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# @override
|
|
31
|
+
def namespace
|
|
32
|
+
'com.my-namespace'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @override
|
|
36
|
+
def as_json(_opts={})
|
|
37
|
+
{
|
|
38
|
+
'a_record_field' => @a_record_field
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnEnum
|
|
44
|
+
class AnEnum < AvroGen::SchemaClass::Enum
|
|
45
|
+
# @override
|
|
46
|
+
def symbols
|
|
47
|
+
%w(sym1 sym2)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def sym1?
|
|
52
|
+
@value == 'sym1'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def sym2?
|
|
56
|
+
@value == 'sym2'
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Attribute Readers ###
|
|
63
|
+
# @return [AnEnum]
|
|
64
|
+
attr_reader :an_enum
|
|
65
|
+
# @return [ARecord]
|
|
66
|
+
attr_reader :a_record
|
|
67
|
+
|
|
68
|
+
### Attribute Accessors ###
|
|
69
|
+
# @return [String]
|
|
70
|
+
attr_accessor :a_string
|
|
71
|
+
# @return [Integer]
|
|
72
|
+
attr_accessor :a_int
|
|
73
|
+
# @return [Integer]
|
|
74
|
+
attr_accessor :a_long
|
|
75
|
+
# @return [Float]
|
|
76
|
+
attr_accessor :a_float
|
|
77
|
+
# @return [Float]
|
|
78
|
+
attr_accessor :a_double
|
|
79
|
+
# @return [nil, Integer]
|
|
80
|
+
attr_accessor :an_optional_int
|
|
81
|
+
# @return [Array<Integer>]
|
|
82
|
+
attr_accessor :an_array
|
|
83
|
+
# @return [Hash<String, String>]
|
|
84
|
+
attr_accessor :a_map
|
|
85
|
+
# @return [String]
|
|
86
|
+
attr_accessor :timestamp
|
|
87
|
+
# @return [String]
|
|
88
|
+
attr_accessor :message_id
|
|
89
|
+
|
|
90
|
+
### Attribute Writers ###
|
|
91
|
+
# @return [AnEnum]
|
|
92
|
+
def an_enum=(value)
|
|
93
|
+
@an_enum = AnEnum.initialize_from_value(value, from_message: self._from_message)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @return [ARecord]
|
|
97
|
+
def a_record=(value)
|
|
98
|
+
@a_record = ARecord.initialize_from_value(value, from_message: self._from_message)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# @override
|
|
102
|
+
def initialize(_from_message: false, a_string: nil,
|
|
103
|
+
a_int: nil,
|
|
104
|
+
a_long: nil,
|
|
105
|
+
a_float: nil,
|
|
106
|
+
a_double: nil,
|
|
107
|
+
an_optional_int: nil,
|
|
108
|
+
an_enum: nil,
|
|
109
|
+
an_array: nil,
|
|
110
|
+
a_map: nil,
|
|
111
|
+
timestamp: nil,
|
|
112
|
+
message_id: nil,
|
|
113
|
+
a_record: nil)
|
|
114
|
+
@_from_message = _from_message
|
|
115
|
+
super
|
|
116
|
+
self.a_string = a_string
|
|
117
|
+
self.a_int = a_int
|
|
118
|
+
self.a_long = a_long
|
|
119
|
+
self.a_float = a_float
|
|
120
|
+
self.a_double = a_double
|
|
121
|
+
self.an_optional_int = an_optional_int
|
|
122
|
+
self.an_enum = an_enum
|
|
123
|
+
self.an_array = an_array
|
|
124
|
+
self.a_map = a_map
|
|
125
|
+
self.timestamp = timestamp
|
|
126
|
+
self.message_id = message_id
|
|
127
|
+
self.a_record = a_record
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# @override
|
|
131
|
+
def schema
|
|
132
|
+
'Generated'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @override
|
|
136
|
+
def namespace
|
|
137
|
+
'com.my-namespace'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def self.tombstone(key)
|
|
141
|
+
record = self.allocate
|
|
142
|
+
record.tombstone_key = key
|
|
143
|
+
record.a_string = key
|
|
144
|
+
record
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# @override
|
|
148
|
+
def as_json(_opts={})
|
|
149
|
+
{
|
|
150
|
+
'a_string' => @a_string,
|
|
151
|
+
'a_int' => @a_int,
|
|
152
|
+
'a_long' => @a_long,
|
|
153
|
+
'a_float' => @a_float,
|
|
154
|
+
'a_double' => @a_double,
|
|
155
|
+
'an_optional_int' => @an_optional_int,
|
|
156
|
+
'an_enum' => @an_enum&.as_json,
|
|
157
|
+
'an_array' => @an_array,
|
|
158
|
+
'a_map' => @a_map,
|
|
159
|
+
'timestamp' => @timestamp,
|
|
160
|
+
'message_id' => @message_id,
|
|
161
|
+
'a_record' => @a_record&.as_json
|
|
162
|
+
}
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end; end
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_long_namespace_schema.rb:
|
|
169
|
+
# frozen_string_literal: true
|
|
170
|
+
|
|
171
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
172
|
+
module Schemas; module MyNamespace
|
|
173
|
+
### Primary Schema Class ###
|
|
174
|
+
# Autogenerated Schema for Record at com.my-namespace.my-suborg.MyLongNamespaceSchema
|
|
175
|
+
class MyLongNamespaceSchema < AvroGen::SchemaClass::Record
|
|
176
|
+
|
|
177
|
+
### Attribute Accessors ###
|
|
178
|
+
# @return [String]
|
|
179
|
+
attr_accessor :test_id
|
|
180
|
+
# @return [Integer]
|
|
181
|
+
attr_accessor :some_int
|
|
182
|
+
|
|
183
|
+
# @override
|
|
184
|
+
def initialize(_from_message: false, test_id: nil,
|
|
185
|
+
some_int: nil)
|
|
186
|
+
@_from_message = _from_message
|
|
187
|
+
super
|
|
188
|
+
self.test_id = test_id
|
|
189
|
+
self.some_int = some_int
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# @override
|
|
193
|
+
def schema
|
|
194
|
+
'MyLongNamespaceSchema'
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# @override
|
|
198
|
+
def namespace
|
|
199
|
+
'com.my-namespace.my-suborg'
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# @override
|
|
203
|
+
def as_json(_opts={})
|
|
204
|
+
{
|
|
205
|
+
'test_id' => @test_id,
|
|
206
|
+
'some_int' => @some_int
|
|
207
|
+
}
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end; end
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_nested_schema.rb:
|
|
214
|
+
# frozen_string_literal: true
|
|
215
|
+
|
|
216
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
217
|
+
module Schemas; module MyNamespace
|
|
218
|
+
### Primary Schema Class ###
|
|
219
|
+
# Autogenerated Schema for Record at com.my-namespace.MyNestedSchema
|
|
220
|
+
class MyNestedSchema < AvroGen::SchemaClass::Record
|
|
221
|
+
|
|
222
|
+
### Secondary Schema Classes ###
|
|
223
|
+
# Autogenerated Schema for Record at com.my-namespace.MyNestedRecord
|
|
224
|
+
class MyNestedRecord < AvroGen::SchemaClass::Record
|
|
225
|
+
|
|
226
|
+
### Attribute Accessors ###
|
|
227
|
+
# @return [Integer]
|
|
228
|
+
attr_accessor :some_int
|
|
229
|
+
# @return [Float]
|
|
230
|
+
attr_accessor :some_float
|
|
231
|
+
# @return [String]
|
|
232
|
+
attr_accessor :some_string
|
|
233
|
+
# @return [nil, Integer]
|
|
234
|
+
attr_accessor :some_optional_int
|
|
235
|
+
|
|
236
|
+
# @override
|
|
237
|
+
def initialize(_from_message: false, some_int: nil,
|
|
238
|
+
some_float: nil,
|
|
239
|
+
some_string: nil,
|
|
240
|
+
some_optional_int: nil)
|
|
241
|
+
@_from_message = _from_message
|
|
242
|
+
super
|
|
243
|
+
self.some_int = some_int
|
|
244
|
+
self.some_float = some_float
|
|
245
|
+
self.some_string = some_string
|
|
246
|
+
self.some_optional_int = some_optional_int
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# @override
|
|
250
|
+
def schema
|
|
251
|
+
'MyNestedRecord'
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# @override
|
|
255
|
+
def namespace
|
|
256
|
+
'com.my-namespace'
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# @override
|
|
260
|
+
def as_json(_opts={})
|
|
261
|
+
{
|
|
262
|
+
'some_int' => @some_int,
|
|
263
|
+
'some_float' => @some_float,
|
|
264
|
+
'some_string' => @some_string,
|
|
265
|
+
'some_optional_int' => @some_optional_int
|
|
266
|
+
}
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
### Attribute Readers ###
|
|
272
|
+
# @return [MyNestedRecord]
|
|
273
|
+
attr_reader :some_nested_record
|
|
274
|
+
# @return [nil, MyNestedRecord]
|
|
275
|
+
attr_reader :some_optional_record
|
|
276
|
+
|
|
277
|
+
### Attribute Accessors ###
|
|
278
|
+
# @return [String]
|
|
279
|
+
attr_accessor :test_id
|
|
280
|
+
# @return [Float]
|
|
281
|
+
attr_accessor :test_float
|
|
282
|
+
# @return [Array<String>]
|
|
283
|
+
attr_accessor :test_array
|
|
284
|
+
|
|
285
|
+
### Attribute Writers ###
|
|
286
|
+
# @return [MyNestedRecord]
|
|
287
|
+
def some_nested_record=(value)
|
|
288
|
+
@some_nested_record = MyNestedRecord.initialize_from_value(value, from_message: self._from_message)
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# @return [nil, MyNestedRecord]
|
|
292
|
+
def some_optional_record=(value)
|
|
293
|
+
@some_optional_record = MyNestedRecord.initialize_from_value(value, from_message: self._from_message)
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# @override
|
|
297
|
+
def initialize(_from_message: false, test_id: nil,
|
|
298
|
+
test_float: nil,
|
|
299
|
+
test_array: nil,
|
|
300
|
+
some_nested_record: nil,
|
|
301
|
+
some_optional_record: nil)
|
|
302
|
+
@_from_message = _from_message
|
|
303
|
+
super
|
|
304
|
+
self.test_id = test_id
|
|
305
|
+
self.test_float = test_float
|
|
306
|
+
self.test_array = test_array
|
|
307
|
+
self.some_nested_record = some_nested_record
|
|
308
|
+
self.some_optional_record = some_optional_record
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# @override
|
|
312
|
+
def schema
|
|
313
|
+
'MyNestedSchema'
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# @override
|
|
317
|
+
def namespace
|
|
318
|
+
'com.my-namespace'
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# @override
|
|
322
|
+
def as_json(_opts={})
|
|
323
|
+
{
|
|
324
|
+
'test_id' => @test_id,
|
|
325
|
+
'test_float' => @test_float,
|
|
326
|
+
'test_array' => @test_array,
|
|
327
|
+
'some_nested_record' => @some_nested_record&.as_json,
|
|
328
|
+
'some_optional_record' => @some_optional_record&.as_json
|
|
329
|
+
}
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
end; end
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema.rb:
|
|
336
|
+
# frozen_string_literal: true
|
|
337
|
+
|
|
338
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
339
|
+
module Schemas; module MyNamespace
|
|
340
|
+
### Primary Schema Class ###
|
|
341
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchema
|
|
342
|
+
class MySchema < AvroGen::SchemaClass::Record
|
|
343
|
+
|
|
344
|
+
### Attribute Accessors ###
|
|
345
|
+
# @return [String]
|
|
346
|
+
attr_accessor :test_id
|
|
347
|
+
# @return [Integer]
|
|
348
|
+
attr_accessor :some_int
|
|
349
|
+
|
|
350
|
+
# @override
|
|
351
|
+
def initialize(_from_message: false, test_id: nil,
|
|
352
|
+
some_int: nil)
|
|
353
|
+
@_from_message = _from_message
|
|
354
|
+
super
|
|
355
|
+
self.test_id = test_id
|
|
356
|
+
self.some_int = some_int
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# @override
|
|
360
|
+
def schema
|
|
361
|
+
'MySchema'
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# @override
|
|
365
|
+
def namespace
|
|
366
|
+
'com.my-namespace'
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
# @override
|
|
370
|
+
def as_json(_opts={})
|
|
371
|
+
{
|
|
372
|
+
'test_id' => @test_id,
|
|
373
|
+
'some_int' => @some_int
|
|
374
|
+
}
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
end; end
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_compound_key.rb:
|
|
381
|
+
# frozen_string_literal: true
|
|
382
|
+
|
|
383
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
384
|
+
module Schemas; module MyNamespace
|
|
385
|
+
### Primary Schema Class ###
|
|
386
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaCompound_key
|
|
387
|
+
class MySchemaCompoundKey < AvroGen::SchemaClass::Record
|
|
388
|
+
|
|
389
|
+
### Attribute Accessors ###
|
|
390
|
+
# @return [String]
|
|
391
|
+
attr_accessor :part_one
|
|
392
|
+
# @return [String]
|
|
393
|
+
attr_accessor :part_two
|
|
394
|
+
|
|
395
|
+
# @override
|
|
396
|
+
def initialize(_from_message: false, part_one: nil,
|
|
397
|
+
part_two: nil)
|
|
398
|
+
@_from_message = _from_message
|
|
399
|
+
super
|
|
400
|
+
self.part_one = part_one
|
|
401
|
+
self.part_two = part_two
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
# @override
|
|
405
|
+
def schema
|
|
406
|
+
'MySchemaCompound_key'
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
# @override
|
|
410
|
+
def namespace
|
|
411
|
+
'com.my-namespace'
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
# @override
|
|
415
|
+
def as_json(_opts={})
|
|
416
|
+
{
|
|
417
|
+
'part_one' => @part_one,
|
|
418
|
+
'part_two' => @part_two
|
|
419
|
+
}
|
|
420
|
+
end
|
|
421
|
+
end
|
|
422
|
+
end; end
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_id_key.rb:
|
|
426
|
+
# frozen_string_literal: true
|
|
427
|
+
|
|
428
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
429
|
+
module Schemas; module MyNamespace
|
|
430
|
+
### Primary Schema Class ###
|
|
431
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaId_key
|
|
432
|
+
class MySchemaIdKey < AvroGen::SchemaClass::Record
|
|
433
|
+
|
|
434
|
+
### Attribute Accessors ###
|
|
435
|
+
# @return [Integer]
|
|
436
|
+
attr_accessor :id
|
|
437
|
+
|
|
438
|
+
# @override
|
|
439
|
+
def initialize(_from_message: false, id: nil)
|
|
440
|
+
@_from_message = _from_message
|
|
441
|
+
super
|
|
442
|
+
self.id = id
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
# @override
|
|
446
|
+
def schema
|
|
447
|
+
'MySchemaId_key'
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
# @override
|
|
451
|
+
def namespace
|
|
452
|
+
'com.my-namespace'
|
|
453
|
+
end
|
|
454
|
+
|
|
455
|
+
# @override
|
|
456
|
+
def as_json(_opts={})
|
|
457
|
+
{
|
|
458
|
+
'id' => @id
|
|
459
|
+
}
|
|
460
|
+
end
|
|
461
|
+
end
|
|
462
|
+
end; end
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_key.rb:
|
|
466
|
+
# frozen_string_literal: true
|
|
467
|
+
|
|
468
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
469
|
+
module Schemas; module MyNamespace
|
|
470
|
+
### Primary Schema Class ###
|
|
471
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchema_key
|
|
472
|
+
class MySchemaKey < AvroGen::SchemaClass::Record
|
|
473
|
+
|
|
474
|
+
### Attribute Accessors ###
|
|
475
|
+
# @return [String]
|
|
476
|
+
attr_accessor :test_id
|
|
477
|
+
|
|
478
|
+
# @override
|
|
479
|
+
def initialize(_from_message: false, test_id: nil)
|
|
480
|
+
@_from_message = _from_message
|
|
481
|
+
super
|
|
482
|
+
self.test_id = test_id
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
# @override
|
|
486
|
+
def schema
|
|
487
|
+
'MySchema_key'
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
# @override
|
|
491
|
+
def namespace
|
|
492
|
+
'com.my-namespace'
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
# @override
|
|
496
|
+
def as_json(_opts={})
|
|
497
|
+
{
|
|
498
|
+
'test_id' => @test_id
|
|
499
|
+
}
|
|
500
|
+
end
|
|
501
|
+
end
|
|
502
|
+
end; end
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_boolean.rb:
|
|
506
|
+
# frozen_string_literal: true
|
|
507
|
+
|
|
508
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
509
|
+
module Schemas; module MyNamespace
|
|
510
|
+
### Primary Schema Class ###
|
|
511
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithBooleans
|
|
512
|
+
class MySchemaWithBoolean < AvroGen::SchemaClass::Record
|
|
513
|
+
|
|
514
|
+
### Attribute Accessors ###
|
|
515
|
+
# @return [String]
|
|
516
|
+
attr_accessor :test_id
|
|
517
|
+
# @return [Boolean]
|
|
518
|
+
attr_accessor :some_bool
|
|
519
|
+
|
|
520
|
+
# @override
|
|
521
|
+
def initialize(_from_message: false, test_id: nil,
|
|
522
|
+
some_bool: nil)
|
|
523
|
+
@_from_message = _from_message
|
|
524
|
+
super
|
|
525
|
+
self.test_id = test_id
|
|
526
|
+
self.some_bool = some_bool
|
|
527
|
+
end
|
|
528
|
+
|
|
529
|
+
# @override
|
|
530
|
+
def schema
|
|
531
|
+
'MySchemaWithBooleans'
|
|
532
|
+
end
|
|
533
|
+
|
|
534
|
+
# @override
|
|
535
|
+
def namespace
|
|
536
|
+
'com.my-namespace'
|
|
537
|
+
end
|
|
538
|
+
|
|
539
|
+
# @override
|
|
540
|
+
def as_json(_opts={})
|
|
541
|
+
{
|
|
542
|
+
'test_id' => @test_id,
|
|
543
|
+
'some_bool' => @some_bool
|
|
544
|
+
}
|
|
545
|
+
end
|
|
546
|
+
end
|
|
547
|
+
end; end
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_circular_reference.rb:
|
|
551
|
+
# frozen_string_literal: true
|
|
552
|
+
|
|
553
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
554
|
+
module Schemas; module MyNamespace
|
|
555
|
+
### Primary Schema Class ###
|
|
556
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithCircularReference
|
|
557
|
+
class MySchemaWithCircularReference < AvroGen::SchemaClass::Record
|
|
558
|
+
|
|
559
|
+
### Secondary Schema Classes ###
|
|
560
|
+
# Autogenerated Schema for Record at com.my-namespace.Property
|
|
561
|
+
class Property < AvroGen::SchemaClass::Record
|
|
562
|
+
|
|
563
|
+
### Attribute Accessors ###
|
|
564
|
+
# @return [Boolean, Integer, Integer, Float, Float, String, Array<Property>, Hash<String, Property>]
|
|
565
|
+
attr_accessor :property
|
|
566
|
+
|
|
567
|
+
# @override
|
|
568
|
+
def initialize(_from_message: false, property: nil)
|
|
569
|
+
@_from_message = _from_message
|
|
570
|
+
super
|
|
571
|
+
self.property = property
|
|
572
|
+
end
|
|
573
|
+
|
|
574
|
+
# @override
|
|
575
|
+
def schema
|
|
576
|
+
'Property'
|
|
577
|
+
end
|
|
578
|
+
|
|
579
|
+
# @override
|
|
580
|
+
def namespace
|
|
581
|
+
'com.my-namespace'
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
# @override
|
|
585
|
+
def as_json(_opts={})
|
|
586
|
+
{
|
|
587
|
+
'property' => @property
|
|
588
|
+
}
|
|
589
|
+
end
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
### Attribute Readers ###
|
|
594
|
+
# @return [Hash<String, Property>]
|
|
595
|
+
attr_reader :properties
|
|
596
|
+
|
|
597
|
+
### Attribute Writers ###
|
|
598
|
+
# @return [Hash<String, Property>]
|
|
599
|
+
def properties=(values)
|
|
600
|
+
@properties = values&.transform_values do |value|
|
|
601
|
+
Property.initialize_from_value(value, from_message: self._from_message)
|
|
602
|
+
end
|
|
603
|
+
end
|
|
604
|
+
|
|
605
|
+
# @override
|
|
606
|
+
def initialize(_from_message: false, properties: {})
|
|
607
|
+
@_from_message = _from_message
|
|
608
|
+
super
|
|
609
|
+
self.properties = properties
|
|
610
|
+
end
|
|
611
|
+
|
|
612
|
+
# @override
|
|
613
|
+
def schema
|
|
614
|
+
'MySchemaWithCircularReference'
|
|
615
|
+
end
|
|
616
|
+
|
|
617
|
+
# @override
|
|
618
|
+
def namespace
|
|
619
|
+
'com.my-namespace'
|
|
620
|
+
end
|
|
621
|
+
|
|
622
|
+
# @override
|
|
623
|
+
def as_json(_opts={})
|
|
624
|
+
{
|
|
625
|
+
'properties' => @properties.transform_values { |v| v&.as_json }
|
|
626
|
+
}
|
|
627
|
+
end
|
|
628
|
+
end
|
|
629
|
+
end; end
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_complex_type.rb:
|
|
633
|
+
# frozen_string_literal: true
|
|
634
|
+
|
|
635
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
636
|
+
module Schemas; module MyNamespace
|
|
637
|
+
### Primary Schema Class ###
|
|
638
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithComplexTypes
|
|
639
|
+
class MySchemaWithComplexType < AvroGen::SchemaClass::Record
|
|
640
|
+
|
|
641
|
+
### Secondary Schema Classes ###
|
|
642
|
+
# Autogenerated Schema for Record at com.my-namespace.ARecord
|
|
643
|
+
class ARecord < AvroGen::SchemaClass::Record
|
|
644
|
+
|
|
645
|
+
### Attribute Accessors ###
|
|
646
|
+
# @return [String]
|
|
647
|
+
attr_accessor :a_record_field
|
|
648
|
+
|
|
649
|
+
# @override
|
|
650
|
+
def initialize(_from_message: false, a_record_field: nil)
|
|
651
|
+
@_from_message = _from_message
|
|
652
|
+
super
|
|
653
|
+
self.a_record_field = a_record_field
|
|
654
|
+
end
|
|
655
|
+
|
|
656
|
+
# @override
|
|
657
|
+
def schema
|
|
658
|
+
'ARecord'
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
# @override
|
|
662
|
+
def namespace
|
|
663
|
+
'com.my-namespace'
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
# @override
|
|
667
|
+
def as_json(_opts={})
|
|
668
|
+
{
|
|
669
|
+
'a_record_field' => @a_record_field
|
|
670
|
+
}
|
|
671
|
+
end
|
|
672
|
+
end
|
|
673
|
+
|
|
674
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnEnum
|
|
675
|
+
class AnEnum < AvroGen::SchemaClass::Enum
|
|
676
|
+
# @override
|
|
677
|
+
def symbols
|
|
678
|
+
%w(sym1 sym2)
|
|
679
|
+
end
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
def sym1?
|
|
683
|
+
@value == 'sym1'
|
|
684
|
+
end
|
|
685
|
+
|
|
686
|
+
def sym2?
|
|
687
|
+
@value == 'sym2'
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
end
|
|
691
|
+
|
|
692
|
+
# Autogenerated Schema for Enum at com.my-namespace.AnotherEnum
|
|
693
|
+
class AnotherEnum < AvroGen::SchemaClass::Enum
|
|
694
|
+
# @override
|
|
695
|
+
def symbols
|
|
696
|
+
%w(sym3 sym4)
|
|
697
|
+
end
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
def sym3?
|
|
701
|
+
@value == 'sym3'
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
def sym4?
|
|
705
|
+
@value == 'sym4'
|
|
706
|
+
end
|
|
707
|
+
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
# Autogenerated Schema for Enum at com.my-namespace.YetAnotherEnum
|
|
711
|
+
class YetAnotherEnum < AvroGen::SchemaClass::Enum
|
|
712
|
+
# @override
|
|
713
|
+
def symbols
|
|
714
|
+
%w(sym5 sym6)
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
def sym5?
|
|
719
|
+
@value == 'sym5'
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
def sym6?
|
|
723
|
+
@value == 'sym6'
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
end
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
### Attribute Readers ###
|
|
730
|
+
# @return [ARecord]
|
|
731
|
+
attr_reader :some_record
|
|
732
|
+
# @return [nil, ARecord]
|
|
733
|
+
attr_reader :some_optional_record
|
|
734
|
+
# @return [Array<ARecord>]
|
|
735
|
+
attr_reader :some_record_array
|
|
736
|
+
# @return [Hash<String, ARecord>]
|
|
737
|
+
attr_reader :some_record_map
|
|
738
|
+
# @return [Array<AnEnum>]
|
|
739
|
+
attr_reader :some_enum_array
|
|
740
|
+
# @return [nil, AnotherEnum]
|
|
741
|
+
attr_reader :some_optional_enum
|
|
742
|
+
# @return [YetAnotherEnum]
|
|
743
|
+
attr_reader :some_enum_with_default
|
|
744
|
+
|
|
745
|
+
### Attribute Accessors ###
|
|
746
|
+
# @return [String]
|
|
747
|
+
attr_accessor :test_id
|
|
748
|
+
# @return [String, nil]
|
|
749
|
+
attr_accessor :union_string
|
|
750
|
+
# @return [Float]
|
|
751
|
+
attr_accessor :test_float
|
|
752
|
+
# @return [Array<String>]
|
|
753
|
+
attr_accessor :test_string_array
|
|
754
|
+
# @return [Array<Integer>]
|
|
755
|
+
attr_accessor :test_int_array
|
|
756
|
+
# @return [Integer, nil]
|
|
757
|
+
attr_accessor :test_optional_int
|
|
758
|
+
# @return [Hash<String, Integer>]
|
|
759
|
+
attr_accessor :some_integer_map
|
|
760
|
+
|
|
761
|
+
### Attribute Writers ###
|
|
762
|
+
# @return [ARecord]
|
|
763
|
+
def some_record=(value)
|
|
764
|
+
@some_record = ARecord.initialize_from_value(value, from_message: self._from_message)
|
|
765
|
+
end
|
|
766
|
+
|
|
767
|
+
# @return [nil, ARecord]
|
|
768
|
+
def some_optional_record=(value)
|
|
769
|
+
@some_optional_record = ARecord.initialize_from_value(value, from_message: self._from_message)
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
# @return [Array<ARecord>]
|
|
773
|
+
def some_record_array=(values)
|
|
774
|
+
@some_record_array = values&.map do |value|
|
|
775
|
+
ARecord.initialize_from_value(value, from_message: self._from_message)
|
|
776
|
+
end
|
|
777
|
+
end
|
|
778
|
+
|
|
779
|
+
# @return [Hash<String, ARecord>]
|
|
780
|
+
def some_record_map=(values)
|
|
781
|
+
@some_record_map = values&.transform_values do |value|
|
|
782
|
+
ARecord.initialize_from_value(value, from_message: self._from_message)
|
|
783
|
+
end
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
# @return [Array<AnEnum>]
|
|
787
|
+
def some_enum_array=(values)
|
|
788
|
+
@some_enum_array = values&.map do |value|
|
|
789
|
+
AnEnum.initialize_from_value(value, from_message: self._from_message)
|
|
790
|
+
end
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
# @return [nil, AnotherEnum]
|
|
794
|
+
def some_optional_enum=(value)
|
|
795
|
+
@some_optional_enum = AnotherEnum.initialize_from_value(value, from_message: self._from_message)
|
|
796
|
+
end
|
|
797
|
+
|
|
798
|
+
# @return [YetAnotherEnum]
|
|
799
|
+
def some_enum_with_default=(value)
|
|
800
|
+
@some_enum_with_default = YetAnotherEnum.initialize_from_value(value, from_message: self._from_message)
|
|
801
|
+
end
|
|
802
|
+
|
|
803
|
+
# @override
|
|
804
|
+
def initialize(_from_message: false, test_id: nil,
|
|
805
|
+
union_string: "",
|
|
806
|
+
test_float: nil,
|
|
807
|
+
test_string_array: ["test"],
|
|
808
|
+
test_int_array: [123],
|
|
809
|
+
test_optional_int: 123,
|
|
810
|
+
some_integer_map: {"abc"=>123},
|
|
811
|
+
some_record: {"a_record_field"=>"Test String"},
|
|
812
|
+
some_optional_record: nil,
|
|
813
|
+
some_record_array: nil,
|
|
814
|
+
some_record_map: nil,
|
|
815
|
+
some_enum_array: nil,
|
|
816
|
+
some_optional_enum: nil,
|
|
817
|
+
some_enum_with_default: "sym6")
|
|
818
|
+
@_from_message = _from_message
|
|
819
|
+
super
|
|
820
|
+
self.test_id = test_id
|
|
821
|
+
self.union_string = union_string
|
|
822
|
+
self.test_float = test_float
|
|
823
|
+
self.test_string_array = test_string_array
|
|
824
|
+
self.test_int_array = test_int_array
|
|
825
|
+
self.test_optional_int = test_optional_int
|
|
826
|
+
self.some_integer_map = some_integer_map
|
|
827
|
+
self.some_record = some_record
|
|
828
|
+
self.some_optional_record = some_optional_record
|
|
829
|
+
self.some_record_array = some_record_array
|
|
830
|
+
self.some_record_map = some_record_map
|
|
831
|
+
self.some_enum_array = some_enum_array
|
|
832
|
+
self.some_optional_enum = some_optional_enum
|
|
833
|
+
self.some_enum_with_default = some_enum_with_default
|
|
834
|
+
end
|
|
835
|
+
|
|
836
|
+
# @override
|
|
837
|
+
def schema
|
|
838
|
+
'MySchemaWithComplexTypes'
|
|
839
|
+
end
|
|
840
|
+
|
|
841
|
+
# @override
|
|
842
|
+
def namespace
|
|
843
|
+
'com.my-namespace'
|
|
844
|
+
end
|
|
845
|
+
|
|
846
|
+
# @override
|
|
847
|
+
def as_json(_opts={})
|
|
848
|
+
{
|
|
849
|
+
'test_id' => @test_id,
|
|
850
|
+
'union_string' => @union_string,
|
|
851
|
+
'test_float' => @test_float,
|
|
852
|
+
'test_string_array' => @test_string_array,
|
|
853
|
+
'test_int_array' => @test_int_array,
|
|
854
|
+
'test_optional_int' => @test_optional_int,
|
|
855
|
+
'some_integer_map' => @some_integer_map,
|
|
856
|
+
'some_record' => @some_record&.as_json,
|
|
857
|
+
'some_optional_record' => @some_optional_record&.as_json,
|
|
858
|
+
'some_record_array' => @some_record_array.map { |v| v&.as_json },
|
|
859
|
+
'some_record_map' => @some_record_map.transform_values { |v| v&.as_json },
|
|
860
|
+
'some_enum_array' => @some_enum_array.map { |v| v&.as_json },
|
|
861
|
+
'some_optional_enum' => @some_optional_enum&.as_json,
|
|
862
|
+
'some_enum_with_default' => @some_enum_with_default&.as_json
|
|
863
|
+
}
|
|
864
|
+
end
|
|
865
|
+
end
|
|
866
|
+
end; end
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_date_time.rb:
|
|
870
|
+
# frozen_string_literal: true
|
|
871
|
+
|
|
872
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
873
|
+
module Schemas; module MyNamespace
|
|
874
|
+
### Primary Schema Class ###
|
|
875
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithDateTimes
|
|
876
|
+
class MySchemaWithDateTime < AvroGen::SchemaClass::Record
|
|
877
|
+
|
|
878
|
+
### Attribute Accessors ###
|
|
879
|
+
# @return [String]
|
|
880
|
+
attr_accessor :test_id
|
|
881
|
+
# @return [Integer, nil]
|
|
882
|
+
attr_accessor :updated_at
|
|
883
|
+
# @return [nil, Integer]
|
|
884
|
+
attr_accessor :some_int
|
|
885
|
+
# @return [nil, Integer]
|
|
886
|
+
attr_accessor :some_datetime_int
|
|
887
|
+
# @return [String]
|
|
888
|
+
attr_accessor :timestamp
|
|
889
|
+
|
|
890
|
+
# @override
|
|
891
|
+
def initialize(_from_message: false, test_id: nil,
|
|
892
|
+
updated_at: nil,
|
|
893
|
+
some_int: nil,
|
|
894
|
+
some_datetime_int: nil,
|
|
895
|
+
timestamp: nil)
|
|
896
|
+
@_from_message = _from_message
|
|
897
|
+
super
|
|
898
|
+
self.test_id = test_id
|
|
899
|
+
self.updated_at = updated_at
|
|
900
|
+
self.some_int = some_int
|
|
901
|
+
self.some_datetime_int = some_datetime_int
|
|
902
|
+
self.timestamp = timestamp
|
|
903
|
+
end
|
|
904
|
+
|
|
905
|
+
# @override
|
|
906
|
+
def schema
|
|
907
|
+
'MySchemaWithDateTimes'
|
|
908
|
+
end
|
|
909
|
+
|
|
910
|
+
# @override
|
|
911
|
+
def namespace
|
|
912
|
+
'com.my-namespace'
|
|
913
|
+
end
|
|
914
|
+
|
|
915
|
+
# @override
|
|
916
|
+
def as_json(_opts={})
|
|
917
|
+
{
|
|
918
|
+
'test_id' => @test_id,
|
|
919
|
+
'updated_at' => @updated_at,
|
|
920
|
+
'some_int' => @some_int,
|
|
921
|
+
'some_datetime_int' => @some_datetime_int,
|
|
922
|
+
'timestamp' => @timestamp
|
|
923
|
+
}
|
|
924
|
+
end
|
|
925
|
+
end
|
|
926
|
+
end; end
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_id.rb:
|
|
930
|
+
# frozen_string_literal: true
|
|
931
|
+
|
|
932
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
933
|
+
module Schemas; module MyNamespace
|
|
934
|
+
### Primary Schema Class ###
|
|
935
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithId
|
|
936
|
+
class MySchemaWithId < AvroGen::SchemaClass::Record
|
|
937
|
+
|
|
938
|
+
### Attribute Accessors ###
|
|
939
|
+
# @return [String]
|
|
940
|
+
attr_accessor :test_id
|
|
941
|
+
# @return [Integer]
|
|
942
|
+
attr_accessor :some_int
|
|
943
|
+
# @return [String]
|
|
944
|
+
attr_accessor :message_id
|
|
945
|
+
# @return [String]
|
|
946
|
+
attr_accessor :timestamp
|
|
947
|
+
|
|
948
|
+
# @override
|
|
949
|
+
def initialize(_from_message: false, test_id: nil,
|
|
950
|
+
some_int: nil,
|
|
951
|
+
message_id: nil,
|
|
952
|
+
timestamp: nil)
|
|
953
|
+
@_from_message = _from_message
|
|
954
|
+
super
|
|
955
|
+
self.test_id = test_id
|
|
956
|
+
self.some_int = some_int
|
|
957
|
+
self.message_id = message_id
|
|
958
|
+
self.timestamp = timestamp
|
|
959
|
+
end
|
|
960
|
+
|
|
961
|
+
# @override
|
|
962
|
+
def schema
|
|
963
|
+
'MySchemaWithId'
|
|
964
|
+
end
|
|
965
|
+
|
|
966
|
+
# @override
|
|
967
|
+
def namespace
|
|
968
|
+
'com.my-namespace'
|
|
969
|
+
end
|
|
970
|
+
|
|
971
|
+
# @override
|
|
972
|
+
def as_json(_opts={})
|
|
973
|
+
{
|
|
974
|
+
'test_id' => @test_id,
|
|
975
|
+
'some_int' => @some_int,
|
|
976
|
+
'message_id' => @message_id,
|
|
977
|
+
'timestamp' => @timestamp
|
|
978
|
+
}
|
|
979
|
+
end
|
|
980
|
+
end
|
|
981
|
+
end; end
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_title.rb:
|
|
985
|
+
# frozen_string_literal: true
|
|
986
|
+
|
|
987
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
988
|
+
module Schemas; module MyNamespace
|
|
989
|
+
### Primary Schema Class ###
|
|
990
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithTitle
|
|
991
|
+
class MySchemaWithTitle < AvroGen::SchemaClass::Record
|
|
992
|
+
|
|
993
|
+
### Attribute Accessors ###
|
|
994
|
+
# @return [String]
|
|
995
|
+
attr_accessor :test_id
|
|
996
|
+
# @return [Integer]
|
|
997
|
+
attr_accessor :some_int
|
|
998
|
+
# @return [String]
|
|
999
|
+
attr_accessor :title
|
|
1000
|
+
|
|
1001
|
+
# @override
|
|
1002
|
+
def initialize(_from_message: false, test_id: nil,
|
|
1003
|
+
some_int: nil,
|
|
1004
|
+
title: nil)
|
|
1005
|
+
@_from_message = _from_message
|
|
1006
|
+
super
|
|
1007
|
+
self.test_id = test_id
|
|
1008
|
+
self.some_int = some_int
|
|
1009
|
+
self.title = title
|
|
1010
|
+
end
|
|
1011
|
+
|
|
1012
|
+
# @override
|
|
1013
|
+
def schema
|
|
1014
|
+
'MySchemaWithTitle'
|
|
1015
|
+
end
|
|
1016
|
+
|
|
1017
|
+
# @override
|
|
1018
|
+
def namespace
|
|
1019
|
+
'com.my-namespace'
|
|
1020
|
+
end
|
|
1021
|
+
|
|
1022
|
+
# @override
|
|
1023
|
+
def as_json(_opts={})
|
|
1024
|
+
{
|
|
1025
|
+
'test_id' => @test_id,
|
|
1026
|
+
'some_int' => @some_int,
|
|
1027
|
+
'title' => @title
|
|
1028
|
+
}
|
|
1029
|
+
end
|
|
1030
|
+
end
|
|
1031
|
+
end; end
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_union_type.rb:
|
|
1035
|
+
# frozen_string_literal: true
|
|
1036
|
+
|
|
1037
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1038
|
+
module Schemas; module MyNamespace
|
|
1039
|
+
### Primary Schema Class ###
|
|
1040
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithUnionType
|
|
1041
|
+
class MySchemaWithUnionType < AvroGen::SchemaClass::Record
|
|
1042
|
+
|
|
1043
|
+
### Secondary Schema Classes ###
|
|
1044
|
+
# Autogenerated Schema for Record at com.flipp.content.Record1
|
|
1045
|
+
class Record1 < AvroGen::SchemaClass::Record
|
|
1046
|
+
|
|
1047
|
+
### Attribute Accessors ###
|
|
1048
|
+
# @return [Hash<String, Integer>]
|
|
1049
|
+
attr_accessor :record1_map
|
|
1050
|
+
# @return [Integer]
|
|
1051
|
+
attr_accessor :record1_id
|
|
1052
|
+
|
|
1053
|
+
# @override
|
|
1054
|
+
def initialize(_from_message: false, record1_map: {},
|
|
1055
|
+
record1_id: 0)
|
|
1056
|
+
@_from_message = _from_message
|
|
1057
|
+
super
|
|
1058
|
+
self.record1_map = record1_map
|
|
1059
|
+
self.record1_id = record1_id
|
|
1060
|
+
end
|
|
1061
|
+
|
|
1062
|
+
# @override
|
|
1063
|
+
def schema
|
|
1064
|
+
'Record1'
|
|
1065
|
+
end
|
|
1066
|
+
|
|
1067
|
+
# @override
|
|
1068
|
+
def namespace
|
|
1069
|
+
'com.flipp.content'
|
|
1070
|
+
end
|
|
1071
|
+
|
|
1072
|
+
# @override
|
|
1073
|
+
def as_json(_opts={})
|
|
1074
|
+
{
|
|
1075
|
+
'record1_map' => @record1_map,
|
|
1076
|
+
'record1_id' => @record1_id
|
|
1077
|
+
}
|
|
1078
|
+
end
|
|
1079
|
+
end
|
|
1080
|
+
|
|
1081
|
+
# Autogenerated Schema for Record at com.flipp.content.Record2
|
|
1082
|
+
class Record2 < AvroGen::SchemaClass::Record
|
|
1083
|
+
|
|
1084
|
+
### Attribute Accessors ###
|
|
1085
|
+
# @return [String]
|
|
1086
|
+
attr_accessor :record2_id
|
|
1087
|
+
|
|
1088
|
+
# @override
|
|
1089
|
+
def initialize(_from_message: false, record2_id: "")
|
|
1090
|
+
@_from_message = _from_message
|
|
1091
|
+
super
|
|
1092
|
+
self.record2_id = record2_id
|
|
1093
|
+
end
|
|
1094
|
+
|
|
1095
|
+
# @override
|
|
1096
|
+
def schema
|
|
1097
|
+
'Record2'
|
|
1098
|
+
end
|
|
1099
|
+
|
|
1100
|
+
# @override
|
|
1101
|
+
def namespace
|
|
1102
|
+
'com.flipp.content'
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1105
|
+
# @override
|
|
1106
|
+
def as_json(_opts={})
|
|
1107
|
+
{
|
|
1108
|
+
'record2_id' => @record2_id
|
|
1109
|
+
}
|
|
1110
|
+
end
|
|
1111
|
+
end
|
|
1112
|
+
|
|
1113
|
+
# Autogenerated Schema for Record at com.flipp.content.Record3
|
|
1114
|
+
class Record3 < AvroGen::SchemaClass::Record
|
|
1115
|
+
|
|
1116
|
+
### Attribute Accessors ###
|
|
1117
|
+
# @return [Float]
|
|
1118
|
+
attr_accessor :record3_id
|
|
1119
|
+
|
|
1120
|
+
# @override
|
|
1121
|
+
def initialize(_from_message: false, record3_id: 0.0)
|
|
1122
|
+
@_from_message = _from_message
|
|
1123
|
+
super
|
|
1124
|
+
self.record3_id = record3_id
|
|
1125
|
+
end
|
|
1126
|
+
|
|
1127
|
+
# @override
|
|
1128
|
+
def schema
|
|
1129
|
+
'Record3'
|
|
1130
|
+
end
|
|
1131
|
+
|
|
1132
|
+
# @override
|
|
1133
|
+
def namespace
|
|
1134
|
+
'com.flipp.content'
|
|
1135
|
+
end
|
|
1136
|
+
|
|
1137
|
+
# @override
|
|
1138
|
+
def as_json(_opts={})
|
|
1139
|
+
{
|
|
1140
|
+
'record3_id' => @record3_id
|
|
1141
|
+
}
|
|
1142
|
+
end
|
|
1143
|
+
end
|
|
1144
|
+
|
|
1145
|
+
# Autogenerated Schema for Record at com.flipp.content.Record4
|
|
1146
|
+
class Record4 < AvroGen::SchemaClass::Record
|
|
1147
|
+
|
|
1148
|
+
### Attribute Accessors ###
|
|
1149
|
+
# @return [Integer]
|
|
1150
|
+
attr_accessor :record4_id
|
|
1151
|
+
|
|
1152
|
+
# @override
|
|
1153
|
+
def initialize(_from_message: false, record4_id: 0)
|
|
1154
|
+
@_from_message = _from_message
|
|
1155
|
+
super
|
|
1156
|
+
self.record4_id = record4_id
|
|
1157
|
+
end
|
|
1158
|
+
|
|
1159
|
+
# @override
|
|
1160
|
+
def schema
|
|
1161
|
+
'Record4'
|
|
1162
|
+
end
|
|
1163
|
+
|
|
1164
|
+
# @override
|
|
1165
|
+
def namespace
|
|
1166
|
+
'com.flipp.content'
|
|
1167
|
+
end
|
|
1168
|
+
|
|
1169
|
+
# @override
|
|
1170
|
+
def as_json(_opts={})
|
|
1171
|
+
{
|
|
1172
|
+
'record4_id' => @record4_id
|
|
1173
|
+
}
|
|
1174
|
+
end
|
|
1175
|
+
end
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
### Attribute Readers ###
|
|
1179
|
+
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
|
1180
|
+
attr_reader :test_union_type
|
|
1181
|
+
|
|
1182
|
+
### Attribute Accessors ###
|
|
1183
|
+
# @return [String]
|
|
1184
|
+
attr_accessor :test_id
|
|
1185
|
+
# @return [nil, Integer]
|
|
1186
|
+
attr_accessor :test_long
|
|
1187
|
+
|
|
1188
|
+
### Attribute Writers ###
|
|
1189
|
+
# @return [nil, Record1, Record2, Record3, Record4, Integer, Array<String>]
|
|
1190
|
+
def test_union_type=(value)
|
|
1191
|
+
@test_union_type = initialize_test_union_type_type(value, from_message: self._from_message)
|
|
1192
|
+
end
|
|
1193
|
+
|
|
1194
|
+
# Helper method to determine which schema type to use for test_union_type
|
|
1195
|
+
# @param value [Hash, nil]
|
|
1196
|
+
# @param from_message [Boolean] whether this was initialized from a real Avro message
|
|
1197
|
+
# @return [Object, nil]
|
|
1198
|
+
def initialize_test_union_type_type(value, from_message: false)
|
|
1199
|
+
return nil if value.nil?
|
|
1200
|
+
|
|
1201
|
+
klass = [Record1, Record2, Record3, Record4].find do |candidate|
|
|
1202
|
+
fields = candidate.new.as_json.keys
|
|
1203
|
+
(value.keys - fields).empty?
|
|
1204
|
+
end
|
|
1205
|
+
|
|
1206
|
+
klass.initialize_from_value(value, from_message: self._from_message)
|
|
1207
|
+
end
|
|
1208
|
+
|
|
1209
|
+
# @override
|
|
1210
|
+
def initialize(_from_message: false, test_id: "",
|
|
1211
|
+
test_long: nil,
|
|
1212
|
+
test_union_type: nil)
|
|
1213
|
+
@_from_message = _from_message
|
|
1214
|
+
super
|
|
1215
|
+
self.test_id = test_id
|
|
1216
|
+
self.test_long = test_long
|
|
1217
|
+
self.test_union_type = test_union_type
|
|
1218
|
+
end
|
|
1219
|
+
|
|
1220
|
+
# @override
|
|
1221
|
+
def schema
|
|
1222
|
+
'MySchemaWithUnionType'
|
|
1223
|
+
end
|
|
1224
|
+
|
|
1225
|
+
# @override
|
|
1226
|
+
def namespace
|
|
1227
|
+
'com.my-namespace'
|
|
1228
|
+
end
|
|
1229
|
+
|
|
1230
|
+
# @override
|
|
1231
|
+
def as_json(_opts={})
|
|
1232
|
+
{
|
|
1233
|
+
'test_id' => @test_id,
|
|
1234
|
+
'test_long' => @test_long,
|
|
1235
|
+
'test_union_type' => @test_union_type&.as_json
|
|
1236
|
+
}
|
|
1237
|
+
end
|
|
1238
|
+
end
|
|
1239
|
+
end; end
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
spec/app/lib/schema_classes/schemas/my_namespace/my_schema_with_unique_id.rb:
|
|
1243
|
+
# frozen_string_literal: true
|
|
1244
|
+
|
|
1245
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1246
|
+
module Schemas; module MyNamespace
|
|
1247
|
+
### Primary Schema Class ###
|
|
1248
|
+
# Autogenerated Schema for Record at com.my-namespace.MySchemaWithUniqueId
|
|
1249
|
+
class MySchemaWithUniqueId < AvroGen::SchemaClass::Record
|
|
1250
|
+
|
|
1251
|
+
### Attribute Accessors ###
|
|
1252
|
+
# @return [Integer]
|
|
1253
|
+
attr_accessor :id
|
|
1254
|
+
# @return [String]
|
|
1255
|
+
attr_accessor :test_id
|
|
1256
|
+
# @return [Integer]
|
|
1257
|
+
attr_accessor :some_int
|
|
1258
|
+
# @return [String]
|
|
1259
|
+
attr_accessor :message_id
|
|
1260
|
+
# @return [String]
|
|
1261
|
+
attr_accessor :timestamp
|
|
1262
|
+
|
|
1263
|
+
# @override
|
|
1264
|
+
def initialize(_from_message: false, id: nil,
|
|
1265
|
+
test_id: nil,
|
|
1266
|
+
some_int: nil,
|
|
1267
|
+
message_id: nil,
|
|
1268
|
+
timestamp: nil)
|
|
1269
|
+
@_from_message = _from_message
|
|
1270
|
+
super
|
|
1271
|
+
self.id = id
|
|
1272
|
+
self.test_id = test_id
|
|
1273
|
+
self.some_int = some_int
|
|
1274
|
+
self.message_id = message_id
|
|
1275
|
+
self.timestamp = timestamp
|
|
1276
|
+
end
|
|
1277
|
+
|
|
1278
|
+
# @override
|
|
1279
|
+
def schema
|
|
1280
|
+
'MySchemaWithUniqueId'
|
|
1281
|
+
end
|
|
1282
|
+
|
|
1283
|
+
# @override
|
|
1284
|
+
def namespace
|
|
1285
|
+
'com.my-namespace'
|
|
1286
|
+
end
|
|
1287
|
+
|
|
1288
|
+
# @override
|
|
1289
|
+
def as_json(_opts={})
|
|
1290
|
+
{
|
|
1291
|
+
'id' => @id,
|
|
1292
|
+
'test_id' => @test_id,
|
|
1293
|
+
'some_int' => @some_int,
|
|
1294
|
+
'message_id' => @message_id,
|
|
1295
|
+
'timestamp' => @timestamp
|
|
1296
|
+
}
|
|
1297
|
+
end
|
|
1298
|
+
end
|
|
1299
|
+
end; end
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
spec/app/lib/schema_classes/schemas/my_namespace/request/create_topic.rb:
|
|
1303
|
+
# frozen_string_literal: true
|
|
1304
|
+
|
|
1305
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1306
|
+
module Schemas; module MyNamespace; module Request
|
|
1307
|
+
### Primary Schema Class ###
|
|
1308
|
+
# Autogenerated Schema for Record at com.my-namespace.request.CreateTopic
|
|
1309
|
+
class CreateTopic < AvroGen::SchemaClass::Record
|
|
1310
|
+
|
|
1311
|
+
### Attribute Accessors ###
|
|
1312
|
+
# @return [String]
|
|
1313
|
+
attr_accessor :request_id
|
|
1314
|
+
|
|
1315
|
+
# @override
|
|
1316
|
+
def initialize(_from_message: false, request_id: nil)
|
|
1317
|
+
@_from_message = _from_message
|
|
1318
|
+
super
|
|
1319
|
+
self.request_id = request_id
|
|
1320
|
+
end
|
|
1321
|
+
|
|
1322
|
+
# @override
|
|
1323
|
+
def schema
|
|
1324
|
+
'CreateTopic'
|
|
1325
|
+
end
|
|
1326
|
+
|
|
1327
|
+
# @override
|
|
1328
|
+
def namespace
|
|
1329
|
+
'com.my-namespace.request'
|
|
1330
|
+
end
|
|
1331
|
+
|
|
1332
|
+
# @override
|
|
1333
|
+
def as_json(_opts={})
|
|
1334
|
+
{
|
|
1335
|
+
'request_id' => @request_id
|
|
1336
|
+
}
|
|
1337
|
+
end
|
|
1338
|
+
end
|
|
1339
|
+
end; end; end
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
spec/app/lib/schema_classes/schemas/my_namespace/request/index.rb:
|
|
1343
|
+
# frozen_string_literal: true
|
|
1344
|
+
|
|
1345
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1346
|
+
module Schemas; module MyNamespace; module Request
|
|
1347
|
+
### Primary Schema Class ###
|
|
1348
|
+
# Autogenerated Schema for Record at com.my-namespace.request.Index
|
|
1349
|
+
class Index < AvroGen::SchemaClass::Record
|
|
1350
|
+
|
|
1351
|
+
### Attribute Accessors ###
|
|
1352
|
+
# @return [String]
|
|
1353
|
+
attr_accessor :request_id
|
|
1354
|
+
|
|
1355
|
+
# @override
|
|
1356
|
+
def initialize(_from_message: false, request_id: nil)
|
|
1357
|
+
@_from_message = _from_message
|
|
1358
|
+
super
|
|
1359
|
+
self.request_id = request_id
|
|
1360
|
+
end
|
|
1361
|
+
|
|
1362
|
+
# @override
|
|
1363
|
+
def schema
|
|
1364
|
+
'Index'
|
|
1365
|
+
end
|
|
1366
|
+
|
|
1367
|
+
# @override
|
|
1368
|
+
def namespace
|
|
1369
|
+
'com.my-namespace.request'
|
|
1370
|
+
end
|
|
1371
|
+
|
|
1372
|
+
# @override
|
|
1373
|
+
def as_json(_opts={})
|
|
1374
|
+
{
|
|
1375
|
+
'request_id' => @request_id
|
|
1376
|
+
}
|
|
1377
|
+
end
|
|
1378
|
+
end
|
|
1379
|
+
end; end; end
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
spec/app/lib/schema_classes/schemas/my_namespace/request/update_request.rb:
|
|
1383
|
+
# frozen_string_literal: true
|
|
1384
|
+
|
|
1385
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1386
|
+
module Schemas; module MyNamespace; module Request
|
|
1387
|
+
### Primary Schema Class ###
|
|
1388
|
+
# Autogenerated Schema for Record at com.my-namespace.request.UpdateRequest
|
|
1389
|
+
class UpdateRequest < AvroGen::SchemaClass::Record
|
|
1390
|
+
|
|
1391
|
+
### Attribute Accessors ###
|
|
1392
|
+
# @return [String]
|
|
1393
|
+
attr_accessor :update_request_id
|
|
1394
|
+
|
|
1395
|
+
# @override
|
|
1396
|
+
def initialize(_from_message: false, update_request_id: nil)
|
|
1397
|
+
@_from_message = _from_message
|
|
1398
|
+
super
|
|
1399
|
+
self.update_request_id = update_request_id
|
|
1400
|
+
end
|
|
1401
|
+
|
|
1402
|
+
# @override
|
|
1403
|
+
def schema
|
|
1404
|
+
'UpdateRequest'
|
|
1405
|
+
end
|
|
1406
|
+
|
|
1407
|
+
# @override
|
|
1408
|
+
def namespace
|
|
1409
|
+
'com.my-namespace.request'
|
|
1410
|
+
end
|
|
1411
|
+
|
|
1412
|
+
# @override
|
|
1413
|
+
def as_json(_opts={})
|
|
1414
|
+
{
|
|
1415
|
+
'update_request_id' => @update_request_id
|
|
1416
|
+
}
|
|
1417
|
+
end
|
|
1418
|
+
end
|
|
1419
|
+
end; end; end
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
spec/app/lib/schema_classes/schemas/my_namespace/response/create_topic.rb:
|
|
1423
|
+
# frozen_string_literal: true
|
|
1424
|
+
|
|
1425
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1426
|
+
module Schemas; module MyNamespace; module Response
|
|
1427
|
+
### Primary Schema Class ###
|
|
1428
|
+
# Autogenerated Schema for Record at com.my-namespace.response.CreateTopic
|
|
1429
|
+
class CreateTopic < AvroGen::SchemaClass::Record
|
|
1430
|
+
|
|
1431
|
+
### Attribute Accessors ###
|
|
1432
|
+
# @return [String]
|
|
1433
|
+
attr_accessor :response_id
|
|
1434
|
+
|
|
1435
|
+
# @override
|
|
1436
|
+
def initialize(_from_message: false, response_id: nil)
|
|
1437
|
+
@_from_message = _from_message
|
|
1438
|
+
super
|
|
1439
|
+
self.response_id = response_id
|
|
1440
|
+
end
|
|
1441
|
+
|
|
1442
|
+
# @override
|
|
1443
|
+
def schema
|
|
1444
|
+
'CreateTopic'
|
|
1445
|
+
end
|
|
1446
|
+
|
|
1447
|
+
# @override
|
|
1448
|
+
def namespace
|
|
1449
|
+
'com.my-namespace.response'
|
|
1450
|
+
end
|
|
1451
|
+
|
|
1452
|
+
# @override
|
|
1453
|
+
def as_json(_opts={})
|
|
1454
|
+
{
|
|
1455
|
+
'response_id' => @response_id
|
|
1456
|
+
}
|
|
1457
|
+
end
|
|
1458
|
+
end
|
|
1459
|
+
end; end; end
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
spec/app/lib/schema_classes/schemas/my_namespace/response/index.rb:
|
|
1463
|
+
# frozen_string_literal: true
|
|
1464
|
+
|
|
1465
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1466
|
+
module Schemas; module MyNamespace; module Response
|
|
1467
|
+
### Primary Schema Class ###
|
|
1468
|
+
# Autogenerated Schema for Record at com.my-namespace.response.Index
|
|
1469
|
+
class Index < AvroGen::SchemaClass::Record
|
|
1470
|
+
|
|
1471
|
+
### Attribute Accessors ###
|
|
1472
|
+
# @return [String]
|
|
1473
|
+
attr_accessor :response_id
|
|
1474
|
+
|
|
1475
|
+
# @override
|
|
1476
|
+
def initialize(_from_message: false, response_id: nil)
|
|
1477
|
+
@_from_message = _from_message
|
|
1478
|
+
super
|
|
1479
|
+
self.response_id = response_id
|
|
1480
|
+
end
|
|
1481
|
+
|
|
1482
|
+
# @override
|
|
1483
|
+
def schema
|
|
1484
|
+
'Index'
|
|
1485
|
+
end
|
|
1486
|
+
|
|
1487
|
+
# @override
|
|
1488
|
+
def namespace
|
|
1489
|
+
'com.my-namespace.response'
|
|
1490
|
+
end
|
|
1491
|
+
|
|
1492
|
+
# @override
|
|
1493
|
+
def as_json(_opts={})
|
|
1494
|
+
{
|
|
1495
|
+
'response_id' => @response_id
|
|
1496
|
+
}
|
|
1497
|
+
end
|
|
1498
|
+
end
|
|
1499
|
+
end; end; end
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
spec/app/lib/schema_classes/schemas/my_namespace/response/update_response.rb:
|
|
1503
|
+
# frozen_string_literal: true
|
|
1504
|
+
|
|
1505
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1506
|
+
module Schemas; module MyNamespace; module Response
|
|
1507
|
+
### Primary Schema Class ###
|
|
1508
|
+
# Autogenerated Schema for Record at com.my-namespace.response.UpdateResponse
|
|
1509
|
+
class UpdateResponse < AvroGen::SchemaClass::Record
|
|
1510
|
+
|
|
1511
|
+
### Attribute Accessors ###
|
|
1512
|
+
# @return [String]
|
|
1513
|
+
attr_accessor :update_response_id
|
|
1514
|
+
|
|
1515
|
+
# @override
|
|
1516
|
+
def initialize(_from_message: false, update_response_id: nil)
|
|
1517
|
+
@_from_message = _from_message
|
|
1518
|
+
super
|
|
1519
|
+
self.update_response_id = update_response_id
|
|
1520
|
+
end
|
|
1521
|
+
|
|
1522
|
+
# @override
|
|
1523
|
+
def schema
|
|
1524
|
+
'UpdateResponse'
|
|
1525
|
+
end
|
|
1526
|
+
|
|
1527
|
+
# @override
|
|
1528
|
+
def namespace
|
|
1529
|
+
'com.my-namespace.response'
|
|
1530
|
+
end
|
|
1531
|
+
|
|
1532
|
+
# @override
|
|
1533
|
+
def as_json(_opts={})
|
|
1534
|
+
{
|
|
1535
|
+
'update_response_id' => @update_response_id
|
|
1536
|
+
}
|
|
1537
|
+
end
|
|
1538
|
+
end
|
|
1539
|
+
end; end; end
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
spec/app/lib/schema_classes/schemas/my_namespace/wibble.rb:
|
|
1543
|
+
# frozen_string_literal: true
|
|
1544
|
+
|
|
1545
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1546
|
+
module Schemas; module MyNamespace
|
|
1547
|
+
### Primary Schema Class ###
|
|
1548
|
+
# Autogenerated Schema for Record at com.my-namespace.Wibble
|
|
1549
|
+
class Wibble < AvroGen::SchemaClass::Record
|
|
1550
|
+
|
|
1551
|
+
### Attribute Accessors ###
|
|
1552
|
+
# @return [Integer]
|
|
1553
|
+
attr_accessor :id
|
|
1554
|
+
# @return [Integer]
|
|
1555
|
+
attr_accessor :wibble_id
|
|
1556
|
+
# @return [String]
|
|
1557
|
+
attr_accessor :name
|
|
1558
|
+
# @return [String]
|
|
1559
|
+
attr_accessor :floop
|
|
1560
|
+
# @return [Integer]
|
|
1561
|
+
attr_accessor :birthday_int
|
|
1562
|
+
# @return [Integer]
|
|
1563
|
+
attr_accessor :birthday_long
|
|
1564
|
+
# @return [nil, Integer]
|
|
1565
|
+
attr_accessor :birthday_optional
|
|
1566
|
+
# @return [Integer]
|
|
1567
|
+
attr_accessor :updated_at
|
|
1568
|
+
# @return [Integer]
|
|
1569
|
+
attr_accessor :created_at
|
|
1570
|
+
|
|
1571
|
+
# @override
|
|
1572
|
+
def initialize(_from_message: false, id: nil,
|
|
1573
|
+
wibble_id: nil,
|
|
1574
|
+
name: nil,
|
|
1575
|
+
floop: nil,
|
|
1576
|
+
birthday_int: nil,
|
|
1577
|
+
birthday_long: nil,
|
|
1578
|
+
birthday_optional: nil,
|
|
1579
|
+
updated_at: nil,
|
|
1580
|
+
created_at: nil)
|
|
1581
|
+
@_from_message = _from_message
|
|
1582
|
+
super
|
|
1583
|
+
self.id = id
|
|
1584
|
+
self.wibble_id = wibble_id
|
|
1585
|
+
self.name = name
|
|
1586
|
+
self.floop = floop
|
|
1587
|
+
self.birthday_int = birthday_int
|
|
1588
|
+
self.birthday_long = birthday_long
|
|
1589
|
+
self.birthday_optional = birthday_optional
|
|
1590
|
+
self.updated_at = updated_at
|
|
1591
|
+
self.created_at = created_at
|
|
1592
|
+
end
|
|
1593
|
+
|
|
1594
|
+
# @override
|
|
1595
|
+
def schema
|
|
1596
|
+
'Wibble'
|
|
1597
|
+
end
|
|
1598
|
+
|
|
1599
|
+
# @override
|
|
1600
|
+
def namespace
|
|
1601
|
+
'com.my-namespace'
|
|
1602
|
+
end
|
|
1603
|
+
|
|
1604
|
+
# @override
|
|
1605
|
+
def as_json(_opts={})
|
|
1606
|
+
{
|
|
1607
|
+
'id' => @id,
|
|
1608
|
+
'wibble_id' => @wibble_id,
|
|
1609
|
+
'name' => @name,
|
|
1610
|
+
'floop' => @floop,
|
|
1611
|
+
'birthday_int' => @birthday_int,
|
|
1612
|
+
'birthday_long' => @birthday_long,
|
|
1613
|
+
'birthday_optional' => @birthday_optional,
|
|
1614
|
+
'updated_at' => @updated_at,
|
|
1615
|
+
'created_at' => @created_at
|
|
1616
|
+
}
|
|
1617
|
+
end
|
|
1618
|
+
end
|
|
1619
|
+
end; end
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
spec/app/lib/schema_classes/schemas/my_namespace/widget.rb:
|
|
1623
|
+
# frozen_string_literal: true
|
|
1624
|
+
|
|
1625
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1626
|
+
module Schemas; module MyNamespace
|
|
1627
|
+
### Primary Schema Class ###
|
|
1628
|
+
# Autogenerated Schema for Record at com.my-namespace.Widget
|
|
1629
|
+
class Widget < AvroGen::SchemaClass::Record
|
|
1630
|
+
|
|
1631
|
+
### Attribute Accessors ###
|
|
1632
|
+
# @return [Integer]
|
|
1633
|
+
attr_accessor :id
|
|
1634
|
+
# @return [Integer]
|
|
1635
|
+
attr_accessor :widget_id
|
|
1636
|
+
# @return [String]
|
|
1637
|
+
attr_accessor :name
|
|
1638
|
+
# @return [Integer]
|
|
1639
|
+
attr_accessor :updated_at
|
|
1640
|
+
# @return [Integer]
|
|
1641
|
+
attr_accessor :created_at
|
|
1642
|
+
|
|
1643
|
+
# @override
|
|
1644
|
+
def initialize(_from_message: false, id: nil,
|
|
1645
|
+
widget_id: nil,
|
|
1646
|
+
name: nil,
|
|
1647
|
+
updated_at: nil,
|
|
1648
|
+
created_at: nil)
|
|
1649
|
+
@_from_message = _from_message
|
|
1650
|
+
super
|
|
1651
|
+
self.id = id
|
|
1652
|
+
self.widget_id = widget_id
|
|
1653
|
+
self.name = name
|
|
1654
|
+
self.updated_at = updated_at
|
|
1655
|
+
self.created_at = created_at
|
|
1656
|
+
end
|
|
1657
|
+
|
|
1658
|
+
# @override
|
|
1659
|
+
def schema
|
|
1660
|
+
'Widget'
|
|
1661
|
+
end
|
|
1662
|
+
|
|
1663
|
+
# @override
|
|
1664
|
+
def namespace
|
|
1665
|
+
'com.my-namespace'
|
|
1666
|
+
end
|
|
1667
|
+
|
|
1668
|
+
# @override
|
|
1669
|
+
def as_json(_opts={})
|
|
1670
|
+
{
|
|
1671
|
+
'id' => @id,
|
|
1672
|
+
'widget_id' => @widget_id,
|
|
1673
|
+
'name' => @name,
|
|
1674
|
+
'updated_at' => @updated_at,
|
|
1675
|
+
'created_at' => @created_at
|
|
1676
|
+
}
|
|
1677
|
+
end
|
|
1678
|
+
end
|
|
1679
|
+
end; end
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
spec/app/lib/schema_classes/schemas/my_namespace/widget_the_second.rb:
|
|
1683
|
+
# frozen_string_literal: true
|
|
1684
|
+
|
|
1685
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1686
|
+
module Schemas; module MyNamespace
|
|
1687
|
+
### Primary Schema Class ###
|
|
1688
|
+
# Autogenerated Schema for Record at com.my-namespace.WidgetTheSecond
|
|
1689
|
+
class WidgetTheSecond < AvroGen::SchemaClass::Record
|
|
1690
|
+
|
|
1691
|
+
### Attribute Accessors ###
|
|
1692
|
+
# @return [Integer]
|
|
1693
|
+
attr_accessor :id
|
|
1694
|
+
# @return [Integer]
|
|
1695
|
+
attr_accessor :widget_id
|
|
1696
|
+
# @return [String]
|
|
1697
|
+
attr_accessor :model_id
|
|
1698
|
+
# @return [Integer]
|
|
1699
|
+
attr_accessor :updated_at
|
|
1700
|
+
# @return [Integer]
|
|
1701
|
+
attr_accessor :created_at
|
|
1702
|
+
|
|
1703
|
+
# @override
|
|
1704
|
+
def initialize(_from_message: false, id: nil,
|
|
1705
|
+
widget_id: nil,
|
|
1706
|
+
model_id: nil,
|
|
1707
|
+
updated_at: nil,
|
|
1708
|
+
created_at: nil)
|
|
1709
|
+
@_from_message = _from_message
|
|
1710
|
+
super
|
|
1711
|
+
self.id = id
|
|
1712
|
+
self.widget_id = widget_id
|
|
1713
|
+
self.model_id = model_id
|
|
1714
|
+
self.updated_at = updated_at
|
|
1715
|
+
self.created_at = created_at
|
|
1716
|
+
end
|
|
1717
|
+
|
|
1718
|
+
# @override
|
|
1719
|
+
def schema
|
|
1720
|
+
'WidgetTheSecond'
|
|
1721
|
+
end
|
|
1722
|
+
|
|
1723
|
+
# @override
|
|
1724
|
+
def namespace
|
|
1725
|
+
'com.my-namespace'
|
|
1726
|
+
end
|
|
1727
|
+
|
|
1728
|
+
# @override
|
|
1729
|
+
def as_json(_opts={})
|
|
1730
|
+
{
|
|
1731
|
+
'id' => @id,
|
|
1732
|
+
'widget_id' => @widget_id,
|
|
1733
|
+
'model_id' => @model_id,
|
|
1734
|
+
'updated_at' => @updated_at,
|
|
1735
|
+
'created_at' => @created_at
|
|
1736
|
+
}
|
|
1737
|
+
end
|
|
1738
|
+
end
|
|
1739
|
+
end; end
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
spec/app/lib/schema_classes/schemas/my_namespace/widget_the_third.rb:
|
|
1743
|
+
# frozen_string_literal: true
|
|
1744
|
+
|
|
1745
|
+
# This file is autogenerated by AvroGen, Do NOT modify
|
|
1746
|
+
module Schemas; module MyNamespace
|
|
1747
|
+
### Primary Schema Class ###
|
|
1748
|
+
# Autogenerated Schema for Record at com.my-namespace.WidgetTheThird
|
|
1749
|
+
class WidgetTheThird < AvroGen::SchemaClass::Record
|
|
1750
|
+
|
|
1751
|
+
### Attribute Accessors ###
|
|
1752
|
+
# @return [String]
|
|
1753
|
+
attr_accessor :id
|
|
1754
|
+
# @return [Integer]
|
|
1755
|
+
attr_accessor :widget_id
|
|
1756
|
+
# @return [String]
|
|
1757
|
+
attr_accessor :model_id
|
|
1758
|
+
# @return [Integer]
|
|
1759
|
+
attr_accessor :updated_at
|
|
1760
|
+
# @return [Integer]
|
|
1761
|
+
attr_accessor :created_at
|
|
1762
|
+
|
|
1763
|
+
# @override
|
|
1764
|
+
def initialize(_from_message: false, id: nil,
|
|
1765
|
+
widget_id: nil,
|
|
1766
|
+
model_id: nil,
|
|
1767
|
+
updated_at: nil,
|
|
1768
|
+
created_at: nil)
|
|
1769
|
+
@_from_message = _from_message
|
|
1770
|
+
super
|
|
1771
|
+
self.id = id
|
|
1772
|
+
self.widget_id = widget_id
|
|
1773
|
+
self.model_id = model_id
|
|
1774
|
+
self.updated_at = updated_at
|
|
1775
|
+
self.created_at = created_at
|
|
1776
|
+
end
|
|
1777
|
+
|
|
1778
|
+
# @override
|
|
1779
|
+
def schema
|
|
1780
|
+
'WidgetTheThird'
|
|
1781
|
+
end
|
|
1782
|
+
|
|
1783
|
+
# @override
|
|
1784
|
+
def namespace
|
|
1785
|
+
'com.my-namespace'
|
|
1786
|
+
end
|
|
1787
|
+
|
|
1788
|
+
# @override
|
|
1789
|
+
def as_json(_opts={})
|
|
1790
|
+
{
|
|
1791
|
+
'id' => @id,
|
|
1792
|
+
'widget_id' => @widget_id,
|
|
1793
|
+
'model_id' => @model_id,
|
|
1794
|
+
'updated_at' => @updated_at,
|
|
1795
|
+
'created_at' => @created_at
|
|
1796
|
+
}
|
|
1797
|
+
end
|
|
1798
|
+
end
|
|
1799
|
+
end; end
|
|
1800
|
+
|