kafka-grpc 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2237 @@
1
+ # Generated code: use without restriction (see GENERATED-CODE-LICENSE.md).
2
+ module KafkaPb
3
+ # @generated by protoc-gen-grpc-dc-ruby. DO NOT EDIT.
4
+ KafkaPbVarint = lambda do |value|
5
+ out = +"".b
6
+ v = value & 0xffffffffffffffff
7
+ while v > 0x7f
8
+ out << ((v & 0x7f) | 0x80)
9
+ v >>= 7
10
+ end
11
+ out << v
12
+ out
13
+ end
14
+
15
+ class Writer
16
+ def initialize
17
+ @out = String.new(encoding: Encoding::BINARY)
18
+ end
19
+
20
+ def varint(value)
21
+ @out << KafkaPbVarint.call(value)
22
+ end
23
+
24
+ def tag(field, wire)
25
+ varint((field << 3) | wire)
26
+ end
27
+
28
+ def bytes_field(field, payload)
29
+ tag(field, 2)
30
+ varint(payload.bytesize)
31
+ @out << payload.b
32
+ end
33
+
34
+ def string_field(field, value)
35
+ return if value.nil? || value.empty?
36
+
37
+ bytes_field(field, value.encode(Encoding::UTF_8).b)
38
+ end
39
+
40
+ def fixed(fmt, value)
41
+ @out << [value].pack(fmt)
42
+ end
43
+
44
+ def raw(payload)
45
+ @out << payload.b
46
+ end
47
+
48
+ def to_bytes
49
+ @out
50
+ end
51
+ end
52
+
53
+ class Reader
54
+ def initialize(buf)
55
+ @buf = buf.b
56
+ @pos = 0
57
+ end
58
+
59
+ def done?
60
+ @pos >= @buf.bytesize
61
+ end
62
+
63
+ def varint
64
+ result = 0
65
+ shift = 0
66
+ loop do
67
+ raise ArgumentError, "truncated varint" if @pos >= @buf.bytesize
68
+
69
+ b = @buf.getbyte(@pos)
70
+ @pos += 1
71
+ result |= (b & 0x7f) << shift
72
+ return result if (b & 0x80).zero?
73
+
74
+ shift += 7
75
+ raise ArgumentError, "varint too long" if shift >= 70
76
+ end
77
+ end
78
+
79
+ def take(n)
80
+ raise ArgumentError, "truncated field" if @pos + n > @buf.bytesize
81
+
82
+ value = @buf.byteslice(@pos, n)
83
+ @pos += n
84
+ value
85
+ end
86
+
87
+ # [number, wire, varint_value, bytes_value, fixed_value] or nil.
88
+ def field
89
+ return nil if done?
90
+
91
+ start = @pos
92
+ tag = varint
93
+ num = tag >> 3
94
+ wire = tag & 7
95
+ raw = -> { @buf.byteslice(start, @pos - start) }
96
+ case wire
97
+ when 0 then [num, wire, varint, "".b, "".b, raw.call]
98
+ when 2
99
+ n = varint
100
+ v = take(n)
101
+ [num, wire, 0, v, "".b, raw.call]
102
+ when 1
103
+ v = take(8)
104
+ [num, wire, 0, "".b, v, raw.call]
105
+ when 5
106
+ v = take(4)
107
+ [num, wire, 0, "".b, v, raw.call]
108
+ else raise ArgumentError, "bad wire type"
109
+ end
110
+ end
111
+ end
112
+
113
+ module Compression
114
+ COMPRESSION_NONE = 0
115
+ COMPRESSION_GZIP = 1
116
+ COMPRESSION_SNAPPY = 2
117
+ COMPRESSION_LZ4 = 3
118
+ COMPRESSION_ZSTD = 4
119
+ end
120
+
121
+ module Acks
122
+ ACKS_UNSPECIFIED = 0
123
+ ACKS_NONE = 1
124
+ ACKS_LEADER = 2
125
+ ACKS_ALL = 3
126
+ end
127
+
128
+ class Header
129
+ attr_accessor :key, :value, :unknown_fields
130
+
131
+ def initialize(key: "", value: "".b)
132
+ @key = key
133
+ @value = value
134
+ @unknown_fields = "".b
135
+ end
136
+
137
+ def marshal_dc
138
+ w = Writer.new
139
+ w.string_field(1, @key)
140
+ if @value.bytesize > 0
141
+ w.bytes_field(2, @value)
142
+ end
143
+ w.raw(@unknown_fields)
144
+ w.to_bytes
145
+ end
146
+
147
+ def unmarshal_dc(data)
148
+ @unknown_fields = "".b
149
+ @key = ""
150
+ @value = "".b
151
+ r = Reader.new(data)
152
+ loop do
153
+ item = r.field
154
+ break if item.nil?
155
+
156
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
157
+ case num
158
+ when 1
159
+ @key = bytes_value.dup.force_encoding(Encoding::UTF_8)
160
+ when 2
161
+ @value = bytes_value
162
+ else
163
+ @unknown_fields = @unknown_fields + raw_value
164
+ end
165
+ end
166
+ self
167
+ end
168
+
169
+ def ==(other)
170
+ other.is_a?(Header) && @key == other.key && @value == other.value
171
+ end
172
+ end
173
+
174
+ class Record
175
+ attr_accessor :key, :value, :headers, :timestamp_ms, :null_key, :unknown_fields
176
+
177
+ def initialize(key: "".b, value: "".b, headers: [], timestamp_ms: 0, null_key: false)
178
+ @key = key
179
+ @value = value
180
+ @headers = headers
181
+ @timestamp_ms = timestamp_ms
182
+ @null_key = null_key
183
+ @unknown_fields = "".b
184
+ end
185
+
186
+ def marshal_dc
187
+ w = Writer.new
188
+ if @key.bytesize > 0
189
+ w.bytes_field(1, @key)
190
+ end
191
+ if @value.bytesize > 0
192
+ w.bytes_field(2, @value)
193
+ end
194
+ @headers.each { |x| w.bytes_field(3, x.marshal_dc) }
195
+ if @timestamp_ms != 0
196
+ w.tag(4, 0)
197
+ w.varint(@timestamp_ms)
198
+ end
199
+ if @null_key
200
+ w.tag(5, 0)
201
+ w.varint((@null_key ? 1 : 0))
202
+ end
203
+ w.raw(@unknown_fields)
204
+ w.to_bytes
205
+ end
206
+
207
+ def unmarshal_dc(data)
208
+ @unknown_fields = "".b
209
+ @key = "".b
210
+ @value = "".b
211
+ @headers = []
212
+ @timestamp_ms = 0
213
+ @null_key = false
214
+ r = Reader.new(data)
215
+ loop do
216
+ item = r.field
217
+ break if item.nil?
218
+
219
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
220
+ case num
221
+ when 1
222
+ @key = bytes_value
223
+ when 2
224
+ @value = bytes_value
225
+ when 3
226
+ item = Header.new
227
+ item.unmarshal_dc(bytes_value)
228
+ @headers << item
229
+ when 4
230
+ @timestamp_ms = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
231
+ when 5
232
+ @null_key = (varint_value != 0)
233
+ else
234
+ @unknown_fields = @unknown_fields + raw_value
235
+ end
236
+ end
237
+ self
238
+ end
239
+
240
+ def ==(other)
241
+ other.is_a?(Record) && @key == other.key && @value == other.value && @headers == other.headers && @timestamp_ms == other.timestamp_ms && @null_key == other.null_key
242
+ end
243
+ end
244
+
245
+ class FetchedRecord
246
+ attr_accessor :offset, :timestamp_ms, :key, :value, :headers, :key_null, :unknown_fields
247
+
248
+ def initialize(offset: 0, timestamp_ms: 0, key: "".b, value: "".b, headers: [], key_null: false)
249
+ @offset = offset
250
+ @timestamp_ms = timestamp_ms
251
+ @key = key
252
+ @value = value
253
+ @headers = headers
254
+ @key_null = key_null
255
+ @unknown_fields = "".b
256
+ end
257
+
258
+ def marshal_dc
259
+ w = Writer.new
260
+ if @offset != 0
261
+ w.tag(1, 0)
262
+ w.varint(@offset)
263
+ end
264
+ if @timestamp_ms != 0
265
+ w.tag(2, 0)
266
+ w.varint(@timestamp_ms)
267
+ end
268
+ if @key.bytesize > 0
269
+ w.bytes_field(3, @key)
270
+ end
271
+ if @value.bytesize > 0
272
+ w.bytes_field(4, @value)
273
+ end
274
+ @headers.each { |x| w.bytes_field(5, x.marshal_dc) }
275
+ if @key_null
276
+ w.tag(6, 0)
277
+ w.varint((@key_null ? 1 : 0))
278
+ end
279
+ w.raw(@unknown_fields)
280
+ w.to_bytes
281
+ end
282
+
283
+ def unmarshal_dc(data)
284
+ @unknown_fields = "".b
285
+ @offset = 0
286
+ @timestamp_ms = 0
287
+ @key = "".b
288
+ @value = "".b
289
+ @headers = []
290
+ @key_null = false
291
+ r = Reader.new(data)
292
+ loop do
293
+ item = r.field
294
+ break if item.nil?
295
+
296
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
297
+ case num
298
+ when 1
299
+ @offset = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
300
+ when 2
301
+ @timestamp_ms = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
302
+ when 3
303
+ @key = bytes_value
304
+ when 4
305
+ @value = bytes_value
306
+ when 5
307
+ item = Header.new
308
+ item.unmarshal_dc(bytes_value)
309
+ @headers << item
310
+ when 6
311
+ @key_null = (varint_value != 0)
312
+ else
313
+ @unknown_fields = @unknown_fields + raw_value
314
+ end
315
+ end
316
+ self
317
+ end
318
+
319
+ def ==(other)
320
+ other.is_a?(FetchedRecord) && @offset == other.offset && @timestamp_ms == other.timestamp_ms && @key == other.key && @value == other.value && @headers == other.headers && @key_null == other.key_null
321
+ end
322
+ end
323
+
324
+ class TopicPartition
325
+ attr_accessor :topic, :partition, :unknown_fields
326
+
327
+ def initialize(topic: "", partition: 0)
328
+ @topic = topic
329
+ @partition = partition
330
+ @unknown_fields = "".b
331
+ end
332
+
333
+ def marshal_dc
334
+ w = Writer.new
335
+ w.string_field(1, @topic)
336
+ if @partition != 0
337
+ w.tag(2, 0)
338
+ w.varint(@partition)
339
+ end
340
+ w.raw(@unknown_fields)
341
+ w.to_bytes
342
+ end
343
+
344
+ def unmarshal_dc(data)
345
+ @unknown_fields = "".b
346
+ @topic = ""
347
+ @partition = 0
348
+ r = Reader.new(data)
349
+ loop do
350
+ item = r.field
351
+ break if item.nil?
352
+
353
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
354
+ case num
355
+ when 1
356
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
357
+ when 2
358
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
359
+ else
360
+ @unknown_fields = @unknown_fields + raw_value
361
+ end
362
+ end
363
+ self
364
+ end
365
+
366
+ def ==(other)
367
+ other.is_a?(TopicPartition) && @topic == other.topic && @partition == other.partition
368
+ end
369
+ end
370
+
371
+ class MetadataRequest
372
+ attr_accessor :topics, :allow_auto_topic_creation, :unknown_fields
373
+
374
+ def initialize(topics: [], allow_auto_topic_creation: false)
375
+ @topics = topics
376
+ @allow_auto_topic_creation = allow_auto_topic_creation
377
+ @unknown_fields = "".b
378
+ end
379
+
380
+ def marshal_dc
381
+ w = Writer.new
382
+ @topics.each { |x| w.bytes_field(1, x) }
383
+ if @allow_auto_topic_creation
384
+ w.tag(2, 0)
385
+ w.varint((@allow_auto_topic_creation ? 1 : 0))
386
+ end
387
+ w.raw(@unknown_fields)
388
+ w.to_bytes
389
+ end
390
+
391
+ def unmarshal_dc(data)
392
+ @unknown_fields = "".b
393
+ @topics = []
394
+ @allow_auto_topic_creation = false
395
+ r = Reader.new(data)
396
+ loop do
397
+ item = r.field
398
+ break if item.nil?
399
+
400
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
401
+ case num
402
+ when 1
403
+ @topics << bytes_value.dup.force_encoding(Encoding::UTF_8)
404
+ when 2
405
+ @allow_auto_topic_creation = (varint_value != 0)
406
+ else
407
+ @unknown_fields = @unknown_fields + raw_value
408
+ end
409
+ end
410
+ self
411
+ end
412
+
413
+ def ==(other)
414
+ other.is_a?(MetadataRequest) && @topics == other.topics && @allow_auto_topic_creation == other.allow_auto_topic_creation
415
+ end
416
+ end
417
+
418
+ class BrokerMetadata
419
+ attr_accessor :node_id, :host, :port, :rack, :unknown_fields
420
+
421
+ def initialize(node_id: 0, host: "", port: 0, rack: "")
422
+ @node_id = node_id
423
+ @host = host
424
+ @port = port
425
+ @rack = rack
426
+ @unknown_fields = "".b
427
+ end
428
+
429
+ def marshal_dc
430
+ w = Writer.new
431
+ if @node_id != 0
432
+ w.tag(1, 0)
433
+ w.varint(@node_id)
434
+ end
435
+ w.string_field(2, @host)
436
+ if @port != 0
437
+ w.tag(3, 0)
438
+ w.varint(@port)
439
+ end
440
+ w.string_field(4, @rack)
441
+ w.raw(@unknown_fields)
442
+ w.to_bytes
443
+ end
444
+
445
+ def unmarshal_dc(data)
446
+ @unknown_fields = "".b
447
+ @node_id = 0
448
+ @host = ""
449
+ @port = 0
450
+ @rack = ""
451
+ r = Reader.new(data)
452
+ loop do
453
+ item = r.field
454
+ break if item.nil?
455
+
456
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
457
+ case num
458
+ when 1
459
+ @node_id = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
460
+ when 2
461
+ @host = bytes_value.dup.force_encoding(Encoding::UTF_8)
462
+ when 3
463
+ @port = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
464
+ when 4
465
+ @rack = bytes_value.dup.force_encoding(Encoding::UTF_8)
466
+ else
467
+ @unknown_fields = @unknown_fields + raw_value
468
+ end
469
+ end
470
+ self
471
+ end
472
+
473
+ def ==(other)
474
+ other.is_a?(BrokerMetadata) && @node_id == other.node_id && @host == other.host && @port == other.port && @rack == other.rack
475
+ end
476
+ end
477
+
478
+ class PartitionMetadata
479
+ attr_accessor :id, :leader_id, :leader_epoch, :replicas, :isr, :error_code, :unknown_fields
480
+
481
+ def initialize(id: 0, leader_id: 0, leader_epoch: 0, replicas: [], isr: [], error_code: 0)
482
+ @id = id
483
+ @leader_id = leader_id
484
+ @leader_epoch = leader_epoch
485
+ @replicas = replicas
486
+ @isr = isr
487
+ @error_code = error_code
488
+ @unknown_fields = "".b
489
+ end
490
+
491
+ def marshal_dc
492
+ w = Writer.new
493
+ if @id != 0
494
+ w.tag(1, 0)
495
+ w.varint(@id)
496
+ end
497
+ if @leader_id != 0
498
+ w.tag(2, 0)
499
+ w.varint(@leader_id)
500
+ end
501
+ if @leader_epoch != 0
502
+ w.tag(3, 0)
503
+ w.varint(@leader_epoch)
504
+ end
505
+ unless @replicas.empty?
506
+ payload = +"".b
507
+ @replicas.each { |x| payload << KafkaPbVarint.call(x) }
508
+ w.bytes_field(4, payload)
509
+ end
510
+ unless @isr.empty?
511
+ payload = +"".b
512
+ @isr.each { |x| payload << KafkaPbVarint.call(x) }
513
+ w.bytes_field(5, payload)
514
+ end
515
+ if @error_code != 0
516
+ w.tag(6, 0)
517
+ w.varint(@error_code)
518
+ end
519
+ w.raw(@unknown_fields)
520
+ w.to_bytes
521
+ end
522
+
523
+ def unmarshal_dc(data)
524
+ @unknown_fields = "".b
525
+ @id = 0
526
+ @leader_id = 0
527
+ @leader_epoch = 0
528
+ @replicas = []
529
+ @isr = []
530
+ @error_code = 0
531
+ r = Reader.new(data)
532
+ loop do
533
+ item = r.field
534
+ break if item.nil?
535
+
536
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
537
+ case num
538
+ when 1
539
+ @id = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
540
+ when 2
541
+ @leader_id = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
542
+ when 3
543
+ @leader_epoch = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
544
+ when 4
545
+ if wire == 2
546
+ sub = Reader.new(bytes_value)
547
+ until sub.done?
548
+ raw = sub.varint
549
+ @replicas << (((raw & 0xffffffff) ^ 0x80000000) - 0x80000000)
550
+ end
551
+ else
552
+ @replicas << (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
553
+ end
554
+ when 5
555
+ if wire == 2
556
+ sub = Reader.new(bytes_value)
557
+ until sub.done?
558
+ raw = sub.varint
559
+ @isr << (((raw & 0xffffffff) ^ 0x80000000) - 0x80000000)
560
+ end
561
+ else
562
+ @isr << (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
563
+ end
564
+ when 6
565
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
566
+ else
567
+ @unknown_fields = @unknown_fields + raw_value
568
+ end
569
+ end
570
+ self
571
+ end
572
+
573
+ def ==(other)
574
+ other.is_a?(PartitionMetadata) && @id == other.id && @leader_id == other.leader_id && @leader_epoch == other.leader_epoch && @replicas == other.replicas && @isr == other.isr && @error_code == other.error_code
575
+ end
576
+ end
577
+
578
+ class TopicMetadata
579
+ attr_accessor :name, :is_internal, :error_code, :partitions, :unknown_fields
580
+
581
+ def initialize(name: "", is_internal: false, error_code: 0, partitions: [])
582
+ @name = name
583
+ @is_internal = is_internal
584
+ @error_code = error_code
585
+ @partitions = partitions
586
+ @unknown_fields = "".b
587
+ end
588
+
589
+ def marshal_dc
590
+ w = Writer.new
591
+ w.string_field(1, @name)
592
+ if @is_internal
593
+ w.tag(2, 0)
594
+ w.varint((@is_internal ? 1 : 0))
595
+ end
596
+ if @error_code != 0
597
+ w.tag(3, 0)
598
+ w.varint(@error_code)
599
+ end
600
+ @partitions.each { |x| w.bytes_field(4, x.marshal_dc) }
601
+ w.raw(@unknown_fields)
602
+ w.to_bytes
603
+ end
604
+
605
+ def unmarshal_dc(data)
606
+ @unknown_fields = "".b
607
+ @name = ""
608
+ @is_internal = false
609
+ @error_code = 0
610
+ @partitions = []
611
+ r = Reader.new(data)
612
+ loop do
613
+ item = r.field
614
+ break if item.nil?
615
+
616
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
617
+ case num
618
+ when 1
619
+ @name = bytes_value.dup.force_encoding(Encoding::UTF_8)
620
+ when 2
621
+ @is_internal = (varint_value != 0)
622
+ when 3
623
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
624
+ when 4
625
+ item = PartitionMetadata.new
626
+ item.unmarshal_dc(bytes_value)
627
+ @partitions << item
628
+ else
629
+ @unknown_fields = @unknown_fields + raw_value
630
+ end
631
+ end
632
+ self
633
+ end
634
+
635
+ def ==(other)
636
+ other.is_a?(TopicMetadata) && @name == other.name && @is_internal == other.is_internal && @error_code == other.error_code && @partitions == other.partitions
637
+ end
638
+ end
639
+
640
+ class MetadataResponse
641
+ attr_accessor :throttle_time_ms, :brokers, :cluster_id, :controller_id, :topics, :unknown_fields
642
+
643
+ def initialize(throttle_time_ms: 0, brokers: [], cluster_id: "", controller_id: 0, topics: [])
644
+ @throttle_time_ms = throttle_time_ms
645
+ @brokers = brokers
646
+ @cluster_id = cluster_id
647
+ @controller_id = controller_id
648
+ @topics = topics
649
+ @unknown_fields = "".b
650
+ end
651
+
652
+ def marshal_dc
653
+ w = Writer.new
654
+ if @throttle_time_ms != 0
655
+ w.tag(1, 0)
656
+ w.varint(@throttle_time_ms)
657
+ end
658
+ @brokers.each { |x| w.bytes_field(2, x.marshal_dc) }
659
+ w.string_field(3, @cluster_id)
660
+ if @controller_id != 0
661
+ w.tag(4, 0)
662
+ w.varint(@controller_id)
663
+ end
664
+ @topics.each { |x| w.bytes_field(5, x.marshal_dc) }
665
+ w.raw(@unknown_fields)
666
+ w.to_bytes
667
+ end
668
+
669
+ def unmarshal_dc(data)
670
+ @unknown_fields = "".b
671
+ @throttle_time_ms = 0
672
+ @brokers = []
673
+ @cluster_id = ""
674
+ @controller_id = 0
675
+ @topics = []
676
+ r = Reader.new(data)
677
+ loop do
678
+ item = r.field
679
+ break if item.nil?
680
+
681
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
682
+ case num
683
+ when 1
684
+ @throttle_time_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
685
+ when 2
686
+ item = BrokerMetadata.new
687
+ item.unmarshal_dc(bytes_value)
688
+ @brokers << item
689
+ when 3
690
+ @cluster_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
691
+ when 4
692
+ @controller_id = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
693
+ when 5
694
+ item = TopicMetadata.new
695
+ item.unmarshal_dc(bytes_value)
696
+ @topics << item
697
+ else
698
+ @unknown_fields = @unknown_fields + raw_value
699
+ end
700
+ end
701
+ self
702
+ end
703
+
704
+ def ==(other)
705
+ other.is_a?(MetadataResponse) && @throttle_time_ms == other.throttle_time_ms && @brokers == other.brokers && @cluster_id == other.cluster_id && @controller_id == other.controller_id && @topics == other.topics
706
+ end
707
+ end
708
+
709
+ class OpenProducerRequest
710
+ attr_accessor :transactional_id, :transaction_timeout_ms, :unknown_fields
711
+
712
+ def initialize(transactional_id: "", transaction_timeout_ms: 0)
713
+ @transactional_id = transactional_id
714
+ @transaction_timeout_ms = transaction_timeout_ms
715
+ @unknown_fields = "".b
716
+ end
717
+
718
+ def marshal_dc
719
+ w = Writer.new
720
+ w.string_field(1, @transactional_id)
721
+ if @transaction_timeout_ms != 0
722
+ w.tag(2, 0)
723
+ w.varint(@transaction_timeout_ms)
724
+ end
725
+ w.raw(@unknown_fields)
726
+ w.to_bytes
727
+ end
728
+
729
+ def unmarshal_dc(data)
730
+ @unknown_fields = "".b
731
+ @transactional_id = ""
732
+ @transaction_timeout_ms = 0
733
+ r = Reader.new(data)
734
+ loop do
735
+ item = r.field
736
+ break if item.nil?
737
+
738
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
739
+ case num
740
+ when 1
741
+ @transactional_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
742
+ when 2
743
+ @transaction_timeout_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
744
+ else
745
+ @unknown_fields = @unknown_fields + raw_value
746
+ end
747
+ end
748
+ self
749
+ end
750
+
751
+ def ==(other)
752
+ other.is_a?(OpenProducerRequest) && @transactional_id == other.transactional_id && @transaction_timeout_ms == other.transaction_timeout_ms
753
+ end
754
+ end
755
+
756
+ class OpenProducerResponse
757
+ attr_accessor :session_id, :producer_id, :producer_epoch, :error_code, :unknown_fields
758
+
759
+ def initialize(session_id: "", producer_id: 0, producer_epoch: 0, error_code: 0)
760
+ @session_id = session_id
761
+ @producer_id = producer_id
762
+ @producer_epoch = producer_epoch
763
+ @error_code = error_code
764
+ @unknown_fields = "".b
765
+ end
766
+
767
+ def marshal_dc
768
+ w = Writer.new
769
+ w.string_field(1, @session_id)
770
+ if @producer_id != 0
771
+ w.tag(2, 0)
772
+ w.varint(@producer_id)
773
+ end
774
+ if @producer_epoch != 0
775
+ w.tag(3, 0)
776
+ w.varint(@producer_epoch)
777
+ end
778
+ if @error_code != 0
779
+ w.tag(4, 0)
780
+ w.varint(@error_code)
781
+ end
782
+ w.raw(@unknown_fields)
783
+ w.to_bytes
784
+ end
785
+
786
+ def unmarshal_dc(data)
787
+ @unknown_fields = "".b
788
+ @session_id = ""
789
+ @producer_id = 0
790
+ @producer_epoch = 0
791
+ @error_code = 0
792
+ r = Reader.new(data)
793
+ loop do
794
+ item = r.field
795
+ break if item.nil?
796
+
797
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
798
+ case num
799
+ when 1
800
+ @session_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
801
+ when 2
802
+ @producer_id = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
803
+ when 3
804
+ @producer_epoch = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
805
+ when 4
806
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
807
+ else
808
+ @unknown_fields = @unknown_fields + raw_value
809
+ end
810
+ end
811
+ self
812
+ end
813
+
814
+ def ==(other)
815
+ other.is_a?(OpenProducerResponse) && @session_id == other.session_id && @producer_id == other.producer_id && @producer_epoch == other.producer_epoch && @error_code == other.error_code
816
+ end
817
+ end
818
+
819
+ class CloseProducerRequest
820
+ attr_accessor :session_id, :unknown_fields
821
+
822
+ def initialize(session_id: "")
823
+ @session_id = session_id
824
+ @unknown_fields = "".b
825
+ end
826
+
827
+ def marshal_dc
828
+ w = Writer.new
829
+ w.string_field(1, @session_id)
830
+ w.raw(@unknown_fields)
831
+ w.to_bytes
832
+ end
833
+
834
+ def unmarshal_dc(data)
835
+ @unknown_fields = "".b
836
+ @session_id = ""
837
+ r = Reader.new(data)
838
+ loop do
839
+ item = r.field
840
+ break if item.nil?
841
+
842
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
843
+ case num
844
+ when 1
845
+ @session_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
846
+ else
847
+ @unknown_fields = @unknown_fields + raw_value
848
+ end
849
+ end
850
+ self
851
+ end
852
+
853
+ def ==(other)
854
+ other.is_a?(CloseProducerRequest) && @session_id == other.session_id
855
+ end
856
+ end
857
+
858
+ class CloseProducerResponse
859
+ attr_accessor :error_code, :unknown_fields
860
+
861
+ def initialize(error_code: 0)
862
+ @error_code = error_code
863
+ @unknown_fields = "".b
864
+ end
865
+
866
+ def marshal_dc
867
+ w = Writer.new
868
+ if @error_code != 0
869
+ w.tag(1, 0)
870
+ w.varint(@error_code)
871
+ end
872
+ w.raw(@unknown_fields)
873
+ w.to_bytes
874
+ end
875
+
876
+ def unmarshal_dc(data)
877
+ @unknown_fields = "".b
878
+ @error_code = 0
879
+ r = Reader.new(data)
880
+ loop do
881
+ item = r.field
882
+ break if item.nil?
883
+
884
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
885
+ case num
886
+ when 1
887
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
888
+ else
889
+ @unknown_fields = @unknown_fields + raw_value
890
+ end
891
+ end
892
+ self
893
+ end
894
+
895
+ def ==(other)
896
+ other.is_a?(CloseProducerResponse) && @error_code == other.error_code
897
+ end
898
+ end
899
+
900
+ class EndTransactionRequest
901
+ attr_accessor :session_id, :commit, :unknown_fields
902
+
903
+ def initialize(session_id: "", commit: false)
904
+ @session_id = session_id
905
+ @commit = commit
906
+ @unknown_fields = "".b
907
+ end
908
+
909
+ def marshal_dc
910
+ w = Writer.new
911
+ w.string_field(1, @session_id)
912
+ if @commit
913
+ w.tag(2, 0)
914
+ w.varint((@commit ? 1 : 0))
915
+ end
916
+ w.raw(@unknown_fields)
917
+ w.to_bytes
918
+ end
919
+
920
+ def unmarshal_dc(data)
921
+ @unknown_fields = "".b
922
+ @session_id = ""
923
+ @commit = false
924
+ r = Reader.new(data)
925
+ loop do
926
+ item = r.field
927
+ break if item.nil?
928
+
929
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
930
+ case num
931
+ when 1
932
+ @session_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
933
+ when 2
934
+ @commit = (varint_value != 0)
935
+ else
936
+ @unknown_fields = @unknown_fields + raw_value
937
+ end
938
+ end
939
+ self
940
+ end
941
+
942
+ def ==(other)
943
+ other.is_a?(EndTransactionRequest) && @session_id == other.session_id && @commit == other.commit
944
+ end
945
+ end
946
+
947
+ class EndTransactionResponse
948
+ attr_accessor :error_code, :unknown_fields
949
+
950
+ def initialize(error_code: 0)
951
+ @error_code = error_code
952
+ @unknown_fields = "".b
953
+ end
954
+
955
+ def marshal_dc
956
+ w = Writer.new
957
+ if @error_code != 0
958
+ w.tag(1, 0)
959
+ w.varint(@error_code)
960
+ end
961
+ w.raw(@unknown_fields)
962
+ w.to_bytes
963
+ end
964
+
965
+ def unmarshal_dc(data)
966
+ @unknown_fields = "".b
967
+ @error_code = 0
968
+ r = Reader.new(data)
969
+ loop do
970
+ item = r.field
971
+ break if item.nil?
972
+
973
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
974
+ case num
975
+ when 1
976
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
977
+ else
978
+ @unknown_fields = @unknown_fields + raw_value
979
+ end
980
+ end
981
+ self
982
+ end
983
+
984
+ def ==(other)
985
+ other.is_a?(EndTransactionResponse) && @error_code == other.error_code
986
+ end
987
+ end
988
+
989
+ class ProduceRequest
990
+ attr_accessor :topic, :partition, :records, :acks, :timeout_ms, :compression, :session_id, :transactional_id, :unknown_fields
991
+
992
+ def initialize(topic: "", partition: 0, records: [], acks: 0, timeout_ms: 0, compression: 0, session_id: "", transactional_id: "")
993
+ @topic = topic
994
+ @partition = partition
995
+ @records = records
996
+ @acks = acks
997
+ @timeout_ms = timeout_ms
998
+ @compression = compression
999
+ @session_id = session_id
1000
+ @transactional_id = transactional_id
1001
+ @unknown_fields = "".b
1002
+ end
1003
+
1004
+ def marshal_dc
1005
+ w = Writer.new
1006
+ w.string_field(1, @topic)
1007
+ if @partition != 0
1008
+ w.tag(2, 0)
1009
+ w.varint(@partition)
1010
+ end
1011
+ @records.each { |x| w.bytes_field(3, x.marshal_dc) }
1012
+ if @acks != 0
1013
+ w.tag(4, 0)
1014
+ w.varint(@acks)
1015
+ end
1016
+ if @timeout_ms != 0
1017
+ w.tag(5, 0)
1018
+ w.varint(@timeout_ms)
1019
+ end
1020
+ if @compression != 0
1021
+ w.tag(6, 0)
1022
+ w.varint(@compression)
1023
+ end
1024
+ w.string_field(7, @session_id)
1025
+ w.string_field(8, @transactional_id)
1026
+ w.raw(@unknown_fields)
1027
+ w.to_bytes
1028
+ end
1029
+
1030
+ def unmarshal_dc(data)
1031
+ @unknown_fields = "".b
1032
+ @topic = ""
1033
+ @partition = 0
1034
+ @records = []
1035
+ @acks = 0
1036
+ @timeout_ms = 0
1037
+ @compression = 0
1038
+ @session_id = ""
1039
+ @transactional_id = ""
1040
+ r = Reader.new(data)
1041
+ loop do
1042
+ item = r.field
1043
+ break if item.nil?
1044
+
1045
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1046
+ case num
1047
+ when 1
1048
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1049
+ when 2
1050
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1051
+ when 3
1052
+ item = Record.new
1053
+ item.unmarshal_dc(bytes_value)
1054
+ @records << item
1055
+ when 4
1056
+ @acks = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1057
+ when 5
1058
+ @timeout_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1059
+ when 6
1060
+ @compression = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1061
+ when 7
1062
+ @session_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1063
+ when 8
1064
+ @transactional_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1065
+ else
1066
+ @unknown_fields = @unknown_fields + raw_value
1067
+ end
1068
+ end
1069
+ self
1070
+ end
1071
+
1072
+ def ==(other)
1073
+ other.is_a?(ProduceRequest) && @topic == other.topic && @partition == other.partition && @records == other.records && @acks == other.acks && @timeout_ms == other.timeout_ms && @compression == other.compression && @session_id == other.session_id && @transactional_id == other.transactional_id
1074
+ end
1075
+ end
1076
+
1077
+ class ProduceResponse
1078
+ attr_accessor :partition, :base_offset, :log_append_time_ms, :error_code, :unknown_fields
1079
+
1080
+ def initialize(partition: 0, base_offset: 0, log_append_time_ms: 0, error_code: 0)
1081
+ @partition = partition
1082
+ @base_offset = base_offset
1083
+ @log_append_time_ms = log_append_time_ms
1084
+ @error_code = error_code
1085
+ @unknown_fields = "".b
1086
+ end
1087
+
1088
+ def marshal_dc
1089
+ w = Writer.new
1090
+ if @partition != 0
1091
+ w.tag(1, 0)
1092
+ w.varint(@partition)
1093
+ end
1094
+ if @base_offset != 0
1095
+ w.tag(2, 0)
1096
+ w.varint(@base_offset)
1097
+ end
1098
+ if @log_append_time_ms != 0
1099
+ w.tag(3, 0)
1100
+ w.varint(@log_append_time_ms)
1101
+ end
1102
+ if @error_code != 0
1103
+ w.tag(4, 0)
1104
+ w.varint(@error_code)
1105
+ end
1106
+ w.raw(@unknown_fields)
1107
+ w.to_bytes
1108
+ end
1109
+
1110
+ def unmarshal_dc(data)
1111
+ @unknown_fields = "".b
1112
+ @partition = 0
1113
+ @base_offset = 0
1114
+ @log_append_time_ms = 0
1115
+ @error_code = 0
1116
+ r = Reader.new(data)
1117
+ loop do
1118
+ item = r.field
1119
+ break if item.nil?
1120
+
1121
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1122
+ case num
1123
+ when 1
1124
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1125
+ when 2
1126
+ @base_offset = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1127
+ when 3
1128
+ @log_append_time_ms = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1129
+ when 4
1130
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1131
+ else
1132
+ @unknown_fields = @unknown_fields + raw_value
1133
+ end
1134
+ end
1135
+ self
1136
+ end
1137
+
1138
+ def ==(other)
1139
+ other.is_a?(ProduceResponse) && @partition == other.partition && @base_offset == other.base_offset && @log_append_time_ms == other.log_append_time_ms && @error_code == other.error_code
1140
+ end
1141
+ end
1142
+
1143
+ class ConsumeRequest
1144
+ attr_accessor :topic, :partition, :offset, :max_records, :max_wait_ms, :min_bytes, :read_committed, :unknown_fields
1145
+
1146
+ def initialize(topic: "", partition: 0, offset: 0, max_records: 0, max_wait_ms: 0, min_bytes: 0, read_committed: false)
1147
+ @topic = topic
1148
+ @partition = partition
1149
+ @offset = offset
1150
+ @max_records = max_records
1151
+ @max_wait_ms = max_wait_ms
1152
+ @min_bytes = min_bytes
1153
+ @read_committed = read_committed
1154
+ @unknown_fields = "".b
1155
+ end
1156
+
1157
+ def marshal_dc
1158
+ w = Writer.new
1159
+ w.string_field(1, @topic)
1160
+ if @partition != 0
1161
+ w.tag(2, 0)
1162
+ w.varint(@partition)
1163
+ end
1164
+ if @offset != 0
1165
+ w.tag(3, 0)
1166
+ w.varint(@offset)
1167
+ end
1168
+ if @max_records != 0
1169
+ w.tag(4, 0)
1170
+ w.varint(@max_records)
1171
+ end
1172
+ if @max_wait_ms != 0
1173
+ w.tag(5, 0)
1174
+ w.varint(@max_wait_ms)
1175
+ end
1176
+ if @min_bytes != 0
1177
+ w.tag(6, 0)
1178
+ w.varint(@min_bytes)
1179
+ end
1180
+ if @read_committed
1181
+ w.tag(7, 0)
1182
+ w.varint((@read_committed ? 1 : 0))
1183
+ end
1184
+ w.raw(@unknown_fields)
1185
+ w.to_bytes
1186
+ end
1187
+
1188
+ def unmarshal_dc(data)
1189
+ @unknown_fields = "".b
1190
+ @topic = ""
1191
+ @partition = 0
1192
+ @offset = 0
1193
+ @max_records = 0
1194
+ @max_wait_ms = 0
1195
+ @min_bytes = 0
1196
+ @read_committed = false
1197
+ r = Reader.new(data)
1198
+ loop do
1199
+ item = r.field
1200
+ break if item.nil?
1201
+
1202
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1203
+ case num
1204
+ when 1
1205
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1206
+ when 2
1207
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1208
+ when 3
1209
+ @offset = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1210
+ when 4
1211
+ @max_records = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1212
+ when 5
1213
+ @max_wait_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1214
+ when 6
1215
+ @min_bytes = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1216
+ when 7
1217
+ @read_committed = (varint_value != 0)
1218
+ else
1219
+ @unknown_fields = @unknown_fields + raw_value
1220
+ end
1221
+ end
1222
+ self
1223
+ end
1224
+
1225
+ def ==(other)
1226
+ other.is_a?(ConsumeRequest) && @topic == other.topic && @partition == other.partition && @offset == other.offset && @max_records == other.max_records && @max_wait_ms == other.max_wait_ms && @min_bytes == other.min_bytes && @read_committed == other.read_committed
1227
+ end
1228
+ end
1229
+
1230
+ class ConsumeResponse
1231
+ attr_accessor :topic, :partition, :high_watermark, :error_code, :records, :unknown_fields
1232
+
1233
+ def initialize(topic: "", partition: 0, high_watermark: 0, error_code: 0, records: [])
1234
+ @topic = topic
1235
+ @partition = partition
1236
+ @high_watermark = high_watermark
1237
+ @error_code = error_code
1238
+ @records = records
1239
+ @unknown_fields = "".b
1240
+ end
1241
+
1242
+ def marshal_dc
1243
+ w = Writer.new
1244
+ w.string_field(1, @topic)
1245
+ if @partition != 0
1246
+ w.tag(2, 0)
1247
+ w.varint(@partition)
1248
+ end
1249
+ if @high_watermark != 0
1250
+ w.tag(3, 0)
1251
+ w.varint(@high_watermark)
1252
+ end
1253
+ if @error_code != 0
1254
+ w.tag(4, 0)
1255
+ w.varint(@error_code)
1256
+ end
1257
+ @records.each { |x| w.bytes_field(5, x.marshal_dc) }
1258
+ w.raw(@unknown_fields)
1259
+ w.to_bytes
1260
+ end
1261
+
1262
+ def unmarshal_dc(data)
1263
+ @unknown_fields = "".b
1264
+ @topic = ""
1265
+ @partition = 0
1266
+ @high_watermark = 0
1267
+ @error_code = 0
1268
+ @records = []
1269
+ r = Reader.new(data)
1270
+ loop do
1271
+ item = r.field
1272
+ break if item.nil?
1273
+
1274
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1275
+ case num
1276
+ when 1
1277
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1278
+ when 2
1279
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1280
+ when 3
1281
+ @high_watermark = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1282
+ when 4
1283
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1284
+ when 5
1285
+ item = FetchedRecord.new
1286
+ item.unmarshal_dc(bytes_value)
1287
+ @records << item
1288
+ else
1289
+ @unknown_fields = @unknown_fields + raw_value
1290
+ end
1291
+ end
1292
+ self
1293
+ end
1294
+
1295
+ def ==(other)
1296
+ other.is_a?(ConsumeResponse) && @topic == other.topic && @partition == other.partition && @high_watermark == other.high_watermark && @error_code == other.error_code && @records == other.records
1297
+ end
1298
+ end
1299
+
1300
+ class GroupSubscribeRequest
1301
+ attr_accessor :group_id, :topics, :group_instance_id, :session_timeout_ms, :max_poll_records, :auto_offset_reset, :read_committed, :unknown_fields
1302
+
1303
+ def initialize(group_id: "", topics: [], group_instance_id: "", session_timeout_ms: 0, max_poll_records: 0, auto_offset_reset: "", read_committed: false)
1304
+ @group_id = group_id
1305
+ @topics = topics
1306
+ @group_instance_id = group_instance_id
1307
+ @session_timeout_ms = session_timeout_ms
1308
+ @max_poll_records = max_poll_records
1309
+ @auto_offset_reset = auto_offset_reset
1310
+ @read_committed = read_committed
1311
+ @unknown_fields = "".b
1312
+ end
1313
+
1314
+ def marshal_dc
1315
+ w = Writer.new
1316
+ w.string_field(1, @group_id)
1317
+ @topics.each { |x| w.bytes_field(2, x) }
1318
+ w.string_field(3, @group_instance_id)
1319
+ if @session_timeout_ms != 0
1320
+ w.tag(4, 0)
1321
+ w.varint(@session_timeout_ms)
1322
+ end
1323
+ if @max_poll_records != 0
1324
+ w.tag(5, 0)
1325
+ w.varint(@max_poll_records)
1326
+ end
1327
+ w.string_field(6, @auto_offset_reset)
1328
+ if @read_committed
1329
+ w.tag(7, 0)
1330
+ w.varint((@read_committed ? 1 : 0))
1331
+ end
1332
+ w.raw(@unknown_fields)
1333
+ w.to_bytes
1334
+ end
1335
+
1336
+ def unmarshal_dc(data)
1337
+ @unknown_fields = "".b
1338
+ @group_id = ""
1339
+ @topics = []
1340
+ @group_instance_id = ""
1341
+ @session_timeout_ms = 0
1342
+ @max_poll_records = 0
1343
+ @auto_offset_reset = ""
1344
+ @read_committed = false
1345
+ r = Reader.new(data)
1346
+ loop do
1347
+ item = r.field
1348
+ break if item.nil?
1349
+
1350
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1351
+ case num
1352
+ when 1
1353
+ @group_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1354
+ when 2
1355
+ @topics << bytes_value.dup.force_encoding(Encoding::UTF_8)
1356
+ when 3
1357
+ @group_instance_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1358
+ when 4
1359
+ @session_timeout_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1360
+ when 5
1361
+ @max_poll_records = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1362
+ when 6
1363
+ @auto_offset_reset = bytes_value.dup.force_encoding(Encoding::UTF_8)
1364
+ when 7
1365
+ @read_committed = (varint_value != 0)
1366
+ else
1367
+ @unknown_fields = @unknown_fields + raw_value
1368
+ end
1369
+ end
1370
+ self
1371
+ end
1372
+
1373
+ def ==(other)
1374
+ other.is_a?(GroupSubscribeRequest) && @group_id == other.group_id && @topics == other.topics && @group_instance_id == other.group_instance_id && @session_timeout_ms == other.session_timeout_ms && @max_poll_records == other.max_poll_records && @auto_offset_reset == other.auto_offset_reset && @read_committed == other.read_committed
1375
+ end
1376
+ end
1377
+
1378
+ class GroupSubscribeResponse
1379
+ attr_accessor :assignment, :batch, :group_error, :unknown_fields
1380
+
1381
+ def initialize(assignment: nil, batch: nil, group_error: nil)
1382
+ @assignment = assignment
1383
+ @batch = batch
1384
+ @group_error = group_error
1385
+ @unknown_fields = "".b
1386
+ end
1387
+
1388
+ def marshal_dc
1389
+ w = Writer.new
1390
+ unless (!@batch.nil? || !@group_error.nil?)
1391
+ unless @assignment.nil?
1392
+ w.bytes_field(1, @assignment.marshal_dc)
1393
+ end
1394
+ end
1395
+ unless (!@group_error.nil?)
1396
+ unless @batch.nil?
1397
+ w.bytes_field(2, @batch.marshal_dc)
1398
+ end
1399
+ end
1400
+ unless @group_error.nil?
1401
+ w.bytes_field(3, @group_error.marshal_dc)
1402
+ end
1403
+ w.raw(@unknown_fields)
1404
+ w.to_bytes
1405
+ end
1406
+
1407
+ def unmarshal_dc(data)
1408
+ @unknown_fields = "".b
1409
+ @assignment = nil
1410
+ @batch = nil
1411
+ @group_error = nil
1412
+ r = Reader.new(data)
1413
+ loop do
1414
+ item = r.field
1415
+ break if item.nil?
1416
+
1417
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1418
+ case num
1419
+ when 1
1420
+ @batch = nil
1421
+ @group_error = nil
1422
+ @assignment = Assignment.new
1423
+ @assignment.unmarshal_dc(bytes_value)
1424
+ when 2
1425
+ @assignment = nil
1426
+ @group_error = nil
1427
+ @batch = RecordBatch.new
1428
+ @batch.unmarshal_dc(bytes_value)
1429
+ when 3
1430
+ @assignment = nil
1431
+ @batch = nil
1432
+ @group_error = GroupError.new
1433
+ @group_error.unmarshal_dc(bytes_value)
1434
+ else
1435
+ @unknown_fields = @unknown_fields + raw_value
1436
+ end
1437
+ end
1438
+ self
1439
+ end
1440
+
1441
+ def ==(other)
1442
+ other.is_a?(GroupSubscribeResponse) && @assignment == other.assignment && @batch == other.batch && @group_error == other.group_error
1443
+ end
1444
+ end
1445
+
1446
+ class Assignment
1447
+ attr_accessor :generation_id, :member_id, :partitions, :unknown_fields
1448
+
1449
+ def initialize(generation_id: 0, member_id: "", partitions: [])
1450
+ @generation_id = generation_id
1451
+ @member_id = member_id
1452
+ @partitions = partitions
1453
+ @unknown_fields = "".b
1454
+ end
1455
+
1456
+ def marshal_dc
1457
+ w = Writer.new
1458
+ if @generation_id != 0
1459
+ w.tag(1, 0)
1460
+ w.varint(@generation_id)
1461
+ end
1462
+ w.string_field(2, @member_id)
1463
+ @partitions.each { |x| w.bytes_field(3, x.marshal_dc) }
1464
+ w.raw(@unknown_fields)
1465
+ w.to_bytes
1466
+ end
1467
+
1468
+ def unmarshal_dc(data)
1469
+ @unknown_fields = "".b
1470
+ @generation_id = 0
1471
+ @member_id = ""
1472
+ @partitions = []
1473
+ r = Reader.new(data)
1474
+ loop do
1475
+ item = r.field
1476
+ break if item.nil?
1477
+
1478
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1479
+ case num
1480
+ when 1
1481
+ @generation_id = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1482
+ when 2
1483
+ @member_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1484
+ when 3
1485
+ item = TopicPartition.new
1486
+ item.unmarshal_dc(bytes_value)
1487
+ @partitions << item
1488
+ else
1489
+ @unknown_fields = @unknown_fields + raw_value
1490
+ end
1491
+ end
1492
+ self
1493
+ end
1494
+
1495
+ def ==(other)
1496
+ other.is_a?(Assignment) && @generation_id == other.generation_id && @member_id == other.member_id && @partitions == other.partitions
1497
+ end
1498
+ end
1499
+
1500
+ class RecordBatch
1501
+ attr_accessor :topic, :partition, :high_watermark, :records, :unknown_fields
1502
+
1503
+ def initialize(topic: "", partition: 0, high_watermark: 0, records: [])
1504
+ @topic = topic
1505
+ @partition = partition
1506
+ @high_watermark = high_watermark
1507
+ @records = records
1508
+ @unknown_fields = "".b
1509
+ end
1510
+
1511
+ def marshal_dc
1512
+ w = Writer.new
1513
+ w.string_field(1, @topic)
1514
+ if @partition != 0
1515
+ w.tag(2, 0)
1516
+ w.varint(@partition)
1517
+ end
1518
+ if @high_watermark != 0
1519
+ w.tag(3, 0)
1520
+ w.varint(@high_watermark)
1521
+ end
1522
+ @records.each { |x| w.bytes_field(4, x.marshal_dc) }
1523
+ w.raw(@unknown_fields)
1524
+ w.to_bytes
1525
+ end
1526
+
1527
+ def unmarshal_dc(data)
1528
+ @unknown_fields = "".b
1529
+ @topic = ""
1530
+ @partition = 0
1531
+ @high_watermark = 0
1532
+ @records = []
1533
+ r = Reader.new(data)
1534
+ loop do
1535
+ item = r.field
1536
+ break if item.nil?
1537
+
1538
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1539
+ case num
1540
+ when 1
1541
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1542
+ when 2
1543
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1544
+ when 3
1545
+ @high_watermark = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1546
+ when 4
1547
+ item = FetchedRecord.new
1548
+ item.unmarshal_dc(bytes_value)
1549
+ @records << item
1550
+ else
1551
+ @unknown_fields = @unknown_fields + raw_value
1552
+ end
1553
+ end
1554
+ self
1555
+ end
1556
+
1557
+ def ==(other)
1558
+ other.is_a?(RecordBatch) && @topic == other.topic && @partition == other.partition && @high_watermark == other.high_watermark && @records == other.records
1559
+ end
1560
+ end
1561
+
1562
+ class GroupError
1563
+ attr_accessor :error_code, :message, :unknown_fields
1564
+
1565
+ def initialize(error_code: 0, message: "")
1566
+ @error_code = error_code
1567
+ @message = message
1568
+ @unknown_fields = "".b
1569
+ end
1570
+
1571
+ def marshal_dc
1572
+ w = Writer.new
1573
+ if @error_code != 0
1574
+ w.tag(1, 0)
1575
+ w.varint(@error_code)
1576
+ end
1577
+ w.string_field(2, @message)
1578
+ w.raw(@unknown_fields)
1579
+ w.to_bytes
1580
+ end
1581
+
1582
+ def unmarshal_dc(data)
1583
+ @unknown_fields = "".b
1584
+ @error_code = 0
1585
+ @message = ""
1586
+ r = Reader.new(data)
1587
+ loop do
1588
+ item = r.field
1589
+ break if item.nil?
1590
+
1591
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1592
+ case num
1593
+ when 1
1594
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1595
+ when 2
1596
+ @message = bytes_value.dup.force_encoding(Encoding::UTF_8)
1597
+ else
1598
+ @unknown_fields = @unknown_fields + raw_value
1599
+ end
1600
+ end
1601
+ self
1602
+ end
1603
+
1604
+ def ==(other)
1605
+ other.is_a?(GroupError) && @error_code == other.error_code && @message == other.message
1606
+ end
1607
+ end
1608
+
1609
+ class ListOffsetsRequest
1610
+ attr_accessor :topic, :partition, :timestamp, :read_committed, :unknown_fields
1611
+
1612
+ def initialize(topic: "", partition: 0, timestamp: 0, read_committed: false)
1613
+ @topic = topic
1614
+ @partition = partition
1615
+ @timestamp = timestamp
1616
+ @read_committed = read_committed
1617
+ @unknown_fields = "".b
1618
+ end
1619
+
1620
+ def marshal_dc
1621
+ w = Writer.new
1622
+ w.string_field(1, @topic)
1623
+ if @partition != 0
1624
+ w.tag(2, 0)
1625
+ w.varint(@partition)
1626
+ end
1627
+ if @timestamp != 0
1628
+ w.tag(3, 0)
1629
+ w.varint(@timestamp)
1630
+ end
1631
+ if @read_committed
1632
+ w.tag(4, 0)
1633
+ w.varint((@read_committed ? 1 : 0))
1634
+ end
1635
+ w.raw(@unknown_fields)
1636
+ w.to_bytes
1637
+ end
1638
+
1639
+ def unmarshal_dc(data)
1640
+ @unknown_fields = "".b
1641
+ @topic = ""
1642
+ @partition = 0
1643
+ @timestamp = 0
1644
+ @read_committed = false
1645
+ r = Reader.new(data)
1646
+ loop do
1647
+ item = r.field
1648
+ break if item.nil?
1649
+
1650
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1651
+ case num
1652
+ when 1
1653
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1654
+ when 2
1655
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1656
+ when 3
1657
+ @timestamp = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1658
+ when 4
1659
+ @read_committed = (varint_value != 0)
1660
+ else
1661
+ @unknown_fields = @unknown_fields + raw_value
1662
+ end
1663
+ end
1664
+ self
1665
+ end
1666
+
1667
+ def ==(other)
1668
+ other.is_a?(ListOffsetsRequest) && @topic == other.topic && @partition == other.partition && @timestamp == other.timestamp && @read_committed == other.read_committed
1669
+ end
1670
+ end
1671
+
1672
+ class ListOffsetsResponse
1673
+ attr_accessor :offset, :timestamp_ms, :error_code, :unknown_fields
1674
+
1675
+ def initialize(offset: 0, timestamp_ms: 0, error_code: 0)
1676
+ @offset = offset
1677
+ @timestamp_ms = timestamp_ms
1678
+ @error_code = error_code
1679
+ @unknown_fields = "".b
1680
+ end
1681
+
1682
+ def marshal_dc
1683
+ w = Writer.new
1684
+ if @offset != 0
1685
+ w.tag(1, 0)
1686
+ w.varint(@offset)
1687
+ end
1688
+ if @timestamp_ms != 0
1689
+ w.tag(2, 0)
1690
+ w.varint(@timestamp_ms)
1691
+ end
1692
+ if @error_code != 0
1693
+ w.tag(3, 0)
1694
+ w.varint(@error_code)
1695
+ end
1696
+ w.raw(@unknown_fields)
1697
+ w.to_bytes
1698
+ end
1699
+
1700
+ def unmarshal_dc(data)
1701
+ @unknown_fields = "".b
1702
+ @offset = 0
1703
+ @timestamp_ms = 0
1704
+ @error_code = 0
1705
+ r = Reader.new(data)
1706
+ loop do
1707
+ item = r.field
1708
+ break if item.nil?
1709
+
1710
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1711
+ case num
1712
+ when 1
1713
+ @offset = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1714
+ when 2
1715
+ @timestamp_ms = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1716
+ when 3
1717
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1718
+ else
1719
+ @unknown_fields = @unknown_fields + raw_value
1720
+ end
1721
+ end
1722
+ self
1723
+ end
1724
+
1725
+ def ==(other)
1726
+ other.is_a?(ListOffsetsResponse) && @offset == other.offset && @timestamp_ms == other.timestamp_ms && @error_code == other.error_code
1727
+ end
1728
+ end
1729
+
1730
+ class CommitOffsetRequest
1731
+ attr_accessor :group_id, :topic, :partition, :committed_offset, :metadata, :session_id, :unknown_fields
1732
+
1733
+ def initialize(group_id: "", topic: "", partition: 0, committed_offset: 0, metadata: "", session_id: "")
1734
+ @group_id = group_id
1735
+ @topic = topic
1736
+ @partition = partition
1737
+ @committed_offset = committed_offset
1738
+ @metadata = metadata
1739
+ @session_id = session_id
1740
+ @unknown_fields = "".b
1741
+ end
1742
+
1743
+ def marshal_dc
1744
+ w = Writer.new
1745
+ w.string_field(1, @group_id)
1746
+ w.string_field(2, @topic)
1747
+ if @partition != 0
1748
+ w.tag(3, 0)
1749
+ w.varint(@partition)
1750
+ end
1751
+ if @committed_offset != 0
1752
+ w.tag(4, 0)
1753
+ w.varint(@committed_offset)
1754
+ end
1755
+ w.string_field(5, @metadata)
1756
+ w.string_field(6, @session_id)
1757
+ w.raw(@unknown_fields)
1758
+ w.to_bytes
1759
+ end
1760
+
1761
+ def unmarshal_dc(data)
1762
+ @unknown_fields = "".b
1763
+ @group_id = ""
1764
+ @topic = ""
1765
+ @partition = 0
1766
+ @committed_offset = 0
1767
+ @metadata = ""
1768
+ @session_id = ""
1769
+ r = Reader.new(data)
1770
+ loop do
1771
+ item = r.field
1772
+ break if item.nil?
1773
+
1774
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1775
+ case num
1776
+ when 1
1777
+ @group_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1778
+ when 2
1779
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1780
+ when 3
1781
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1782
+ when 4
1783
+ @committed_offset = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1784
+ when 5
1785
+ @metadata = bytes_value.dup.force_encoding(Encoding::UTF_8)
1786
+ when 6
1787
+ @session_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1788
+ else
1789
+ @unknown_fields = @unknown_fields + raw_value
1790
+ end
1791
+ end
1792
+ self
1793
+ end
1794
+
1795
+ def ==(other)
1796
+ other.is_a?(CommitOffsetRequest) && @group_id == other.group_id && @topic == other.topic && @partition == other.partition && @committed_offset == other.committed_offset && @metadata == other.metadata && @session_id == other.session_id
1797
+ end
1798
+ end
1799
+
1800
+ class CommitOffsetResponse
1801
+ attr_accessor :error_code, :unknown_fields
1802
+
1803
+ def initialize(error_code: 0)
1804
+ @error_code = error_code
1805
+ @unknown_fields = "".b
1806
+ end
1807
+
1808
+ def marshal_dc
1809
+ w = Writer.new
1810
+ if @error_code != 0
1811
+ w.tag(1, 0)
1812
+ w.varint(@error_code)
1813
+ end
1814
+ w.raw(@unknown_fields)
1815
+ w.to_bytes
1816
+ end
1817
+
1818
+ def unmarshal_dc(data)
1819
+ @unknown_fields = "".b
1820
+ @error_code = 0
1821
+ r = Reader.new(data)
1822
+ loop do
1823
+ item = r.field
1824
+ break if item.nil?
1825
+
1826
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1827
+ case num
1828
+ when 1
1829
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1830
+ else
1831
+ @unknown_fields = @unknown_fields + raw_value
1832
+ end
1833
+ end
1834
+ self
1835
+ end
1836
+
1837
+ def ==(other)
1838
+ other.is_a?(CommitOffsetResponse) && @error_code == other.error_code
1839
+ end
1840
+ end
1841
+
1842
+ class FetchOffsetRequest
1843
+ attr_accessor :group_id, :topic, :partition, :unknown_fields
1844
+
1845
+ def initialize(group_id: "", topic: "", partition: 0)
1846
+ @group_id = group_id
1847
+ @topic = topic
1848
+ @partition = partition
1849
+ @unknown_fields = "".b
1850
+ end
1851
+
1852
+ def marshal_dc
1853
+ w = Writer.new
1854
+ w.string_field(1, @group_id)
1855
+ w.string_field(2, @topic)
1856
+ if @partition != 0
1857
+ w.tag(3, 0)
1858
+ w.varint(@partition)
1859
+ end
1860
+ w.raw(@unknown_fields)
1861
+ w.to_bytes
1862
+ end
1863
+
1864
+ def unmarshal_dc(data)
1865
+ @unknown_fields = "".b
1866
+ @group_id = ""
1867
+ @topic = ""
1868
+ @partition = 0
1869
+ r = Reader.new(data)
1870
+ loop do
1871
+ item = r.field
1872
+ break if item.nil?
1873
+
1874
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1875
+ case num
1876
+ when 1
1877
+ @group_id = bytes_value.dup.force_encoding(Encoding::UTF_8)
1878
+ when 2
1879
+ @topic = bytes_value.dup.force_encoding(Encoding::UTF_8)
1880
+ when 3
1881
+ @partition = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1882
+ else
1883
+ @unknown_fields = @unknown_fields + raw_value
1884
+ end
1885
+ end
1886
+ self
1887
+ end
1888
+
1889
+ def ==(other)
1890
+ other.is_a?(FetchOffsetRequest) && @group_id == other.group_id && @topic == other.topic && @partition == other.partition
1891
+ end
1892
+ end
1893
+
1894
+ class FetchOffsetResponse
1895
+ attr_accessor :committed_offset, :metadata, :error_code, :unknown_fields
1896
+
1897
+ def initialize(committed_offset: 0, metadata: "", error_code: 0)
1898
+ @committed_offset = committed_offset
1899
+ @metadata = metadata
1900
+ @error_code = error_code
1901
+ @unknown_fields = "".b
1902
+ end
1903
+
1904
+ def marshal_dc
1905
+ w = Writer.new
1906
+ if @committed_offset != 0
1907
+ w.tag(1, 0)
1908
+ w.varint(@committed_offset)
1909
+ end
1910
+ w.string_field(2, @metadata)
1911
+ if @error_code != 0
1912
+ w.tag(3, 0)
1913
+ w.varint(@error_code)
1914
+ end
1915
+ w.raw(@unknown_fields)
1916
+ w.to_bytes
1917
+ end
1918
+
1919
+ def unmarshal_dc(data)
1920
+ @unknown_fields = "".b
1921
+ @committed_offset = 0
1922
+ @metadata = ""
1923
+ @error_code = 0
1924
+ r = Reader.new(data)
1925
+ loop do
1926
+ item = r.field
1927
+ break if item.nil?
1928
+
1929
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1930
+ case num
1931
+ when 1
1932
+ @committed_offset = (((varint_value & 0xffffffffffffffff) ^ 0x8000000000000000) - 0x8000000000000000)
1933
+ when 2
1934
+ @metadata = bytes_value.dup.force_encoding(Encoding::UTF_8)
1935
+ when 3
1936
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1937
+ else
1938
+ @unknown_fields = @unknown_fields + raw_value
1939
+ end
1940
+ end
1941
+ self
1942
+ end
1943
+
1944
+ def ==(other)
1945
+ other.is_a?(FetchOffsetResponse) && @committed_offset == other.committed_offset && @metadata == other.metadata && @error_code == other.error_code
1946
+ end
1947
+ end
1948
+
1949
+ class NewTopic
1950
+ attr_accessor :name, :num_partitions, :replication_factor, :unknown_fields
1951
+
1952
+ def initialize(name: "", num_partitions: 0, replication_factor: 0)
1953
+ @name = name
1954
+ @num_partitions = num_partitions
1955
+ @replication_factor = replication_factor
1956
+ @unknown_fields = "".b
1957
+ end
1958
+
1959
+ def marshal_dc
1960
+ w = Writer.new
1961
+ w.string_field(1, @name)
1962
+ if @num_partitions != 0
1963
+ w.tag(2, 0)
1964
+ w.varint(@num_partitions)
1965
+ end
1966
+ if @replication_factor != 0
1967
+ w.tag(3, 0)
1968
+ w.varint(@replication_factor)
1969
+ end
1970
+ w.raw(@unknown_fields)
1971
+ w.to_bytes
1972
+ end
1973
+
1974
+ def unmarshal_dc(data)
1975
+ @unknown_fields = "".b
1976
+ @name = ""
1977
+ @num_partitions = 0
1978
+ @replication_factor = 0
1979
+ r = Reader.new(data)
1980
+ loop do
1981
+ item = r.field
1982
+ break if item.nil?
1983
+
1984
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
1985
+ case num
1986
+ when 1
1987
+ @name = bytes_value.dup.force_encoding(Encoding::UTF_8)
1988
+ when 2
1989
+ @num_partitions = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1990
+ when 3
1991
+ @replication_factor = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
1992
+ else
1993
+ @unknown_fields = @unknown_fields + raw_value
1994
+ end
1995
+ end
1996
+ self
1997
+ end
1998
+
1999
+ def ==(other)
2000
+ other.is_a?(NewTopic) && @name == other.name && @num_partitions == other.num_partitions && @replication_factor == other.replication_factor
2001
+ end
2002
+ end
2003
+
2004
+ class CreateTopicsRequest
2005
+ attr_accessor :topics, :timeout_ms, :validate_only, :unknown_fields
2006
+
2007
+ def initialize(topics: [], timeout_ms: 0, validate_only: false)
2008
+ @topics = topics
2009
+ @timeout_ms = timeout_ms
2010
+ @validate_only = validate_only
2011
+ @unknown_fields = "".b
2012
+ end
2013
+
2014
+ def marshal_dc
2015
+ w = Writer.new
2016
+ @topics.each { |x| w.bytes_field(1, x.marshal_dc) }
2017
+ if @timeout_ms != 0
2018
+ w.tag(2, 0)
2019
+ w.varint(@timeout_ms)
2020
+ end
2021
+ if @validate_only
2022
+ w.tag(3, 0)
2023
+ w.varint((@validate_only ? 1 : 0))
2024
+ end
2025
+ w.raw(@unknown_fields)
2026
+ w.to_bytes
2027
+ end
2028
+
2029
+ def unmarshal_dc(data)
2030
+ @unknown_fields = "".b
2031
+ @topics = []
2032
+ @timeout_ms = 0
2033
+ @validate_only = false
2034
+ r = Reader.new(data)
2035
+ loop do
2036
+ item = r.field
2037
+ break if item.nil?
2038
+
2039
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
2040
+ case num
2041
+ when 1
2042
+ item = NewTopic.new
2043
+ item.unmarshal_dc(bytes_value)
2044
+ @topics << item
2045
+ when 2
2046
+ @timeout_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
2047
+ when 3
2048
+ @validate_only = (varint_value != 0)
2049
+ else
2050
+ @unknown_fields = @unknown_fields + raw_value
2051
+ end
2052
+ end
2053
+ self
2054
+ end
2055
+
2056
+ def ==(other)
2057
+ other.is_a?(CreateTopicsRequest) && @topics == other.topics && @timeout_ms == other.timeout_ms && @validate_only == other.validate_only
2058
+ end
2059
+ end
2060
+
2061
+ class TopicError
2062
+ attr_accessor :name, :error_code, :unknown_fields
2063
+
2064
+ def initialize(name: "", error_code: 0)
2065
+ @name = name
2066
+ @error_code = error_code
2067
+ @unknown_fields = "".b
2068
+ end
2069
+
2070
+ def marshal_dc
2071
+ w = Writer.new
2072
+ w.string_field(1, @name)
2073
+ if @error_code != 0
2074
+ w.tag(2, 0)
2075
+ w.varint(@error_code)
2076
+ end
2077
+ w.raw(@unknown_fields)
2078
+ w.to_bytes
2079
+ end
2080
+
2081
+ def unmarshal_dc(data)
2082
+ @unknown_fields = "".b
2083
+ @name = ""
2084
+ @error_code = 0
2085
+ r = Reader.new(data)
2086
+ loop do
2087
+ item = r.field
2088
+ break if item.nil?
2089
+
2090
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
2091
+ case num
2092
+ when 1
2093
+ @name = bytes_value.dup.force_encoding(Encoding::UTF_8)
2094
+ when 2
2095
+ @error_code = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
2096
+ else
2097
+ @unknown_fields = @unknown_fields + raw_value
2098
+ end
2099
+ end
2100
+ self
2101
+ end
2102
+
2103
+ def ==(other)
2104
+ other.is_a?(TopicError) && @name == other.name && @error_code == other.error_code
2105
+ end
2106
+ end
2107
+
2108
+ class CreateTopicsResponse
2109
+ attr_accessor :results, :unknown_fields
2110
+
2111
+ def initialize(results: [])
2112
+ @results = results
2113
+ @unknown_fields = "".b
2114
+ end
2115
+
2116
+ def marshal_dc
2117
+ w = Writer.new
2118
+ @results.each { |x| w.bytes_field(1, x.marshal_dc) }
2119
+ w.raw(@unknown_fields)
2120
+ w.to_bytes
2121
+ end
2122
+
2123
+ def unmarshal_dc(data)
2124
+ @unknown_fields = "".b
2125
+ @results = []
2126
+ r = Reader.new(data)
2127
+ loop do
2128
+ item = r.field
2129
+ break if item.nil?
2130
+
2131
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
2132
+ case num
2133
+ when 1
2134
+ item = TopicError.new
2135
+ item.unmarshal_dc(bytes_value)
2136
+ @results << item
2137
+ else
2138
+ @unknown_fields = @unknown_fields + raw_value
2139
+ end
2140
+ end
2141
+ self
2142
+ end
2143
+
2144
+ def ==(other)
2145
+ other.is_a?(CreateTopicsResponse) && @results == other.results
2146
+ end
2147
+ end
2148
+
2149
+ class DeleteTopicsRequest
2150
+ attr_accessor :topics, :timeout_ms, :unknown_fields
2151
+
2152
+ def initialize(topics: [], timeout_ms: 0)
2153
+ @topics = topics
2154
+ @timeout_ms = timeout_ms
2155
+ @unknown_fields = "".b
2156
+ end
2157
+
2158
+ def marshal_dc
2159
+ w = Writer.new
2160
+ @topics.each { |x| w.bytes_field(1, x) }
2161
+ if @timeout_ms != 0
2162
+ w.tag(2, 0)
2163
+ w.varint(@timeout_ms)
2164
+ end
2165
+ w.raw(@unknown_fields)
2166
+ w.to_bytes
2167
+ end
2168
+
2169
+ def unmarshal_dc(data)
2170
+ @unknown_fields = "".b
2171
+ @topics = []
2172
+ @timeout_ms = 0
2173
+ r = Reader.new(data)
2174
+ loop do
2175
+ item = r.field
2176
+ break if item.nil?
2177
+
2178
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
2179
+ case num
2180
+ when 1
2181
+ @topics << bytes_value.dup.force_encoding(Encoding::UTF_8)
2182
+ when 2
2183
+ @timeout_ms = (((varint_value & 0xffffffff) ^ 0x80000000) - 0x80000000)
2184
+ else
2185
+ @unknown_fields = @unknown_fields + raw_value
2186
+ end
2187
+ end
2188
+ self
2189
+ end
2190
+
2191
+ def ==(other)
2192
+ other.is_a?(DeleteTopicsRequest) && @topics == other.topics && @timeout_ms == other.timeout_ms
2193
+ end
2194
+ end
2195
+
2196
+ class DeleteTopicsResponse
2197
+ attr_accessor :results, :unknown_fields
2198
+
2199
+ def initialize(results: [])
2200
+ @results = results
2201
+ @unknown_fields = "".b
2202
+ end
2203
+
2204
+ def marshal_dc
2205
+ w = Writer.new
2206
+ @results.each { |x| w.bytes_field(1, x.marshal_dc) }
2207
+ w.raw(@unknown_fields)
2208
+ w.to_bytes
2209
+ end
2210
+
2211
+ def unmarshal_dc(data)
2212
+ @unknown_fields = "".b
2213
+ @results = []
2214
+ r = Reader.new(data)
2215
+ loop do
2216
+ item = r.field
2217
+ break if item.nil?
2218
+
2219
+ num, wire, varint_value, bytes_value, fixed_value, raw_value = item
2220
+ case num
2221
+ when 1
2222
+ item = TopicError.new
2223
+ item.unmarshal_dc(bytes_value)
2224
+ @results << item
2225
+ else
2226
+ @unknown_fields = @unknown_fields + raw_value
2227
+ end
2228
+ end
2229
+ self
2230
+ end
2231
+
2232
+ def ==(other)
2233
+ other.is_a?(DeleteTopicsResponse) && @results == other.results
2234
+ end
2235
+ end
2236
+
2237
+ end