grpc-dc 0.42.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/kafka_pb.js CHANGED
@@ -43,7 +43,7 @@ class Reader {
43
43
  }
44
44
  }
45
45
  take(n) {
46
- const value = this.bytes.slice(this.pos, this.pos + n);
46
+ const value = this.bytes.subarray(this.pos, this.pos + n);
47
47
  if (value.length !== n) throw new Error("truncated field");
48
48
  this.pos += n;
49
49
  return value;
@@ -54,25 +54,29 @@ class Reader {
54
54
  const tag = this.varint();
55
55
  const field = Number(tag >> 3n);
56
56
  const wire = Number(tag & 7n);
57
+ const f = this._f || (this._f = [0, 0, null, null]);
58
+ f[0] = field;
59
+ f[1] = wire;
57
60
  switch (wire) {
58
61
  case 0:
59
- return [field, wire, this.varint(), this.bytes.slice(start, this.pos)];
62
+ f[2] = this.varint();
63
+ break;
60
64
  case 2: {
61
65
  const len = Number(this.varint());
62
- const v = this.take(len);
63
- return [field, wire, v, this.bytes.slice(start, this.pos)];
64
- }
65
- case 1: {
66
- const v = this.take(8);
67
- return [field, wire, v, this.bytes.slice(start, this.pos)];
68
- }
69
- case 5: {
70
- const v = this.take(4);
71
- return [field, wire, v, this.bytes.slice(start, this.pos)];
66
+ f[2] = this.take(len);
67
+ break;
72
68
  }
69
+ case 1:
70
+ f[2] = this.take(8);
71
+ break;
72
+ case 5:
73
+ f[2] = this.take(4);
74
+ break;
73
75
  default:
74
76
  throw new Error("bad wire type " + wire);
75
77
  }
78
+ f[3] = this.bytes.subarray(start, this.pos);
79
+ return f;
76
80
  }
77
81
  }
78
82
 
@@ -83,6 +87,9 @@ function concatBytes(a, b) {
83
87
  return out;
84
88
  }
85
89
 
90
+ const textEncoder = new TextEncoder();
91
+ const textDecoder = new TextDecoder();
92
+ const EMPTY_BYTES = new Uint8Array(0);
86
93
  function putRaw(out, bytes) {
87
94
  for (let i = 0; i < bytes.length; i++) out.push(bytes[i]);
88
95
  }
