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