@@ -105,7 +112,7 @@ function putBytesField(out, num, payload) {
105
112
 
106
113
  function putStringField(out, num, value) {
107
114
  if (!value) return;
108
- putBytesField(out, num, new TextEncoder().encode(value));
115
+ putBytesField(out, num, textEncoder.encode(value));
109
116
  }
110
117
 
111
118
  function putFixedField(out, num, payload) {
@@ -113,10 +120,11 @@ function putFixedField(out, num, payload) {
113
120
  out.push(...payload);
114
121
  }
115
122
 
123
+ const _fixedBuf = new Uint8Array(8);
124
+ const _fixedView = new DataView(_fixedBuf.buffer);
116
125
  function fixedBytes(value, size, write) {
117
- const bytes = new Uint8Array(size);
118
- write(new DataView(bytes.buffer), value);
119
- return bytes;
126
+ write(_fixedView, value);
127
+ return _fixedBuf.subarray(0, size);
120
128
  }
121
129
 
122
130
  function readFixed(bytes, read) {
@@ -135,7 +143,7 @@ export class Header {
135
143
  constructor({ key = "", value = new Uint8Array(0) } = {}) {
136
144
  this.key = key;
137
145
  this.value = value;
138
- this.unknownFields = new Uint8Array(0);
146
+ this.unknownFields = EMPTY_BYTES;
139
147
  }
140
148
  static encode(msg) {
141
149
  const out = [];
@@ -146,18 +154,32 @@ export class Header {
146
154
  }
147
155
  static decode(bytes) {
148
156
  const msg = new Header();
157
+ Header._fill(msg, bytes);
158
+ return msg;
159
+ }
160
+ static decodeInto(msg, bytes) {
161
+ msg._reset();
162
+ Header._fill(msg, bytes);
163
+ return msg;
164
+ }
165
+ static _fill(msg, bytes) {
149
166
  const reader = new Reader(bytes);
150
167
  let f;
151
168
  while ((f = reader.field()) !== null) {
152
169
  const [num, wire, value, raw] = f;
153
170
  switch (num) {
154
- case 1: msg.key = new TextDecoder().decode(value); break;
171
+ case 1: msg.key = textDecoder.decode(value); break;
155
172
  case 2: msg.value = value; break;
156
173
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
157
174
  }
158
175
  }
159
176
  return msg;
160
177
  }
178
+ _reset() {
179
+ this.key = "";
180
+ this.value = new Uint8Array(0);
181
+ this.unknownFields = EMPTY_BYTES;
182
+ }
161
183
  }
162
184
 
163
185
  export class Record {
@@ -167,7 +189,7 @@ export class Record {
167
189
  this.headers = headers;
168
190
  this.timestampMs = timestampMs;
169
191
  this.nullKey = nullKey;
170
- this.unknownFields = new Uint8Array(0);
192
+ this.unknownFields = EMPTY_BYTES;
171
193
  }
172
194
  static encode(msg) {
173
195
  const out = [];
@@ -181,6 +203,15 @@ export class Record {
181
203
  }
182
204
  static decode(bytes) {
183
205
  const msg = new Record();
206
+ Record._fill(msg, bytes);
207
+ return msg;
208
+ }
209
+ static decodeInto(msg, bytes) {
210
+ msg._reset();
211
+ Record._fill(msg, bytes);
212
+ return msg;
213
+ }
214
+ static _fill(msg, bytes) {
184
215
  const reader = new Reader(bytes);
185
216
  let f;
186
217
  while ((f = reader.field()) !== null) {
@@ -196,6 +227,14 @@ export class Record {
196
227
  }
197
228
  return msg;
198
229
  }
230
+ _reset() {
231
+ this.key = new Uint8Array(0);
232
+ this.value = new Uint8Array(0);
233
+ this.headers = [];
234
+ this.timestampMs = 0n;
235
+ this.nullKey = false;
236
+ this.unknownFields = EMPTY_BYTES;
237
+ }
199
238
  }
200
239
 
201
240
  export class FetchedRecord {
@@ -206,7 +245,7 @@ export class FetchedRecord {
206
245
  this.value = value;
207
246
  this.headers = headers;
208
247
  this.keyNull = keyNull;
209
- this.unknownFields = new Uint8Array(0);
248
+ this.unknownFields = EMPTY_BYTES;
210
249
  }
211
250
  static encode(msg) {
212
251
  const out = [];
@@ -221,6 +260,15 @@ export class FetchedRecord {
221
260
  }
222
261
  static decode(bytes) {
223
262
  const msg = new FetchedRecord();
263
+ FetchedRecord._fill(msg, bytes);
264
+ return msg;
265
+ }
266
+ static decodeInto(msg, bytes) {
267
+ msg._reset();
268
+ FetchedRecord._fill(msg, bytes);
269
+ return msg;
270
+ }
271
+ static _fill(msg, bytes) {
224
272
  const reader = new Reader(bytes);
225
273
  let f;
226
274
  while ((f = reader.field()) !== null) {
@@ -237,13 +285,22 @@ export class FetchedRecord {
237
285
  }
238
286
  return msg;
239
287
  }
288
+ _reset() {
289
+ this.offset = 0n;
290
+ this.timestampMs = 0n;
291
+ this.key = new Uint8Array(0);
292
+ this.value = new Uint8Array(0);
293
+ this.headers = [];
294
+ this.keyNull = false;
295
+ this.unknownFields = EMPTY_BYTES;
296
+ }
240
297
  }
241
298
 
242
299
  export class TopicPartition {
243
300
  constructor({ topic = "", partition = 0 } = {}) {
244
301
  this.topic = topic;
245
302
  this.partition = partition;
246
- this.unknownFields = new Uint8Array(0);
303
+ this.unknownFields = EMPTY_BYTES;
247
304
  }
248
305
  static encode(msg) {
249
306
  const out = [];
@@ -254,47 +311,75 @@ export class TopicPartition {
254
311
  }
255
312
  static decode(bytes) {
256
313
  const msg = new TopicPartition();
314
+ TopicPartition._fill(msg, bytes);
315
+ return msg;
316
+ }
317
+ static decodeInto(msg, bytes) {
318
+ msg._reset();
319
+ TopicPartition._fill(msg, bytes);
320
+ return msg;
321
+ }
322
+ static _fill(msg, bytes) {
257
323
  const reader = new Reader(bytes);
258
324
  let f;
259
325
  while ((f = reader.field()) !== null) {
260
326
  const [num, wire, value, raw] = f;
261
327
  switch (num) {
262
- case 1: msg.topic = new TextDecoder().decode(value); break;
328
+ case 1: msg.topic = textDecoder.decode(value); break;
263
329
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
264
330
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
265
331
  }
266
332
  }
267
333
  return msg;
268
334
  }
335
+ _reset() {
336
+ this.topic = "";
337
+ this.partition = 0;
338
+ this.unknownFields = EMPTY_BYTES;
339
+ }
269
340
  }
270
341
 
271
342
  export class MetadataRequest {
272
343
  constructor({ topics = [], allowAutoTopicCreation = false } = {}) {
273
344
  this.topics = topics;
274
345
  this.allowAutoTopicCreation = allowAutoTopicCreation;
275
- this.unknownFields = new Uint8Array(0);
346
+ this.unknownFields = EMPTY_BYTES;
276
347
  }
277
348
  static encode(msg) {
278
349
  const out = [];
279
- if (msg.topics) for (const v of msg.topics) putBytesField(out, 1, new TextEncoder().encode(v));
350
+ if (msg.topics) for (const v of msg.topics) putBytesField(out, 1, textEncoder.encode(v));
280
351
  putVarintField(out, 2, (msg.allowAutoTopicCreation ? 1n : 0n));
281
352
  putRaw(out, msg.unknownFields);
282
353
  return new Uint8Array(out);
283
354
  }
284
355
  static decode(bytes) {
285
356
  const msg = new MetadataRequest();
357
+ MetadataRequest._fill(msg, bytes);
358
+ return msg;
359
+ }
360
+ static decodeInto(msg, bytes) {
361
+ msg._reset();
362
+ MetadataRequest._fill(msg, bytes);
363
+ return msg;
364
+ }
365
+ static _fill(msg, bytes) {
286
366
  const reader = new Reader(bytes);
287
367
  let f;
288
368
  while ((f = reader.field()) !== null) {
289
369
  const [num, wire, value, raw] = f;
290
370
  switch (num) {
291
- case 1: msg.topics.push(new TextDecoder().decode(value)); break;
371
+ case 1: msg.topics.push(textDecoder.decode(value)); break;
292
372
  case 2: msg.allowAutoTopicCreation = value !== 0n; break;
293
373
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
294
374
  }
295
375
  }
296
376
  return msg;
297
377
  }
378
+ _reset() {
379
+ this.topics = [];
380
+ this.allowAutoTopicCreation = false;
381
+ this.unknownFields = EMPTY_BYTES;
382
+ }
298
383
  }
299
384
 
300
385
  export class BrokerMetadata {
@@ -303,7 +388,7 @@ export class BrokerMetadata {
303
388
  this.host = host;
304
389
  this.port = port;
305
390
  this.rack = rack;
306
- this.unknownFields = new Uint8Array(0);
391
+ this.unknownFields = EMPTY_BYTES;
307
392
  }
308
393
  static encode(msg) {
309
394
  const out = [];
@@ -316,20 +401,36 @@ export class BrokerMetadata {
316
401
  }
317
402
  static decode(bytes) {
318
403
  const msg = new BrokerMetadata();
404
+ BrokerMetadata._fill(msg, bytes);
405
+ return msg;
406
+ }
407
+ static decodeInto(msg, bytes) {
408
+ msg._reset();
409
+ BrokerMetadata._fill(msg, bytes);
410
+ return msg;
411
+ }
412
+ static _fill(msg, bytes) {
319
413
  const reader = new Reader(bytes);
320
414
  let f;
321
415
  while ((f = reader.field()) !== null) {
322
416
  const [num, wire, value, raw] = f;
323
417
  switch (num) {
324
418
  case 1: msg.nodeId = Number(BigInt.asIntN(32, value)); break;
325
- case 2: msg.host = new TextDecoder().decode(value); break;
419
+ case 2: msg.host = textDecoder.decode(value); break;
326
420
  case 3: msg.port = Number(BigInt.asIntN(32, value)); break;
327
- case 4: msg.rack = new TextDecoder().decode(value); break;
421
+ case 4: msg.rack = textDecoder.decode(value); break;
328
422
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
329
423
  }
330
424
  }
331
425
  return msg;
332
426
  }
427
+ _reset() {
428
+ this.nodeId = 0;
429
+ this.host = "";
430
+ this.port = 0;
431
+ this.rack = "";
432
+ this.unknownFields = EMPTY_BYTES;
433
+ }
333
434
  }
334
435
 
335
436
  export class PartitionMetadata {
@@ -340,7 +441,7 @@ export class PartitionMetadata {
340
441
  this.replicas = replicas;
341
442
  this.isr = isr;
342
443
  this.errorCode = errorCode;
343
- this.unknownFields = new Uint8Array(0);
444
+ this.unknownFields = EMPTY_BYTES;
344
445
  }
345
446
  static encode(msg) {
346
447
  const out = [];
@@ -363,6 +464,15 @@ export class PartitionMetadata {
363
464
  }
364
465
  static decode(bytes) {
365
466
  const msg = new PartitionMetadata();
467
+ PartitionMetadata._fill(msg, bytes);
468
+ return msg;
469
+ }
470
+ static decodeInto(msg, bytes) {
471
+ msg._reset();
472
+ PartitionMetadata._fill(msg, bytes);
473
+ return msg;
474
+ }
475
+ static _fill(msg, bytes) {
366
476
  const reader = new Reader(bytes);
367
477
  let f;
368
478
  while ((f = reader.field()) !== null) {
@@ -379,6 +489,15 @@ export class PartitionMetadata {
379
489
  }
380
490
  return msg;
381
491
  }
492
+ _reset() {
493
+ this.id = 0;
494
+ this.leaderId = 0;
495
+ this.leaderEpoch = 0;
496
+ this.replicas = [];
497
+ this.isr = [];
498
+ this.errorCode = 0;
499
+ this.unknownFields = EMPTY_BYTES;
500
+ }
382
501
  }
383
502
 
384
503
  export class TopicMetadata {
@@ -387,7 +506,7 @@ export class TopicMetadata {
387
506
  this.isInternal = isInternal;
388
507
  this.errorCode = errorCode;
389
508
  this.partitions = partitions;
390
- this.unknownFields = new Uint8Array(0);
509
+ this.unknownFields = EMPTY_BYTES;
391
510
  }
392
511
  static encode(msg) {
393
512
  const out = [];
@@ -400,12 +519,21 @@ export class TopicMetadata {
400
519
  }
401
520
  static decode(bytes) {
402
521
  const msg = new TopicMetadata();
522
+ TopicMetadata._fill(msg, bytes);
523
+ return msg;
524
+ }
525
+ static decodeInto(msg, bytes) {
526
+ msg._reset();
527
+ TopicMetadata._fill(msg, bytes);
528
+ return msg;
529
+ }
530
+ static _fill(msg, bytes) {
403
531
  const reader = new Reader(bytes);
404
532
  let f;
405
533
  while ((f = reader.field()) !== null) {
406
534
  const [num, wire, value, raw] = f;
407
535
  switch (num) {
408
- case 1: msg.name = new TextDecoder().decode(value); break;
536
+ case 1: msg.name = textDecoder.decode(value); break;
409
537
  case 2: msg.isInternal = value !== 0n; break;
410
538
  case 3: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
411
539
  case 4: msg.partitions.push(PartitionMetadata.decode(value)); break;
@@ -414,6 +542,13 @@ export class TopicMetadata {
414
542
  }
415
543
  return msg;
416
544
  }
545
+ _reset() {
546
+ this.name = "";
547
+ this.isInternal = false;
548
+ this.errorCode = 0;
549
+ this.partitions = [];
550
+ this.unknownFields = EMPTY_BYTES;
551
+ }
417
552
  }
418
553
 
419
554
  export class MetadataResponse {
@@ -423,7 +558,7 @@ export class MetadataResponse {
423
558
  this.clusterId = clusterId;
424
559
  this.controllerId = controllerId;
425
560
  this.topics = topics;
426
- this.unknownFields = new Uint8Array(0);
561
+ this.unknownFields = EMPTY_BYTES;
427
562
  }
428
563
  static encode(msg) {
429
564
  const out = [];
@@ -437,6 +572,15 @@ export class MetadataResponse {
437
572
  }
438
573
  static decode(bytes) {
439
574
  const msg = new MetadataResponse();
575
+ MetadataResponse._fill(msg, bytes);
576
+ return msg;
577
+ }
578
+ static decodeInto(msg, bytes) {
579
+ msg._reset();
580
+ MetadataResponse._fill(msg, bytes);
581
+ return msg;
582
+ }
583
+ static _fill(msg, bytes) {
440
584
  const reader = new Reader(bytes);
441
585
  let f;
442
586
  while ((f = reader.field()) !== null) {
@@ -444,7 +588,7 @@ export class MetadataResponse {
444
588
  switch (num) {
445
589
  case 1: msg.throttleTimeMs = Number(BigInt.asIntN(32, value)); break;
446
590
  case 2: msg.brokers.push(BrokerMetadata.decode(value)); break;
447
- case 3: msg.clusterId = new TextDecoder().decode(value); break;
591
+ case 3: msg.clusterId = textDecoder.decode(value); break;
448
592
  case 4: msg.controllerId = Number(BigInt.asIntN(32, value)); break;
449
593
  case 5: msg.topics.push(TopicMetadata.decode(value)); break;
450
594
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -452,13 +596,21 @@ export class MetadataResponse {
452
596
  }
453
597
  return msg;
454
598
  }
599
+ _reset() {
600
+ this.throttleTimeMs = 0;
601
+ this.brokers = [];
602
+ this.clusterId = "";
603
+ this.controllerId = 0;
604
+ this.topics = [];
605
+ this.unknownFields = EMPTY_BYTES;
606
+ }
455
607
  }
456
608
 
457
609
  export class OpenProducerRequest {
458
610
  constructor({ transactionalId = "", transactionTimeoutMs = 0 } = {}) {
459
611
  this.transactionalId = transactionalId;
460
612
  this.transactionTimeoutMs = transactionTimeoutMs;
461
- this.unknownFields = new Uint8Array(0);
613
+ this.unknownFields = EMPTY_BYTES;
462
614
  }
463
615
  static encode(msg) {
464
616
  const out = [];
@@ -469,18 +621,32 @@ export class OpenProducerRequest {
469
621
  }
470
622
  static decode(bytes) {
471
623
  const msg = new OpenProducerRequest();
624
+ OpenProducerRequest._fill(msg, bytes);
625
+ return msg;
626
+ }
627
+ static decodeInto(msg, bytes) {
628
+ msg._reset();
629
+ OpenProducerRequest._fill(msg, bytes);
630
+ return msg;
631
+ }
632
+ static _fill(msg, bytes) {
472
633
  const reader = new Reader(bytes);
473
634
  let f;
474
635
  while ((f = reader.field()) !== null) {
475
636
  const [num, wire, value, raw] = f;
476
637
  switch (num) {
477
- case 1: msg.transactionalId = new TextDecoder().decode(value); break;
638
+ case 1: msg.transactionalId = textDecoder.decode(value); break;
478
639
  case 2: msg.transactionTimeoutMs = Number(BigInt.asIntN(32, value)); break;
479
640
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
480
641
  }
481
642
  }
482
643
  return msg;
483
644
  }
645
+ _reset() {
646
+ this.transactionalId = "";
647
+ this.transactionTimeoutMs = 0;
648
+ this.unknownFields = EMPTY_BYTES;
649
+ }
484
650
  }
485
651
 
486
652
  export class OpenProducerResponse {
@@ -489,7 +655,7 @@ export class OpenProducerResponse {
489
655
  this.producerId = producerId;
490
656
  this.producerEpoch = producerEpoch;
491
657
  this.errorCode = errorCode;
492
- this.unknownFields = new Uint8Array(0);
658
+ this.unknownFields = EMPTY_BYTES;
493
659
  }
494
660
  static encode(msg) {
495
661
  const out = [];
@@ -502,12 +668,21 @@ export class OpenProducerResponse {
502
668
  }
503
669
  static decode(bytes) {
504
670
  const msg = new OpenProducerResponse();
671
+ OpenProducerResponse._fill(msg, bytes);
672
+ return msg;
673
+ }
674
+ static decodeInto(msg, bytes) {
675
+ msg._reset();
676
+ OpenProducerResponse._fill(msg, bytes);
677
+ return msg;
678
+ }
679
+ static _fill(msg, bytes) {
505
680
  const reader = new Reader(bytes);
506
681
  let f;
507
682
  while ((f = reader.field()) !== null) {
508
683
  const [num, wire, value, raw] = f;
509
684
  switch (num) {
510
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
685
+ case 1: msg.sessionId = textDecoder.decode(value); break;
511
686
  case 2: msg.producerId = BigInt.asIntN(64, value); break;
512
687
  case 3: msg.producerEpoch = Number(BigInt.asIntN(32, value)); break;
513
688
  case 4: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
@@ -516,12 +691,19 @@ export class OpenProducerResponse {
516
691
  }
517
692
  return msg;
518
693
  }
694
+ _reset() {
695
+ this.sessionId = "";
696
+ this.producerId = 0n;
697
+ this.producerEpoch = 0;
698
+ this.errorCode = 0;
699
+ this.unknownFields = EMPTY_BYTES;
700
+ }
519
701
  }
520
702
 
521
703
  export class CloseProducerRequest {
522
704
  constructor({ sessionId = "" } = {}) {
523
705
  this.sessionId = sessionId;
524
- this.unknownFields = new Uint8Array(0);
706
+ this.unknownFields = EMPTY_BYTES;
525
707
  }
526
708
  static encode(msg) {
527
709
  const out = [];
@@ -531,23 +713,36 @@ export class CloseProducerRequest {
531
713
  }
532
714
  static decode(bytes) {
533
715
  const msg = new CloseProducerRequest();
716
+ CloseProducerRequest._fill(msg, bytes);
717
+ return msg;
718
+ }
719
+ static decodeInto(msg, bytes) {
720
+ msg._reset();
721
+ CloseProducerRequest._fill(msg, bytes);
722
+ return msg;
723
+ }
724
+ static _fill(msg, bytes) {
534
725
  const reader = new Reader(bytes);
535
726
  let f;
536
727
  while ((f = reader.field()) !== null) {
537
728
  const [num, wire, value, raw] = f;
538
729
  switch (num) {
539
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
730
+ case 1: msg.sessionId = textDecoder.decode(value); break;
540
731
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
541
732
  }
542
733
  }
543
734
  return msg;
544
735
  }
736
+ _reset() {
737
+ this.sessionId = "";
738
+ this.unknownFields = EMPTY_BYTES;
739
+ }
545
740
  }
546
741
 
547
742
  export class CloseProducerResponse {
548
743
  constructor({ errorCode = 0 } = {}) {
549
744
  this.errorCode = errorCode;
550
- this.unknownFields = new Uint8Array(0);
745
+ this.unknownFields = EMPTY_BYTES;
551
746
  }
552
747
  static encode(msg) {
553
748
  const out = [];
@@ -557,6 +752,15 @@ export class CloseProducerResponse {
557
752
  }
558
753
  static decode(bytes) {
559
754
  const msg = new CloseProducerResponse();
755
+ CloseProducerResponse._fill(msg, bytes);
756
+ return msg;
757
+ }
758
+ static decodeInto(msg, bytes) {
759
+ msg._reset();
760
+ CloseProducerResponse._fill(msg, bytes);
761
+ return msg;
762
+ }
763
+ static _fill(msg, bytes) {
560
764
  const reader = new Reader(bytes);
561
765
  let f;
562
766
  while ((f = reader.field()) !== null) {
@@ -568,13 +772,17 @@ export class CloseProducerResponse {
568
772
  }
569
773
  return msg;
570
774
  }
775
+ _reset() {
776
+ this.errorCode = 0;
777
+ this.unknownFields = EMPTY_BYTES;
778
+ }
571
779
  }
572
780
 
573
781
  export class EndTransactionRequest {
574
782
  constructor({ sessionId = "", commit = false } = {}) {
575
783
  this.sessionId = sessionId;
576
784
  this.commit = commit;
577
- this.unknownFields = new Uint8Array(0);
785
+ this.unknownFields = EMPTY_BYTES;
578
786
  }
579
787
  static encode(msg) {
580
788
  const out = [];
@@ -585,24 +793,38 @@ export class EndTransactionRequest {
585
793
  }
586
794
  static decode(bytes) {
587
795
  const msg = new EndTransactionRequest();
796
+ EndTransactionRequest._fill(msg, bytes);
797
+ return msg;
798
+ }
799
+ static decodeInto(msg, bytes) {
800
+ msg._reset();
801
+ EndTransactionRequest._fill(msg, bytes);
802
+ return msg;
803
+ }
804
+ static _fill(msg, bytes) {
588
805
  const reader = new Reader(bytes);
589
806
  let f;
590
807
  while ((f = reader.field()) !== null) {
591
808
  const [num, wire, value, raw] = f;
592
809
  switch (num) {
593
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
810
+ case 1: msg.sessionId = textDecoder.decode(value); break;
594
811
  case 2: msg.commit = value !== 0n; break;
595
812
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
596
813
  }
597
814
  }
598
815
  return msg;
599
816
  }
817
+ _reset() {
818
+ this.sessionId = "";
819
+ this.commit = false;
820
+ this.unknownFields = EMPTY_BYTES;
821
+ }
600
822
  }
601
823
 
602
824
  export class EndTransactionResponse {
603
825
  constructor({ errorCode = 0 } = {}) {
604
826
  this.errorCode = errorCode;
605
- this.unknownFields = new Uint8Array(0);
827
+ this.unknownFields = EMPTY_BYTES;
606
828
  }
607
829
  static encode(msg) {
608
830
  const out = [];
@@ -612,6 +834,15 @@ export class EndTransactionResponse {
612
834
  }
613
835
  static decode(bytes) {
614
836
  const msg = new EndTransactionResponse();
837
+ EndTransactionResponse._fill(msg, bytes);
838
+ return msg;
839
+ }
840
+ static decodeInto(msg, bytes) {
841
+ msg._reset();
842
+ EndTransactionResponse._fill(msg, bytes);
843
+ return msg;
844
+ }
845
+ static _fill(msg, bytes) {
615
846
  const reader = new Reader(bytes);
616
847
  let f;
617
848
  while ((f = reader.field()) !== null) {
@@ -623,6 +854,10 @@ export class EndTransactionResponse {
623
854
  }
624
855
  return msg;
625
856
  }
857
+ _reset() {
858
+ this.errorCode = 0;
859
+ this.unknownFields = EMPTY_BYTES;
860
+ }
626
861
  }
627
862
 
628
863
  export class ProduceRequest {
@@ -635,7 +870,7 @@ export class ProduceRequest {
635
870
  this.compression = compression;
636
871
  this.sessionId = sessionId;
637
872
  this.transactionalId = transactionalId;
638
- this.unknownFields = new Uint8Array(0);
873
+ this.unknownFields = EMPTY_BYTES;
639
874
  }
640
875
  static encode(msg) {
641
876
  const out = [];
@@ -652,24 +887,44 @@ export class ProduceRequest {
652
887
  }
653
888
  static decode(bytes) {
654
889
  const msg = new ProduceRequest();
890
+ ProduceRequest._fill(msg, bytes);
891
+ return msg;
892
+ }
893
+ static decodeInto(msg, bytes) {
894
+ msg._reset();
895
+ ProduceRequest._fill(msg, bytes);
896
+ return msg;
897
+ }
898
+ static _fill(msg, bytes) {
655
899
  const reader = new Reader(bytes);
656
900
  let f;
657
901
  while ((f = reader.field()) !== null) {
658
902
  const [num, wire, value, raw] = f;
659
903
  switch (num) {
660
- case 1: msg.topic = new TextDecoder().decode(value); break;
904
+ case 1: msg.topic = textDecoder.decode(value); break;
661
905
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
662
906
  case 3: msg.records.push(Record.decode(value)); break;
663
907
  case 4: msg.acks = Number(BigInt.asIntN(32, value)); break;
664
908
  case 5: msg.timeoutMs = Number(BigInt.asIntN(32, value)); break;
665
909
  case 6: msg.compression = Number(BigInt.asIntN(32, value)); break;
666
- case 7: msg.sessionId = new TextDecoder().decode(value); break;
667
- case 8: msg.transactionalId = new TextDecoder().decode(value); break;
910
+ case 7: msg.sessionId = textDecoder.decode(value); break;
911
+ case 8: msg.transactionalId = textDecoder.decode(value); break;
668
912
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
669
913
  }
670
914
  }
671
915
  return msg;
672
916
  }
917
+ _reset() {
918
+ this.topic = "";
919
+ this.partition = 0;
920
+ this.records = [];
921
+ this.acks = 0;
922
+ this.timeoutMs = 0;
923
+ this.compression = 0;
924
+ this.sessionId = "";
925
+ this.transactionalId = "";
926
+ this.unknownFields = EMPTY_BYTES;
927
+ }
673
928
  }
674
929
 
675
930
  export class ProduceResponse {
@@ -678,7 +933,7 @@ export class ProduceResponse {
678
933
  this.baseOffset = baseOffset;
679
934
  this.logAppendTimeMs = logAppendTimeMs;
680
935
  this.errorCode = errorCode;
681
- this.unknownFields = new Uint8Array(0);
936
+ this.unknownFields = EMPTY_BYTES;
682
937
  }
683
938
  static encode(msg) {
684
939
  const out = [];
@@ -691,6 +946,15 @@ export class ProduceResponse {
691
946
  }
692
947
  static decode(bytes) {
693
948
  const msg = new ProduceResponse();
949
+ ProduceResponse._fill(msg, bytes);
950
+ return msg;
951
+ }
952
+ static decodeInto(msg, bytes) {
953
+ msg._reset();
954
+ ProduceResponse._fill(msg, bytes);
955
+ return msg;
956
+ }
957
+ static _fill(msg, bytes) {
694
958
  const reader = new Reader(bytes);
695
959
  let f;
696
960
  while ((f = reader.field()) !== null) {
@@ -705,6 +969,13 @@ export class ProduceResponse {
705
969
  }
706
970
  return msg;
707
971
  }
972
+ _reset() {
973
+ this.partition = 0;
974
+ this.baseOffset = 0n;
975
+ this.logAppendTimeMs = 0n;
976
+ this.errorCode = 0;
977
+ this.unknownFields = EMPTY_BYTES;
978
+ }
708
979
  }
709
980
 
710
981
  export class ConsumeRequest {
@@ -716,7 +987,7 @@ export class ConsumeRequest {
716
987
  this.maxWaitMs = maxWaitMs;
717
988
  this.minBytes = minBytes;
718
989
  this.readCommitted = readCommitted;
719
- this.unknownFields = new Uint8Array(0);
990
+ this.unknownFields = EMPTY_BYTES;
720
991
  }
721
992
  static encode(msg) {
722
993
  const out = [];
@@ -732,12 +1003,21 @@ export class ConsumeRequest {
732
1003
  }
733
1004
  static decode(bytes) {
734
1005
  const msg = new ConsumeRequest();
1006
+ ConsumeRequest._fill(msg, bytes);
1007
+ return msg;
1008
+ }
1009
+ static decodeInto(msg, bytes) {
1010
+ msg._reset();
1011
+ ConsumeRequest._fill(msg, bytes);
1012
+ return msg;
1013
+ }
1014
+ static _fill(msg, bytes) {
735
1015
  const reader = new Reader(bytes);
736
1016
  let f;
737
1017
  while ((f = reader.field()) !== null) {
738
1018
  const [num, wire, value, raw] = f;
739
1019
  switch (num) {
740
- case 1: msg.topic = new TextDecoder().decode(value); break;
1020
+ case 1: msg.topic = textDecoder.decode(value); break;
741
1021
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
742
1022
  case 3: msg.offset = BigInt.asIntN(64, value); break;
743
1023
  case 4: msg.maxRecords = Number(BigInt.asIntN(32, value)); break;
@@ -749,6 +1029,16 @@ export class ConsumeRequest {
749
1029
  }
750
1030
  return msg;
751
1031
  }
1032
+ _reset() {
1033
+ this.topic = "";
1034
+ this.partition = 0;
1035
+ this.offset = 0n;
1036
+ this.maxRecords = 0;
1037
+ this.maxWaitMs = 0;
1038
+ this.minBytes = 0;
1039
+ this.readCommitted = false;
1040
+ this.unknownFields = EMPTY_BYTES;
1041
+ }
752
1042
  }
753
1043
 
754
1044
  export class ConsumeResponse {
@@ -758,7 +1048,7 @@ export class ConsumeResponse {
758
1048
  this.highWatermark = highWatermark;
759
1049
  this.errorCode = errorCode;
760
1050
  this.records = records;
761
- this.unknownFields = new Uint8Array(0);
1051
+ this.unknownFields = EMPTY_BYTES;
762
1052
  }
763
1053
  static encode(msg) {
764
1054
  const out = [];
@@ -772,12 +1062,21 @@ export class ConsumeResponse {
772
1062
  }
773
1063
  static decode(bytes) {
774
1064
  const msg = new ConsumeResponse();
1065
+ ConsumeResponse._fill(msg, bytes);
1066
+ return msg;
1067
+ }
1068
+ static decodeInto(msg, bytes) {
1069
+ msg._reset();
1070
+ ConsumeResponse._fill(msg, bytes);
1071
+ return msg;
1072
+ }
1073
+ static _fill(msg, bytes) {
775
1074
  const reader = new Reader(bytes);
776
1075
  let f;
777
1076
  while ((f = reader.field()) !== null) {
778
1077
  const [num, wire, value, raw] = f;
779
1078
  switch (num) {
780
- case 1: msg.topic = new TextDecoder().decode(value); break;
1079
+ case 1: msg.topic = textDecoder.decode(value); break;
781
1080
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
782
1081
  case 3: msg.highWatermark = BigInt.asIntN(64, value); break;
783
1082
  case 4: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
@@ -787,6 +1086,14 @@ export class ConsumeResponse {
787
1086
  }
788
1087
  return msg;
789
1088
  }
1089
+ _reset() {
1090
+ this.topic = "";
1091
+ this.partition = 0;
1092
+ this.highWatermark = 0n;
1093
+ this.errorCode = 0;
1094
+ this.records = [];
1095
+ this.unknownFields = EMPTY_BYTES;
1096
+ }
790
1097
  }
791
1098
 
792
1099
  export class GroupSubscribeRequest {
@@ -799,12 +1106,12 @@ export class GroupSubscribeRequest {
799
1106
  this.autoOffsetReset = autoOffsetReset;
800
1107
  this.readCommitted = readCommitted;
801
1108
  this.groupProtocol = groupProtocol;
802
- this.unknownFields = new Uint8Array(0);
1109
+ this.unknownFields = EMPTY_BYTES;
803
1110
  }
804
1111
  static encode(msg) {
805
1112
  const out = [];
806
1113
  putStringField(out, 1, msg.groupId);
807
- if (msg.topics) for (const v of msg.topics) putBytesField(out, 2, new TextEncoder().encode(v));
1114
+ if (msg.topics) for (const v of msg.topics) putBytesField(out, 2, textEncoder.encode(v));
808
1115
  putStringField(out, 3, msg.groupInstanceId);
809
1116
  putVarintField(out, 4, BigInt(msg.sessionTimeoutMs));
810
1117
  putVarintField(out, 5, BigInt(msg.maxPollRecords));
@@ -816,24 +1123,44 @@ export class GroupSubscribeRequest {
816
1123
  }
817
1124
  static decode(bytes) {
818
1125
  const msg = new GroupSubscribeRequest();
1126
+ GroupSubscribeRequest._fill(msg, bytes);
1127
+ return msg;
1128
+ }
1129
+ static decodeInto(msg, bytes) {
1130
+ msg._reset();
1131
+ GroupSubscribeRequest._fill(msg, bytes);
1132
+ return msg;
1133
+ }
1134
+ static _fill(msg, bytes) {
819
1135
  const reader = new Reader(bytes);
820
1136
  let f;
821
1137
  while ((f = reader.field()) !== null) {
822
1138
  const [num, wire, value, raw] = f;
823
1139
  switch (num) {
824
- case 1: msg.groupId = new TextDecoder().decode(value); break;
825
- case 2: msg.topics.push(new TextDecoder().decode(value)); break;
826
- case 3: msg.groupInstanceId = new TextDecoder().decode(value); break;
1140
+ case 1: msg.groupId = textDecoder.decode(value); break;
1141
+ case 2: msg.topics.push(textDecoder.decode(value)); break;
1142
+ case 3: msg.groupInstanceId = textDecoder.decode(value); break;
827
1143
  case 4: msg.sessionTimeoutMs = Number(BigInt.asIntN(32, value)); break;
828
1144
  case 5: msg.maxPollRecords = Number(BigInt.asIntN(32, value)); break;
829
- case 6: msg.autoOffsetReset = new TextDecoder().decode(value); break;
1145
+ case 6: msg.autoOffsetReset = textDecoder.decode(value); break;
830
1146
  case 7: msg.readCommitted = value !== 0n; break;
831
- case 8: msg.groupProtocol = new TextDecoder().decode(value); break;
1147
+ case 8: msg.groupProtocol = textDecoder.decode(value); break;
832
1148
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
833
1149
  }
834
1150
  }
835
1151
  return msg;
836
1152
  }
1153
+ _reset() {
1154
+ this.groupId = "";
1155
+ this.topics = [];
1156
+ this.groupInstanceId = "";
1157
+ this.sessionTimeoutMs = 0;
1158
+ this.maxPollRecords = 0;
1159
+ this.autoOffsetReset = "";
1160
+ this.readCommitted = false;
1161
+ this.groupProtocol = "";
1162
+ this.unknownFields = EMPTY_BYTES;
1163
+ }
837
1164
  }
838
1165
 
839
1166
  export class GroupSubscribeResponse {
@@ -841,7 +1168,7 @@ export class GroupSubscribeResponse {
841
1168
  this.assignment = assignment;
842
1169
  this.batch = batch;
843
1170
  this.groupError = groupError;
844
- this.unknownFields = new Uint8Array(0);
1171
+ this.unknownFields = EMPTY_BYTES;
845
1172
  }
846
1173
  static encode(msg) {
847
1174
  const out = [];
@@ -857,6 +1184,15 @@ export class GroupSubscribeResponse {
857
1184
  }
858
1185
  static decode(bytes) {
859
1186
  const msg = new GroupSubscribeResponse();
1187
+ GroupSubscribeResponse._fill(msg, bytes);
1188
+ return msg;
1189
+ }
1190
+ static decodeInto(msg, bytes) {
1191
+ msg._reset();
1192
+ GroupSubscribeResponse._fill(msg, bytes);
1193
+ return msg;
1194
+ }
1195
+ static _fill(msg, bytes) {
860
1196
  const reader = new Reader(bytes);
861
1197
  let f;
862
1198
  while ((f = reader.field()) !== null) {
@@ -870,6 +1206,12 @@ export class GroupSubscribeResponse {
870
1206
  }
871
1207
  return msg;
872
1208
  }
1209
+ _reset() {
1210
+ this.assignment = undefined;
1211
+ this.batch = undefined;
1212
+ this.groupError = undefined;
1213
+ this.unknownFields = EMPTY_BYTES;
1214
+ }
873
1215
  }
874
1216
 
875
1217
  export class Assignment {
@@ -877,7 +1219,7 @@ export class Assignment {
877
1219
  this.generationId = generationId;
878
1220
  this.memberId = memberId;
879
1221
  this.partitions = partitions;
880
- this.unknownFields = new Uint8Array(0);
1222
+ this.unknownFields = EMPTY_BYTES;
881
1223
  }
882
1224
  static encode(msg) {
883
1225
  const out = [];
@@ -889,19 +1231,34 @@ export class Assignment {
889
1231
  }
890
1232
  static decode(bytes) {
891
1233
  const msg = new Assignment();
1234
+ Assignment._fill(msg, bytes);
1235
+ return msg;
1236
+ }
1237
+ static decodeInto(msg, bytes) {
1238
+ msg._reset();
1239
+ Assignment._fill(msg, bytes);
1240
+ return msg;
1241
+ }
1242
+ static _fill(msg, bytes) {
892
1243
  const reader = new Reader(bytes);
893
1244
  let f;
894
1245
  while ((f = reader.field()) !== null) {
895
1246
  const [num, wire, value, raw] = f;
896
1247
  switch (num) {
897
1248
  case 1: msg.generationId = Number(BigInt.asIntN(32, value)); break;
898
- case 2: msg.memberId = new TextDecoder().decode(value); break;
1249
+ case 2: msg.memberId = textDecoder.decode(value); break;
899
1250
  case 3: msg.partitions.push(TopicPartition.decode(value)); break;
900
1251
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
901
1252
  }
902
1253
  }
903
1254
  return msg;
904
1255
  }
1256
+ _reset() {
1257
+ this.generationId = 0;
1258
+ this.memberId = "";
1259
+ this.partitions = [];
1260
+ this.unknownFields = EMPTY_BYTES;
1261
+ }
905
1262
  }
906
1263
 
907
1264
  export class RecordBatch {
@@ -910,7 +1267,7 @@ export class RecordBatch {
910
1267
  this.partition = partition;
911
1268
  this.highWatermark = highWatermark;
912
1269
  this.records = records;
913
- this.unknownFields = new Uint8Array(0);
1270
+ this.unknownFields = EMPTY_BYTES;
914
1271
  }
915
1272
  static encode(msg) {
916
1273
  const out = [];
@@ -923,12 +1280,21 @@ export class RecordBatch {
923
1280
  }
924
1281
  static decode(bytes) {
925
1282
  const msg = new RecordBatch();
1283
+ RecordBatch._fill(msg, bytes);
1284
+ return msg;
1285
+ }
1286
+ static decodeInto(msg, bytes) {
1287
+ msg._reset();
1288
+ RecordBatch._fill(msg, bytes);
1289
+ return msg;
1290
+ }
1291
+ static _fill(msg, bytes) {
926
1292
  const reader = new Reader(bytes);
927
1293
  let f;
928
1294
  while ((f = reader.field()) !== null) {
929
1295
  const [num, wire, value, raw] = f;
930
1296
  switch (num) {
931
- case 1: msg.topic = new TextDecoder().decode(value); break;
1297
+ case 1: msg.topic = textDecoder.decode(value); break;
932
1298
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
933
1299
  case 3: msg.highWatermark = BigInt.asIntN(64, value); break;
934
1300
  case 4: msg.records.push(FetchedRecord.decode(value)); break;
@@ -937,13 +1303,20 @@ export class RecordBatch {
937
1303
  }
938
1304
  return msg;
939
1305
  }
1306
+ _reset() {
1307
+ this.topic = "";
1308
+ this.partition = 0;
1309
+ this.highWatermark = 0n;
1310
+ this.records = [];
1311
+ this.unknownFields = EMPTY_BYTES;
1312
+ }
940
1313
  }
941
1314
 
942
1315
  export class GroupError {
943
1316
  constructor({ errorCode = 0, message = "" } = {}) {
944
1317
  this.errorCode = errorCode;
945
1318
  this.message = message;
946
- this.unknownFields = new Uint8Array(0);
1319
+ this.unknownFields = EMPTY_BYTES;
947
1320
  }
948
1321
  static encode(msg) {
949
1322
  const out = [];
@@ -954,18 +1327,32 @@ export class GroupError {
954
1327
  }
955
1328
  static decode(bytes) {
956
1329
  const msg = new GroupError();
1330
+ GroupError._fill(msg, bytes);
1331
+ return msg;
1332
+ }
1333
+ static decodeInto(msg, bytes) {
1334
+ msg._reset();
1335
+ GroupError._fill(msg, bytes);
1336
+ return msg;
1337
+ }
1338
+ static _fill(msg, bytes) {
957
1339
  const reader = new Reader(bytes);
958
1340
  let f;
959
1341
  while ((f = reader.field()) !== null) {
960
1342
  const [num, wire, value, raw] = f;
961
1343
  switch (num) {
962
1344
  case 1: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
963
- case 2: msg.message = new TextDecoder().decode(value); break;
1345
+ case 2: msg.message = textDecoder.decode(value); break;
964
1346
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
965
1347
  }
966
1348
  }
967
1349
  return msg;
968
1350
  }
1351
+ _reset() {
1352
+ this.errorCode = 0;
1353
+ this.message = "";
1354
+ this.unknownFields = EMPTY_BYTES;
1355
+ }
969
1356
  }
970
1357
 
971
1358
  export class ListOffsetsRequest {
@@ -974,7 +1361,7 @@ export class ListOffsetsRequest {
974
1361
  this.partition = partition;
975
1362
  this.timestamp = timestamp;
976
1363
  this.readCommitted = readCommitted;
977
- this.unknownFields = new Uint8Array(0);
1364
+ this.unknownFields = EMPTY_BYTES;
978
1365
  }
979
1366
  static encode(msg) {
980
1367
  const out = [];
@@ -987,12 +1374,21 @@ export class ListOffsetsRequest {
987
1374
  }
988
1375
  static decode(bytes) {
989
1376
  const msg = new ListOffsetsRequest();
1377
+ ListOffsetsRequest._fill(msg, bytes);
1378
+ return msg;
1379
+ }
1380
+ static decodeInto(msg, bytes) {
1381
+ msg._reset();
1382
+ ListOffsetsRequest._fill(msg, bytes);
1383
+ return msg;
1384
+ }
1385
+ static _fill(msg, bytes) {
990
1386
  const reader = new Reader(bytes);
991
1387
  let f;
992
1388
  while ((f = reader.field()) !== null) {
993
1389
  const [num, wire, value, raw] = f;
994
1390
  switch (num) {
995
- case 1: msg.topic = new TextDecoder().decode(value); break;
1391
+ case 1: msg.topic = textDecoder.decode(value); break;
996
1392
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
997
1393
  case 3: msg.timestamp = BigInt.asIntN(64, value); break;
998
1394
  case 4: msg.readCommitted = value !== 0n; break;
@@ -1001,6 +1397,13 @@ export class ListOffsetsRequest {
1001
1397
  }
1002
1398
  return msg;
1003
1399
  }
1400
+ _reset() {
1401
+ this.topic = "";
1402
+ this.partition = 0;
1403
+ this.timestamp = 0n;
1404
+ this.readCommitted = false;
1405
+ this.unknownFields = EMPTY_BYTES;
1406
+ }
1004
1407
  }
1005
1408
 
1006
1409
  export class ListOffsetsResponse {
@@ -1008,7 +1411,7 @@ export class ListOffsetsResponse {
1008
1411
  this.offset = offset;
1009
1412
  this.timestampMs = timestampMs;
1010
1413
  this.errorCode = errorCode;
1011
- this.unknownFields = new Uint8Array(0);
1414
+ this.unknownFields = EMPTY_BYTES;
1012
1415
  }
1013
1416
  static encode(msg) {
1014
1417
  const out = [];
@@ -1020,6 +1423,15 @@ export class ListOffsetsResponse {
1020
1423
  }
1021
1424
  static decode(bytes) {
1022
1425
  const msg = new ListOffsetsResponse();
1426
+ ListOffsetsResponse._fill(msg, bytes);
1427
+ return msg;
1428
+ }
1429
+ static decodeInto(msg, bytes) {
1430
+ msg._reset();
1431
+ ListOffsetsResponse._fill(msg, bytes);
1432
+ return msg;
1433
+ }
1434
+ static _fill(msg, bytes) {
1023
1435
  const reader = new Reader(bytes);
1024
1436
  let f;
1025
1437
  while ((f = reader.field()) !== null) {
@@ -1033,6 +1445,12 @@ export class ListOffsetsResponse {
1033
1445
  }
1034
1446
  return msg;
1035
1447
  }
1448
+ _reset() {
1449
+ this.offset = 0n;
1450
+ this.timestampMs = 0n;
1451
+ this.errorCode = 0;
1452
+ this.unknownFields = EMPTY_BYTES;
1453
+ }
1036
1454
  }
1037
1455
 
1038
1456
  export class CommitOffsetRequest {
@@ -1043,7 +1461,7 @@ export class CommitOffsetRequest {
1043
1461
  this.committedOffset = committedOffset;
1044
1462
  this.metadata = metadata;
1045
1463
  this.sessionId = sessionId;
1046
- this.unknownFields = new Uint8Array(0);
1464
+ this.unknownFields = EMPTY_BYTES;
1047
1465
  }
1048
1466
  static encode(msg) {
1049
1467
  const out = [];
@@ -1058,28 +1476,46 @@ export class CommitOffsetRequest {
1058
1476
  }
1059
1477
  static decode(bytes) {
1060
1478
  const msg = new CommitOffsetRequest();
1479
+ CommitOffsetRequest._fill(msg, bytes);
1480
+ return msg;
1481
+ }
1482
+ static decodeInto(msg, bytes) {
1483
+ msg._reset();
1484
+ CommitOffsetRequest._fill(msg, bytes);
1485
+ return msg;
1486
+ }
1487
+ static _fill(msg, bytes) {
1061
1488
  const reader = new Reader(bytes);
1062
1489
  let f;
1063
1490
  while ((f = reader.field()) !== null) {
1064
1491
  const [num, wire, value, raw] = f;
1065
1492
  switch (num) {
1066
- case 1: msg.groupId = new TextDecoder().decode(value); break;
1067
- case 2: msg.topic = new TextDecoder().decode(value); break;
1493
+ case 1: msg.groupId = textDecoder.decode(value); break;
1494
+ case 2: msg.topic = textDecoder.decode(value); break;
1068
1495
  case 3: msg.partition = Number(BigInt.asIntN(32, value)); break;
1069
1496
  case 4: msg.committedOffset = BigInt.asIntN(64, value); break;
1070
- case 5: msg.metadata = new TextDecoder().decode(value); break;
1071
- case 6: msg.sessionId = new TextDecoder().decode(value); break;
1497
+ case 5: msg.metadata = textDecoder.decode(value); break;
1498
+ case 6: msg.sessionId = textDecoder.decode(value); break;
1072
1499
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1073
1500
  }
1074
1501
  }
1075
1502
  return msg;
1076
1503
  }
1504
+ _reset() {
1505
+ this.groupId = "";
1506
+ this.topic = "";
1507
+ this.partition = 0;
1508
+ this.committedOffset = 0n;
1509
+ this.metadata = "";
1510
+ this.sessionId = "";
1511
+ this.unknownFields = EMPTY_BYTES;
1512
+ }
1077
1513
  }
1078
1514
 
1079
1515
  export class CommitOffsetResponse {
1080
1516
  constructor({ errorCode = 0 } = {}) {
1081
1517
  this.errorCode = errorCode;
1082
- this.unknownFields = new Uint8Array(0);
1518
+ this.unknownFields = EMPTY_BYTES;
1083
1519
  }
1084
1520
  static encode(msg) {
1085
1521
  const out = [];
@@ -1089,6 +1525,15 @@ export class CommitOffsetResponse {
1089
1525
  }
1090
1526
  static decode(bytes) {
1091
1527
  const msg = new CommitOffsetResponse();
1528
+ CommitOffsetResponse._fill(msg, bytes);
1529
+ return msg;
1530
+ }
1531
+ static decodeInto(msg, bytes) {
1532
+ msg._reset();
1533
+ CommitOffsetResponse._fill(msg, bytes);
1534
+ return msg;
1535
+ }
1536
+ static _fill(msg, bytes) {
1092
1537
  const reader = new Reader(bytes);
1093
1538
  let f;
1094
1539
  while ((f = reader.field()) !== null) {
@@ -1100,6 +1545,10 @@ export class CommitOffsetResponse {
1100
1545
  }
1101
1546
  return msg;
1102
1547
  }
1548
+ _reset() {
1549
+ this.errorCode = 0;
1550
+ this.unknownFields = EMPTY_BYTES;
1551
+ }
1103
1552
  }
1104
1553
 
1105
1554
  export class FetchOffsetRequest {
@@ -1107,7 +1556,7 @@ export class FetchOffsetRequest {
1107
1556
  this.groupId = groupId;
1108
1557
  this.topic = topic;
1109
1558
  this.partition = partition;
1110
- this.unknownFields = new Uint8Array(0);
1559
+ this.unknownFields = EMPTY_BYTES;
1111
1560
  }
1112
1561
  static encode(msg) {
1113
1562
  const out = [];
@@ -1119,19 +1568,34 @@ export class FetchOffsetRequest {
1119
1568
  }
1120
1569
  static decode(bytes) {
1121
1570
  const msg = new FetchOffsetRequest();
1571
+ FetchOffsetRequest._fill(msg, bytes);
1572
+ return msg;
1573
+ }
1574
+ static decodeInto(msg, bytes) {
1575
+ msg._reset();
1576
+ FetchOffsetRequest._fill(msg, bytes);
1577
+ return msg;
1578
+ }
1579
+ static _fill(msg, bytes) {
1122
1580
  const reader = new Reader(bytes);
1123
1581
  let f;
1124
1582
  while ((f = reader.field()) !== null) {
1125
1583
  const [num, wire, value, raw] = f;
1126
1584
  switch (num) {
1127
- case 1: msg.groupId = new TextDecoder().decode(value); break;
1128
- case 2: msg.topic = new TextDecoder().decode(value); break;
1585
+ case 1: msg.groupId = textDecoder.decode(value); break;
1586
+ case 2: msg.topic = textDecoder.decode(value); break;
1129
1587
  case 3: msg.partition = Number(BigInt.asIntN(32, value)); break;
1130
1588
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1131
1589
  }
1132
1590
  }
1133
1591
  return msg;
1134
1592
  }
1593
+ _reset() {
1594
+ this.groupId = "";
1595
+ this.topic = "";
1596
+ this.partition = 0;
1597
+ this.unknownFields = EMPTY_BYTES;
1598
+ }
1135
1599
  }
1136
1600
 
1137
1601
  export class FetchOffsetResponse {
@@ -1139,7 +1603,7 @@ export class FetchOffsetResponse {
1139
1603
  this.committedOffset = committedOffset;
1140
1604
  this.metadata = metadata;
1141
1605
  this.errorCode = errorCode;
1142
- this.unknownFields = new Uint8Array(0);
1606
+ this.unknownFields = EMPTY_BYTES;
1143
1607
  }
1144
1608
  static encode(msg) {
1145
1609
  const out = [];
@@ -1151,19 +1615,34 @@ export class FetchOffsetResponse {
1151
1615
  }
1152
1616
  static decode(bytes) {
1153
1617
  const msg = new FetchOffsetResponse();
1618
+ FetchOffsetResponse._fill(msg, bytes);
1619
+ return msg;
1620
+ }
1621
+ static decodeInto(msg, bytes) {
1622
+ msg._reset();
1623
+ FetchOffsetResponse._fill(msg, bytes);
1624
+ return msg;
1625
+ }
1626
+ static _fill(msg, bytes) {
1154
1627
  const reader = new Reader(bytes);
1155
1628
  let f;
1156
1629
  while ((f = reader.field()) !== null) {
1157
1630
  const [num, wire, value, raw] = f;
1158
1631
  switch (num) {
1159
1632
  case 1: msg.committedOffset = BigInt.asIntN(64, value); break;
1160
- case 2: msg.metadata = new TextDecoder().decode(value); break;
1633
+ case 2: msg.metadata = textDecoder.decode(value); break;
1161
1634
  case 3: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
1162
1635
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1163
1636
  }
1164
1637
  }
1165
1638
  return msg;
1166
1639
  }
1640
+ _reset() {
1641
+ this.committedOffset = 0n;
1642
+ this.metadata = "";
1643
+ this.errorCode = 0;
1644
+ this.unknownFields = EMPTY_BYTES;
1645
+ }
1167
1646
  }
1168
1647
 
1169
1648
  export class NewTopic {
@@ -1171,7 +1650,7 @@ export class NewTopic {
1171
1650
  this.name = name;
1172
1651
  this.numPartitions = numPartitions;
1173
1652
  this.replicationFactor = replicationFactor;
1174
- this.unknownFields = new Uint8Array(0);
1653
+ this.unknownFields = EMPTY_BYTES;
1175
1654
  }
1176
1655
  static encode(msg) {
1177
1656
  const out = [];
@@ -1183,12 +1662,21 @@ export class NewTopic {
1183
1662
  }
1184
1663
  static decode(bytes) {
1185
1664
  const msg = new NewTopic();
1665
+ NewTopic._fill(msg, bytes);
1666
+ return msg;
1667
+ }
1668
+ static decodeInto(msg, bytes) {
1669
+ msg._reset();
1670
+ NewTopic._fill(msg, bytes);
1671
+ return msg;
1672
+ }
1673
+ static _fill(msg, bytes) {
1186
1674
  const reader = new Reader(bytes);
1187
1675
  let f;
1188
1676
  while ((f = reader.field()) !== null) {
1189
1677
  const [num, wire, value, raw] = f;
1190
1678
  switch (num) {
1191
- case 1: msg.name = new TextDecoder().decode(value); break;
1679
+ case 1: msg.name = textDecoder.decode(value); break;
1192
1680
  case 2: msg.numPartitions = Number(BigInt.asIntN(32, value)); break;
1193
1681
  case 3: msg.replicationFactor = Number(BigInt.asIntN(32, value)); break;
1194
1682
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -1196,6 +1684,12 @@ export class NewTopic {
1196
1684
  }
1197
1685
  return msg;
1198
1686
  }
1687
+ _reset() {
1688
+ this.name = "";
1689
+ this.numPartitions = 0;
1690
+ this.replicationFactor = 0;
1691
+ this.unknownFields = EMPTY_BYTES;
1692
+ }
1199
1693
  }
1200
1694
 
1201
1695
  export class CreateTopicsRequest {
@@ -1203,7 +1697,7 @@ export class CreateTopicsRequest {
1203
1697
  this.topics = topics;
1204
1698
  this.timeoutMs = timeoutMs;
1205
1699
  this.validateOnly = validateOnly;
1206
- this.unknownFields = new Uint8Array(0);
1700
+ this.unknownFields = EMPTY_BYTES;
1207
1701
  }
1208
1702
  static encode(msg) {
1209
1703
  const out = [];
@@ -1215,6 +1709,15 @@ export class CreateTopicsRequest {
1215
1709
  }
1216
1710
  static decode(bytes) {
1217
1711
  const msg = new CreateTopicsRequest();
1712
+ CreateTopicsRequest._fill(msg, bytes);
1713
+ return msg;
1714
+ }
1715
+ static decodeInto(msg, bytes) {
1716
+ msg._reset();
1717
+ CreateTopicsRequest._fill(msg, bytes);
1718
+ return msg;
1719
+ }
1720
+ static _fill(msg, bytes) {
1218
1721
  const reader = new Reader(bytes);
1219
1722
  let f;
1220
1723
  while ((f = reader.field()) !== null) {
@@ -1228,13 +1731,19 @@ export class CreateTopicsRequest {
1228
1731
  }
1229
1732
  return msg;
1230
1733
  }
1734
+ _reset() {
1735
+ this.topics = [];
1736
+ this.timeoutMs = 0;
1737
+ this.validateOnly = false;
1738
+ this.unknownFields = EMPTY_BYTES;
1739
+ }
1231
1740
  }
1232
1741
 
1233
1742
  export class TopicError {
1234
1743
  constructor({ name = "", errorCode = 0 } = {}) {
1235
1744
  this.name = name;
1236
1745
  this.errorCode = errorCode;
1237
- this.unknownFields = new Uint8Array(0);
1746
+ this.unknownFields = EMPTY_BYTES;
1238
1747
  }
1239
1748
  static encode(msg) {
1240
1749
  const out = [];
@@ -1245,24 +1754,38 @@ export class TopicError {
1245
1754
  }
1246
1755
  static decode(bytes) {
1247
1756
  const msg = new TopicError();
1757
+ TopicError._fill(msg, bytes);
1758
+ return msg;
1759
+ }
1760
+ static decodeInto(msg, bytes) {
1761
+ msg._reset();
1762
+ TopicError._fill(msg, bytes);
1763
+ return msg;
1764
+ }
1765
+ static _fill(msg, bytes) {
1248
1766
  const reader = new Reader(bytes);
1249
1767
  let f;
1250
1768
  while ((f = reader.field()) !== null) {
1251
1769
  const [num, wire, value, raw] = f;
1252
1770
  switch (num) {
1253
- case 1: msg.name = new TextDecoder().decode(value); break;
1771
+ case 1: msg.name = textDecoder.decode(value); break;
1254
1772
  case 2: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
1255
1773
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1256
1774
  }
1257
1775
  }
1258
1776
  return msg;
1259
1777
  }
1778
+ _reset() {
1779
+ this.name = "";
1780
+ this.errorCode = 0;
1781
+ this.unknownFields = EMPTY_BYTES;
1782
+ }
1260
1783
  }
1261
1784
 
1262
1785
  export class CreateTopicsResponse {
1263
1786
  constructor({ results = [] } = {}) {
1264
1787
  this.results = results;
1265
- this.unknownFields = new Uint8Array(0);
1788
+ this.unknownFields = EMPTY_BYTES;
1266
1789
  }
1267
1790
  static encode(msg) {
1268
1791
  const out = [];
@@ -1272,6 +1795,15 @@ export class CreateTopicsResponse {
1272
1795
  }
1273
1796
  static decode(bytes) {
1274
1797
  const msg = new CreateTopicsResponse();
1798
+ CreateTopicsResponse._fill(msg, bytes);
1799
+ return msg;
1800
+ }
1801
+ static decodeInto(msg, bytes) {
1802
+ msg._reset();
1803
+ CreateTopicsResponse._fill(msg, bytes);
1804
+ return msg;
1805
+ }
1806
+ static _fill(msg, bytes) {
1275
1807
  const reader = new Reader(bytes);
1276
1808
  let f;
1277
1809
  while ((f = reader.field()) !== null) {
@@ -1283,41 +1815,59 @@ export class CreateTopicsResponse {
1283
1815
  }
1284
1816
  return msg;
1285
1817
  }
1818
+ _reset() {
1819
+ this.results = [];
1820
+ this.unknownFields = EMPTY_BYTES;
1821
+ }
1286
1822
  }
1287
1823
 
1288
1824
  export class DeleteTopicsRequest {
1289
1825
  constructor({ topics = [], timeoutMs = 0 } = {}) {
1290
1826
  this.topics = topics;
1291
1827
  this.timeoutMs = timeoutMs;
1292
- this.unknownFields = new Uint8Array(0);
1828
+ this.unknownFields = EMPTY_BYTES;
1293
1829
  }
1294
1830
  static encode(msg) {
1295
1831
  const out = [];
1296
- if (msg.topics) for (const v of msg.topics) putBytesField(out, 1, new TextEncoder().encode(v));
1832
+ if (msg.topics) for (const v of msg.topics) putBytesField(out, 1, textEncoder.encode(v));
1297
1833
  putVarintField(out, 2, BigInt(msg.timeoutMs));
1298
1834
  putRaw(out, msg.unknownFields);
1299
1835
  return new Uint8Array(out);
1300
1836
  }
1301
1837
  static decode(bytes) {
1302
1838
  const msg = new DeleteTopicsRequest();
1839
+ DeleteTopicsRequest._fill(msg, bytes);
1840
+ return msg;
1841
+ }
1842
+ static decodeInto(msg, bytes) {
1843
+ msg._reset();
1844
+ DeleteTopicsRequest._fill(msg, bytes);
1845
+ return msg;
1846
+ }
1847
+ static _fill(msg, bytes) {
1303
1848
  const reader = new Reader(bytes);
1304
1849
  let f;
1305
1850
  while ((f = reader.field()) !== null) {
1306
1851
  const [num, wire, value, raw] = f;
1307
1852
  switch (num) {
1308
- case 1: msg.topics.push(new TextDecoder().decode(value)); break;
1853
+ case 1: msg.topics.push(textDecoder.decode(value)); break;
1309
1854
  case 2: msg.timeoutMs = Number(BigInt.asIntN(32, value)); break;
1310
1855
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1311
1856
  }
1312
1857
  }
1313
1858
  return msg;
1314
1859
  }
1860
+ _reset() {
1861
+ this.topics = [];
1862
+ this.timeoutMs = 0;
1863
+ this.unknownFields = EMPTY_BYTES;
1864
+ }
1315
1865
  }
1316
1866
 
1317
1867
  export class DeleteTopicsResponse {
1318
1868
  constructor({ results = [] } = {}) {
1319
1869
  this.results = results;
1320
- this.unknownFields = new Uint8Array(0);
1870
+ this.unknownFields = EMPTY_BYTES;
1321
1871
  }
1322
1872
  static encode(msg) {
1323
1873
  const out = [];
@@ -1327,6 +1877,15 @@ export class DeleteTopicsResponse {
1327
1877
  }
1328
1878
  static decode(bytes) {
1329
1879
  const msg = new DeleteTopicsResponse();
1880
+ DeleteTopicsResponse._fill(msg, bytes);
1881
+ return msg;
1882
+ }
1883
+ static decodeInto(msg, bytes) {
1884
+ msg._reset();
1885
+ DeleteTopicsResponse._fill(msg, bytes);
1886
+ return msg;
1887
+ }
1888
+ static _fill(msg, bytes) {
1330
1889
  const reader = new Reader(bytes);
1331
1890
  let f;
1332
1891
  while ((f = reader.field()) !== null) {
@@ -1338,13 +1897,17 @@ export class DeleteTopicsResponse {
1338
1897
  }
1339
1898
  return msg;
1340
1899
  }
1900
+ _reset() {
1901
+ this.results = [];
1902
+ this.unknownFields = EMPTY_BYTES;
1903
+ }
1341
1904
  }
1342
1905
 
1343
1906
  export class ConfigEntry {
1344
1907
  constructor({ name = "", value = "" } = {}) {
1345
1908
  this.name = name;
1346
1909
  this.value = value;
1347
- this.unknownFields = new Uint8Array(0);
1910
+ this.unknownFields = EMPTY_BYTES;
1348
1911
  }
1349
1912
  static encode(msg) {
1350
1913
  const out = [];
@@ -1355,18 +1918,32 @@ export class ConfigEntry {
1355
1918
  }
1356
1919
  static decode(bytes) {
1357
1920
  const msg = new ConfigEntry();
1921
+ ConfigEntry._fill(msg, bytes);
1922
+ return msg;
1923
+ }
1924
+ static decodeInto(msg, bytes) {
1925
+ msg._reset();
1926
+ ConfigEntry._fill(msg, bytes);
1927
+ return msg;
1928
+ }
1929
+ static _fill(msg, bytes) {
1358
1930
  const reader = new Reader(bytes);
1359
1931
  let f;
1360
1932
  while ((f = reader.field()) !== null) {
1361
1933
  const [num, wire, value, raw] = f;
1362
1934
  switch (num) {
1363
- case 1: msg.name = new TextDecoder().decode(value); break;
1364
- case 2: msg.value = new TextDecoder().decode(value); break;
1935
+ case 1: msg.name = textDecoder.decode(value); break;
1936
+ case 2: msg.value = textDecoder.decode(value); break;
1365
1937
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1366
1938
  }
1367
1939
  }
1368
1940
  return msg;
1369
1941
  }
1942
+ _reset() {
1943
+ this.name = "";
1944
+ this.value = "";
1945
+ this.unknownFields = EMPTY_BYTES;
1946
+ }
1370
1947
  }
1371
1948
 
1372
1949
  export class AlterConfigEntry {
@@ -1374,7 +1951,7 @@ export class AlterConfigEntry {
1374
1951
  this.name = name;
1375
1952
  this.value = value;
1376
1953
  this.op = op;
1377
- this.unknownFields = new Uint8Array(0);
1954
+ this.unknownFields = EMPTY_BYTES;
1378
1955
  }
1379
1956
  static encode(msg) {
1380
1957
  const out = [];
@@ -1386,19 +1963,34 @@ export class AlterConfigEntry {
1386
1963
  }
1387
1964
  static decode(bytes) {
1388
1965
  const msg = new AlterConfigEntry();
1966
+ AlterConfigEntry._fill(msg, bytes);
1967
+ return msg;
1968
+ }
1969
+ static decodeInto(msg, bytes) {
1970
+ msg._reset();
1971
+ AlterConfigEntry._fill(msg, bytes);
1972
+ return msg;
1973
+ }
1974
+ static _fill(msg, bytes) {
1389
1975
  const reader = new Reader(bytes);
1390
1976
  let f;
1391
1977
  while ((f = reader.field()) !== null) {
1392
1978
  const [num, wire, value, raw] = f;
1393
1979
  switch (num) {
1394
- case 1: msg.name = new TextDecoder().decode(value); break;
1395
- case 2: msg.value = new TextDecoder().decode(value); break;
1980
+ case 1: msg.name = textDecoder.decode(value); break;
1981
+ case 2: msg.value = textDecoder.decode(value); break;
1396
1982
  case 3: msg.op = Number(BigInt.asIntN(32, value)); break;
1397
1983
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1398
1984
  }
1399
1985
  }
1400
1986
  return msg;
1401
1987
  }
1988
+ _reset() {
1989
+ this.name = "";
1990
+ this.value = "";
1991
+ this.op = 0;
1992
+ this.unknownFields = EMPTY_BYTES;
1993
+ }
1402
1994
  }
1403
1995
 
1404
1996
  export class DescribeConfigsRequest {
@@ -1407,33 +1999,49 @@ export class DescribeConfigsRequest {
1407
1999
  this.resourceName = resourceName;
1408
2000
  this.configKeys = configKeys;
1409
2001
  this.includeSynonyms = includeSynonyms;
1410
- this.unknownFields = new Uint8Array(0);
2002
+ this.unknownFields = EMPTY_BYTES;
1411
2003
  }
1412
2004
  static encode(msg) {
1413
2005
  const out = [];
1414
2006
  putVarintField(out, 1, BigInt(msg.resourceType));
1415
2007
  putStringField(out, 2, msg.resourceName);
1416
- if (msg.configKeys) for (const v of msg.configKeys) putBytesField(out, 3, new TextEncoder().encode(v));
2008
+ if (msg.configKeys) for (const v of msg.configKeys) putBytesField(out, 3, textEncoder.encode(v));
1417
2009
  putVarintField(out, 4, (msg.includeSynonyms ? 1n : 0n));
1418
2010
  putRaw(out, msg.unknownFields);
1419
2011
  return new Uint8Array(out);
1420
2012
  }
1421
2013
  static decode(bytes) {
1422
2014
  const msg = new DescribeConfigsRequest();
2015
+ DescribeConfigsRequest._fill(msg, bytes);
2016
+ return msg;
2017
+ }
2018
+ static decodeInto(msg, bytes) {
2019
+ msg._reset();
2020
+ DescribeConfigsRequest._fill(msg, bytes);
2021
+ return msg;
2022
+ }
2023
+ static _fill(msg, bytes) {
1423
2024
  const reader = new Reader(bytes);
1424
2025
  let f;
1425
2026
  while ((f = reader.field()) !== null) {
1426
2027
  const [num, wire, value, raw] = f;
1427
2028
  switch (num) {
1428
2029
  case 1: msg.resourceType = Number(BigInt.asIntN(32, value)); break;
1429
- case 2: msg.resourceName = new TextDecoder().decode(value); break;
1430
- case 3: msg.configKeys.push(new TextDecoder().decode(value)); break;
2030
+ case 2: msg.resourceName = textDecoder.decode(value); break;
2031
+ case 3: msg.configKeys.push(textDecoder.decode(value)); break;
1431
2032
  case 4: msg.includeSynonyms = value !== 0n; break;
1432
2033
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1433
2034
  }
1434
2035
  }
1435
2036
  return msg;
1436
2037
  }
2038
+ _reset() {
2039
+ this.resourceType = 0;
2040
+ this.resourceName = "";
2041
+ this.configKeys = [];
2042
+ this.includeSynonyms = false;
2043
+ this.unknownFields = EMPTY_BYTES;
2044
+ }
1437
2045
  }
1438
2046
 
1439
2047
  export class ConfigValue {
@@ -1443,7 +2051,7 @@ export class ConfigValue {
1443
2051
  this.readOnly = readOnly;
1444
2052
  this.source = source;
1445
2053
  this.isSensitive = isSensitive;
1446
- this.unknownFields = new Uint8Array(0);
2054
+ this.unknownFields = EMPTY_BYTES;
1447
2055
  }
1448
2056
  static encode(msg) {
1449
2057
  const out = [];
@@ -1457,13 +2065,22 @@ export class ConfigValue {
1457
2065
  }
1458
2066
  static decode(bytes) {
1459
2067
  const msg = new ConfigValue();
2068
+ ConfigValue._fill(msg, bytes);
2069
+ return msg;
2070
+ }
2071
+ static decodeInto(msg, bytes) {
2072
+ msg._reset();
2073
+ ConfigValue._fill(msg, bytes);
2074
+ return msg;
2075
+ }
2076
+ static _fill(msg, bytes) {
1460
2077
  const reader = new Reader(bytes);
1461
2078
  let f;
1462
2079
  while ((f = reader.field()) !== null) {
1463
2080
  const [num, wire, value, raw] = f;
1464
2081
  switch (num) {
1465
- case 1: msg.name = new TextDecoder().decode(value); break;
1466
- case 2: msg.value = new TextDecoder().decode(value); break;
2082
+ case 1: msg.name = textDecoder.decode(value); break;
2083
+ case 2: msg.value = textDecoder.decode(value); break;
1467
2084
  case 3: msg.readOnly = value !== 0n; break;
1468
2085
  case 4: msg.source = Number(BigInt.asIntN(32, value)); break;
1469
2086
  case 5: msg.isSensitive = value !== 0n; break;
@@ -1472,13 +2089,21 @@ export class ConfigValue {
1472
2089
  }
1473
2090
  return msg;
1474
2091
  }
2092
+ _reset() {
2093
+ this.name = "";
2094
+ this.value = "";
2095
+ this.readOnly = false;
2096
+ this.source = 0;
2097
+ this.isSensitive = false;
2098
+ this.unknownFields = EMPTY_BYTES;
2099
+ }
1475
2100
  }
1476
2101
 
1477
2102
  export class DescribeConfigsResponse {
1478
2103
  constructor({ errorCode = 0, values = [] } = {}) {
1479
2104
  this.errorCode = errorCode;
1480
2105
  this.values = values;
1481
- this.unknownFields = new Uint8Array(0);
2106
+ this.unknownFields = EMPTY_BYTES;
1482
2107
  }
1483
2108
  static encode(msg) {
1484
2109
  const out = [];
@@ -1489,6 +2114,15 @@ export class DescribeConfigsResponse {
1489
2114
  }
1490
2115
  static decode(bytes) {
1491
2116
  const msg = new DescribeConfigsResponse();
2117
+ DescribeConfigsResponse._fill(msg, bytes);
2118
+ return msg;
2119
+ }
2120
+ static decodeInto(msg, bytes) {
2121
+ msg._reset();
2122
+ DescribeConfigsResponse._fill(msg, bytes);
2123
+ return msg;
2124
+ }
2125
+ static _fill(msg, bytes) {
1492
2126
  const reader = new Reader(bytes);
1493
2127
  let f;
1494
2128
  while ((f = reader.field()) !== null) {
@@ -1501,6 +2135,11 @@ export class DescribeConfigsResponse {
1501
2135
  }
1502
2136
  return msg;
1503
2137
  }
2138
+ _reset() {
2139
+ this.errorCode = 0;
2140
+ this.values = [];
2141
+ this.unknownFields = EMPTY_BYTES;
2142
+ }
1504
2143
  }
1505
2144
 
1506
2145
  export class AlterConfigsRequest {
@@ -1509,7 +2148,7 @@ export class AlterConfigsRequest {
1509
2148
  this.resourceName = resourceName;
1510
2149
  this.entries = entries;
1511
2150
  this.validateOnly = validateOnly;
1512
- this.unknownFields = new Uint8Array(0);
2151
+ this.unknownFields = EMPTY_BYTES;
1513
2152
  }
1514
2153
  static encode(msg) {
1515
2154
  const out = [];
@@ -1522,13 +2161,22 @@ export class AlterConfigsRequest {
1522
2161
  }
1523
2162
  static decode(bytes) {
1524
2163
  const msg = new AlterConfigsRequest();
2164
+ AlterConfigsRequest._fill(msg, bytes);
2165
+ return msg;
2166
+ }
2167
+ static decodeInto(msg, bytes) {
2168
+ msg._reset();
2169
+ AlterConfigsRequest._fill(msg, bytes);
2170
+ return msg;
2171
+ }
2172
+ static _fill(msg, bytes) {
1525
2173
  const reader = new Reader(bytes);
1526
2174
  let f;
1527
2175
  while ((f = reader.field()) !== null) {
1528
2176
  const [num, wire, value, raw] = f;
1529
2177
  switch (num) {
1530
2178
  case 1: msg.resourceType = Number(BigInt.asIntN(32, value)); break;
1531
- case 2: msg.resourceName = new TextDecoder().decode(value); break;
2179
+ case 2: msg.resourceName = textDecoder.decode(value); break;
1532
2180
  case 3: msg.entries.push(AlterConfigEntry.decode(value)); break;
1533
2181
  case 4: msg.validateOnly = value !== 0n; break;
1534
2182
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -1536,12 +2184,19 @@ export class AlterConfigsRequest {
1536
2184
  }
1537
2185
  return msg;
1538
2186
  }
2187
+ _reset() {
2188
+ this.resourceType = 0;
2189
+ this.resourceName = "";
2190
+ this.entries = [];
2191
+ this.validateOnly = false;
2192
+ this.unknownFields = EMPTY_BYTES;
2193
+ }
1539
2194
  }
1540
2195
 
1541
2196
  export class AlterConfigsResponse {
1542
2197
  constructor({ errorCode = 0 } = {}) {
1543
2198
  this.errorCode = errorCode;
1544
- this.unknownFields = new Uint8Array(0);
2199
+ this.unknownFields = EMPTY_BYTES;
1545
2200
  }
1546
2201
  static encode(msg) {
1547
2202
  const out = [];
@@ -1551,6 +2206,15 @@ export class AlterConfigsResponse {
1551
2206
  }
1552
2207
  static decode(bytes) {
1553
2208
  const msg = new AlterConfigsResponse();
2209
+ AlterConfigsResponse._fill(msg, bytes);
2210
+ return msg;
2211
+ }
2212
+ static decodeInto(msg, bytes) {
2213
+ msg._reset();
2214
+ AlterConfigsResponse._fill(msg, bytes);
2215
+ return msg;
2216
+ }
2217
+ static _fill(msg, bytes) {
1554
2218
  const reader = new Reader(bytes);
1555
2219
  let f;
1556
2220
  while ((f = reader.field()) !== null) {
@@ -1562,6 +2226,10 @@ export class AlterConfigsResponse {
1562
2226
  }
1563
2227
  return msg;
1564
2228
  }
2229
+ _reset() {
2230
+ this.errorCode = 0;
2231
+ this.unknownFields = EMPTY_BYTES;
2232
+ }
1565
2233
  }
1566
2234
 
1567
2235
  export class CreatePartitionsRequest {
@@ -1570,7 +2238,7 @@ export class CreatePartitionsRequest {
1570
2238
  this.totalCount = totalCount;
1571
2239
  this.validateOnly = validateOnly;
1572
2240
  this.timeoutMs = timeoutMs;
1573
- this.unknownFields = new Uint8Array(0);
2241
+ this.unknownFields = EMPTY_BYTES;
1574
2242
  }
1575
2243
  static encode(msg) {
1576
2244
  const out = [];
@@ -1583,12 +2251,21 @@ export class CreatePartitionsRequest {
1583
2251
  }
1584
2252
  static decode(bytes) {
1585
2253
  const msg = new CreatePartitionsRequest();
2254
+ CreatePartitionsRequest._fill(msg, bytes);
2255
+ return msg;
2256
+ }
2257
+ static decodeInto(msg, bytes) {
2258
+ msg._reset();
2259
+ CreatePartitionsRequest._fill(msg, bytes);
2260
+ return msg;
2261
+ }
2262
+ static _fill(msg, bytes) {
1586
2263
  const reader = new Reader(bytes);
1587
2264
  let f;
1588
2265
  while ((f = reader.field()) !== null) {
1589
2266
  const [num, wire, value, raw] = f;
1590
2267
  switch (num) {
1591
- case 1: msg.topic = new TextDecoder().decode(value); break;
2268
+ case 1: msg.topic = textDecoder.decode(value); break;
1592
2269
  case 2: msg.totalCount = Number(BigInt.asIntN(32, value)); break;
1593
2270
  case 3: msg.validateOnly = value !== 0n; break;
1594
2271
  case 4: msg.timeoutMs = Number(BigInt.asIntN(32, value)); break;
@@ -1597,12 +2274,19 @@ export class CreatePartitionsRequest {
1597
2274
  }
1598
2275
  return msg;
1599
2276
  }
2277
+ _reset() {
2278
+ this.topic = "";
2279
+ this.totalCount = 0;
2280
+ this.validateOnly = false;
2281
+ this.timeoutMs = 0;
2282
+ this.unknownFields = EMPTY_BYTES;
2283
+ }
1600
2284
  }
1601
2285
 
1602
2286
  export class CreatePartitionsResponse {
1603
2287
  constructor({ errorCode = 0 } = {}) {
1604
2288
  this.errorCode = errorCode;
1605
- this.unknownFields = new Uint8Array(0);
2289
+ this.unknownFields = EMPTY_BYTES;
1606
2290
  }
1607
2291
  static encode(msg) {
1608
2292
  const out = [];
@@ -1612,6 +2296,15 @@ export class CreatePartitionsResponse {
1612
2296
  }
1613
2297
  static decode(bytes) {
1614
2298
  const msg = new CreatePartitionsResponse();
2299
+ CreatePartitionsResponse._fill(msg, bytes);
2300
+ return msg;
2301
+ }
2302
+ static decodeInto(msg, bytes) {
2303
+ msg._reset();
2304
+ CreatePartitionsResponse._fill(msg, bytes);
2305
+ return msg;
2306
+ }
2307
+ static _fill(msg, bytes) {
1615
2308
  const reader = new Reader(bytes);
1616
2309
  let f;
1617
2310
  while ((f = reader.field()) !== null) {
@@ -1623,6 +2316,10 @@ export class CreatePartitionsResponse {
1623
2316
  }
1624
2317
  return msg;
1625
2318
  }
2319
+ _reset() {
2320
+ this.errorCode = 0;
2321
+ this.unknownFields = EMPTY_BYTES;
2322
+ }
1626
2323
  }
1627
2324
 
1628
2325
  export class DeleteRecordsRequest {
@@ -1630,7 +2327,7 @@ export class DeleteRecordsRequest {
1630
2327
  this.topic = topic;
1631
2328
  this.partition = partition;
1632
2329
  this.beforeOffset = beforeOffset;
1633
- this.unknownFields = new Uint8Array(0);
2330
+ this.unknownFields = EMPTY_BYTES;
1634
2331
  }
1635
2332
  static encode(msg) {
1636
2333
  const out = [];
@@ -1642,12 +2339,21 @@ export class DeleteRecordsRequest {
1642
2339
  }
1643
2340
  static decode(bytes) {
1644
2341
  const msg = new DeleteRecordsRequest();
2342
+ DeleteRecordsRequest._fill(msg, bytes);
2343
+ return msg;
2344
+ }
2345
+ static decodeInto(msg, bytes) {
2346
+ msg._reset();
2347
+ DeleteRecordsRequest._fill(msg, bytes);
2348
+ return msg;
2349
+ }
2350
+ static _fill(msg, bytes) {
1645
2351
  const reader = new Reader(bytes);
1646
2352
  let f;
1647
2353
  while ((f = reader.field()) !== null) {
1648
2354
  const [num, wire, value, raw] = f;
1649
2355
  switch (num) {
1650
- case 1: msg.topic = new TextDecoder().decode(value); break;
2356
+ case 1: msg.topic = textDecoder.decode(value); break;
1651
2357
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
1652
2358
  case 3: msg.beforeOffset = BigInt.asIntN(64, value); break;
1653
2359
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -1655,13 +2361,19 @@ export class DeleteRecordsRequest {
1655
2361
  }
1656
2362
  return msg;
1657
2363
  }
2364
+ _reset() {
2365
+ this.topic = "";
2366
+ this.partition = 0;
2367
+ this.beforeOffset = 0n;
2368
+ this.unknownFields = EMPTY_BYTES;
2369
+ }
1658
2370
  }
1659
2371
 
1660
2372
  export class DeleteRecordsResponse {
1661
2373
  constructor({ lowWatermark = 0n, errorCode = 0 } = {}) {
1662
2374
  this.lowWatermark = lowWatermark;
1663
2375
  this.errorCode = errorCode;
1664
- this.unknownFields = new Uint8Array(0);
2376
+ this.unknownFields = EMPTY_BYTES;
1665
2377
  }
1666
2378
  static encode(msg) {
1667
2379
  const out = [];
@@ -1672,6 +2384,15 @@ export class DeleteRecordsResponse {
1672
2384
  }
1673
2385
  static decode(bytes) {
1674
2386
  const msg = new DeleteRecordsResponse();
2387
+ DeleteRecordsResponse._fill(msg, bytes);
2388
+ return msg;
2389
+ }
2390
+ static decodeInto(msg, bytes) {
2391
+ msg._reset();
2392
+ DeleteRecordsResponse._fill(msg, bytes);
2393
+ return msg;
2394
+ }
2395
+ static _fill(msg, bytes) {
1675
2396
  const reader = new Reader(bytes);
1676
2397
  let f;
1677
2398
  while ((f = reader.field()) !== null) {
@@ -1684,11 +2405,16 @@ export class DeleteRecordsResponse {
1684
2405
  }
1685
2406
  return msg;
1686
2407
  }
2408
+ _reset() {
2409
+ this.lowWatermark = 0n;
2410
+ this.errorCode = 0;
2411
+ this.unknownFields = EMPTY_BYTES;
2412
+ }
1687
2413
  }
1688
2414
 
1689
2415
  export class ListGroupsRequest {
1690
2416
  constructor({ } = {}) {
1691
- this.unknownFields = new Uint8Array(0);
2417
+ this.unknownFields = EMPTY_BYTES;
1692
2418
  }
1693
2419
  static encode(msg) {
1694
2420
  const out = [];
@@ -1697,6 +2423,15 @@ export class ListGroupsRequest {
1697
2423
  }
1698
2424
  static decode(bytes) {
1699
2425
  const msg = new ListGroupsRequest();
2426
+ ListGroupsRequest._fill(msg, bytes);
2427
+ return msg;
2428
+ }
2429
+ static decodeInto(msg, bytes) {
2430
+ msg._reset();
2431
+ ListGroupsRequest._fill(msg, bytes);
2432
+ return msg;
2433
+ }
2434
+ static _fill(msg, bytes) {
1700
2435
  const reader = new Reader(bytes);
1701
2436
  let f;
1702
2437
  while ((f = reader.field()) !== null) {
@@ -1707,6 +2442,9 @@ export class ListGroupsRequest {
1707
2442
  }
1708
2443
  return msg;
1709
2444
  }
2445
+ _reset() {
2446
+ this.unknownFields = EMPTY_BYTES;
2447
+ }
1710
2448
  }
1711
2449
 
1712
2450
  export class GroupListing {
@@ -1714,7 +2452,7 @@ export class GroupListing {
1714
2452
  this.groupId = groupId;
1715
2453
  this.protocolType = protocolType;
1716
2454
  this.groupState = groupState;
1717
- this.unknownFields = new Uint8Array(0);
2455
+ this.unknownFields = EMPTY_BYTES;
1718
2456
  }
1719
2457
  static encode(msg) {
1720
2458
  const out = [];
@@ -1726,26 +2464,41 @@ export class GroupListing {
1726
2464
  }
1727
2465
  static decode(bytes) {
1728
2466
  const msg = new GroupListing();
2467
+ GroupListing._fill(msg, bytes);
2468
+ return msg;
2469
+ }
2470
+ static decodeInto(msg, bytes) {
2471
+ msg._reset();
2472
+ GroupListing._fill(msg, bytes);
2473
+ return msg;
2474
+ }
2475
+ static _fill(msg, bytes) {
1729
2476
  const reader = new Reader(bytes);
1730
2477
  let f;
1731
2478
  while ((f = reader.field()) !== null) {
1732
2479
  const [num, wire, value, raw] = f;
1733
2480
  switch (num) {
1734
- case 1: msg.groupId = new TextDecoder().decode(value); break;
1735
- case 2: msg.protocolType = new TextDecoder().decode(value); break;
1736
- case 3: msg.groupState = new TextDecoder().decode(value); break;
2481
+ case 1: msg.groupId = textDecoder.decode(value); break;
2482
+ case 2: msg.protocolType = textDecoder.decode(value); break;
2483
+ case 3: msg.groupState = textDecoder.decode(value); break;
1737
2484
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1738
2485
  }
1739
2486
  }
1740
2487
  return msg;
1741
2488
  }
2489
+ _reset() {
2490
+ this.groupId = "";
2491
+ this.protocolType = "";
2492
+ this.groupState = "";
2493
+ this.unknownFields = EMPTY_BYTES;
2494
+ }
1742
2495
  }
1743
2496
 
1744
2497
  export class ListGroupsResponse {
1745
2498
  constructor({ errorCode = 0, groups = [] } = {}) {
1746
2499
  this.errorCode = errorCode;
1747
2500
  this.groups = groups;
1748
- this.unknownFields = new Uint8Array(0);
2501
+ this.unknownFields = EMPTY_BYTES;
1749
2502
  }
1750
2503
  static encode(msg) {
1751
2504
  const out = [];
@@ -1756,6 +2509,15 @@ export class ListGroupsResponse {
1756
2509
  }
1757
2510
  static decode(bytes) {
1758
2511
  const msg = new ListGroupsResponse();
2512
+ ListGroupsResponse._fill(msg, bytes);
2513
+ return msg;
2514
+ }
2515
+ static decodeInto(msg, bytes) {
2516
+ msg._reset();
2517
+ ListGroupsResponse._fill(msg, bytes);
2518
+ return msg;
2519
+ }
2520
+ static _fill(msg, bytes) {
1759
2521
  const reader = new Reader(bytes);
1760
2522
  let f;
1761
2523
  while ((f = reader.field()) !== null) {
@@ -1768,32 +2530,50 @@ export class ListGroupsResponse {
1768
2530
  }
1769
2531
  return msg;
1770
2532
  }
2533
+ _reset() {
2534
+ this.errorCode = 0;
2535
+ this.groups = [];
2536
+ this.unknownFields = EMPTY_BYTES;
2537
+ }
1771
2538
  }
1772
2539
 
1773
2540
  export class DescribeGroupsRequest {
1774
2541
  constructor({ groupIds = [] } = {}) {
1775
2542
  this.groupIds = groupIds;
1776
- this.unknownFields = new Uint8Array(0);
2543
+ this.unknownFields = EMPTY_BYTES;
1777
2544
  }
1778
2545
  static encode(msg) {
1779
2546
  const out = [];
1780
- if (msg.groupIds) for (const v of msg.groupIds) putBytesField(out, 1, new TextEncoder().encode(v));
2547
+ if (msg.groupIds) for (const v of msg.groupIds) putBytesField(out, 1, textEncoder.encode(v));
1781
2548
  putRaw(out, msg.unknownFields);
1782
2549
  return new Uint8Array(out);
1783
2550
  }
1784
2551
  static decode(bytes) {
1785
2552
  const msg = new DescribeGroupsRequest();
2553
+ DescribeGroupsRequest._fill(msg, bytes);
2554
+ return msg;
2555
+ }
2556
+ static decodeInto(msg, bytes) {
2557
+ msg._reset();
2558
+ DescribeGroupsRequest._fill(msg, bytes);
2559
+ return msg;
2560
+ }
2561
+ static _fill(msg, bytes) {
1786
2562
  const reader = new Reader(bytes);
1787
2563
  let f;
1788
2564
  while ((f = reader.field()) !== null) {
1789
2565
  const [num, wire, value, raw] = f;
1790
2566
  switch (num) {
1791
- case 1: msg.groupIds.push(new TextDecoder().decode(value)); break;
2567
+ case 1: msg.groupIds.push(textDecoder.decode(value)); break;
1792
2568
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1793
2569
  }
1794
2570
  }
1795
2571
  return msg;
1796
2572
  }
2573
+ _reset() {
2574
+ this.groupIds = [];
2575
+ this.unknownFields = EMPTY_BYTES;
2576
+ }
1797
2577
  }
1798
2578
 
1799
2579
  export class GroupMember {
@@ -1802,7 +2582,7 @@ export class GroupMember {
1802
2582
  this.clientId = clientId;
1803
2583
  this.clientHost = clientHost;
1804
2584
  this.assignment = assignment;
1805
- this.unknownFields = new Uint8Array(0);
2585
+ this.unknownFields = EMPTY_BYTES;
1806
2586
  }
1807
2587
  static encode(msg) {
1808
2588
  const out = [];
@@ -1815,20 +2595,36 @@ export class GroupMember {
1815
2595
  }
1816
2596
  static decode(bytes) {
1817
2597
  const msg = new GroupMember();
2598
+ GroupMember._fill(msg, bytes);
2599
+ return msg;
2600
+ }
2601
+ static decodeInto(msg, bytes) {
2602
+ msg._reset();
2603
+ GroupMember._fill(msg, bytes);
2604
+ return msg;
2605
+ }
2606
+ static _fill(msg, bytes) {
1818
2607
  const reader = new Reader(bytes);
1819
2608
  let f;
1820
2609
  while ((f = reader.field()) !== null) {
1821
2610
  const [num, wire, value, raw] = f;
1822
2611
  switch (num) {
1823
- case 1: msg.memberId = new TextDecoder().decode(value); break;
1824
- case 2: msg.clientId = new TextDecoder().decode(value); break;
1825
- case 3: msg.clientHost = new TextDecoder().decode(value); break;
2612
+ case 1: msg.memberId = textDecoder.decode(value); break;
2613
+ case 2: msg.clientId = textDecoder.decode(value); break;
2614
+ case 3: msg.clientHost = textDecoder.decode(value); break;
1826
2615
  case 4: msg.assignment.push(TopicPartition.decode(value)); break;
1827
2616
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1828
2617
  }
1829
2618
  }
1830
2619
  return msg;
1831
2620
  }
2621
+ _reset() {
2622
+ this.memberId = "";
2623
+ this.clientId = "";
2624
+ this.clientHost = "";
2625
+ this.assignment = [];
2626
+ this.unknownFields = EMPTY_BYTES;
2627
+ }
1832
2628
  }
1833
2629
 
1834
2630
  export class DescribedGroup {
@@ -1839,7 +2635,7 @@ export class DescribedGroup {
1839
2635
  this.protocolType = protocolType;
1840
2636
  this.protocol = protocol;
1841
2637
  this.members = members;
1842
- this.unknownFields = new Uint8Array(0);
2638
+ this.unknownFields = EMPTY_BYTES;
1843
2639
  }
1844
2640
  static encode(msg) {
1845
2641
  const out = [];
@@ -1854,28 +2650,46 @@ export class DescribedGroup {
1854
2650
  }
1855
2651
  static decode(bytes) {
1856
2652
  const msg = new DescribedGroup();
2653
+ DescribedGroup._fill(msg, bytes);
2654
+ return msg;
2655
+ }
2656
+ static decodeInto(msg, bytes) {
2657
+ msg._reset();
2658
+ DescribedGroup._fill(msg, bytes);
2659
+ return msg;
2660
+ }
2661
+ static _fill(msg, bytes) {
1857
2662
  const reader = new Reader(bytes);
1858
2663
  let f;
1859
2664
  while ((f = reader.field()) !== null) {
1860
2665
  const [num, wire, value, raw] = f;
1861
2666
  switch (num) {
1862
- case 1: msg.groupId = new TextDecoder().decode(value); break;
2667
+ case 1: msg.groupId = textDecoder.decode(value); break;
1863
2668
  case 2: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
1864
- case 3: msg.groupState = new TextDecoder().decode(value); break;
1865
- case 4: msg.protocolType = new TextDecoder().decode(value); break;
1866
- case 5: msg.protocol = new TextDecoder().decode(value); break;
2669
+ case 3: msg.groupState = textDecoder.decode(value); break;
2670
+ case 4: msg.protocolType = textDecoder.decode(value); break;
2671
+ case 5: msg.protocol = textDecoder.decode(value); break;
1867
2672
  case 6: msg.members.push(GroupMember.decode(value)); break;
1868
2673
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1869
2674
  }
1870
2675
  }
1871
2676
  return msg;
1872
2677
  }
2678
+ _reset() {
2679
+ this.groupId = "";
2680
+ this.errorCode = 0;
2681
+ this.groupState = "";
2682
+ this.protocolType = "";
2683
+ this.protocol = "";
2684
+ this.members = [];
2685
+ this.unknownFields = EMPTY_BYTES;
2686
+ }
1873
2687
  }
1874
2688
 
1875
2689
  export class DescribeGroupsResponse {
1876
2690
  constructor({ groups = [] } = {}) {
1877
2691
  this.groups = groups;
1878
- this.unknownFields = new Uint8Array(0);
2692
+ this.unknownFields = EMPTY_BYTES;
1879
2693
  }
1880
2694
  static encode(msg) {
1881
2695
  const out = [];
@@ -1885,6 +2699,15 @@ export class DescribeGroupsResponse {
1885
2699
  }
1886
2700
  static decode(bytes) {
1887
2701
  const msg = new DescribeGroupsResponse();
2702
+ DescribeGroupsResponse._fill(msg, bytes);
2703
+ return msg;
2704
+ }
2705
+ static decodeInto(msg, bytes) {
2706
+ msg._reset();
2707
+ DescribeGroupsResponse._fill(msg, bytes);
2708
+ return msg;
2709
+ }
2710
+ static _fill(msg, bytes) {
1888
2711
  const reader = new Reader(bytes);
1889
2712
  let f;
1890
2713
  while ((f = reader.field()) !== null) {
@@ -1896,39 +2719,56 @@ export class DescribeGroupsResponse {
1896
2719
  }
1897
2720
  return msg;
1898
2721
  }
2722
+ _reset() {
2723
+ this.groups = [];
2724
+ this.unknownFields = EMPTY_BYTES;
2725
+ }
1899
2726
  }
1900
2727
 
1901
2728
  export class DeleteGroupsRequest {
1902
2729
  constructor({ groupIds = [] } = {}) {
1903
2730
  this.groupIds = groupIds;
1904
- this.unknownFields = new Uint8Array(0);
2731
+ this.unknownFields = EMPTY_BYTES;
1905
2732
  }
1906
2733
  static encode(msg) {
1907
2734
  const out = [];
1908
- if (msg.groupIds) for (const v of msg.groupIds) putBytesField(out, 1, new TextEncoder().encode(v));
2735
+ if (msg.groupIds) for (const v of msg.groupIds) putBytesField(out, 1, textEncoder.encode(v));
1909
2736
  putRaw(out, msg.unknownFields);
1910
2737
  return new Uint8Array(out);
1911
2738
  }
1912
2739
  static decode(bytes) {
1913
2740
  const msg = new DeleteGroupsRequest();
2741
+ DeleteGroupsRequest._fill(msg, bytes);
2742
+ return msg;
2743
+ }
2744
+ static decodeInto(msg, bytes) {
2745
+ msg._reset();
2746
+ DeleteGroupsRequest._fill(msg, bytes);
2747
+ return msg;
2748
+ }
2749
+ static _fill(msg, bytes) {
1914
2750
  const reader = new Reader(bytes);
1915
2751
  let f;
1916
2752
  while ((f = reader.field()) !== null) {
1917
2753
  const [num, wire, value, raw] = f;
1918
2754
  switch (num) {
1919
- case 1: msg.groupIds.push(new TextDecoder().decode(value)); break;
2755
+ case 1: msg.groupIds.push(textDecoder.decode(value)); break;
1920
2756
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1921
2757
  }
1922
2758
  }
1923
2759
  return msg;
1924
2760
  }
2761
+ _reset() {
2762
+ this.groupIds = [];
2763
+ this.unknownFields = EMPTY_BYTES;
2764
+ }
1925
2765
  }
1926
2766
 
1927
2767
  export class GroupErrorResult {
1928
2768
  constructor({ groupId = "", errorCode = 0 } = {}) {
1929
2769
  this.groupId = groupId;
1930
2770
  this.errorCode = errorCode;
1931
- this.unknownFields = new Uint8Array(0);
2771
+ this.unknownFields = EMPTY_BYTES;
1932
2772
  }
1933
2773
  static encode(msg) {
1934
2774
  const out = [];
@@ -1939,24 +2779,38 @@ export class GroupErrorResult {
1939
2779
  }
1940
2780
  static decode(bytes) {
1941
2781
  const msg = new GroupErrorResult();
2782
+ GroupErrorResult._fill(msg, bytes);
2783
+ return msg;
2784
+ }
2785
+ static decodeInto(msg, bytes) {
2786
+ msg._reset();
2787
+ GroupErrorResult._fill(msg, bytes);
2788
+ return msg;
2789
+ }
2790
+ static _fill(msg, bytes) {
1942
2791
  const reader = new Reader(bytes);
1943
2792
  let f;
1944
2793
  while ((f = reader.field()) !== null) {
1945
2794
  const [num, wire, value, raw] = f;
1946
2795
  switch (num) {
1947
- case 1: msg.groupId = new TextDecoder().decode(value); break;
2796
+ case 1: msg.groupId = textDecoder.decode(value); break;
1948
2797
  case 2: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
1949
2798
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
1950
2799
  }
1951
2800
  }
1952
2801
  return msg;
1953
2802
  }
2803
+ _reset() {
2804
+ this.groupId = "";
2805
+ this.errorCode = 0;
2806
+ this.unknownFields = EMPTY_BYTES;
2807
+ }
1954
2808
  }
1955
2809
 
1956
2810
  export class DeleteGroupsResponse {
1957
2811
  constructor({ results = [] } = {}) {
1958
2812
  this.results = results;
1959
- this.unknownFields = new Uint8Array(0);
2813
+ this.unknownFields = EMPTY_BYTES;
1960
2814
  }
1961
2815
  static encode(msg) {
1962
2816
  const out = [];
@@ -1966,6 +2820,15 @@ export class DeleteGroupsResponse {
1966
2820
  }
1967
2821
  static decode(bytes) {
1968
2822
  const msg = new DeleteGroupsResponse();
2823
+ DeleteGroupsResponse._fill(msg, bytes);
2824
+ return msg;
2825
+ }
2826
+ static decodeInto(msg, bytes) {
2827
+ msg._reset();
2828
+ DeleteGroupsResponse._fill(msg, bytes);
2829
+ return msg;
2830
+ }
2831
+ static _fill(msg, bytes) {
1969
2832
  const reader = new Reader(bytes);
1970
2833
  let f;
1971
2834
  while ((f = reader.field()) !== null) {
@@ -1977,6 +2840,10 @@ export class DeleteGroupsResponse {
1977
2840
  }
1978
2841
  return msg;
1979
2842
  }
2843
+ _reset() {
2844
+ this.results = [];
2845
+ this.unknownFields = EMPTY_BYTES;
2846
+ }
1980
2847
  }
1981
2848
 
1982
2849
  export class DeleteGroupOffsetsRequest {
@@ -1984,7 +2851,7 @@ export class DeleteGroupOffsetsRequest {
1984
2851
  this.groupId = groupId;
1985
2852
  this.topic = topic;
1986
2853
  this.partitions = partitions;
1987
- this.unknownFields = new Uint8Array(0);
2854
+ this.unknownFields = EMPTY_BYTES;
1988
2855
  }
1989
2856
  static encode(msg) {
1990
2857
  const out = [];
@@ -2000,25 +2867,40 @@ export class DeleteGroupOffsetsRequest {
2000
2867
  }
2001
2868
  static decode(bytes) {
2002
2869
  const msg = new DeleteGroupOffsetsRequest();
2870
+ DeleteGroupOffsetsRequest._fill(msg, bytes);
2871
+ return msg;
2872
+ }
2873
+ static decodeInto(msg, bytes) {
2874
+ msg._reset();
2875
+ DeleteGroupOffsetsRequest._fill(msg, bytes);
2876
+ return msg;
2877
+ }
2878
+ static _fill(msg, bytes) {
2003
2879
  const reader = new Reader(bytes);
2004
2880
  let f;
2005
2881
  while ((f = reader.field()) !== null) {
2006
2882
  const [num, wire, value, raw] = f;
2007
2883
  switch (num) {
2008
- case 1: msg.groupId = new TextDecoder().decode(value); break;
2009
- case 2: msg.topic = new TextDecoder().decode(value); break;
2884
+ case 1: msg.groupId = textDecoder.decode(value); break;
2885
+ case 2: msg.topic = textDecoder.decode(value); break;
2010
2886
  case 3: if (wire === 2) { const r = new Reader(value); while (!r.done) msg.partitions.push(Number(BigInt.asIntN(32, r.varint()))); } else msg.partitions.push(Number(BigInt.asIntN(32, value))); break;
2011
2887
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2012
2888
  }
2013
2889
  }
2014
2890
  return msg;
2015
2891
  }
2892
+ _reset() {
2893
+ this.groupId = "";
2894
+ this.topic = "";
2895
+ this.partitions = [];
2896
+ this.unknownFields = EMPTY_BYTES;
2897
+ }
2016
2898
  }
2017
2899
 
2018
2900
  export class DeleteGroupOffsetsResponse {
2019
2901
  constructor({ errorCode = 0 } = {}) {
2020
2902
  this.errorCode = errorCode;
2021
- this.unknownFields = new Uint8Array(0);
2903
+ this.unknownFields = EMPTY_BYTES;
2022
2904
  }
2023
2905
  static encode(msg) {
2024
2906
  const out = [];
@@ -2028,6 +2910,15 @@ export class DeleteGroupOffsetsResponse {
2028
2910
  }
2029
2911
  static decode(bytes) {
2030
2912
  const msg = new DeleteGroupOffsetsResponse();
2913
+ DeleteGroupOffsetsResponse._fill(msg, bytes);
2914
+ return msg;
2915
+ }
2916
+ static decodeInto(msg, bytes) {
2917
+ msg._reset();
2918
+ DeleteGroupOffsetsResponse._fill(msg, bytes);
2919
+ return msg;
2920
+ }
2921
+ static _fill(msg, bytes) {
2031
2922
  const reader = new Reader(bytes);
2032
2923
  let f;
2033
2924
  while ((f = reader.field()) !== null) {
@@ -2039,6 +2930,10 @@ export class DeleteGroupOffsetsResponse {
2039
2930
  }
2040
2931
  return msg;
2041
2932
  }
2933
+ _reset() {
2934
+ this.errorCode = 0;
2935
+ this.unknownFields = EMPTY_BYTES;
2936
+ }
2042
2937
  }
2043
2938
 
2044
2939
  export class Acl {
@@ -2050,7 +2945,7 @@ export class Acl {
2050
2945
  this.host = host;
2051
2946
  this.operation = operation;
2052
2947
  this.permissionType = permissionType;
2053
- this.unknownFields = new Uint8Array(0);
2948
+ this.unknownFields = EMPTY_BYTES;
2054
2949
  }
2055
2950
  static encode(msg) {
2056
2951
  const out = [];
@@ -2066,16 +2961,25 @@ export class Acl {
2066
2961
  }
2067
2962
  static decode(bytes) {
2068
2963
  const msg = new Acl();
2964
+ Acl._fill(msg, bytes);
2965
+ return msg;
2966
+ }
2967
+ static decodeInto(msg, bytes) {
2968
+ msg._reset();
2969
+ Acl._fill(msg, bytes);
2970
+ return msg;
2971
+ }
2972
+ static _fill(msg, bytes) {
2069
2973
  const reader = new Reader(bytes);
2070
2974
  let f;
2071
2975
  while ((f = reader.field()) !== null) {
2072
2976
  const [num, wire, value, raw] = f;
2073
2977
  switch (num) {
2074
2978
  case 1: msg.resourceType = Number(BigInt.asIntN(32, value)); break;
2075
- case 2: msg.resourceName = new TextDecoder().decode(value); break;
2979
+ case 2: msg.resourceName = textDecoder.decode(value); break;
2076
2980
  case 3: msg.patternType = Number(BigInt.asIntN(32, value)); break;
2077
- case 4: msg.principal = new TextDecoder().decode(value); break;
2078
- case 5: msg.host = new TextDecoder().decode(value); break;
2981
+ case 4: msg.principal = textDecoder.decode(value); break;
2982
+ case 5: msg.host = textDecoder.decode(value); break;
2079
2983
  case 6: msg.operation = Number(BigInt.asIntN(32, value)); break;
2080
2984
  case 7: msg.permissionType = Number(BigInt.asIntN(32, value)); break;
2081
2985
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -2083,12 +2987,22 @@ export class Acl {
2083
2987
  }
2084
2988
  return msg;
2085
2989
  }
2990
+ _reset() {
2991
+ this.resourceType = 0;
2992
+ this.resourceName = "";
2993
+ this.patternType = 0;
2994
+ this.principal = "";
2995
+ this.host = "";
2996
+ this.operation = 0;
2997
+ this.permissionType = 0;
2998
+ this.unknownFields = EMPTY_BYTES;
2999
+ }
2086
3000
  }
2087
3001
 
2088
3002
  export class DescribeAclsRequest {
2089
3003
  constructor({ filter = undefined } = {}) {
2090
3004
  this.filter = filter;
2091
- this.unknownFields = new Uint8Array(0);
3005
+ this.unknownFields = EMPTY_BYTES;
2092
3006
  }
2093
3007
  static encode(msg) {
2094
3008
  const out = [];
@@ -2098,6 +3012,15 @@ export class DescribeAclsRequest {
2098
3012
  }
2099
3013
  static decode(bytes) {
2100
3014
  const msg = new DescribeAclsRequest();
3015
+ DescribeAclsRequest._fill(msg, bytes);
3016
+ return msg;
3017
+ }
3018
+ static decodeInto(msg, bytes) {
3019
+ msg._reset();
3020
+ DescribeAclsRequest._fill(msg, bytes);
3021
+ return msg;
3022
+ }
3023
+ static _fill(msg, bytes) {
2101
3024
  const reader = new Reader(bytes);
2102
3025
  let f;
2103
3026
  while ((f = reader.field()) !== null) {
@@ -2109,13 +3032,17 @@ export class DescribeAclsRequest {
2109
3032
  }
2110
3033
  return msg;
2111
3034
  }
3035
+ _reset() {
3036
+ this.filter = undefined;
3037
+ this.unknownFields = EMPTY_BYTES;
3038
+ }
2112
3039
  }
2113
3040
 
2114
3041
  export class DescribeAclsResponse {
2115
3042
  constructor({ errorCode = 0, acls = [] } = {}) {
2116
3043
  this.errorCode = errorCode;
2117
3044
  this.acls = acls;
2118
- this.unknownFields = new Uint8Array(0);
3045
+ this.unknownFields = EMPTY_BYTES;
2119
3046
  }
2120
3047
  static encode(msg) {
2121
3048
  const out = [];
@@ -2126,6 +3053,15 @@ export class DescribeAclsResponse {
2126
3053
  }
2127
3054
  static decode(bytes) {
2128
3055
  const msg = new DescribeAclsResponse();
3056
+ DescribeAclsResponse._fill(msg, bytes);
3057
+ return msg;
3058
+ }
3059
+ static decodeInto(msg, bytes) {
3060
+ msg._reset();
3061
+ DescribeAclsResponse._fill(msg, bytes);
3062
+ return msg;
3063
+ }
3064
+ static _fill(msg, bytes) {
2129
3065
  const reader = new Reader(bytes);
2130
3066
  let f;
2131
3067
  while ((f = reader.field()) !== null) {
@@ -2138,12 +3074,17 @@ export class DescribeAclsResponse {
2138
3074
  }
2139
3075
  return msg;
2140
3076
  }
3077
+ _reset() {
3078
+ this.errorCode = 0;
3079
+ this.acls = [];
3080
+ this.unknownFields = EMPTY_BYTES;
3081
+ }
2141
3082
  }
2142
3083
 
2143
3084
  export class CreateAclsRequest {
2144
3085
  constructor({ acls = [] } = {}) {
2145
3086
  this.acls = acls;
2146
- this.unknownFields = new Uint8Array(0);
3087
+ this.unknownFields = EMPTY_BYTES;
2147
3088
  }
2148
3089
  static encode(msg) {
2149
3090
  const out = [];
@@ -2153,6 +3094,15 @@ export class CreateAclsRequest {
2153
3094
  }
2154
3095
  static decode(bytes) {
2155
3096
  const msg = new CreateAclsRequest();
3097
+ CreateAclsRequest._fill(msg, bytes);
3098
+ return msg;
3099
+ }
3100
+ static decodeInto(msg, bytes) {
3101
+ msg._reset();
3102
+ CreateAclsRequest._fill(msg, bytes);
3103
+ return msg;
3104
+ }
3105
+ static _fill(msg, bytes) {
2156
3106
  const reader = new Reader(bytes);
2157
3107
  let f;
2158
3108
  while ((f = reader.field()) !== null) {
@@ -2164,12 +3114,16 @@ export class CreateAclsRequest {
2164
3114
  }
2165
3115
  return msg;
2166
3116
  }
3117
+ _reset() {
3118
+ this.acls = [];
3119
+ this.unknownFields = EMPTY_BYTES;
3120
+ }
2167
3121
  }
2168
3122
 
2169
3123
  export class CreateAclsResponse {
2170
3124
  constructor({ errorCodes = [] } = {}) {
2171
3125
  this.errorCodes = errorCodes;
2172
- this.unknownFields = new Uint8Array(0);
3126
+ this.unknownFields = EMPTY_BYTES;
2173
3127
  }
2174
3128
  static encode(msg) {
2175
3129
  const out = [];
@@ -2183,6 +3137,15 @@ export class CreateAclsResponse {
2183
3137
  }
2184
3138
  static decode(bytes) {
2185
3139
  const msg = new CreateAclsResponse();
3140
+ CreateAclsResponse._fill(msg, bytes);
3141
+ return msg;
3142
+ }
3143
+ static decodeInto(msg, bytes) {
3144
+ msg._reset();
3145
+ CreateAclsResponse._fill(msg, bytes);
3146
+ return msg;
3147
+ }
3148
+ static _fill(msg, bytes) {
2186
3149
  const reader = new Reader(bytes);
2187
3150
  let f;
2188
3151
  while ((f = reader.field()) !== null) {
@@ -2194,12 +3157,16 @@ export class CreateAclsResponse {
2194
3157
  }
2195
3158
  return msg;
2196
3159
  }
3160
+ _reset() {
3161
+ this.errorCodes = [];
3162
+ this.unknownFields = EMPTY_BYTES;
3163
+ }
2197
3164
  }
2198
3165
 
2199
3166
  export class DeleteAclsRequest {
2200
3167
  constructor({ filters = [] } = {}) {
2201
3168
  this.filters = filters;
2202
- this.unknownFields = new Uint8Array(0);
3169
+ this.unknownFields = EMPTY_BYTES;
2203
3170
  }
2204
3171
  static encode(msg) {
2205
3172
  const out = [];
@@ -2209,6 +3176,15 @@ export class DeleteAclsRequest {
2209
3176
  }
2210
3177
  static decode(bytes) {
2211
3178
  const msg = new DeleteAclsRequest();
3179
+ DeleteAclsRequest._fill(msg, bytes);
3180
+ return msg;
3181
+ }
3182
+ static decodeInto(msg, bytes) {
3183
+ msg._reset();
3184
+ DeleteAclsRequest._fill(msg, bytes);
3185
+ return msg;
3186
+ }
3187
+ static _fill(msg, bytes) {
2212
3188
  const reader = new Reader(bytes);
2213
3189
  let f;
2214
3190
  while ((f = reader.field()) !== null) {
@@ -2220,12 +3196,16 @@ export class DeleteAclsRequest {
2220
3196
  }
2221
3197
  return msg;
2222
3198
  }
3199
+ _reset() {
3200
+ this.filters = [];
3201
+ this.unknownFields = EMPTY_BYTES;
3202
+ }
2223
3203
  }
2224
3204
 
2225
3205
  export class DeleteAclsResponse {
2226
3206
  constructor({ errorCodes = [] } = {}) {
2227
3207
  this.errorCodes = errorCodes;
2228
- this.unknownFields = new Uint8Array(0);
3208
+ this.unknownFields = EMPTY_BYTES;
2229
3209
  }
2230
3210
  static encode(msg) {
2231
3211
  const out = [];
@@ -2239,6 +3219,15 @@ export class DeleteAclsResponse {
2239
3219
  }
2240
3220
  static decode(bytes) {
2241
3221
  const msg = new DeleteAclsResponse();
3222
+ DeleteAclsResponse._fill(msg, bytes);
3223
+ return msg;
3224
+ }
3225
+ static decodeInto(msg, bytes) {
3226
+ msg._reset();
3227
+ DeleteAclsResponse._fill(msg, bytes);
3228
+ return msg;
3229
+ }
3230
+ static _fill(msg, bytes) {
2242
3231
  const reader = new Reader(bytes);
2243
3232
  let f;
2244
3233
  while ((f = reader.field()) !== null) {
@@ -2250,11 +3239,15 @@ export class DeleteAclsResponse {
2250
3239
  }
2251
3240
  return msg;
2252
3241
  }
3242
+ _reset() {
3243
+ this.errorCodes = [];
3244
+ this.unknownFields = EMPTY_BYTES;
3245
+ }
2253
3246
  }
2254
3247
 
2255
3248
  export class ListTransactionsRequest {
2256
3249
  constructor({ } = {}) {
2257
- this.unknownFields = new Uint8Array(0);
3250
+ this.unknownFields = EMPTY_BYTES;
2258
3251
  }
2259
3252
  static encode(msg) {
2260
3253
  const out = [];
@@ -2263,6 +3256,15 @@ export class ListTransactionsRequest {
2263
3256
  }
2264
3257
  static decode(bytes) {
2265
3258
  const msg = new ListTransactionsRequest();
3259
+ ListTransactionsRequest._fill(msg, bytes);
3260
+ return msg;
3261
+ }
3262
+ static decodeInto(msg, bytes) {
3263
+ msg._reset();
3264
+ ListTransactionsRequest._fill(msg, bytes);
3265
+ return msg;
3266
+ }
3267
+ static _fill(msg, bytes) {
2266
3268
  const reader = new Reader(bytes);
2267
3269
  let f;
2268
3270
  while ((f = reader.field()) !== null) {
@@ -2273,6 +3275,9 @@ export class ListTransactionsRequest {
2273
3275
  }
2274
3276
  return msg;
2275
3277
  }
3278
+ _reset() {
3279
+ this.unknownFields = EMPTY_BYTES;
3280
+ }
2276
3281
  }
2277
3282
 
2278
3283
  export class TransactionListing {
@@ -2280,7 +3285,7 @@ export class TransactionListing {
2280
3285
  this.transactionalId = transactionalId;
2281
3286
  this.producerId = producerId;
2282
3287
  this.transactionState = transactionState;
2283
- this.unknownFields = new Uint8Array(0);
3288
+ this.unknownFields = EMPTY_BYTES;
2284
3289
  }
2285
3290
  static encode(msg) {
2286
3291
  const out = [];
@@ -2292,26 +3297,41 @@ export class TransactionListing {
2292
3297
  }
2293
3298
  static decode(bytes) {
2294
3299
  const msg = new TransactionListing();
3300
+ TransactionListing._fill(msg, bytes);
3301
+ return msg;
3302
+ }
3303
+ static decodeInto(msg, bytes) {
3304
+ msg._reset();
3305
+ TransactionListing._fill(msg, bytes);
3306
+ return msg;
3307
+ }
3308
+ static _fill(msg, bytes) {
2295
3309
  const reader = new Reader(bytes);
2296
3310
  let f;
2297
3311
  while ((f = reader.field()) !== null) {
2298
3312
  const [num, wire, value, raw] = f;
2299
3313
  switch (num) {
2300
- case 1: msg.transactionalId = new TextDecoder().decode(value); break;
3314
+ case 1: msg.transactionalId = textDecoder.decode(value); break;
2301
3315
  case 2: msg.producerId = BigInt.asIntN(64, value); break;
2302
- case 3: msg.transactionState = new TextDecoder().decode(value); break;
3316
+ case 3: msg.transactionState = textDecoder.decode(value); break;
2303
3317
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2304
3318
  }
2305
3319
  }
2306
3320
  return msg;
2307
3321
  }
3322
+ _reset() {
3323
+ this.transactionalId = "";
3324
+ this.producerId = 0n;
3325
+ this.transactionState = "";
3326
+ this.unknownFields = EMPTY_BYTES;
3327
+ }
2308
3328
  }
2309
3329
 
2310
3330
  export class ListTransactionsResponse {
2311
3331
  constructor({ errorCode = 0, transactions = [] } = {}) {
2312
3332
  this.errorCode = errorCode;
2313
3333
  this.transactions = transactions;
2314
- this.unknownFields = new Uint8Array(0);
3334
+ this.unknownFields = EMPTY_BYTES;
2315
3335
  }
2316
3336
  static encode(msg) {
2317
3337
  const out = [];
@@ -2322,6 +3342,15 @@ export class ListTransactionsResponse {
2322
3342
  }
2323
3343
  static decode(bytes) {
2324
3344
  const msg = new ListTransactionsResponse();
3345
+ ListTransactionsResponse._fill(msg, bytes);
3346
+ return msg;
3347
+ }
3348
+ static decodeInto(msg, bytes) {
3349
+ msg._reset();
3350
+ ListTransactionsResponse._fill(msg, bytes);
3351
+ return msg;
3352
+ }
3353
+ static _fill(msg, bytes) {
2325
3354
  const reader = new Reader(bytes);
2326
3355
  let f;
2327
3356
  while ((f = reader.field()) !== null) {
@@ -2334,32 +3363,50 @@ export class ListTransactionsResponse {
2334
3363
  }
2335
3364
  return msg;
2336
3365
  }
3366
+ _reset() {
3367
+ this.errorCode = 0;
3368
+ this.transactions = [];
3369
+ this.unknownFields = EMPTY_BYTES;
3370
+ }
2337
3371
  }
2338
3372
 
2339
3373
  export class DescribeTransactionsRequest {
2340
3374
  constructor({ transactionalIds = [] } = {}) {
2341
3375
  this.transactionalIds = transactionalIds;
2342
- this.unknownFields = new Uint8Array(0);
3376
+ this.unknownFields = EMPTY_BYTES;
2343
3377
  }
2344
3378
  static encode(msg) {
2345
3379
  const out = [];
2346
- if (msg.transactionalIds) for (const v of msg.transactionalIds) putBytesField(out, 1, new TextEncoder().encode(v));
3380
+ if (msg.transactionalIds) for (const v of msg.transactionalIds) putBytesField(out, 1, textEncoder.encode(v));
2347
3381
  putRaw(out, msg.unknownFields);
2348
3382
  return new Uint8Array(out);
2349
3383
  }
2350
3384
  static decode(bytes) {
2351
3385
  const msg = new DescribeTransactionsRequest();
3386
+ DescribeTransactionsRequest._fill(msg, bytes);
3387
+ return msg;
3388
+ }
3389
+ static decodeInto(msg, bytes) {
3390
+ msg._reset();
3391
+ DescribeTransactionsRequest._fill(msg, bytes);
3392
+ return msg;
3393
+ }
3394
+ static _fill(msg, bytes) {
2352
3395
  const reader = new Reader(bytes);
2353
3396
  let f;
2354
3397
  while ((f = reader.field()) !== null) {
2355
3398
  const [num, wire, value, raw] = f;
2356
3399
  switch (num) {
2357
- case 1: msg.transactionalIds.push(new TextDecoder().decode(value)); break;
3400
+ case 1: msg.transactionalIds.push(textDecoder.decode(value)); break;
2358
3401
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2359
3402
  }
2360
3403
  }
2361
3404
  return msg;
2362
3405
  }
3406
+ _reset() {
3407
+ this.transactionalIds = [];
3408
+ this.unknownFields = EMPTY_BYTES;
3409
+ }
2363
3410
  }
2364
3411
 
2365
3412
  export class DescribedTransaction {
@@ -2370,7 +3417,7 @@ export class DescribedTransaction {
2370
3417
  this.producerEpoch = producerEpoch;
2371
3418
  this.transactionState = transactionState;
2372
3419
  this.lastUpdateTimestampMs = lastUpdateTimestampMs;
2373
- this.unknownFields = new Uint8Array(0);
3420
+ this.unknownFields = EMPTY_BYTES;
2374
3421
  }
2375
3422
  static encode(msg) {
2376
3423
  const out = [];
@@ -2385,28 +3432,46 @@ export class DescribedTransaction {
2385
3432
  }
2386
3433
  static decode(bytes) {
2387
3434
  const msg = new DescribedTransaction();
3435
+ DescribedTransaction._fill(msg, bytes);
3436
+ return msg;
3437
+ }
3438
+ static decodeInto(msg, bytes) {
3439
+ msg._reset();
3440
+ DescribedTransaction._fill(msg, bytes);
3441
+ return msg;
3442
+ }
3443
+ static _fill(msg, bytes) {
2388
3444
  const reader = new Reader(bytes);
2389
3445
  let f;
2390
3446
  while ((f = reader.field()) !== null) {
2391
3447
  const [num, wire, value, raw] = f;
2392
3448
  switch (num) {
2393
- case 1: msg.transactionalId = new TextDecoder().decode(value); break;
3449
+ case 1: msg.transactionalId = textDecoder.decode(value); break;
2394
3450
  case 2: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
2395
3451
  case 3: msg.producerId = BigInt.asIntN(64, value); break;
2396
3452
  case 4: msg.producerEpoch = Number(BigInt.asIntN(32, value)); break;
2397
- case 5: msg.transactionState = new TextDecoder().decode(value); break;
3453
+ case 5: msg.transactionState = textDecoder.decode(value); break;
2398
3454
  case 6: msg.lastUpdateTimestampMs = BigInt.asIntN(64, value); break;
2399
3455
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2400
3456
  }
2401
3457
  }
2402
3458
  return msg;
2403
3459
  }
3460
+ _reset() {
3461
+ this.transactionalId = "";
3462
+ this.errorCode = 0;
3463
+ this.producerId = 0n;
3464
+ this.producerEpoch = 0;
3465
+ this.transactionState = "";
3466
+ this.lastUpdateTimestampMs = 0n;
3467
+ this.unknownFields = EMPTY_BYTES;
3468
+ }
2404
3469
  }
2405
3470
 
2406
3471
  export class DescribeTransactionsResponse {
2407
3472
  constructor({ transactions = [] } = {}) {
2408
3473
  this.transactions = transactions;
2409
- this.unknownFields = new Uint8Array(0);
3474
+ this.unknownFields = EMPTY_BYTES;
2410
3475
  }
2411
3476
  static encode(msg) {
2412
3477
  const out = [];
@@ -2416,6 +3481,15 @@ export class DescribeTransactionsResponse {
2416
3481
  }
2417
3482
  static decode(bytes) {
2418
3483
  const msg = new DescribeTransactionsResponse();
3484
+ DescribeTransactionsResponse._fill(msg, bytes);
3485
+ return msg;
3486
+ }
3487
+ static decodeInto(msg, bytes) {
3488
+ msg._reset();
3489
+ DescribeTransactionsResponse._fill(msg, bytes);
3490
+ return msg;
3491
+ }
3492
+ static _fill(msg, bytes) {
2419
3493
  const reader = new Reader(bytes);
2420
3494
  let f;
2421
3495
  while ((f = reader.field()) !== null) {
@@ -2427,6 +3501,10 @@ export class DescribeTransactionsResponse {
2427
3501
  }
2428
3502
  return msg;
2429
3503
  }
3504
+ _reset() {
3505
+ this.transactions = [];
3506
+ this.unknownFields = EMPTY_BYTES;
3507
+ }
2430
3508
  }
2431
3509
 
2432
3510
  export class OpenShareGroupRequest {
@@ -2435,12 +3513,12 @@ export class OpenShareGroupRequest {
2435
3513
  this.topics = topics;
2436
3514
  this.groupInstanceId = groupInstanceId;
2437
3515
  this.sessionTimeoutMs = sessionTimeoutMs;
2438
- this.unknownFields = new Uint8Array(0);
3516
+ this.unknownFields = EMPTY_BYTES;
2439
3517
  }
2440
3518
  static encode(msg) {
2441
3519
  const out = [];
2442
3520
  putStringField(out, 1, msg.groupId);
2443
- if (msg.topics) for (const v of msg.topics) putBytesField(out, 2, new TextEncoder().encode(v));
3521
+ if (msg.topics) for (const v of msg.topics) putBytesField(out, 2, textEncoder.encode(v));
2444
3522
  putStringField(out, 3, msg.groupInstanceId);
2445
3523
  putVarintField(out, 4, BigInt(msg.sessionTimeoutMs));
2446
3524
  putRaw(out, msg.unknownFields);
@@ -2448,20 +3526,36 @@ export class OpenShareGroupRequest {
2448
3526
  }
2449
3527
  static decode(bytes) {
2450
3528
  const msg = new OpenShareGroupRequest();
3529
+ OpenShareGroupRequest._fill(msg, bytes);
3530
+ return msg;
3531
+ }
3532
+ static decodeInto(msg, bytes) {
3533
+ msg._reset();
3534
+ OpenShareGroupRequest._fill(msg, bytes);
3535
+ return msg;
3536
+ }
3537
+ static _fill(msg, bytes) {
2451
3538
  const reader = new Reader(bytes);
2452
3539
  let f;
2453
3540
  while ((f = reader.field()) !== null) {
2454
3541
  const [num, wire, value, raw] = f;
2455
3542
  switch (num) {
2456
- case 1: msg.groupId = new TextDecoder().decode(value); break;
2457
- case 2: msg.topics.push(new TextDecoder().decode(value)); break;
2458
- case 3: msg.groupInstanceId = new TextDecoder().decode(value); break;
3543
+ case 1: msg.groupId = textDecoder.decode(value); break;
3544
+ case 2: msg.topics.push(textDecoder.decode(value)); break;
3545
+ case 3: msg.groupInstanceId = textDecoder.decode(value); break;
2459
3546
  case 4: msg.sessionTimeoutMs = Number(BigInt.asIntN(32, value)); break;
2460
3547
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2461
3548
  }
2462
3549
  }
2463
3550
  return msg;
2464
3551
  }
3552
+ _reset() {
3553
+ this.groupId = "";
3554
+ this.topics = [];
3555
+ this.groupInstanceId = "";
3556
+ this.sessionTimeoutMs = 0;
3557
+ this.unknownFields = EMPTY_BYTES;
3558
+ }
2465
3559
  }
2466
3560
 
2467
3561
  export class OpenShareGroupResponse {
@@ -2469,7 +3563,7 @@ export class OpenShareGroupResponse {
2469
3563
  this.sessionId = sessionId;
2470
3564
  this.errorCode = errorCode;
2471
3565
  this.assignment = assignment;
2472
- this.unknownFields = new Uint8Array(0);
3566
+ this.unknownFields = EMPTY_BYTES;
2473
3567
  }
2474
3568
  static encode(msg) {
2475
3569
  const out = [];
@@ -2481,12 +3575,21 @@ export class OpenShareGroupResponse {
2481
3575
  }
2482
3576
  static decode(bytes) {
2483
3577
  const msg = new OpenShareGroupResponse();
3578
+ OpenShareGroupResponse._fill(msg, bytes);
3579
+ return msg;
3580
+ }
3581
+ static decodeInto(msg, bytes) {
3582
+ msg._reset();
3583
+ OpenShareGroupResponse._fill(msg, bytes);
3584
+ return msg;
3585
+ }
3586
+ static _fill(msg, bytes) {
2484
3587
  const reader = new Reader(bytes);
2485
3588
  let f;
2486
3589
  while ((f = reader.field()) !== null) {
2487
3590
  const [num, wire, value, raw] = f;
2488
3591
  switch (num) {
2489
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
3592
+ case 1: msg.sessionId = textDecoder.decode(value); break;
2490
3593
  case 2: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
2491
3594
  case 3: msg.assignment = Assignment.decode(value); break;
2492
3595
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -2494,6 +3597,12 @@ export class OpenShareGroupResponse {
2494
3597
  }
2495
3598
  return msg;
2496
3599
  }
3600
+ _reset() {
3601
+ this.sessionId = "";
3602
+ this.errorCode = 0;
3603
+ this.assignment = undefined;
3604
+ this.unknownFields = EMPTY_BYTES;
3605
+ }
2497
3606
  }
2498
3607
 
2499
3608
  export class SharePollRequest {
@@ -2501,7 +3610,7 @@ export class SharePollRequest {
2501
3610
  this.sessionId = sessionId;
2502
3611
  this.maxRecords = maxRecords;
2503
3612
  this.maxWaitMs = maxWaitMs;
2504
- this.unknownFields = new Uint8Array(0);
3613
+ this.unknownFields = EMPTY_BYTES;
2505
3614
  }
2506
3615
  static encode(msg) {
2507
3616
  const out = [];
@@ -2513,12 +3622,21 @@ export class SharePollRequest {
2513
3622
  }
2514
3623
  static decode(bytes) {
2515
3624
  const msg = new SharePollRequest();
3625
+ SharePollRequest._fill(msg, bytes);
3626
+ return msg;
3627
+ }
3628
+ static decodeInto(msg, bytes) {
3629
+ msg._reset();
3630
+ SharePollRequest._fill(msg, bytes);
3631
+ return msg;
3632
+ }
3633
+ static _fill(msg, bytes) {
2516
3634
  const reader = new Reader(bytes);
2517
3635
  let f;
2518
3636
  while ((f = reader.field()) !== null) {
2519
3637
  const [num, wire, value, raw] = f;
2520
3638
  switch (num) {
2521
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
3639
+ case 1: msg.sessionId = textDecoder.decode(value); break;
2522
3640
  case 2: msg.maxRecords = Number(BigInt.asIntN(32, value)); break;
2523
3641
  case 3: msg.maxWaitMs = Number(BigInt.asIntN(32, value)); break;
2524
3642
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
@@ -2526,6 +3644,12 @@ export class SharePollRequest {
2526
3644
  }
2527
3645
  return msg;
2528
3646
  }
3647
+ _reset() {
3648
+ this.sessionId = "";
3649
+ this.maxRecords = 0;
3650
+ this.maxWaitMs = 0;
3651
+ this.unknownFields = EMPTY_BYTES;
3652
+ }
2529
3653
  }
2530
3654
 
2531
3655
  export class SharePollRecord {
@@ -2539,7 +3663,7 @@ export class SharePollRecord {
2539
3663
  this.timestampMs = timestampMs;
2540
3664
  this.deliveryCount = deliveryCount;
2541
3665
  this.nullKey = nullKey;
2542
- this.unknownFields = new Uint8Array(0);
3666
+ this.unknownFields = EMPTY_BYTES;
2543
3667
  }
2544
3668
  static encode(msg) {
2545
3669
  const out = [];
@@ -2557,12 +3681,21 @@ export class SharePollRecord {
2557
3681
  }
2558
3682
  static decode(bytes) {
2559
3683
  const msg = new SharePollRecord();
3684
+ SharePollRecord._fill(msg, bytes);
3685
+ return msg;
3686
+ }
3687
+ static decodeInto(msg, bytes) {
3688
+ msg._reset();
3689
+ SharePollRecord._fill(msg, bytes);
3690
+ return msg;
3691
+ }
3692
+ static _fill(msg, bytes) {
2560
3693
  const reader = new Reader(bytes);
2561
3694
  let f;
2562
3695
  while ((f = reader.field()) !== null) {
2563
3696
  const [num, wire, value, raw] = f;
2564
3697
  switch (num) {
2565
- case 1: msg.topic = new TextDecoder().decode(value); break;
3698
+ case 1: msg.topic = textDecoder.decode(value); break;
2566
3699
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
2567
3700
  case 3: msg.offset = BigInt.asIntN(64, value); break;
2568
3701
  case 4: msg.key = value; break;
@@ -2576,13 +3709,25 @@ export class SharePollRecord {
2576
3709
  }
2577
3710
  return msg;
2578
3711
  }
3712
+ _reset() {
3713
+ this.topic = "";
3714
+ this.partition = 0;
3715
+ this.offset = 0n;
3716
+ this.key = new Uint8Array(0);
3717
+ this.value = new Uint8Array(0);
3718
+ this.headers = [];
3719
+ this.timestampMs = 0n;
3720
+ this.deliveryCount = 0;
3721
+ this.nullKey = false;
3722
+ this.unknownFields = EMPTY_BYTES;
3723
+ }
2579
3724
  }
2580
3725
 
2581
3726
  export class SharePollResponse {
2582
3727
  constructor({ records = [], errorCode = 0 } = {}) {
2583
3728
  this.records = records;
2584
3729
  this.errorCode = errorCode;
2585
- this.unknownFields = new Uint8Array(0);
3730
+ this.unknownFields = EMPTY_BYTES;
2586
3731
  }
2587
3732
  static encode(msg) {
2588
3733
  const out = [];
@@ -2593,6 +3738,15 @@ export class SharePollResponse {
2593
3738
  }
2594
3739
  static decode(bytes) {
2595
3740
  const msg = new SharePollResponse();
3741
+ SharePollResponse._fill(msg, bytes);
3742
+ return msg;
3743
+ }
3744
+ static decodeInto(msg, bytes) {
3745
+ msg._reset();
3746
+ SharePollResponse._fill(msg, bytes);
3747
+ return msg;
3748
+ }
3749
+ static _fill(msg, bytes) {
2596
3750
  const reader = new Reader(bytes);
2597
3751
  let f;
2598
3752
  while ((f = reader.field()) !== null) {
@@ -2605,6 +3759,11 @@ export class SharePollResponse {
2605
3759
  }
2606
3760
  return msg;
2607
3761
  }
3762
+ _reset() {
3763
+ this.records = [];
3764
+ this.errorCode = 0;
3765
+ this.unknownFields = EMPTY_BYTES;
3766
+ }
2608
3767
  }
2609
3768
 
2610
3769
  export class ShareAckEntry {
@@ -2613,7 +3772,7 @@ export class ShareAckEntry {
2613
3772
  this.partition = partition;
2614
3773
  this.offset = offset;
2615
3774
  this.ackType = ackType;
2616
- this.unknownFields = new Uint8Array(0);
3775
+ this.unknownFields = EMPTY_BYTES;
2617
3776
  }
2618
3777
  static encode(msg) {
2619
3778
  const out = [];
@@ -2626,12 +3785,21 @@ export class ShareAckEntry {
2626
3785
  }
2627
3786
  static decode(bytes) {
2628
3787
  const msg = new ShareAckEntry();
3788
+ ShareAckEntry._fill(msg, bytes);
3789
+ return msg;
3790
+ }
3791
+ static decodeInto(msg, bytes) {
3792
+ msg._reset();
3793
+ ShareAckEntry._fill(msg, bytes);
3794
+ return msg;
3795
+ }
3796
+ static _fill(msg, bytes) {
2629
3797
  const reader = new Reader(bytes);
2630
3798
  let f;
2631
3799
  while ((f = reader.field()) !== null) {
2632
3800
  const [num, wire, value, raw] = f;
2633
3801
  switch (num) {
2634
- case 1: msg.topic = new TextDecoder().decode(value); break;
3802
+ case 1: msg.topic = textDecoder.decode(value); break;
2635
3803
  case 2: msg.partition = Number(BigInt.asIntN(32, value)); break;
2636
3804
  case 3: msg.offset = BigInt.asIntN(64, value); break;
2637
3805
  case 4: msg.ackType = Number(BigInt.asIntN(32, value)); break;
@@ -2640,13 +3808,20 @@ export class ShareAckEntry {
2640
3808
  }
2641
3809
  return msg;
2642
3810
  }
3811
+ _reset() {
3812
+ this.topic = "";
3813
+ this.partition = 0;
3814
+ this.offset = 0n;
3815
+ this.ackType = 0;
3816
+ this.unknownFields = EMPTY_BYTES;
3817
+ }
2643
3818
  }
2644
3819
 
2645
3820
  export class ShareAckRequest {
2646
3821
  constructor({ sessionId = "", entries = [] } = {}) {
2647
3822
  this.sessionId = sessionId;
2648
3823
  this.entries = entries;
2649
- this.unknownFields = new Uint8Array(0);
3824
+ this.unknownFields = EMPTY_BYTES;
2650
3825
  }
2651
3826
  static encode(msg) {
2652
3827
  const out = [];
@@ -2657,24 +3832,38 @@ export class ShareAckRequest {
2657
3832
  }
2658
3833
  static decode(bytes) {
2659
3834
  const msg = new ShareAckRequest();
3835
+ ShareAckRequest._fill(msg, bytes);
3836
+ return msg;
3837
+ }
3838
+ static decodeInto(msg, bytes) {
3839
+ msg._reset();
3840
+ ShareAckRequest._fill(msg, bytes);
3841
+ return msg;
3842
+ }
3843
+ static _fill(msg, bytes) {
2660
3844
  const reader = new Reader(bytes);
2661
3845
  let f;
2662
3846
  while ((f = reader.field()) !== null) {
2663
3847
  const [num, wire, value, raw] = f;
2664
3848
  switch (num) {
2665
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
3849
+ case 1: msg.sessionId = textDecoder.decode(value); break;
2666
3850
  case 2: msg.entries.push(ShareAckEntry.decode(value)); break;
2667
3851
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2668
3852
  }
2669
3853
  }
2670
3854
  return msg;
2671
3855
  }
3856
+ _reset() {
3857
+ this.sessionId = "";
3858
+ this.entries = [];
3859
+ this.unknownFields = EMPTY_BYTES;
3860
+ }
2672
3861
  }
2673
3862
 
2674
3863
  export class ShareAckResponse {
2675
3864
  constructor({ errorCode = 0 } = {}) {
2676
3865
  this.errorCode = errorCode;
2677
- this.unknownFields = new Uint8Array(0);
3866
+ this.unknownFields = EMPTY_BYTES;
2678
3867
  }
2679
3868
  static encode(msg) {
2680
3869
  const out = [];
@@ -2684,6 +3873,15 @@ export class ShareAckResponse {
2684
3873
  }
2685
3874
  static decode(bytes) {
2686
3875
  const msg = new ShareAckResponse();
3876
+ ShareAckResponse._fill(msg, bytes);
3877
+ return msg;
3878
+ }
3879
+ static decodeInto(msg, bytes) {
3880
+ msg._reset();
3881
+ ShareAckResponse._fill(msg, bytes);
3882
+ return msg;
3883
+ }
3884
+ static _fill(msg, bytes) {
2687
3885
  const reader = new Reader(bytes);
2688
3886
  let f;
2689
3887
  while ((f = reader.field()) !== null) {
@@ -2695,12 +3893,16 @@ export class ShareAckResponse {
2695
3893
  }
2696
3894
  return msg;
2697
3895
  }
3896
+ _reset() {
3897
+ this.errorCode = 0;
3898
+ this.unknownFields = EMPTY_BYTES;
3899
+ }
2698
3900
  }
2699
3901
 
2700
3902
  export class CloseShareGroupRequest {
2701
3903
  constructor({ sessionId = "" } = {}) {
2702
3904
  this.sessionId = sessionId;
2703
- this.unknownFields = new Uint8Array(0);
3905
+ this.unknownFields = EMPTY_BYTES;
2704
3906
  }
2705
3907
  static encode(msg) {
2706
3908
  const out = [];
@@ -2710,23 +3912,36 @@ export class CloseShareGroupRequest {
2710
3912
  }
2711
3913
  static decode(bytes) {
2712
3914
  const msg = new CloseShareGroupRequest();
3915
+ CloseShareGroupRequest._fill(msg, bytes);
3916
+ return msg;
3917
+ }
3918
+ static decodeInto(msg, bytes) {
3919
+ msg._reset();
3920
+ CloseShareGroupRequest._fill(msg, bytes);
3921
+ return msg;
3922
+ }
3923
+ static _fill(msg, bytes) {
2713
3924
  const reader = new Reader(bytes);
2714
3925
  let f;
2715
3926
  while ((f = reader.field()) !== null) {
2716
3927
  const [num, wire, value, raw] = f;
2717
3928
  switch (num) {
2718
- case 1: msg.sessionId = new TextDecoder().decode(value); break;
3929
+ case 1: msg.sessionId = textDecoder.decode(value); break;
2719
3930
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2720
3931
  }
2721
3932
  }
2722
3933
  return msg;
2723
3934
  }
3935
+ _reset() {
3936
+ this.sessionId = "";
3937
+ this.unknownFields = EMPTY_BYTES;
3938
+ }
2724
3939
  }
2725
3940
 
2726
3941
  export class CloseShareGroupResponse {
2727
3942
  constructor({ errorCode = 0 } = {}) {
2728
3943
  this.errorCode = errorCode;
2729
- this.unknownFields = new Uint8Array(0);
3944
+ this.unknownFields = EMPTY_BYTES;
2730
3945
  }
2731
3946
  static encode(msg) {
2732
3947
  const out = [];
@@ -2736,6 +3951,15 @@ export class CloseShareGroupResponse {
2736
3951
  }
2737
3952
  static decode(bytes) {
2738
3953
  const msg = new CloseShareGroupResponse();
3954
+ CloseShareGroupResponse._fill(msg, bytes);
3955
+ return msg;
3956
+ }
3957
+ static decodeInto(msg, bytes) {
3958
+ msg._reset();
3959
+ CloseShareGroupResponse._fill(msg, bytes);
3960
+ return msg;
3961
+ }
3962
+ static _fill(msg, bytes) {
2739
3963
  const reader = new Reader(bytes);
2740
3964
  let f;
2741
3965
  while ((f = reader.field()) !== null) {
@@ -2747,6 +3971,10 @@ export class CloseShareGroupResponse {
2747
3971
  }
2748
3972
  return msg;
2749
3973
  }
3974
+ _reset() {
3975
+ this.errorCode = 0;
3976
+ this.unknownFields = EMPTY_BYTES;
3977
+ }
2750
3978
  }
2751
3979
 
2752
3980
  export class ShareGroupMember {
@@ -2757,7 +3985,7 @@ export class ShareGroupMember {
2757
3985
  this.clientHost = clientHost;
2758
3986
  this.subscribedTopics = subscribedTopics;
2759
3987
  this.assignment = assignment;
2760
- this.unknownFields = new Uint8Array(0);
3988
+ this.unknownFields = EMPTY_BYTES;
2761
3989
  }
2762
3990
  static encode(msg) {
2763
3991
  const out = [];
@@ -2765,29 +3993,47 @@ export class ShareGroupMember {
2765
3993
  putVarintField(out, 2, BigInt(msg.memberEpoch));
2766
3994
  putStringField(out, 3, msg.clientId);
2767
3995
  putStringField(out, 4, msg.clientHost);
2768
- if (msg.subscribedTopics) for (const v of msg.subscribedTopics) putBytesField(out, 5, new TextEncoder().encode(v));
3996
+ if (msg.subscribedTopics) for (const v of msg.subscribedTopics) putBytesField(out, 5, textEncoder.encode(v));
2769
3997
  if (msg.assignment) for (const v of msg.assignment) putBytesField(out, 6, TopicPartition.encode(v));
2770
3998
  putRaw(out, msg.unknownFields);
2771
3999
  return new Uint8Array(out);
2772
4000
  }
2773
4001
  static decode(bytes) {
2774
4002
  const msg = new ShareGroupMember();
4003
+ ShareGroupMember._fill(msg, bytes);
4004
+ return msg;
4005
+ }
4006
+ static decodeInto(msg, bytes) {
4007
+ msg._reset();
4008
+ ShareGroupMember._fill(msg, bytes);
4009
+ return msg;
4010
+ }
4011
+ static _fill(msg, bytes) {
2775
4012
  const reader = new Reader(bytes);
2776
4013
  let f;
2777
4014
  while ((f = reader.field()) !== null) {
2778
4015
  const [num, wire, value, raw] = f;
2779
4016
  switch (num) {
2780
- case 1: msg.memberId = new TextDecoder().decode(value); break;
4017
+ case 1: msg.memberId = textDecoder.decode(value); break;
2781
4018
  case 2: msg.memberEpoch = Number(BigInt.asIntN(32, value)); break;
2782
- case 3: msg.clientId = new TextDecoder().decode(value); break;
2783
- case 4: msg.clientHost = new TextDecoder().decode(value); break;
2784
- case 5: msg.subscribedTopics.push(new TextDecoder().decode(value)); break;
4019
+ case 3: msg.clientId = textDecoder.decode(value); break;
4020
+ case 4: msg.clientHost = textDecoder.decode(value); break;
4021
+ case 5: msg.subscribedTopics.push(textDecoder.decode(value)); break;
2785
4022
  case 6: msg.assignment.push(TopicPartition.decode(value)); break;
2786
4023
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2787
4024
  }
2788
4025
  }
2789
4026
  return msg;
2790
4027
  }
4028
+ _reset() {
4029
+ this.memberId = "";
4030
+ this.memberEpoch = 0;
4031
+ this.clientId = "";
4032
+ this.clientHost = "";
4033
+ this.subscribedTopics = [];
4034
+ this.assignment = [];
4035
+ this.unknownFields = EMPTY_BYTES;
4036
+ }
2791
4037
  }
2792
4038
 
2793
4039
  export class ShareGroupDescription {
@@ -2798,7 +4044,7 @@ export class ShareGroupDescription {
2798
4044
  this.groupEpoch = groupEpoch;
2799
4045
  this.assignmentEpoch = assignmentEpoch;
2800
4046
  this.members = members;
2801
- this.unknownFields = new Uint8Array(0);
4047
+ this.unknownFields = EMPTY_BYTES;
2802
4048
  }
2803
4049
  static encode(msg) {
2804
4050
  const out = [];
@@ -2813,14 +4059,23 @@ export class ShareGroupDescription {
2813
4059
  }
2814
4060
  static decode(bytes) {
2815
4061
  const msg = new ShareGroupDescription();
4062
+ ShareGroupDescription._fill(msg, bytes);
4063
+ return msg;
4064
+ }
4065
+ static decodeInto(msg, bytes) {
4066
+ msg._reset();
4067
+ ShareGroupDescription._fill(msg, bytes);
4068
+ return msg;
4069
+ }
4070
+ static _fill(msg, bytes) {
2816
4071
  const reader = new Reader(bytes);
2817
4072
  let f;
2818
4073
  while ((f = reader.field()) !== null) {
2819
4074
  const [num, wire, value, raw] = f;
2820
4075
  switch (num) {
2821
- case 1: msg.groupId = new TextDecoder().decode(value); break;
4076
+ case 1: msg.groupId = textDecoder.decode(value); break;
2822
4077
  case 2: msg.errorCode = Number(BigInt.asIntN(32, value)); break;
2823
- case 3: msg.state = new TextDecoder().decode(value); break;
4078
+ case 3: msg.state = textDecoder.decode(value); break;
2824
4079
  case 4: msg.groupEpoch = Number(BigInt.asIntN(32, value)); break;
2825
4080
  case 5: msg.assignmentEpoch = Number(BigInt.asIntN(32, value)); break;
2826
4081
  case 6: msg.members.push(ShareGroupMember.decode(value)); break;
@@ -2829,39 +4084,61 @@ export class ShareGroupDescription {
2829
4084
  }
2830
4085
  return msg;
2831
4086
  }
4087
+ _reset() {
4088
+ this.groupId = "";
4089
+ this.errorCode = 0;
4090
+ this.state = "";
4091
+ this.groupEpoch = 0;
4092
+ this.assignmentEpoch = 0;
4093
+ this.members = [];
4094
+ this.unknownFields = EMPTY_BYTES;
4095
+ }
2832
4096
  }
2833
4097
 
2834
4098
  export class DescribeShareGroupsRequest {
2835
4099
  constructor({ groupIds = [] } = {}) {
2836
4100
  this.groupIds = groupIds;
2837
- this.unknownFields = new Uint8Array(0);
4101
+ this.unknownFields = EMPTY_BYTES;
2838
4102
  }
2839
4103
  static encode(msg) {
2840
4104
  const out = [];
2841
- if (msg.groupIds) for (const v of msg.groupIds) putBytesField(out, 1, new TextEncoder().encode(v));
4105
+ if (msg.groupIds) for (const v of msg.groupIds) putBytesField(out, 1, textEncoder.encode(v));
2842
4106
  putRaw(out, msg.unknownFields);
2843
4107
  return new Uint8Array(out);
2844
4108
  }
2845
4109
  static decode(bytes) {
2846
4110
  const msg = new DescribeShareGroupsRequest();
4111
+ DescribeShareGroupsRequest._fill(msg, bytes);
4112
+ return msg;
4113
+ }
4114
+ static decodeInto(msg, bytes) {
4115
+ msg._reset();
4116
+ DescribeShareGroupsRequest._fill(msg, bytes);
4117
+ return msg;
4118
+ }
4119
+ static _fill(msg, bytes) {
2847
4120
  const reader = new Reader(bytes);
2848
4121
  let f;
2849
4122
  while ((f = reader.field()) !== null) {
2850
4123
  const [num, wire, value, raw] = f;
2851
4124
  switch (num) {
2852
- case 1: msg.groupIds.push(new TextDecoder().decode(value)); break;
4125
+ case 1: msg.groupIds.push(textDecoder.decode(value)); break;
2853
4126
  default: msg.unknownFields = concatBytes(msg.unknownFields, raw); break;
2854
4127
  }
2855
4128
  }
2856
4129
  return msg;
2857
4130
  }
4131
+ _reset() {
4132
+ this.groupIds = [];
4133
+ this.unknownFields = EMPTY_BYTES;
4134
+ }
2858
4135
  }
2859
4136
 
2860
4137
  export class DescribeShareGroupsResponse {
2861
4138
  constructor({ groups = [], errorCode = 0 } = {}) {
2862
4139
  this.groups = groups;
2863
4140
  this.errorCode = errorCode;
2864
- this.unknownFields = new Uint8Array(0);
4141
+ this.unknownFields = EMPTY_BYTES;
2865
4142
  }
2866
4143
  static encode(msg) {
2867
4144
  const out = [];
@@ -2872,6 +4149,15 @@ export class DescribeShareGroupsResponse {
2872
4149
  }
2873
4150
  static decode(bytes) {
2874
4151
  const msg = new DescribeShareGroupsResponse();
4152
+ DescribeShareGroupsResponse._fill(msg, bytes);
4153
+ return msg;
4154
+ }
4155
+ static decodeInto(msg, bytes) {
4156
+ msg._reset();
4157
+ DescribeShareGroupsResponse._fill(msg, bytes);
4158
+ return msg;
4159
+ }
4160
+ static _fill(msg, bytes) {
2875
4161
  const reader = new Reader(bytes);
2876
4162
  let f;
2877
4163
  while ((f = reader.field()) !== null) {
@@ -2884,5 +4170,10 @@ export class DescribeShareGroupsResponse {
2884
4170
  }
2885
4171
  return msg;
2886
4172
  }
4173
+ _reset() {
4174
+ this.groups = [];
4175
+ this.errorCode = 0;
4176
+ this.unknownFields = EMPTY_BYTES;
4177
+ }
2887
4178
  }
2888
4179