...

Source file src/github.com/twmb/franz-go/pkg/kmsg/generated.go

Documentation: github.com/twmb/franz-go/pkg/kmsg

     1  package kmsg
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"reflect"
     7  	"strings"
     8  
     9  	"github.com/twmb/franz-go/pkg/kmsg/internal/kbin"
    10  )
    11  
    12  // Code generated by franz-go/generate. DO NOT EDIT.
    13  
    14  // MaxKey is the maximum key used for any messages in this package.
    15  // Note that this value will change as Kafka adds more messages.
    16  const MaxKey = 67
    17  
    18  // MessageV0 is the message format Kafka used prior to 0.10.
    19  //
    20  // To produce or fetch messages, Kafka would write many messages contiguously
    21  // as an array without specifying the array length.
    22  type MessageV0 struct {
    23  	// Offset is the offset of this record.
    24  	//
    25  	// If this is the outer message of a recursive message set (i.e. a
    26  	// message set has been compressed and this is the outer message),
    27  	// then the offset should be the offset of the last inner value.
    28  	Offset int64
    29  
    30  	// MessageSize is the size of everything that follows in this message.
    31  	MessageSize int32
    32  
    33  	// CRC is the crc of everything that follows this field (NOT using the
    34  	// Castagnoli polynomial, as is the case in the 0.11+ RecordBatch).
    35  	CRC int32
    36  
    37  	// Magic is 0.
    38  	Magic int8
    39  
    40  	// Attributes describe the attributes of this message.
    41  	//
    42  	// The first three bits correspond to compression:
    43  	//   - 00 is no compression
    44  	//   - 01 is gzip compression
    45  	//   - 10 is snappy compression
    46  	//
    47  	// The remaining bits are unused and must be 0.
    48  	Attributes int8
    49  
    50  	// Key is an blob of data for a record.
    51  	//
    52  	// Key's are usually used for hashing the record to specific Kafka partitions.
    53  	Key []byte
    54  
    55  	// Value is a blob of data. This field is the main "message" portion of a
    56  	// record.
    57  	Value []byte
    58  }
    59  
    60  func (v *MessageV0) AppendTo(dst []byte) []byte {
    61  	{
    62  		v := v.Offset
    63  		dst = kbin.AppendInt64(dst, v)
    64  	}
    65  	{
    66  		v := v.MessageSize
    67  		dst = kbin.AppendInt32(dst, v)
    68  	}
    69  	{
    70  		v := v.CRC
    71  		dst = kbin.AppendInt32(dst, v)
    72  	}
    73  	{
    74  		v := v.Magic
    75  		dst = kbin.AppendInt8(dst, v)
    76  	}
    77  	{
    78  		v := v.Attributes
    79  		dst = kbin.AppendInt8(dst, v)
    80  	}
    81  	{
    82  		v := v.Key
    83  		dst = kbin.AppendNullableBytes(dst, v)
    84  	}
    85  	{
    86  		v := v.Value
    87  		dst = kbin.AppendNullableBytes(dst, v)
    88  	}
    89  	return dst
    90  }
    91  
    92  func (v *MessageV0) ReadFrom(src []byte) error {
    93  	return v.readFrom(src, false)
    94  }
    95  
    96  func (v *MessageV0) UnsafeReadFrom(src []byte) error {
    97  	return v.readFrom(src, true)
    98  }
    99  
   100  func (v *MessageV0) readFrom(src []byte, unsafe bool) error {
   101  	v.Default()
   102  	b := kbin.Reader{Src: src}
   103  	s := v
   104  	{
   105  		v := b.Int64()
   106  		s.Offset = v
   107  	}
   108  	{
   109  		v := b.Int32()
   110  		s.MessageSize = v
   111  	}
   112  	{
   113  		v := b.Int32()
   114  		s.CRC = v
   115  	}
   116  	{
   117  		v := b.Int8()
   118  		s.Magic = v
   119  	}
   120  	{
   121  		v := b.Int8()
   122  		s.Attributes = v
   123  	}
   124  	{
   125  		v := b.NullableBytes()
   126  		s.Key = v
   127  	}
   128  	{
   129  		v := b.NullableBytes()
   130  		s.Value = v
   131  	}
   132  	return b.Complete()
   133  }
   134  
   135  // Default sets any default fields. Calling this allows for future compatibility
   136  // if new fields are added to MessageV0.
   137  func (v *MessageV0) Default() {
   138  }
   139  
   140  // NewMessageV0 returns a default MessageV0
   141  // This is a shortcut for creating a struct and calling Default yourself.
   142  func NewMessageV0() MessageV0 {
   143  	var v MessageV0
   144  	v.Default()
   145  	return v
   146  }
   147  
   148  // MessageV1 is the message format Kafka used prior to 0.11.
   149  //
   150  // To produce or fetch messages, Kafka would write many messages contiguously
   151  // as an array without specifying the array length.
   152  //
   153  // To support compression, an entire message set would be compressed and used
   154  // as the Value in another message set (thus being "recursive"). The key for
   155  // this outer message set must be null.
   156  type MessageV1 struct {
   157  	// Offset is the offset of this record.
   158  	//
   159  	// Different from v0, if this message set is a recursive message set
   160  	// (that is, compressed and inside another message set), the offset
   161  	// on the inner set is relative to the offset of the outer set.
   162  	Offset int64
   163  
   164  	// MessageSize is the size of everything that follows in this message.
   165  	MessageSize int32
   166  
   167  	// CRC is the crc of everything that follows this field (NOT using the
   168  	// Castagnoli polynomial, as is the case in the 0.11+ RecordBatch).
   169  	CRC int32
   170  
   171  	// Magic is 1.
   172  	Magic int8
   173  
   174  	// Attributes describe the attributes of this message.
   175  	//
   176  	// The first three bits correspond to compression:
   177  	//   - 00 is no compression
   178  	//   - 01 is gzip compression
   179  	//   - 10 is snappy compression
   180  	//
   181  	// Bit 4 is the timestamp type, with 0 meaning CreateTime corresponding
   182  	// to the timestamp being from the producer, and 1 meaning LogAppendTime
   183  	// corresponding to the timestamp being from the broker.
   184  	// Setting this to LogAppendTime will cause batches to be rejected.
   185  	//
   186  	// The remaining bits are unused and must be 0.
   187  	Attributes int8
   188  
   189  	// Timestamp is the millisecond timestamp of this message.
   190  	Timestamp int64
   191  
   192  	// Key is an blob of data for a record.
   193  	//
   194  	// Key's are usually used for hashing the record to specific Kafka partitions.
   195  	Key []byte
   196  
   197  	// Value is  a blob of data. This field is the main "message" portion of a
   198  	// record.
   199  	Value []byte
   200  }
   201  
   202  func (v *MessageV1) AppendTo(dst []byte) []byte {
   203  	{
   204  		v := v.Offset
   205  		dst = kbin.AppendInt64(dst, v)
   206  	}
   207  	{
   208  		v := v.MessageSize
   209  		dst = kbin.AppendInt32(dst, v)
   210  	}
   211  	{
   212  		v := v.CRC
   213  		dst = kbin.AppendInt32(dst, v)
   214  	}
   215  	{
   216  		v := v.Magic
   217  		dst = kbin.AppendInt8(dst, v)
   218  	}
   219  	{
   220  		v := v.Attributes
   221  		dst = kbin.AppendInt8(dst, v)
   222  	}
   223  	{
   224  		v := v.Timestamp
   225  		dst = kbin.AppendInt64(dst, v)
   226  	}
   227  	{
   228  		v := v.Key
   229  		dst = kbin.AppendNullableBytes(dst, v)
   230  	}
   231  	{
   232  		v := v.Value
   233  		dst = kbin.AppendNullableBytes(dst, v)
   234  	}
   235  	return dst
   236  }
   237  
   238  func (v *MessageV1) ReadFrom(src []byte) error {
   239  	return v.readFrom(src, false)
   240  }
   241  
   242  func (v *MessageV1) UnsafeReadFrom(src []byte) error {
   243  	return v.readFrom(src, true)
   244  }
   245  
   246  func (v *MessageV1) readFrom(src []byte, unsafe bool) error {
   247  	v.Default()
   248  	b := kbin.Reader{Src: src}
   249  	s := v
   250  	{
   251  		v := b.Int64()
   252  		s.Offset = v
   253  	}
   254  	{
   255  		v := b.Int32()
   256  		s.MessageSize = v
   257  	}
   258  	{
   259  		v := b.Int32()
   260  		s.CRC = v
   261  	}
   262  	{
   263  		v := b.Int8()
   264  		s.Magic = v
   265  	}
   266  	{
   267  		v := b.Int8()
   268  		s.Attributes = v
   269  	}
   270  	{
   271  		v := b.Int64()
   272  		s.Timestamp = v
   273  	}
   274  	{
   275  		v := b.NullableBytes()
   276  		s.Key = v
   277  	}
   278  	{
   279  		v := b.NullableBytes()
   280  		s.Value = v
   281  	}
   282  	return b.Complete()
   283  }
   284  
   285  // Default sets any default fields. Calling this allows for future compatibility
   286  // if new fields are added to MessageV1.
   287  func (v *MessageV1) Default() {
   288  }
   289  
   290  // NewMessageV1 returns a default MessageV1
   291  // This is a shortcut for creating a struct and calling Default yourself.
   292  func NewMessageV1() MessageV1 {
   293  	var v MessageV1
   294  	v.Default()
   295  	return v
   296  }
   297  
   298  // Header is user provided metadata for a record. Kafka does not look at
   299  // headers at all; they are solely for producers and consumers.
   300  type Header struct {
   301  	Key string
   302  
   303  	Value []byte
   304  }
   305  
   306  func (v *Header) AppendTo(dst []byte) []byte {
   307  	{
   308  		v := v.Key
   309  		dst = kbin.AppendVarintString(dst, v)
   310  	}
   311  	{
   312  		v := v.Value
   313  		dst = kbin.AppendVarintBytes(dst, v)
   314  	}
   315  	return dst
   316  }
   317  
   318  func (v *Header) ReadFrom(src []byte) error {
   319  	return v.readFrom(src, false)
   320  }
   321  
   322  func (v *Header) UnsafeReadFrom(src []byte) error {
   323  	return v.readFrom(src, true)
   324  }
   325  
   326  func (v *Header) readFrom(src []byte, unsafe bool) error {
   327  	v.Default()
   328  	b := kbin.Reader{Src: src}
   329  	s := v
   330  	{
   331  		var v string
   332  		if unsafe {
   333  			v = b.UnsafeVarintString()
   334  		} else {
   335  			v = b.VarintString()
   336  		}
   337  		s.Key = v
   338  	}
   339  	{
   340  		v := b.VarintBytes()
   341  		s.Value = v
   342  	}
   343  	return b.Complete()
   344  }
   345  
   346  // Default sets any default fields. Calling this allows for future compatibility
   347  // if new fields are added to Header.
   348  func (v *Header) Default() {
   349  }
   350  
   351  // NewHeader returns a default Header
   352  // This is a shortcut for creating a struct and calling Default yourself.
   353  func NewHeader() Header {
   354  	var v Header
   355  	v.Default()
   356  	return v
   357  }
   358  
   359  // RecordBatch is a Kafka concept that groups many individual records together
   360  // in a more optimized format.
   361  type RecordBatch struct {
   362  	// FirstOffset is the first offset in a record batch.
   363  	//
   364  	// For producing, this is usually 0.
   365  	FirstOffset int64
   366  
   367  	// Length is the wire length of everything that follows this field.
   368  	Length int32
   369  
   370  	// PartitionLeaderEpoch is the leader epoch of the broker at the time
   371  	// this batch was written. Kafka uses this for cluster communication,
   372  	// but clients can also use this to better aid truncation detection.
   373  	// See KIP-320. Producers should set this to -1.
   374  	PartitionLeaderEpoch int32
   375  
   376  	// Magic is the current "magic" number of this message format.
   377  	// The current magic number is 2.
   378  	Magic int8
   379  
   380  	// CRC is the crc of everything that follows this field using the
   381  	// Castagnoli polynomial.
   382  	CRC int32
   383  
   384  	// Attributes describe the records array of this batch.
   385  	//
   386  	// The first three bits correspond to compression:
   387  	//   - 000 is no compression
   388  	//   - 001 is gzip compression
   389  	//   - 010 is snappy compression
   390  	//   - 011 is lz4 compression
   391  	//   - 100 is zstd compression (produce request version 7+)
   392  	//
   393  	// Bit 4 is the timestamp type, with 0 meaning CreateTime corresponding
   394  	// to the timestamp being from the producer, and 1 meaning LogAppendTime
   395  	// corresponding to the timestamp being from the broker.
   396  	// Setting this to LogAppendTime will cause batches to be rejected.
   397  	//
   398  	// Bit 5 indicates whether the batch is part of a transaction (1 is yes).
   399  	//
   400  	// Bit 6 indicates if the batch includes a control message (1 is yes).
   401  	// Control messages are used to enable transactions and are generated from
   402  	// the broker. Clients should not return control batches to applications.
   403  	Attributes int16
   404  
   405  	// LastOffsetDelta is the offset of the last message in a batch. This is used
   406  	// by the broker to ensure correct behavior even with batch compaction.
   407  	LastOffsetDelta int32
   408  
   409  	// FirstTimestamp is the timestamp (in milliseconds) of the first record
   410  	// in a batch.
   411  	FirstTimestamp int64
   412  
   413  	// MaxTimestamp is the timestamp (in milliseconds) of the last record
   414  	// in a batch. Similar to LastOffsetDelta, this is used to ensure correct
   415  	// behavior with compacting.
   416  	MaxTimestamp int64
   417  
   418  	// ProducerID is the broker assigned producerID from an InitProducerID
   419  	// request.
   420  	//
   421  	// Clients that wish to support idempotent messages and transactions must
   422  	// set this field.
   423  	//
   424  	// Note that when not using transactions, any producer here is always
   425  	// accepted (and the epoch is always zero). Outside transactions, the ID
   426  	// is used only to deduplicate requests (and there must be at max 5
   427  	// concurrent requests).
   428  	ProducerID int64
   429  
   430  	// ProducerEpoch is the broker assigned producerEpoch from an InitProducerID
   431  	// request.
   432  	//
   433  	// Clients that wish to support idempotent messages and transactions must
   434  	// set this field.
   435  	ProducerEpoch int16
   436  
   437  	// FirstSequence is the producer assigned sequence number used by the
   438  	// broker to deduplicate messages.
   439  	//
   440  	// Clients that wish to support idempotent messages and transactions must
   441  	// set this field.
   442  	//
   443  	// The sequence number for each record in a batch is OffsetDelta + FirstSequence.
   444  	FirstSequence int32
   445  
   446  	// NumRecords is the number of records in the array below.
   447  	//
   448  	// This is separate from Records due to the potential for records to be
   449  	// compressed.
   450  	NumRecords int32
   451  
   452  	// Records contains records, either compressed or uncompressed.
   453  	//
   454  	// For uncompressed records, this is an array of records ([Record]).
   455  	//
   456  	// For compressed records, the length of the uncompressed array is kept
   457  	// but everything that follows is compressed.
   458  	//
   459  	// The number of bytes is expected to be the Length field minus 49.
   460  	Records []byte
   461  }
   462  
   463  func (v *RecordBatch) AppendTo(dst []byte) []byte {
   464  	{
   465  		v := v.FirstOffset
   466  		dst = kbin.AppendInt64(dst, v)
   467  	}
   468  	{
   469  		v := v.Length
   470  		dst = kbin.AppendInt32(dst, v)
   471  	}
   472  	{
   473  		v := v.PartitionLeaderEpoch
   474  		dst = kbin.AppendInt32(dst, v)
   475  	}
   476  	{
   477  		v := v.Magic
   478  		dst = kbin.AppendInt8(dst, v)
   479  	}
   480  	{
   481  		v := v.CRC
   482  		dst = kbin.AppendInt32(dst, v)
   483  	}
   484  	{
   485  		v := v.Attributes
   486  		dst = kbin.AppendInt16(dst, v)
   487  	}
   488  	{
   489  		v := v.LastOffsetDelta
   490  		dst = kbin.AppendInt32(dst, v)
   491  	}
   492  	{
   493  		v := v.FirstTimestamp
   494  		dst = kbin.AppendInt64(dst, v)
   495  	}
   496  	{
   497  		v := v.MaxTimestamp
   498  		dst = kbin.AppendInt64(dst, v)
   499  	}
   500  	{
   501  		v := v.ProducerID
   502  		dst = kbin.AppendInt64(dst, v)
   503  	}
   504  	{
   505  		v := v.ProducerEpoch
   506  		dst = kbin.AppendInt16(dst, v)
   507  	}
   508  	{
   509  		v := v.FirstSequence
   510  		dst = kbin.AppendInt32(dst, v)
   511  	}
   512  	{
   513  		v := v.NumRecords
   514  		dst = kbin.AppendInt32(dst, v)
   515  	}
   516  	{
   517  		v := v.Records
   518  		dst = append(dst, v...)
   519  	}
   520  	return dst
   521  }
   522  
   523  func (v *RecordBatch) ReadFrom(src []byte) error {
   524  	return v.readFrom(src, false)
   525  }
   526  
   527  func (v *RecordBatch) UnsafeReadFrom(src []byte) error {
   528  	return v.readFrom(src, true)
   529  }
   530  
   531  func (v *RecordBatch) readFrom(src []byte, unsafe bool) error {
   532  	v.Default()
   533  	b := kbin.Reader{Src: src}
   534  	s := v
   535  	{
   536  		v := b.Int64()
   537  		s.FirstOffset = v
   538  	}
   539  	{
   540  		v := b.Int32()
   541  		s.Length = v
   542  	}
   543  	{
   544  		v := b.Int32()
   545  		s.PartitionLeaderEpoch = v
   546  	}
   547  	{
   548  		v := b.Int8()
   549  		s.Magic = v
   550  	}
   551  	{
   552  		v := b.Int32()
   553  		s.CRC = v
   554  	}
   555  	{
   556  		v := b.Int16()
   557  		s.Attributes = v
   558  	}
   559  	{
   560  		v := b.Int32()
   561  		s.LastOffsetDelta = v
   562  	}
   563  	{
   564  		v := b.Int64()
   565  		s.FirstTimestamp = v
   566  	}
   567  	{
   568  		v := b.Int64()
   569  		s.MaxTimestamp = v
   570  	}
   571  	{
   572  		v := b.Int64()
   573  		s.ProducerID = v
   574  	}
   575  	{
   576  		v := b.Int16()
   577  		s.ProducerEpoch = v
   578  	}
   579  	{
   580  		v := b.Int32()
   581  		s.FirstSequence = v
   582  	}
   583  	{
   584  		v := b.Int32()
   585  		s.NumRecords = v
   586  	}
   587  	{
   588  		v := b.Span(int(s.Length) - 49)
   589  		s.Records = v
   590  	}
   591  	return b.Complete()
   592  }
   593  
   594  // Default sets any default fields. Calling this allows for future compatibility
   595  // if new fields are added to RecordBatch.
   596  func (v *RecordBatch) Default() {
   597  }
   598  
   599  // NewRecordBatch returns a default RecordBatch
   600  // This is a shortcut for creating a struct and calling Default yourself.
   601  func NewRecordBatch() RecordBatch {
   602  	var v RecordBatch
   603  	v.Default()
   604  	return v
   605  }
   606  
   607  // OffsetCommitKey is the key for the Kafka internal __consumer_offsets topic
   608  // if the key starts with an int16 with a value of 0 or 1.
   609  //
   610  // This type was introduced in KAFKA-1012 commit a670537aa3 with release 0.8.2
   611  // and has been in use ever since.
   612  type OffsetCommitKey struct {
   613  	// Version is which encoding version this value is using.
   614  	Version int16
   615  
   616  	// Group is the group being committed.
   617  	Group string
   618  
   619  	// Topic is the topic being committed.
   620  	Topic string
   621  
   622  	// Partition is the partition being committed.
   623  	Partition int32
   624  }
   625  
   626  func (v *OffsetCommitKey) AppendTo(dst []byte) []byte {
   627  	version := v.Version
   628  	_ = version
   629  	{
   630  		v := v.Version
   631  		dst = kbin.AppendInt16(dst, v)
   632  	}
   633  	{
   634  		v := v.Group
   635  		dst = kbin.AppendString(dst, v)
   636  	}
   637  	{
   638  		v := v.Topic
   639  		dst = kbin.AppendString(dst, v)
   640  	}
   641  	{
   642  		v := v.Partition
   643  		dst = kbin.AppendInt32(dst, v)
   644  	}
   645  	return dst
   646  }
   647  
   648  func (v *OffsetCommitKey) ReadFrom(src []byte) error {
   649  	return v.readFrom(src, false)
   650  }
   651  
   652  func (v *OffsetCommitKey) UnsafeReadFrom(src []byte) error {
   653  	return v.readFrom(src, true)
   654  }
   655  
   656  func (v *OffsetCommitKey) readFrom(src []byte, unsafe bool) error {
   657  	v.Default()
   658  	b := kbin.Reader{Src: src}
   659  	v.Version = b.Int16()
   660  	version := v.Version
   661  	_ = version
   662  	s := v
   663  	{
   664  		var v string
   665  		if unsafe {
   666  			v = b.UnsafeString()
   667  		} else {
   668  			v = b.String()
   669  		}
   670  		s.Group = v
   671  	}
   672  	{
   673  		var v string
   674  		if unsafe {
   675  			v = b.UnsafeString()
   676  		} else {
   677  			v = b.String()
   678  		}
   679  		s.Topic = v
   680  	}
   681  	{
   682  		v := b.Int32()
   683  		s.Partition = v
   684  	}
   685  	return b.Complete()
   686  }
   687  
   688  // Default sets any default fields. Calling this allows for future compatibility
   689  // if new fields are added to OffsetCommitKey.
   690  func (v *OffsetCommitKey) Default() {
   691  }
   692  
   693  // NewOffsetCommitKey returns a default OffsetCommitKey
   694  // This is a shortcut for creating a struct and calling Default yourself.
   695  func NewOffsetCommitKey() OffsetCommitKey {
   696  	var v OffsetCommitKey
   697  	v.Default()
   698  	return v
   699  }
   700  
   701  // OffsetCommitValue is the value for the Kafka internal __consumer_offsets
   702  // topic if the key is of OffsetCommitKey type.
   703  //
   704  // Version 0 was introduced with the key version 0.
   705  //
   706  // KAFKA-1634 commit c5df2a8e3a in 0.9.0 released version 1.
   707  //
   708  // KAFKA-4682 commit 418a91b5d4, proposed in KIP-211 and included in 2.1.0
   709  // released version 2.
   710  //
   711  // KAFKA-7437 commit 9f7267dd2f, proposed in KIP-320 and included in 2.1.0
   712  // released version 3.
   713  type OffsetCommitValue struct {
   714  	// Version is which encoding version this value is using.
   715  	Version int16
   716  
   717  	// Offset is the committed offset.
   718  	Offset int64
   719  
   720  	// LeaderEpoch is the epoch of the leader committing this message.
   721  	LeaderEpoch int32 // v3+
   722  
   723  	// Metadata is the metadata included in the commit.
   724  	Metadata string
   725  
   726  	// CommitTimestamp is when this commit occurred.
   727  	CommitTimestamp int64
   728  
   729  	// ExpireTimestamp, introduced in v1 and dropped in v2 with KIP-111,
   730  	// is when this commit expires.
   731  	ExpireTimestamp int64 // v1-v1
   732  }
   733  
   734  func (v *OffsetCommitValue) AppendTo(dst []byte) []byte {
   735  	version := v.Version
   736  	_ = version
   737  	{
   738  		v := v.Version
   739  		dst = kbin.AppendInt16(dst, v)
   740  	}
   741  	{
   742  		v := v.Offset
   743  		dst = kbin.AppendInt64(dst, v)
   744  	}
   745  	if version >= 3 {
   746  		v := v.LeaderEpoch
   747  		dst = kbin.AppendInt32(dst, v)
   748  	}
   749  	{
   750  		v := v.Metadata
   751  		dst = kbin.AppendString(dst, v)
   752  	}
   753  	{
   754  		v := v.CommitTimestamp
   755  		dst = kbin.AppendInt64(dst, v)
   756  	}
   757  	if version >= 1 && version <= 1 {
   758  		v := v.ExpireTimestamp
   759  		dst = kbin.AppendInt64(dst, v)
   760  	}
   761  	return dst
   762  }
   763  
   764  func (v *OffsetCommitValue) ReadFrom(src []byte) error {
   765  	return v.readFrom(src, false)
   766  }
   767  
   768  func (v *OffsetCommitValue) UnsafeReadFrom(src []byte) error {
   769  	return v.readFrom(src, true)
   770  }
   771  
   772  func (v *OffsetCommitValue) readFrom(src []byte, unsafe bool) error {
   773  	v.Default()
   774  	b := kbin.Reader{Src: src}
   775  	v.Version = b.Int16()
   776  	version := v.Version
   777  	_ = version
   778  	s := v
   779  	{
   780  		v := b.Int64()
   781  		s.Offset = v
   782  	}
   783  	if version >= 3 {
   784  		v := b.Int32()
   785  		s.LeaderEpoch = v
   786  	}
   787  	{
   788  		var v string
   789  		if unsafe {
   790  			v = b.UnsafeString()
   791  		} else {
   792  			v = b.String()
   793  		}
   794  		s.Metadata = v
   795  	}
   796  	{
   797  		v := b.Int64()
   798  		s.CommitTimestamp = v
   799  	}
   800  	if version >= 1 && version <= 1 {
   801  		v := b.Int64()
   802  		s.ExpireTimestamp = v
   803  	}
   804  	return b.Complete()
   805  }
   806  
   807  // Default sets any default fields. Calling this allows for future compatibility
   808  // if new fields are added to OffsetCommitValue.
   809  func (v *OffsetCommitValue) Default() {
   810  }
   811  
   812  // NewOffsetCommitValue returns a default OffsetCommitValue
   813  // This is a shortcut for creating a struct and calling Default yourself.
   814  func NewOffsetCommitValue() OffsetCommitValue {
   815  	var v OffsetCommitValue
   816  	v.Default()
   817  	return v
   818  }
   819  
   820  // GroupMetadataKey is the key for the Kafka internal __consumer_offsets topic
   821  // if the key starts with an int16 with a value of 2.
   822  //
   823  // This type was introduced in KAFKA-2017 commit 7c33475274 with release 0.9.0
   824  // and has been in use ever since.
   825  type GroupMetadataKey struct {
   826  	// Version is which encoding version this value is using.
   827  	Version int16
   828  
   829  	// Group is the group this metadata is for.
   830  	Group string
   831  }
   832  
   833  func (v *GroupMetadataKey) AppendTo(dst []byte) []byte {
   834  	version := v.Version
   835  	_ = version
   836  	{
   837  		v := v.Version
   838  		dst = kbin.AppendInt16(dst, v)
   839  	}
   840  	{
   841  		v := v.Group
   842  		dst = kbin.AppendString(dst, v)
   843  	}
   844  	return dst
   845  }
   846  
   847  func (v *GroupMetadataKey) ReadFrom(src []byte) error {
   848  	return v.readFrom(src, false)
   849  }
   850  
   851  func (v *GroupMetadataKey) UnsafeReadFrom(src []byte) error {
   852  	return v.readFrom(src, true)
   853  }
   854  
   855  func (v *GroupMetadataKey) readFrom(src []byte, unsafe bool) error {
   856  	v.Default()
   857  	b := kbin.Reader{Src: src}
   858  	v.Version = b.Int16()
   859  	version := v.Version
   860  	_ = version
   861  	s := v
   862  	{
   863  		var v string
   864  		if unsafe {
   865  			v = b.UnsafeString()
   866  		} else {
   867  			v = b.String()
   868  		}
   869  		s.Group = v
   870  	}
   871  	return b.Complete()
   872  }
   873  
   874  // Default sets any default fields. Calling this allows for future compatibility
   875  // if new fields are added to GroupMetadataKey.
   876  func (v *GroupMetadataKey) Default() {
   877  }
   878  
   879  // NewGroupMetadataKey returns a default GroupMetadataKey
   880  // This is a shortcut for creating a struct and calling Default yourself.
   881  func NewGroupMetadataKey() GroupMetadataKey {
   882  	var v GroupMetadataKey
   883  	v.Default()
   884  	return v
   885  }
   886  
   887  type GroupMetadataValueMember struct {
   888  	// MemberID is a group member.
   889  	MemberID string
   890  
   891  	// InstanceID is the instance ID of this member in the group (KIP-345).
   892  	InstanceID *string // v3+
   893  
   894  	// ClientID is the client ID of this group member.
   895  	ClientID string
   896  
   897  	// ClientHost is the hostname of this group member.
   898  	ClientHost string
   899  
   900  	// RebalanceTimeoutMillis is the rebalance timeout of this group member.
   901  	RebalanceTimeoutMillis int32 // v1+
   902  
   903  	// SessionTimeoutMillis is the session timeout of this group member.
   904  	SessionTimeoutMillis int32
   905  
   906  	// Subscription is the subscription of this group member.
   907  	Subscription []byte
   908  
   909  	// Assignment is what the leader assigned this group member.
   910  	Assignment []byte
   911  }
   912  
   913  // Default sets any default fields. Calling this allows for future compatibility
   914  // if new fields are added to GroupMetadataValueMember.
   915  func (v *GroupMetadataValueMember) Default() {
   916  }
   917  
   918  // NewGroupMetadataValueMember returns a default GroupMetadataValueMember
   919  // This is a shortcut for creating a struct and calling Default yourself.
   920  func NewGroupMetadataValueMember() GroupMetadataValueMember {
   921  	var v GroupMetadataValueMember
   922  	v.Default()
   923  	return v
   924  }
   925  
   926  // GroupMetadataValue is the value for the Kafka internal __consumer_offsets
   927  // topic if the key is of GroupMetadataKey type.
   928  //
   929  // Version 0 was introduced with the key version 0.
   930  //
   931  // KAFKA-3888 commit 40b1dd3f49, proposed in KIP-62 and included in 0.10.1
   932  // released version 1.
   933  //
   934  // KAFKA-4682 commit 418a91b5d4, proposed in KIP-211 and included in 2.1.0
   935  // released version 2.
   936  //
   937  // KAFKA-7862 commit 0f995ba6be, proposed in KIP-345 and included in 2.3.0
   938  // released version 3.
   939  type GroupMetadataValue struct {
   940  	// Version is the version of this value.
   941  	Version int16
   942  
   943  	// ProtocolType is the type of protocol being used for the group
   944  	// (i.e., "consumer").
   945  	ProtocolType string
   946  
   947  	// Generation is the generation of this group.
   948  	Generation int32
   949  
   950  	// Protocol is the agreed upon protocol all members are using to partition
   951  	// (i.e., "sticky").
   952  	Protocol *string
   953  
   954  	// Leader is the group leader.
   955  	Leader *string
   956  
   957  	// CurrentStateTimestamp is the timestamp for this state of the group
   958  	// (stable, etc.).
   959  	CurrentStateTimestamp int64 // v2+
   960  
   961  	// Members are the group members.
   962  	Members []GroupMetadataValueMember
   963  }
   964  
   965  func (v *GroupMetadataValue) AppendTo(dst []byte) []byte {
   966  	version := v.Version
   967  	_ = version
   968  	{
   969  		v := v.Version
   970  		dst = kbin.AppendInt16(dst, v)
   971  	}
   972  	{
   973  		v := v.ProtocolType
   974  		dst = kbin.AppendString(dst, v)
   975  	}
   976  	{
   977  		v := v.Generation
   978  		dst = kbin.AppendInt32(dst, v)
   979  	}
   980  	{
   981  		v := v.Protocol
   982  		dst = kbin.AppendNullableString(dst, v)
   983  	}
   984  	{
   985  		v := v.Leader
   986  		dst = kbin.AppendNullableString(dst, v)
   987  	}
   988  	if version >= 2 {
   989  		v := v.CurrentStateTimestamp
   990  		dst = kbin.AppendInt64(dst, v)
   991  	}
   992  	{
   993  		v := v.Members
   994  		dst = kbin.AppendArrayLen(dst, len(v))
   995  		for i := range v {
   996  			v := &v[i]
   997  			{
   998  				v := v.MemberID
   999  				dst = kbin.AppendString(dst, v)
  1000  			}
  1001  			if version >= 3 {
  1002  				v := v.InstanceID
  1003  				dst = kbin.AppendNullableString(dst, v)
  1004  			}
  1005  			{
  1006  				v := v.ClientID
  1007  				dst = kbin.AppendString(dst, v)
  1008  			}
  1009  			{
  1010  				v := v.ClientHost
  1011  				dst = kbin.AppendString(dst, v)
  1012  			}
  1013  			if version >= 1 {
  1014  				v := v.RebalanceTimeoutMillis
  1015  				dst = kbin.AppendInt32(dst, v)
  1016  			}
  1017  			{
  1018  				v := v.SessionTimeoutMillis
  1019  				dst = kbin.AppendInt32(dst, v)
  1020  			}
  1021  			{
  1022  				v := v.Subscription
  1023  				dst = kbin.AppendBytes(dst, v)
  1024  			}
  1025  			{
  1026  				v := v.Assignment
  1027  				dst = kbin.AppendBytes(dst, v)
  1028  			}
  1029  		}
  1030  	}
  1031  	return dst
  1032  }
  1033  
  1034  func (v *GroupMetadataValue) ReadFrom(src []byte) error {
  1035  	return v.readFrom(src, false)
  1036  }
  1037  
  1038  func (v *GroupMetadataValue) UnsafeReadFrom(src []byte) error {
  1039  	return v.readFrom(src, true)
  1040  }
  1041  
  1042  func (v *GroupMetadataValue) readFrom(src []byte, unsafe bool) error {
  1043  	v.Default()
  1044  	b := kbin.Reader{Src: src}
  1045  	v.Version = b.Int16()
  1046  	version := v.Version
  1047  	_ = version
  1048  	s := v
  1049  	{
  1050  		var v string
  1051  		if unsafe {
  1052  			v = b.UnsafeString()
  1053  		} else {
  1054  			v = b.String()
  1055  		}
  1056  		s.ProtocolType = v
  1057  	}
  1058  	{
  1059  		v := b.Int32()
  1060  		s.Generation = v
  1061  	}
  1062  	{
  1063  		var v *string
  1064  		if unsafe {
  1065  			v = b.UnsafeNullableString()
  1066  		} else {
  1067  			v = b.NullableString()
  1068  		}
  1069  		s.Protocol = v
  1070  	}
  1071  	{
  1072  		var v *string
  1073  		if unsafe {
  1074  			v = b.UnsafeNullableString()
  1075  		} else {
  1076  			v = b.NullableString()
  1077  		}
  1078  		s.Leader = v
  1079  	}
  1080  	if version >= 2 {
  1081  		v := b.Int64()
  1082  		s.CurrentStateTimestamp = v
  1083  	}
  1084  	{
  1085  		v := s.Members
  1086  		a := v
  1087  		var l int32
  1088  		l = b.ArrayLen()
  1089  		if !b.Ok() {
  1090  			return b.Complete()
  1091  		}
  1092  		a = a[:0]
  1093  		if l > 0 {
  1094  			a = append(a, make([]GroupMetadataValueMember, l)...)
  1095  		}
  1096  		for i := int32(0); i < l; i++ {
  1097  			v := &a[i]
  1098  			v.Default()
  1099  			s := v
  1100  			{
  1101  				var v string
  1102  				if unsafe {
  1103  					v = b.UnsafeString()
  1104  				} else {
  1105  					v = b.String()
  1106  				}
  1107  				s.MemberID = v
  1108  			}
  1109  			if version >= 3 {
  1110  				var v *string
  1111  				if unsafe {
  1112  					v = b.UnsafeNullableString()
  1113  				} else {
  1114  					v = b.NullableString()
  1115  				}
  1116  				s.InstanceID = v
  1117  			}
  1118  			{
  1119  				var v string
  1120  				if unsafe {
  1121  					v = b.UnsafeString()
  1122  				} else {
  1123  					v = b.String()
  1124  				}
  1125  				s.ClientID = v
  1126  			}
  1127  			{
  1128  				var v string
  1129  				if unsafe {
  1130  					v = b.UnsafeString()
  1131  				} else {
  1132  					v = b.String()
  1133  				}
  1134  				s.ClientHost = v
  1135  			}
  1136  			if version >= 1 {
  1137  				v := b.Int32()
  1138  				s.RebalanceTimeoutMillis = v
  1139  			}
  1140  			{
  1141  				v := b.Int32()
  1142  				s.SessionTimeoutMillis = v
  1143  			}
  1144  			{
  1145  				v := b.Bytes()
  1146  				s.Subscription = v
  1147  			}
  1148  			{
  1149  				v := b.Bytes()
  1150  				s.Assignment = v
  1151  			}
  1152  		}
  1153  		v = a
  1154  		s.Members = v
  1155  	}
  1156  	return b.Complete()
  1157  }
  1158  
  1159  // Default sets any default fields. Calling this allows for future compatibility
  1160  // if new fields are added to GroupMetadataValue.
  1161  func (v *GroupMetadataValue) Default() {
  1162  }
  1163  
  1164  // NewGroupMetadataValue returns a default GroupMetadataValue
  1165  // This is a shortcut for creating a struct and calling Default yourself.
  1166  func NewGroupMetadataValue() GroupMetadataValue {
  1167  	var v GroupMetadataValue
  1168  	v.Default()
  1169  	return v
  1170  }
  1171  
  1172  // TxnMetadataKey is the key for the Kafka internal __transaction_state topic
  1173  // if the key starts with an int16 with a value of 0.
  1174  type TxnMetadataKey struct {
  1175  	// Version is the version of this type.
  1176  	Version int16
  1177  
  1178  	// TransactionalID is the transactional ID this record is for.
  1179  	TransactionalID string
  1180  }
  1181  
  1182  func (v *TxnMetadataKey) AppendTo(dst []byte) []byte {
  1183  	version := v.Version
  1184  	_ = version
  1185  	{
  1186  		v := v.Version
  1187  		dst = kbin.AppendInt16(dst, v)
  1188  	}
  1189  	{
  1190  		v := v.TransactionalID
  1191  		dst = kbin.AppendString(dst, v)
  1192  	}
  1193  	return dst
  1194  }
  1195  
  1196  func (v *TxnMetadataKey) ReadFrom(src []byte) error {
  1197  	return v.readFrom(src, false)
  1198  }
  1199  
  1200  func (v *TxnMetadataKey) UnsafeReadFrom(src []byte) error {
  1201  	return v.readFrom(src, true)
  1202  }
  1203  
  1204  func (v *TxnMetadataKey) readFrom(src []byte, unsafe bool) error {
  1205  	v.Default()
  1206  	b := kbin.Reader{Src: src}
  1207  	v.Version = b.Int16()
  1208  	version := v.Version
  1209  	_ = version
  1210  	s := v
  1211  	{
  1212  		var v string
  1213  		if unsafe {
  1214  			v = b.UnsafeString()
  1215  		} else {
  1216  			v = b.String()
  1217  		}
  1218  		s.TransactionalID = v
  1219  	}
  1220  	return b.Complete()
  1221  }
  1222  
  1223  // Default sets any default fields. Calling this allows for future compatibility
  1224  // if new fields are added to TxnMetadataKey.
  1225  func (v *TxnMetadataKey) Default() {
  1226  }
  1227  
  1228  // NewTxnMetadataKey returns a default TxnMetadataKey
  1229  // This is a shortcut for creating a struct and calling Default yourself.
  1230  func NewTxnMetadataKey() TxnMetadataKey {
  1231  	var v TxnMetadataKey
  1232  	v.Default()
  1233  	return v
  1234  }
  1235  
  1236  type TxnMetadataValueTopic struct {
  1237  	// Topic is a topic involved in this transaction.
  1238  	Topic string
  1239  
  1240  	// Partitions are partitions in this topic involved in the transaction.
  1241  	Partitions []int32
  1242  }
  1243  
  1244  // Default sets any default fields. Calling this allows for future compatibility
  1245  // if new fields are added to TxnMetadataValueTopic.
  1246  func (v *TxnMetadataValueTopic) Default() {
  1247  }
  1248  
  1249  // NewTxnMetadataValueTopic returns a default TxnMetadataValueTopic
  1250  // This is a shortcut for creating a struct and calling Default yourself.
  1251  func NewTxnMetadataValueTopic() TxnMetadataValueTopic {
  1252  	var v TxnMetadataValueTopic
  1253  	v.Default()
  1254  	return v
  1255  }
  1256  
  1257  // TxnMetadataValue is the value for the Kafka internal __transaction_state
  1258  // topic if the key is of TxnMetadataKey type.
  1259  type TxnMetadataValue struct {
  1260  	// Version is the version of this value.
  1261  	Version int16
  1262  
  1263  	// ProducerID is the ID in use by the transactional ID.
  1264  	ProducerID int64
  1265  
  1266  	// ProducerEpoch is the epoch associated with the producer ID.
  1267  	ProducerEpoch int16
  1268  
  1269  	// TimeoutMillis is the timeout of this transaction in milliseconds.
  1270  	TimeoutMillis int32
  1271  
  1272  	// State is the state this transaction is in,
  1273  	// 0 is Empty, 1 is Ongoing, 2 is PrepareCommit, 3 is PrepareAbort, 4 is
  1274  	// CompleteCommit, 5 is CompleteAbort, 6 is Dead, and 7 is PrepareEpochFence.
  1275  	State TransactionState
  1276  
  1277  	// Topics are topics that are involved in this transaction.
  1278  	Topics []TxnMetadataValueTopic
  1279  
  1280  	// LastUpdateTimestamp is the timestamp in millis of when this transaction
  1281  	// was last updated.
  1282  	LastUpdateTimestamp int64
  1283  
  1284  	// StartTimestamp is the timestamp in millis of when this transaction started.
  1285  	StartTimestamp int64
  1286  }
  1287  
  1288  func (v *TxnMetadataValue) AppendTo(dst []byte) []byte {
  1289  	version := v.Version
  1290  	_ = version
  1291  	{
  1292  		v := v.Version
  1293  		dst = kbin.AppendInt16(dst, v)
  1294  	}
  1295  	{
  1296  		v := v.ProducerID
  1297  		dst = kbin.AppendInt64(dst, v)
  1298  	}
  1299  	{
  1300  		v := v.ProducerEpoch
  1301  		dst = kbin.AppendInt16(dst, v)
  1302  	}
  1303  	{
  1304  		v := v.TimeoutMillis
  1305  		dst = kbin.AppendInt32(dst, v)
  1306  	}
  1307  	{
  1308  		v := v.State
  1309  		{
  1310  			v := int8(v)
  1311  			dst = kbin.AppendInt8(dst, v)
  1312  		}
  1313  	}
  1314  	{
  1315  		v := v.Topics
  1316  		dst = kbin.AppendArrayLen(dst, len(v))
  1317  		for i := range v {
  1318  			v := &v[i]
  1319  			{
  1320  				v := v.Topic
  1321  				dst = kbin.AppendString(dst, v)
  1322  			}
  1323  			{
  1324  				v := v.Partitions
  1325  				dst = kbin.AppendArrayLen(dst, len(v))
  1326  				for i := range v {
  1327  					v := v[i]
  1328  					dst = kbin.AppendInt32(dst, v)
  1329  				}
  1330  			}
  1331  		}
  1332  	}
  1333  	{
  1334  		v := v.LastUpdateTimestamp
  1335  		dst = kbin.AppendInt64(dst, v)
  1336  	}
  1337  	{
  1338  		v := v.StartTimestamp
  1339  		dst = kbin.AppendInt64(dst, v)
  1340  	}
  1341  	return dst
  1342  }
  1343  
  1344  func (v *TxnMetadataValue) ReadFrom(src []byte) error {
  1345  	return v.readFrom(src, false)
  1346  }
  1347  
  1348  func (v *TxnMetadataValue) UnsafeReadFrom(src []byte) error {
  1349  	return v.readFrom(src, true)
  1350  }
  1351  
  1352  func (v *TxnMetadataValue) readFrom(src []byte, unsafe bool) error {
  1353  	v.Default()
  1354  	b := kbin.Reader{Src: src}
  1355  	v.Version = b.Int16()
  1356  	version := v.Version
  1357  	_ = version
  1358  	s := v
  1359  	{
  1360  		v := b.Int64()
  1361  		s.ProducerID = v
  1362  	}
  1363  	{
  1364  		v := b.Int16()
  1365  		s.ProducerEpoch = v
  1366  	}
  1367  	{
  1368  		v := b.Int32()
  1369  		s.TimeoutMillis = v
  1370  	}
  1371  	{
  1372  		var t TransactionState
  1373  		{
  1374  			v := b.Int8()
  1375  			t = TransactionState(v)
  1376  		}
  1377  		v := t
  1378  		s.State = v
  1379  	}
  1380  	{
  1381  		v := s.Topics
  1382  		a := v
  1383  		var l int32
  1384  		l = b.ArrayLen()
  1385  		if !b.Ok() {
  1386  			return b.Complete()
  1387  		}
  1388  		a = a[:0]
  1389  		if l > 0 {
  1390  			a = append(a, make([]TxnMetadataValueTopic, l)...)
  1391  		}
  1392  		for i := int32(0); i < l; i++ {
  1393  			v := &a[i]
  1394  			v.Default()
  1395  			s := v
  1396  			{
  1397  				var v string
  1398  				if unsafe {
  1399  					v = b.UnsafeString()
  1400  				} else {
  1401  					v = b.String()
  1402  				}
  1403  				s.Topic = v
  1404  			}
  1405  			{
  1406  				v := s.Partitions
  1407  				a := v
  1408  				var l int32
  1409  				l = b.ArrayLen()
  1410  				if !b.Ok() {
  1411  					return b.Complete()
  1412  				}
  1413  				a = a[:0]
  1414  				if l > 0 {
  1415  					a = append(a, make([]int32, l)...)
  1416  				}
  1417  				for i := int32(0); i < l; i++ {
  1418  					v := b.Int32()
  1419  					a[i] = v
  1420  				}
  1421  				v = a
  1422  				s.Partitions = v
  1423  			}
  1424  		}
  1425  		v = a
  1426  		s.Topics = v
  1427  	}
  1428  	{
  1429  		v := b.Int64()
  1430  		s.LastUpdateTimestamp = v
  1431  	}
  1432  	{
  1433  		v := b.Int64()
  1434  		s.StartTimestamp = v
  1435  	}
  1436  	return b.Complete()
  1437  }
  1438  
  1439  // Default sets any default fields. Calling this allows for future compatibility
  1440  // if new fields are added to TxnMetadataValue.
  1441  func (v *TxnMetadataValue) Default() {
  1442  }
  1443  
  1444  // NewTxnMetadataValue returns a default TxnMetadataValue
  1445  // This is a shortcut for creating a struct and calling Default yourself.
  1446  func NewTxnMetadataValue() TxnMetadataValue {
  1447  	var v TxnMetadataValue
  1448  	v.Default()
  1449  	return v
  1450  }
  1451  
  1452  type StickyMemberMetadataCurrentAssignment struct {
  1453  	// Topic is a topic the group member is currently assigned.
  1454  	Topic string
  1455  
  1456  	// Partitions are the partitions within a topic that a group member is
  1457  	// currently assigned.
  1458  	Partitions []int32
  1459  }
  1460  
  1461  // Default sets any default fields. Calling this allows for future compatibility
  1462  // if new fields are added to StickyMemberMetadataCurrentAssignment.
  1463  func (v *StickyMemberMetadataCurrentAssignment) Default() {
  1464  }
  1465  
  1466  // NewStickyMemberMetadataCurrentAssignment returns a default StickyMemberMetadataCurrentAssignment
  1467  // This is a shortcut for creating a struct and calling Default yourself.
  1468  func NewStickyMemberMetadataCurrentAssignment() StickyMemberMetadataCurrentAssignment {
  1469  	var v StickyMemberMetadataCurrentAssignment
  1470  	v.Default()
  1471  	return v
  1472  }
  1473  
  1474  // StickyMemberMetadata is is what is encoded in UserData for
  1475  // ConsumerMemberMetadata in group join requests with the sticky partitioning
  1476  // strategy.
  1477  //
  1478  // V1 added generation, which fixed a bug with flaky group members joining
  1479  // repeatedly. See KIP-341 for more details.
  1480  //
  1481  // Note that clients should always try decoding as v1 and, if that fails,
  1482  // fall back to v0. This is necessary due to there being no version number
  1483  // anywhere in this type.
  1484  type StickyMemberMetadata struct {
  1485  	// CurrentAssignment is the assignment that a group member has when
  1486  	// issuing a join.
  1487  	CurrentAssignment []StickyMemberMetadataCurrentAssignment
  1488  
  1489  	// Generation is the generation of this join. This is incremented every join.
  1490  	//
  1491  	// This field has a default of -1.
  1492  	Generation int32 // v1+
  1493  }
  1494  
  1495  // Default sets any default fields. Calling this allows for future compatibility
  1496  // if new fields are added to StickyMemberMetadata.
  1497  func (v *StickyMemberMetadata) Default() {
  1498  	v.Generation = -1
  1499  }
  1500  
  1501  // NewStickyMemberMetadata returns a default StickyMemberMetadata
  1502  // This is a shortcut for creating a struct and calling Default yourself.
  1503  func NewStickyMemberMetadata() StickyMemberMetadata {
  1504  	var v StickyMemberMetadata
  1505  	v.Default()
  1506  	return v
  1507  }
  1508  
  1509  type ConsumerMemberMetadataOwnedPartition struct {
  1510  	Topic string
  1511  
  1512  	Partitions []int32
  1513  }
  1514  
  1515  // Default sets any default fields. Calling this allows for future compatibility
  1516  // if new fields are added to ConsumerMemberMetadataOwnedPartition.
  1517  func (v *ConsumerMemberMetadataOwnedPartition) Default() {
  1518  }
  1519  
  1520  // NewConsumerMemberMetadataOwnedPartition returns a default ConsumerMemberMetadataOwnedPartition
  1521  // This is a shortcut for creating a struct and calling Default yourself.
  1522  func NewConsumerMemberMetadataOwnedPartition() ConsumerMemberMetadataOwnedPartition {
  1523  	var v ConsumerMemberMetadataOwnedPartition
  1524  	v.Default()
  1525  	return v
  1526  }
  1527  
  1528  // ConsumerMemberMetadata is the metadata that is usually sent with a join group
  1529  // request with the "consumer" protocol (normal, non-connect consumers).
  1530  type ConsumerMemberMetadata struct {
  1531  	// Version is 0, 1, 2, or 3.
  1532  	Version int16
  1533  
  1534  	// Topics is the list of topics in the group that this member is interested
  1535  	// in consuming.
  1536  	Topics []string
  1537  
  1538  	// UserData is arbitrary client data for a given client in the group.
  1539  	// For sticky assignment, this is StickyMemberMetadata.
  1540  	UserData []byte
  1541  
  1542  	// OwnedPartitions, introduced for KIP-429, are the partitions that this
  1543  	// member currently owns.
  1544  	OwnedPartitions []ConsumerMemberMetadataOwnedPartition // v1+
  1545  
  1546  	// Generation is the generation of the group.
  1547  	//
  1548  	// This field has a default of -1.
  1549  	Generation int32 // v2+
  1550  
  1551  	// Rack, if non-nil, opts into rack-aware replica assignment.
  1552  	Rack *string // v3+
  1553  }
  1554  
  1555  func (v *ConsumerMemberMetadata) AppendTo(dst []byte) []byte {
  1556  	version := v.Version
  1557  	_ = version
  1558  	{
  1559  		v := v.Version
  1560  		dst = kbin.AppendInt16(dst, v)
  1561  	}
  1562  	{
  1563  		v := v.Topics
  1564  		dst = kbin.AppendArrayLen(dst, len(v))
  1565  		for i := range v {
  1566  			v := v[i]
  1567  			dst = kbin.AppendString(dst, v)
  1568  		}
  1569  	}
  1570  	{
  1571  		v := v.UserData
  1572  		dst = kbin.AppendNullableBytes(dst, v)
  1573  	}
  1574  	if version >= 1 {
  1575  		v := v.OwnedPartitions
  1576  		dst = kbin.AppendArrayLen(dst, len(v))
  1577  		for i := range v {
  1578  			v := &v[i]
  1579  			{
  1580  				v := v.Topic
  1581  				dst = kbin.AppendString(dst, v)
  1582  			}
  1583  			{
  1584  				v := v.Partitions
  1585  				dst = kbin.AppendArrayLen(dst, len(v))
  1586  				for i := range v {
  1587  					v := v[i]
  1588  					dst = kbin.AppendInt32(dst, v)
  1589  				}
  1590  			}
  1591  		}
  1592  	}
  1593  	if version >= 2 {
  1594  		v := v.Generation
  1595  		dst = kbin.AppendInt32(dst, v)
  1596  	}
  1597  	if version >= 3 {
  1598  		v := v.Rack
  1599  		dst = kbin.AppendNullableString(dst, v)
  1600  	}
  1601  	return dst
  1602  }
  1603  
  1604  func (v *ConsumerMemberMetadata) ReadFrom(src []byte) error {
  1605  	return v.readFrom(src, false)
  1606  }
  1607  
  1608  func (v *ConsumerMemberMetadata) UnsafeReadFrom(src []byte) error {
  1609  	return v.readFrom(src, true)
  1610  }
  1611  
  1612  func (v *ConsumerMemberMetadata) readFrom(src []byte, unsafe bool) error {
  1613  	v.Default()
  1614  	b := kbin.Reader{Src: src}
  1615  	v.Version = b.Int16()
  1616  	version := v.Version
  1617  	_ = version
  1618  	s := v
  1619  	{
  1620  		v := s.Topics
  1621  		a := v
  1622  		var l int32
  1623  		l = b.ArrayLen()
  1624  		if !b.Ok() {
  1625  			return b.Complete()
  1626  		}
  1627  		a = a[:0]
  1628  		if l > 0 {
  1629  			a = append(a, make([]string, l)...)
  1630  		}
  1631  		for i := int32(0); i < l; i++ {
  1632  			var v string
  1633  			if unsafe {
  1634  				v = b.UnsafeString()
  1635  			} else {
  1636  				v = b.String()
  1637  			}
  1638  			a[i] = v
  1639  		}
  1640  		v = a
  1641  		s.Topics = v
  1642  	}
  1643  	{
  1644  		v := b.NullableBytes()
  1645  		s.UserData = v
  1646  	}
  1647  	if version >= 1 {
  1648  		v := s.OwnedPartitions
  1649  		a := v
  1650  		var l int32
  1651  		l = b.ArrayLen()
  1652  		if !b.Ok() {
  1653  			return b.Complete()
  1654  		}
  1655  		a = a[:0]
  1656  		if l > 0 {
  1657  			a = append(a, make([]ConsumerMemberMetadataOwnedPartition, l)...)
  1658  		}
  1659  		for i := int32(0); i < l; i++ {
  1660  			v := &a[i]
  1661  			v.Default()
  1662  			s := v
  1663  			{
  1664  				var v string
  1665  				if unsafe {
  1666  					v = b.UnsafeString()
  1667  				} else {
  1668  					v = b.String()
  1669  				}
  1670  				s.Topic = v
  1671  			}
  1672  			{
  1673  				v := s.Partitions
  1674  				a := v
  1675  				var l int32
  1676  				l = b.ArrayLen()
  1677  				if !b.Ok() {
  1678  					return b.Complete()
  1679  				}
  1680  				a = a[:0]
  1681  				if l > 0 {
  1682  					a = append(a, make([]int32, l)...)
  1683  				}
  1684  				for i := int32(0); i < l; i++ {
  1685  					v := b.Int32()
  1686  					a[i] = v
  1687  				}
  1688  				v = a
  1689  				s.Partitions = v
  1690  			}
  1691  		}
  1692  		v = a
  1693  		s.OwnedPartitions = v
  1694  	}
  1695  	if version >= 2 {
  1696  		v := b.Int32()
  1697  		s.Generation = v
  1698  	}
  1699  	if version >= 3 {
  1700  		var v *string
  1701  		if unsafe {
  1702  			v = b.UnsafeNullableString()
  1703  		} else {
  1704  			v = b.NullableString()
  1705  		}
  1706  		s.Rack = v
  1707  	}
  1708  	return b.Complete()
  1709  }
  1710  
  1711  // Default sets any default fields. Calling this allows for future compatibility
  1712  // if new fields are added to ConsumerMemberMetadata.
  1713  func (v *ConsumerMemberMetadata) Default() {
  1714  	v.Generation = -1
  1715  }
  1716  
  1717  // NewConsumerMemberMetadata returns a default ConsumerMemberMetadata
  1718  // This is a shortcut for creating a struct and calling Default yourself.
  1719  func NewConsumerMemberMetadata() ConsumerMemberMetadata {
  1720  	var v ConsumerMemberMetadata
  1721  	v.Default()
  1722  	return v
  1723  }
  1724  
  1725  type ConsumerMemberAssignmentTopic struct {
  1726  	// Topic is a topic in the assignment.
  1727  	Topic string
  1728  
  1729  	// Partitions contains partitions in the assignment.
  1730  	Partitions []int32
  1731  }
  1732  
  1733  // Default sets any default fields. Calling this allows for future compatibility
  1734  // if new fields are added to ConsumerMemberAssignmentTopic.
  1735  func (v *ConsumerMemberAssignmentTopic) Default() {
  1736  }
  1737  
  1738  // NewConsumerMemberAssignmentTopic returns a default ConsumerMemberAssignmentTopic
  1739  // This is a shortcut for creating a struct and calling Default yourself.
  1740  func NewConsumerMemberAssignmentTopic() ConsumerMemberAssignmentTopic {
  1741  	var v ConsumerMemberAssignmentTopic
  1742  	v.Default()
  1743  	return v
  1744  }
  1745  
  1746  // ConsumerMemberAssignment is the assignment data that is usually sent with a
  1747  // sync group request with the "consumer" protocol (normal, non-connect
  1748  // consumers).
  1749  type ConsumerMemberAssignment struct {
  1750  	// Verson is 0, 1, or 2.
  1751  	Version int16
  1752  
  1753  	// Topics contains topics in the assignment.
  1754  	Topics []ConsumerMemberAssignmentTopic
  1755  
  1756  	// UserData is arbitrary client data for a given client in the group.
  1757  	UserData []byte
  1758  }
  1759  
  1760  func (v *ConsumerMemberAssignment) AppendTo(dst []byte) []byte {
  1761  	version := v.Version
  1762  	_ = version
  1763  	{
  1764  		v := v.Version
  1765  		dst = kbin.AppendInt16(dst, v)
  1766  	}
  1767  	{
  1768  		v := v.Topics
  1769  		dst = kbin.AppendArrayLen(dst, len(v))
  1770  		for i := range v {
  1771  			v := &v[i]
  1772  			{
  1773  				v := v.Topic
  1774  				dst = kbin.AppendString(dst, v)
  1775  			}
  1776  			{
  1777  				v := v.Partitions
  1778  				dst = kbin.AppendArrayLen(dst, len(v))
  1779  				for i := range v {
  1780  					v := v[i]
  1781  					dst = kbin.AppendInt32(dst, v)
  1782  				}
  1783  			}
  1784  		}
  1785  	}
  1786  	{
  1787  		v := v.UserData
  1788  		dst = kbin.AppendNullableBytes(dst, v)
  1789  	}
  1790  	return dst
  1791  }
  1792  
  1793  func (v *ConsumerMemberAssignment) ReadFrom(src []byte) error {
  1794  	return v.readFrom(src, false)
  1795  }
  1796  
  1797  func (v *ConsumerMemberAssignment) UnsafeReadFrom(src []byte) error {
  1798  	return v.readFrom(src, true)
  1799  }
  1800  
  1801  func (v *ConsumerMemberAssignment) readFrom(src []byte, unsafe bool) error {
  1802  	v.Default()
  1803  	b := kbin.Reader{Src: src}
  1804  	v.Version = b.Int16()
  1805  	version := v.Version
  1806  	_ = version
  1807  	s := v
  1808  	{
  1809  		v := s.Topics
  1810  		a := v
  1811  		var l int32
  1812  		l = b.ArrayLen()
  1813  		if !b.Ok() {
  1814  			return b.Complete()
  1815  		}
  1816  		a = a[:0]
  1817  		if l > 0 {
  1818  			a = append(a, make([]ConsumerMemberAssignmentTopic, l)...)
  1819  		}
  1820  		for i := int32(0); i < l; i++ {
  1821  			v := &a[i]
  1822  			v.Default()
  1823  			s := v
  1824  			{
  1825  				var v string
  1826  				if unsafe {
  1827  					v = b.UnsafeString()
  1828  				} else {
  1829  					v = b.String()
  1830  				}
  1831  				s.Topic = v
  1832  			}
  1833  			{
  1834  				v := s.Partitions
  1835  				a := v
  1836  				var l int32
  1837  				l = b.ArrayLen()
  1838  				if !b.Ok() {
  1839  					return b.Complete()
  1840  				}
  1841  				a = a[:0]
  1842  				if l > 0 {
  1843  					a = append(a, make([]int32, l)...)
  1844  				}
  1845  				for i := int32(0); i < l; i++ {
  1846  					v := b.Int32()
  1847  					a[i] = v
  1848  				}
  1849  				v = a
  1850  				s.Partitions = v
  1851  			}
  1852  		}
  1853  		v = a
  1854  		s.Topics = v
  1855  	}
  1856  	{
  1857  		v := b.NullableBytes()
  1858  		s.UserData = v
  1859  	}
  1860  	return b.Complete()
  1861  }
  1862  
  1863  // Default sets any default fields. Calling this allows for future compatibility
  1864  // if new fields are added to ConsumerMemberAssignment.
  1865  func (v *ConsumerMemberAssignment) Default() {
  1866  }
  1867  
  1868  // NewConsumerMemberAssignment returns a default ConsumerMemberAssignment
  1869  // This is a shortcut for creating a struct and calling Default yourself.
  1870  func NewConsumerMemberAssignment() ConsumerMemberAssignment {
  1871  	var v ConsumerMemberAssignment
  1872  	v.Default()
  1873  	return v
  1874  }
  1875  
  1876  // ConnectMemberMetadata is the metadata used in a join group request with the
  1877  // "connect" protocol. v1 introduced incremental cooperative rebalancing (akin
  1878  // to cooperative-sticky) per KIP-415.
  1879  //
  1880  //	v0 defined in connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ConnectProtocol.java
  1881  //	v1+ defined in connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/IncrementalCooperativeConnectProtocol.java
  1882  type ConnectMemberMetadata struct {
  1883  	Version int16
  1884  
  1885  	URL string
  1886  
  1887  	ConfigOffset int64
  1888  
  1889  	CurrentAssignment []byte // v1+
  1890  }
  1891  
  1892  func (v *ConnectMemberMetadata) AppendTo(dst []byte) []byte {
  1893  	version := v.Version
  1894  	_ = version
  1895  	{
  1896  		v := v.Version
  1897  		dst = kbin.AppendInt16(dst, v)
  1898  	}
  1899  	{
  1900  		v := v.URL
  1901  		dst = kbin.AppendString(dst, v)
  1902  	}
  1903  	{
  1904  		v := v.ConfigOffset
  1905  		dst = kbin.AppendInt64(dst, v)
  1906  	}
  1907  	if version >= 1 {
  1908  		v := v.CurrentAssignment
  1909  		dst = kbin.AppendNullableBytes(dst, v)
  1910  	}
  1911  	return dst
  1912  }
  1913  
  1914  func (v *ConnectMemberMetadata) ReadFrom(src []byte) error {
  1915  	return v.readFrom(src, false)
  1916  }
  1917  
  1918  func (v *ConnectMemberMetadata) UnsafeReadFrom(src []byte) error {
  1919  	return v.readFrom(src, true)
  1920  }
  1921  
  1922  func (v *ConnectMemberMetadata) readFrom(src []byte, unsafe bool) error {
  1923  	v.Default()
  1924  	b := kbin.Reader{Src: src}
  1925  	v.Version = b.Int16()
  1926  	version := v.Version
  1927  	_ = version
  1928  	s := v
  1929  	{
  1930  		var v string
  1931  		if unsafe {
  1932  			v = b.UnsafeString()
  1933  		} else {
  1934  			v = b.String()
  1935  		}
  1936  		s.URL = v
  1937  	}
  1938  	{
  1939  		v := b.Int64()
  1940  		s.ConfigOffset = v
  1941  	}
  1942  	if version >= 1 {
  1943  		v := b.NullableBytes()
  1944  		s.CurrentAssignment = v
  1945  	}
  1946  	return b.Complete()
  1947  }
  1948  
  1949  // Default sets any default fields. Calling this allows for future compatibility
  1950  // if new fields are added to ConnectMemberMetadata.
  1951  func (v *ConnectMemberMetadata) Default() {
  1952  }
  1953  
  1954  // NewConnectMemberMetadata returns a default ConnectMemberMetadata
  1955  // This is a shortcut for creating a struct and calling Default yourself.
  1956  func NewConnectMemberMetadata() ConnectMemberMetadata {
  1957  	var v ConnectMemberMetadata
  1958  	v.Default()
  1959  	return v
  1960  }
  1961  
  1962  type ConnectMemberAssignmentAssignment struct {
  1963  	Connector string
  1964  
  1965  	Tasks []int16
  1966  }
  1967  
  1968  // Default sets any default fields. Calling this allows for future compatibility
  1969  // if new fields are added to ConnectMemberAssignmentAssignment.
  1970  func (v *ConnectMemberAssignmentAssignment) Default() {
  1971  }
  1972  
  1973  // NewConnectMemberAssignmentAssignment returns a default ConnectMemberAssignmentAssignment
  1974  // This is a shortcut for creating a struct and calling Default yourself.
  1975  func NewConnectMemberAssignmentAssignment() ConnectMemberAssignmentAssignment {
  1976  	var v ConnectMemberAssignmentAssignment
  1977  	v.Default()
  1978  	return v
  1979  }
  1980  
  1981  type ConnectMemberAssignmentRevoked struct {
  1982  	Connector string
  1983  
  1984  	Tasks []int16
  1985  }
  1986  
  1987  // Default sets any default fields. Calling this allows for future compatibility
  1988  // if new fields are added to ConnectMemberAssignmentRevoked.
  1989  func (v *ConnectMemberAssignmentRevoked) Default() {
  1990  }
  1991  
  1992  // NewConnectMemberAssignmentRevoked returns a default ConnectMemberAssignmentRevoked
  1993  // This is a shortcut for creating a struct and calling Default yourself.
  1994  func NewConnectMemberAssignmentRevoked() ConnectMemberAssignmentRevoked {
  1995  	var v ConnectMemberAssignmentRevoked
  1996  	v.Default()
  1997  	return v
  1998  }
  1999  
  2000  // ConnectMemberAssignment is the assignment that is used in a sync group
  2001  // request with the "connect" protocol. See ConnectMemberMetadata for links to
  2002  // the Kafka code where these fields are defined.
  2003  type ConnectMemberAssignment struct {
  2004  	Version int16
  2005  
  2006  	Error int16
  2007  
  2008  	Leader string
  2009  
  2010  	LeaderURL string
  2011  
  2012  	ConfigOffset int64
  2013  
  2014  	Assignment []ConnectMemberAssignmentAssignment
  2015  
  2016  	Revoked []ConnectMemberAssignmentRevoked // v1+
  2017  
  2018  	ScheduledDelay int32 // v1+
  2019  }
  2020  
  2021  func (v *ConnectMemberAssignment) AppendTo(dst []byte) []byte {
  2022  	version := v.Version
  2023  	_ = version
  2024  	{
  2025  		v := v.Version
  2026  		dst = kbin.AppendInt16(dst, v)
  2027  	}
  2028  	{
  2029  		v := v.Error
  2030  		dst = kbin.AppendInt16(dst, v)
  2031  	}
  2032  	{
  2033  		v := v.Leader
  2034  		dst = kbin.AppendString(dst, v)
  2035  	}
  2036  	{
  2037  		v := v.LeaderURL
  2038  		dst = kbin.AppendString(dst, v)
  2039  	}
  2040  	{
  2041  		v := v.ConfigOffset
  2042  		dst = kbin.AppendInt64(dst, v)
  2043  	}
  2044  	{
  2045  		v := v.Assignment
  2046  		dst = kbin.AppendArrayLen(dst, len(v))
  2047  		for i := range v {
  2048  			v := &v[i]
  2049  			{
  2050  				v := v.Connector
  2051  				dst = kbin.AppendString(dst, v)
  2052  			}
  2053  			{
  2054  				v := v.Tasks
  2055  				dst = kbin.AppendArrayLen(dst, len(v))
  2056  				for i := range v {
  2057  					v := v[i]
  2058  					dst = kbin.AppendInt16(dst, v)
  2059  				}
  2060  			}
  2061  		}
  2062  	}
  2063  	if version >= 1 {
  2064  		v := v.Revoked
  2065  		dst = kbin.AppendArrayLen(dst, len(v))
  2066  		for i := range v {
  2067  			v := &v[i]
  2068  			{
  2069  				v := v.Connector
  2070  				dst = kbin.AppendString(dst, v)
  2071  			}
  2072  			{
  2073  				v := v.Tasks
  2074  				dst = kbin.AppendArrayLen(dst, len(v))
  2075  				for i := range v {
  2076  					v := v[i]
  2077  					dst = kbin.AppendInt16(dst, v)
  2078  				}
  2079  			}
  2080  		}
  2081  	}
  2082  	if version >= 1 {
  2083  		v := v.ScheduledDelay
  2084  		dst = kbin.AppendInt32(dst, v)
  2085  	}
  2086  	return dst
  2087  }
  2088  
  2089  func (v *ConnectMemberAssignment) ReadFrom(src []byte) error {
  2090  	return v.readFrom(src, false)
  2091  }
  2092  
  2093  func (v *ConnectMemberAssignment) UnsafeReadFrom(src []byte) error {
  2094  	return v.readFrom(src, true)
  2095  }
  2096  
  2097  func (v *ConnectMemberAssignment) readFrom(src []byte, unsafe bool) error {
  2098  	v.Default()
  2099  	b := kbin.Reader{Src: src}
  2100  	v.Version = b.Int16()
  2101  	version := v.Version
  2102  	_ = version
  2103  	s := v
  2104  	{
  2105  		v := b.Int16()
  2106  		s.Error = v
  2107  	}
  2108  	{
  2109  		var v string
  2110  		if unsafe {
  2111  			v = b.UnsafeString()
  2112  		} else {
  2113  			v = b.String()
  2114  		}
  2115  		s.Leader = v
  2116  	}
  2117  	{
  2118  		var v string
  2119  		if unsafe {
  2120  			v = b.UnsafeString()
  2121  		} else {
  2122  			v = b.String()
  2123  		}
  2124  		s.LeaderURL = v
  2125  	}
  2126  	{
  2127  		v := b.Int64()
  2128  		s.ConfigOffset = v
  2129  	}
  2130  	{
  2131  		v := s.Assignment
  2132  		a := v
  2133  		var l int32
  2134  		l = b.ArrayLen()
  2135  		if !b.Ok() {
  2136  			return b.Complete()
  2137  		}
  2138  		a = a[:0]
  2139  		if l > 0 {
  2140  			a = append(a, make([]ConnectMemberAssignmentAssignment, l)...)
  2141  		}
  2142  		for i := int32(0); i < l; i++ {
  2143  			v := &a[i]
  2144  			v.Default()
  2145  			s := v
  2146  			{
  2147  				var v string
  2148  				if unsafe {
  2149  					v = b.UnsafeString()
  2150  				} else {
  2151  					v = b.String()
  2152  				}
  2153  				s.Connector = v
  2154  			}
  2155  			{
  2156  				v := s.Tasks
  2157  				a := v
  2158  				var l int32
  2159  				l = b.ArrayLen()
  2160  				if !b.Ok() {
  2161  					return b.Complete()
  2162  				}
  2163  				a = a[:0]
  2164  				if l > 0 {
  2165  					a = append(a, make([]int16, l)...)
  2166  				}
  2167  				for i := int32(0); i < l; i++ {
  2168  					v := b.Int16()
  2169  					a[i] = v
  2170  				}
  2171  				v = a
  2172  				s.Tasks = v
  2173  			}
  2174  		}
  2175  		v = a
  2176  		s.Assignment = v
  2177  	}
  2178  	if version >= 1 {
  2179  		v := s.Revoked
  2180  		a := v
  2181  		var l int32
  2182  		l = b.ArrayLen()
  2183  		if !b.Ok() {
  2184  			return b.Complete()
  2185  		}
  2186  		a = a[:0]
  2187  		if l > 0 {
  2188  			a = append(a, make([]ConnectMemberAssignmentRevoked, l)...)
  2189  		}
  2190  		for i := int32(0); i < l; i++ {
  2191  			v := &a[i]
  2192  			v.Default()
  2193  			s := v
  2194  			{
  2195  				var v string
  2196  				if unsafe {
  2197  					v = b.UnsafeString()
  2198  				} else {
  2199  					v = b.String()
  2200  				}
  2201  				s.Connector = v
  2202  			}
  2203  			{
  2204  				v := s.Tasks
  2205  				a := v
  2206  				var l int32
  2207  				l = b.ArrayLen()
  2208  				if !b.Ok() {
  2209  					return b.Complete()
  2210  				}
  2211  				a = a[:0]
  2212  				if l > 0 {
  2213  					a = append(a, make([]int16, l)...)
  2214  				}
  2215  				for i := int32(0); i < l; i++ {
  2216  					v := b.Int16()
  2217  					a[i] = v
  2218  				}
  2219  				v = a
  2220  				s.Tasks = v
  2221  			}
  2222  		}
  2223  		v = a
  2224  		s.Revoked = v
  2225  	}
  2226  	if version >= 1 {
  2227  		v := b.Int32()
  2228  		s.ScheduledDelay = v
  2229  	}
  2230  	return b.Complete()
  2231  }
  2232  
  2233  // Default sets any default fields. Calling this allows for future compatibility
  2234  // if new fields are added to ConnectMemberAssignment.
  2235  func (v *ConnectMemberAssignment) Default() {
  2236  }
  2237  
  2238  // NewConnectMemberAssignment returns a default ConnectMemberAssignment
  2239  // This is a shortcut for creating a struct and calling Default yourself.
  2240  func NewConnectMemberAssignment() ConnectMemberAssignment {
  2241  	var v ConnectMemberAssignment
  2242  	v.Default()
  2243  	return v
  2244  }
  2245  
  2246  // DefaultPrincipalData is the encoded principal data. This is used in an
  2247  // envelope request from broker to broker.
  2248  type DefaultPrincipalData struct {
  2249  	Version int16
  2250  
  2251  	// The principal type.
  2252  	Type string
  2253  
  2254  	// The principal name.
  2255  	Name string
  2256  
  2257  	// Whether the principal was authenticated by a delegation token on the forwarding broker.
  2258  	TokenAuthenticated bool
  2259  
  2260  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  2261  	UnknownTags Tags
  2262  }
  2263  
  2264  func (v *DefaultPrincipalData) AppendTo(dst []byte) []byte {
  2265  	version := v.Version
  2266  	_ = version
  2267  	isFlexible := version >= 0
  2268  	_ = isFlexible
  2269  	{
  2270  		v := v.Version
  2271  		dst = kbin.AppendInt16(dst, v)
  2272  	}
  2273  	{
  2274  		v := v.Type
  2275  		if isFlexible {
  2276  			dst = kbin.AppendCompactString(dst, v)
  2277  		} else {
  2278  			dst = kbin.AppendString(dst, v)
  2279  		}
  2280  	}
  2281  	{
  2282  		v := v.Name
  2283  		if isFlexible {
  2284  			dst = kbin.AppendCompactString(dst, v)
  2285  		} else {
  2286  			dst = kbin.AppendString(dst, v)
  2287  		}
  2288  	}
  2289  	{
  2290  		v := v.TokenAuthenticated
  2291  		dst = kbin.AppendBool(dst, v)
  2292  	}
  2293  	if isFlexible {
  2294  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2295  		dst = v.UnknownTags.AppendEach(dst)
  2296  	}
  2297  	return dst
  2298  }
  2299  
  2300  func (v *DefaultPrincipalData) ReadFrom(src []byte) error {
  2301  	return v.readFrom(src, false)
  2302  }
  2303  
  2304  func (v *DefaultPrincipalData) UnsafeReadFrom(src []byte) error {
  2305  	return v.readFrom(src, true)
  2306  }
  2307  
  2308  func (v *DefaultPrincipalData) readFrom(src []byte, unsafe bool) error {
  2309  	v.Default()
  2310  	b := kbin.Reader{Src: src}
  2311  	v.Version = b.Int16()
  2312  	version := v.Version
  2313  	_ = version
  2314  	isFlexible := version >= 0
  2315  	_ = isFlexible
  2316  	s := v
  2317  	{
  2318  		var v string
  2319  		if unsafe {
  2320  			if isFlexible {
  2321  				v = b.UnsafeCompactString()
  2322  			} else {
  2323  				v = b.UnsafeString()
  2324  			}
  2325  		} else {
  2326  			if isFlexible {
  2327  				v = b.CompactString()
  2328  			} else {
  2329  				v = b.String()
  2330  			}
  2331  		}
  2332  		s.Type = v
  2333  	}
  2334  	{
  2335  		var v string
  2336  		if unsafe {
  2337  			if isFlexible {
  2338  				v = b.UnsafeCompactString()
  2339  			} else {
  2340  				v = b.UnsafeString()
  2341  			}
  2342  		} else {
  2343  			if isFlexible {
  2344  				v = b.CompactString()
  2345  			} else {
  2346  				v = b.String()
  2347  			}
  2348  		}
  2349  		s.Name = v
  2350  	}
  2351  	{
  2352  		v := b.Bool()
  2353  		s.TokenAuthenticated = v
  2354  	}
  2355  	if isFlexible {
  2356  		s.UnknownTags = internalReadTags(&b)
  2357  	}
  2358  	return b.Complete()
  2359  }
  2360  func (v *DefaultPrincipalData) IsFlexible() bool { return v.Version >= 0 }
  2361  
  2362  // Default sets any default fields. Calling this allows for future compatibility
  2363  // if new fields are added to DefaultPrincipalData.
  2364  func (v *DefaultPrincipalData) Default() {
  2365  }
  2366  
  2367  // NewDefaultPrincipalData returns a default DefaultPrincipalData
  2368  // This is a shortcut for creating a struct and calling Default yourself.
  2369  func NewDefaultPrincipalData() DefaultPrincipalData {
  2370  	var v DefaultPrincipalData
  2371  	v.Default()
  2372  	return v
  2373  }
  2374  
  2375  // ControlRecordKey is the key in a control record.
  2376  type ControlRecordKey struct {
  2377  	Version int16
  2378  
  2379  	Type ControlRecordKeyType
  2380  }
  2381  
  2382  func (v *ControlRecordKey) AppendTo(dst []byte) []byte {
  2383  	version := v.Version
  2384  	_ = version
  2385  	{
  2386  		v := v.Version
  2387  		dst = kbin.AppendInt16(dst, v)
  2388  	}
  2389  	{
  2390  		v := v.Type
  2391  		{
  2392  			v := int8(v)
  2393  			dst = kbin.AppendInt8(dst, v)
  2394  		}
  2395  	}
  2396  	return dst
  2397  }
  2398  
  2399  func (v *ControlRecordKey) ReadFrom(src []byte) error {
  2400  	return v.readFrom(src, false)
  2401  }
  2402  
  2403  func (v *ControlRecordKey) UnsafeReadFrom(src []byte) error {
  2404  	return v.readFrom(src, true)
  2405  }
  2406  
  2407  func (v *ControlRecordKey) readFrom(src []byte, unsafe bool) error {
  2408  	v.Default()
  2409  	b := kbin.Reader{Src: src}
  2410  	v.Version = b.Int16()
  2411  	version := v.Version
  2412  	_ = version
  2413  	s := v
  2414  	{
  2415  		var t ControlRecordKeyType
  2416  		{
  2417  			v := b.Int8()
  2418  			t = ControlRecordKeyType(v)
  2419  		}
  2420  		v := t
  2421  		s.Type = v
  2422  	}
  2423  	return b.Complete()
  2424  }
  2425  
  2426  // Default sets any default fields. Calling this allows for future compatibility
  2427  // if new fields are added to ControlRecordKey.
  2428  func (v *ControlRecordKey) Default() {
  2429  }
  2430  
  2431  // NewControlRecordKey returns a default ControlRecordKey
  2432  // This is a shortcut for creating a struct and calling Default yourself.
  2433  func NewControlRecordKey() ControlRecordKey {
  2434  	var v ControlRecordKey
  2435  	v.Default()
  2436  	return v
  2437  }
  2438  
  2439  // EndTxnMarker is the value for a control record when the key is type 0 or 1.
  2440  type EndTxnMarker struct {
  2441  	Version int16
  2442  
  2443  	CoordinatorEpoch int32
  2444  }
  2445  
  2446  func (v *EndTxnMarker) AppendTo(dst []byte) []byte {
  2447  	version := v.Version
  2448  	_ = version
  2449  	{
  2450  		v := v.Version
  2451  		dst = kbin.AppendInt16(dst, v)
  2452  	}
  2453  	{
  2454  		v := v.CoordinatorEpoch
  2455  		dst = kbin.AppendInt32(dst, v)
  2456  	}
  2457  	return dst
  2458  }
  2459  
  2460  func (v *EndTxnMarker) ReadFrom(src []byte) error {
  2461  	return v.readFrom(src, false)
  2462  }
  2463  
  2464  func (v *EndTxnMarker) UnsafeReadFrom(src []byte) error {
  2465  	return v.readFrom(src, true)
  2466  }
  2467  
  2468  func (v *EndTxnMarker) readFrom(src []byte, unsafe bool) error {
  2469  	v.Default()
  2470  	b := kbin.Reader{Src: src}
  2471  	v.Version = b.Int16()
  2472  	version := v.Version
  2473  	_ = version
  2474  	s := v
  2475  	{
  2476  		v := b.Int32()
  2477  		s.CoordinatorEpoch = v
  2478  	}
  2479  	return b.Complete()
  2480  }
  2481  
  2482  // Default sets any default fields. Calling this allows for future compatibility
  2483  // if new fields are added to EndTxnMarker.
  2484  func (v *EndTxnMarker) Default() {
  2485  }
  2486  
  2487  // NewEndTxnMarker returns a default EndTxnMarker
  2488  // This is a shortcut for creating a struct and calling Default yourself.
  2489  func NewEndTxnMarker() EndTxnMarker {
  2490  	var v EndTxnMarker
  2491  	v.Default()
  2492  	return v
  2493  }
  2494  
  2495  type LeaderChangeMessageVoter struct {
  2496  	VoterID int32
  2497  
  2498  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  2499  	UnknownTags Tags
  2500  }
  2501  
  2502  // Default sets any default fields. Calling this allows for future compatibility
  2503  // if new fields are added to LeaderChangeMessageVoter.
  2504  func (v *LeaderChangeMessageVoter) Default() {
  2505  }
  2506  
  2507  // NewLeaderChangeMessageVoter returns a default LeaderChangeMessageVoter
  2508  // This is a shortcut for creating a struct and calling Default yourself.
  2509  func NewLeaderChangeMessageVoter() LeaderChangeMessageVoter {
  2510  	var v LeaderChangeMessageVoter
  2511  	v.Default()
  2512  	return v
  2513  }
  2514  
  2515  // LeaderChangeMessage is the value for a control record when the key is type 3.
  2516  type LeaderChangeMessage struct {
  2517  	Version int16
  2518  
  2519  	// The ID of the newly elected leader.
  2520  	LeaderID int32
  2521  
  2522  	// The set of voters in the quorum for this epoch.
  2523  	Voters []LeaderChangeMessageVoter
  2524  
  2525  	// The voters who voted for the leader at the time of election.
  2526  	GrantingVoters []LeaderChangeMessageVoter
  2527  
  2528  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  2529  	UnknownTags Tags
  2530  }
  2531  
  2532  func (v *LeaderChangeMessage) AppendTo(dst []byte) []byte {
  2533  	version := v.Version
  2534  	_ = version
  2535  	isFlexible := version >= 0
  2536  	_ = isFlexible
  2537  	{
  2538  		v := v.Version
  2539  		dst = kbin.AppendInt16(dst, v)
  2540  	}
  2541  	{
  2542  		v := v.LeaderID
  2543  		dst = kbin.AppendInt32(dst, v)
  2544  	}
  2545  	{
  2546  		v := v.Voters
  2547  		if isFlexible {
  2548  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  2549  		} else {
  2550  			dst = kbin.AppendArrayLen(dst, len(v))
  2551  		}
  2552  		for i := range v {
  2553  			v := &v[i]
  2554  			{
  2555  				v := v.VoterID
  2556  				dst = kbin.AppendInt32(dst, v)
  2557  			}
  2558  			if isFlexible {
  2559  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2560  				dst = v.UnknownTags.AppendEach(dst)
  2561  			}
  2562  		}
  2563  	}
  2564  	{
  2565  		v := v.GrantingVoters
  2566  		if isFlexible {
  2567  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  2568  		} else {
  2569  			dst = kbin.AppendArrayLen(dst, len(v))
  2570  		}
  2571  		for i := range v {
  2572  			v := &v[i]
  2573  			{
  2574  				v := v.VoterID
  2575  				dst = kbin.AppendInt32(dst, v)
  2576  			}
  2577  			if isFlexible {
  2578  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2579  				dst = v.UnknownTags.AppendEach(dst)
  2580  			}
  2581  		}
  2582  	}
  2583  	if isFlexible {
  2584  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2585  		dst = v.UnknownTags.AppendEach(dst)
  2586  	}
  2587  	return dst
  2588  }
  2589  
  2590  func (v *LeaderChangeMessage) ReadFrom(src []byte) error {
  2591  	return v.readFrom(src, false)
  2592  }
  2593  
  2594  func (v *LeaderChangeMessage) UnsafeReadFrom(src []byte) error {
  2595  	return v.readFrom(src, true)
  2596  }
  2597  
  2598  func (v *LeaderChangeMessage) readFrom(src []byte, unsafe bool) error {
  2599  	v.Default()
  2600  	b := kbin.Reader{Src: src}
  2601  	v.Version = b.Int16()
  2602  	version := v.Version
  2603  	_ = version
  2604  	isFlexible := version >= 0
  2605  	_ = isFlexible
  2606  	s := v
  2607  	{
  2608  		v := b.Int32()
  2609  		s.LeaderID = v
  2610  	}
  2611  	{
  2612  		v := s.Voters
  2613  		a := v
  2614  		var l int32
  2615  		if isFlexible {
  2616  			l = b.CompactArrayLen()
  2617  		} else {
  2618  			l = b.ArrayLen()
  2619  		}
  2620  		if !b.Ok() {
  2621  			return b.Complete()
  2622  		}
  2623  		a = a[:0]
  2624  		if l > 0 {
  2625  			a = append(a, make([]LeaderChangeMessageVoter, l)...)
  2626  		}
  2627  		for i := int32(0); i < l; i++ {
  2628  			v := &a[i]
  2629  			v.Default()
  2630  			s := v
  2631  			{
  2632  				v := b.Int32()
  2633  				s.VoterID = v
  2634  			}
  2635  			if isFlexible {
  2636  				s.UnknownTags = internalReadTags(&b)
  2637  			}
  2638  		}
  2639  		v = a
  2640  		s.Voters = v
  2641  	}
  2642  	{
  2643  		v := s.GrantingVoters
  2644  		a := v
  2645  		var l int32
  2646  		if isFlexible {
  2647  			l = b.CompactArrayLen()
  2648  		} else {
  2649  			l = b.ArrayLen()
  2650  		}
  2651  		if !b.Ok() {
  2652  			return b.Complete()
  2653  		}
  2654  		a = a[:0]
  2655  		if l > 0 {
  2656  			a = append(a, make([]LeaderChangeMessageVoter, l)...)
  2657  		}
  2658  		for i := int32(0); i < l; i++ {
  2659  			v := &a[i]
  2660  			v.Default()
  2661  			s := v
  2662  			{
  2663  				v := b.Int32()
  2664  				s.VoterID = v
  2665  			}
  2666  			if isFlexible {
  2667  				s.UnknownTags = internalReadTags(&b)
  2668  			}
  2669  		}
  2670  		v = a
  2671  		s.GrantingVoters = v
  2672  	}
  2673  	if isFlexible {
  2674  		s.UnknownTags = internalReadTags(&b)
  2675  	}
  2676  	return b.Complete()
  2677  }
  2678  func (v *LeaderChangeMessage) IsFlexible() bool { return v.Version >= 0 }
  2679  
  2680  // Default sets any default fields. Calling this allows for future compatibility
  2681  // if new fields are added to LeaderChangeMessage.
  2682  func (v *LeaderChangeMessage) Default() {
  2683  }
  2684  
  2685  // NewLeaderChangeMessage returns a default LeaderChangeMessage
  2686  // This is a shortcut for creating a struct and calling Default yourself.
  2687  func NewLeaderChangeMessage() LeaderChangeMessage {
  2688  	var v LeaderChangeMessage
  2689  	v.Default()
  2690  	return v
  2691  }
  2692  
  2693  type ProduceRequestTopicPartition struct {
  2694  	// Partition is a partition to send a record batch to.
  2695  	Partition int32
  2696  
  2697  	// Records is a batch of records to write to a topic's partition.
  2698  	//
  2699  	// For Kafka pre 0.11.0, the contents of the byte array is a serialized
  2700  	// message set. At or after 0.11.0, the contents of the byte array is a
  2701  	// serialized RecordBatch.
  2702  	Records []byte
  2703  
  2704  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  2705  	UnknownTags Tags // v9+
  2706  }
  2707  
  2708  // Default sets any default fields. Calling this allows for future compatibility
  2709  // if new fields are added to ProduceRequestTopicPartition.
  2710  func (v *ProduceRequestTopicPartition) Default() {
  2711  }
  2712  
  2713  // NewProduceRequestTopicPartition returns a default ProduceRequestTopicPartition
  2714  // This is a shortcut for creating a struct and calling Default yourself.
  2715  func NewProduceRequestTopicPartition() ProduceRequestTopicPartition {
  2716  	var v ProduceRequestTopicPartition
  2717  	v.Default()
  2718  	return v
  2719  }
  2720  
  2721  type ProduceRequestTopic struct {
  2722  	// Topic is a topic to send record batches to.
  2723  	Topic string
  2724  
  2725  	// Partitions is an array of partitions to send record batches to.
  2726  	Partitions []ProduceRequestTopicPartition
  2727  
  2728  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  2729  	UnknownTags Tags // v9+
  2730  }
  2731  
  2732  // Default sets any default fields. Calling this allows for future compatibility
  2733  // if new fields are added to ProduceRequestTopic.
  2734  func (v *ProduceRequestTopic) Default() {
  2735  }
  2736  
  2737  // NewProduceRequestTopic returns a default ProduceRequestTopic
  2738  // This is a shortcut for creating a struct and calling Default yourself.
  2739  func NewProduceRequestTopic() ProduceRequestTopic {
  2740  	var v ProduceRequestTopic
  2741  	v.Default()
  2742  	return v
  2743  }
  2744  
  2745  // ProduceRequest issues records to be created to Kafka.
  2746  //
  2747  // Kafka 0.10.0 (v2) changed Records from MessageSet v0 to MessageSet v1.
  2748  // Kafka 0.11.0 (v3) again changed Records to RecordBatch.
  2749  //
  2750  // Note that the special client ID "__admin_client" will allow you to produce
  2751  // records to internal topics. This is generally recommended if you want to
  2752  // break your Kafka cluster.
  2753  type ProduceRequest struct {
  2754  	// Version is the version of this message used with a Kafka broker.
  2755  	Version int16
  2756  
  2757  	// TransactionID is the transaction ID to use for this request, allowing for
  2758  	// exactly once semantics.
  2759  	TransactionID *string // v3+
  2760  
  2761  	// Acks specifies the number of acks that the partition leaders must receive
  2762  	// from in sync replicas before considering a record batch fully written.
  2763  	//
  2764  	// Valid values are -1, 0, or 1 corresponding to all, none, or the leader only.
  2765  	//
  2766  	// Note that if no acks are requested, Kafka will close the connection
  2767  	// if any topic or partition errors to trigger a client metadata refresh.
  2768  	Acks int16
  2769  
  2770  	// TimeoutMillis is how long Kafka can wait before responding to this request.
  2771  	// This field has no effect on Kafka's processing of the request; the request
  2772  	// will continue to be processed if the timeout is reached. If the timeout is
  2773  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
  2774  	//
  2775  	// This field has a default of 15000.
  2776  	TimeoutMillis int32
  2777  
  2778  	// Topics is an array of topics to send record batches to.
  2779  	Topics []ProduceRequestTopic
  2780  
  2781  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  2782  	UnknownTags Tags // v9+
  2783  }
  2784  
  2785  func (*ProduceRequest) Key() int16                       { return 0 }
  2786  func (*ProduceRequest) MaxVersion() int16                { return 9 }
  2787  func (v *ProduceRequest) SetVersion(version int16)       { v.Version = version }
  2788  func (v *ProduceRequest) GetVersion() int16              { return v.Version }
  2789  func (v *ProduceRequest) IsFlexible() bool               { return v.Version >= 9 }
  2790  func (v *ProduceRequest) Timeout() int32                 { return v.TimeoutMillis }
  2791  func (v *ProduceRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
  2792  func (v *ProduceRequest) ResponseKind() Response {
  2793  	r := &ProduceResponse{Version: v.Version}
  2794  	r.Default()
  2795  	return r
  2796  }
  2797  
  2798  // RequestWith is requests v on r and returns the response or an error.
  2799  // For sharded requests, the response may be merged and still return an error.
  2800  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  2801  func (v *ProduceRequest) RequestWith(ctx context.Context, r Requestor) (*ProduceResponse, error) {
  2802  	kresp, err := r.Request(ctx, v)
  2803  	resp, _ := kresp.(*ProduceResponse)
  2804  	return resp, err
  2805  }
  2806  
  2807  func (v *ProduceRequest) AppendTo(dst []byte) []byte {
  2808  	version := v.Version
  2809  	_ = version
  2810  	isFlexible := version >= 9
  2811  	_ = isFlexible
  2812  	if version >= 3 {
  2813  		v := v.TransactionID
  2814  		if isFlexible {
  2815  			dst = kbin.AppendCompactNullableString(dst, v)
  2816  		} else {
  2817  			dst = kbin.AppendNullableString(dst, v)
  2818  		}
  2819  	}
  2820  	{
  2821  		v := v.Acks
  2822  		dst = kbin.AppendInt16(dst, v)
  2823  	}
  2824  	{
  2825  		v := v.TimeoutMillis
  2826  		dst = kbin.AppendInt32(dst, v)
  2827  	}
  2828  	{
  2829  		v := v.Topics
  2830  		if isFlexible {
  2831  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  2832  		} else {
  2833  			dst = kbin.AppendArrayLen(dst, len(v))
  2834  		}
  2835  		for i := range v {
  2836  			v := &v[i]
  2837  			{
  2838  				v := v.Topic
  2839  				if isFlexible {
  2840  					dst = kbin.AppendCompactString(dst, v)
  2841  				} else {
  2842  					dst = kbin.AppendString(dst, v)
  2843  				}
  2844  			}
  2845  			{
  2846  				v := v.Partitions
  2847  				if isFlexible {
  2848  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  2849  				} else {
  2850  					dst = kbin.AppendArrayLen(dst, len(v))
  2851  				}
  2852  				for i := range v {
  2853  					v := &v[i]
  2854  					{
  2855  						v := v.Partition
  2856  						dst = kbin.AppendInt32(dst, v)
  2857  					}
  2858  					{
  2859  						v := v.Records
  2860  						if isFlexible {
  2861  							dst = kbin.AppendCompactNullableBytes(dst, v)
  2862  						} else {
  2863  							dst = kbin.AppendNullableBytes(dst, v)
  2864  						}
  2865  					}
  2866  					if isFlexible {
  2867  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2868  						dst = v.UnknownTags.AppendEach(dst)
  2869  					}
  2870  				}
  2871  			}
  2872  			if isFlexible {
  2873  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2874  				dst = v.UnknownTags.AppendEach(dst)
  2875  			}
  2876  		}
  2877  	}
  2878  	if isFlexible {
  2879  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  2880  		dst = v.UnknownTags.AppendEach(dst)
  2881  	}
  2882  	return dst
  2883  }
  2884  
  2885  func (v *ProduceRequest) ReadFrom(src []byte) error {
  2886  	return v.readFrom(src, false)
  2887  }
  2888  
  2889  func (v *ProduceRequest) UnsafeReadFrom(src []byte) error {
  2890  	return v.readFrom(src, true)
  2891  }
  2892  
  2893  func (v *ProduceRequest) readFrom(src []byte, unsafe bool) error {
  2894  	v.Default()
  2895  	b := kbin.Reader{Src: src}
  2896  	version := v.Version
  2897  	_ = version
  2898  	isFlexible := version >= 9
  2899  	_ = isFlexible
  2900  	s := v
  2901  	if version >= 3 {
  2902  		var v *string
  2903  		if isFlexible {
  2904  			if unsafe {
  2905  				v = b.UnsafeCompactNullableString()
  2906  			} else {
  2907  				v = b.CompactNullableString()
  2908  			}
  2909  		} else {
  2910  			if unsafe {
  2911  				v = b.UnsafeNullableString()
  2912  			} else {
  2913  				v = b.NullableString()
  2914  			}
  2915  		}
  2916  		s.TransactionID = v
  2917  	}
  2918  	{
  2919  		v := b.Int16()
  2920  		s.Acks = v
  2921  	}
  2922  	{
  2923  		v := b.Int32()
  2924  		s.TimeoutMillis = v
  2925  	}
  2926  	{
  2927  		v := s.Topics
  2928  		a := v
  2929  		var l int32
  2930  		if isFlexible {
  2931  			l = b.CompactArrayLen()
  2932  		} else {
  2933  			l = b.ArrayLen()
  2934  		}
  2935  		if !b.Ok() {
  2936  			return b.Complete()
  2937  		}
  2938  		a = a[:0]
  2939  		if l > 0 {
  2940  			a = append(a, make([]ProduceRequestTopic, l)...)
  2941  		}
  2942  		for i := int32(0); i < l; i++ {
  2943  			v := &a[i]
  2944  			v.Default()
  2945  			s := v
  2946  			{
  2947  				var v string
  2948  				if unsafe {
  2949  					if isFlexible {
  2950  						v = b.UnsafeCompactString()
  2951  					} else {
  2952  						v = b.UnsafeString()
  2953  					}
  2954  				} else {
  2955  					if isFlexible {
  2956  						v = b.CompactString()
  2957  					} else {
  2958  						v = b.String()
  2959  					}
  2960  				}
  2961  				s.Topic = v
  2962  			}
  2963  			{
  2964  				v := s.Partitions
  2965  				a := v
  2966  				var l int32
  2967  				if isFlexible {
  2968  					l = b.CompactArrayLen()
  2969  				} else {
  2970  					l = b.ArrayLen()
  2971  				}
  2972  				if !b.Ok() {
  2973  					return b.Complete()
  2974  				}
  2975  				a = a[:0]
  2976  				if l > 0 {
  2977  					a = append(a, make([]ProduceRequestTopicPartition, l)...)
  2978  				}
  2979  				for i := int32(0); i < l; i++ {
  2980  					v := &a[i]
  2981  					v.Default()
  2982  					s := v
  2983  					{
  2984  						v := b.Int32()
  2985  						s.Partition = v
  2986  					}
  2987  					{
  2988  						var v []byte
  2989  						if isFlexible {
  2990  							v = b.CompactNullableBytes()
  2991  						} else {
  2992  							v = b.NullableBytes()
  2993  						}
  2994  						s.Records = v
  2995  					}
  2996  					if isFlexible {
  2997  						s.UnknownTags = internalReadTags(&b)
  2998  					}
  2999  				}
  3000  				v = a
  3001  				s.Partitions = v
  3002  			}
  3003  			if isFlexible {
  3004  				s.UnknownTags = internalReadTags(&b)
  3005  			}
  3006  		}
  3007  		v = a
  3008  		s.Topics = v
  3009  	}
  3010  	if isFlexible {
  3011  		s.UnknownTags = internalReadTags(&b)
  3012  	}
  3013  	return b.Complete()
  3014  }
  3015  
  3016  // NewPtrProduceRequest returns a pointer to a default ProduceRequest
  3017  // This is a shortcut for creating a new(struct) and calling Default yourself.
  3018  func NewPtrProduceRequest() *ProduceRequest {
  3019  	var v ProduceRequest
  3020  	v.Default()
  3021  	return &v
  3022  }
  3023  
  3024  // Default sets any default fields. Calling this allows for future compatibility
  3025  // if new fields are added to ProduceRequest.
  3026  func (v *ProduceRequest) Default() {
  3027  	v.TimeoutMillis = 15000
  3028  }
  3029  
  3030  // NewProduceRequest returns a default ProduceRequest
  3031  // This is a shortcut for creating a struct and calling Default yourself.
  3032  func NewProduceRequest() ProduceRequest {
  3033  	var v ProduceRequest
  3034  	v.Default()
  3035  	return v
  3036  }
  3037  
  3038  type ProduceResponseTopicPartitionErrorRecord struct {
  3039  	// RelativeOffset is the offset of the record that caused problems.
  3040  	RelativeOffset int32
  3041  
  3042  	// ErrorMessage is the error of this record.
  3043  	ErrorMessage *string
  3044  
  3045  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3046  	UnknownTags Tags // v9+
  3047  }
  3048  
  3049  // Default sets any default fields. Calling this allows for future compatibility
  3050  // if new fields are added to ProduceResponseTopicPartitionErrorRecord.
  3051  func (v *ProduceResponseTopicPartitionErrorRecord) Default() {
  3052  }
  3053  
  3054  // NewProduceResponseTopicPartitionErrorRecord returns a default ProduceResponseTopicPartitionErrorRecord
  3055  // This is a shortcut for creating a struct and calling Default yourself.
  3056  func NewProduceResponseTopicPartitionErrorRecord() ProduceResponseTopicPartitionErrorRecord {
  3057  	var v ProduceResponseTopicPartitionErrorRecord
  3058  	v.Default()
  3059  	return v
  3060  }
  3061  
  3062  type ProduceResponseTopicPartition struct {
  3063  	// Partition is the partition this response pertains to.
  3064  	Partition int32
  3065  
  3066  	// ErrorCode is any error for a topic/partition in the request.
  3067  	// There are many error codes for produce requests.
  3068  	//
  3069  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned for all topics and
  3070  	// partitions if the request had a transactional ID but the client
  3071  	// is not authorized for transactions.
  3072  	//
  3073  	// CLUSTER_AUTHORIZATION_FAILED is returned for all topics and partitions
  3074  	// if the request was idempotent but the client is not authorized
  3075  	// for idempotent requests.
  3076  	//
  3077  	// TOPIC_AUTHORIZATION_FAILED is returned for all topics the client
  3078  	// is not authorized to talk to.
  3079  	//
  3080  	// INVALID_REQUIRED_ACKS is returned if the request contained an invalid
  3081  	// number for "acks".
  3082  	//
  3083  	// CORRUPT_MESSAGE is returned for many reasons, generally related to
  3084  	// problems with messages (invalid magic, size mismatch, etc.).
  3085  	//
  3086  	// MESSAGE_TOO_LARGE is returned if a record batch is larger than the
  3087  	// broker's configured max.message.size.
  3088  	//
  3089  	// RECORD_LIST_TOO_LARGE is returned if the record batch is larger than
  3090  	// the broker's segment.bytes.
  3091  	//
  3092  	// INVALID_TIMESTAMP is returned if the record batch uses LogAppendTime
  3093  	// or if the timestamp delta from when the broker receives the message
  3094  	// is more than the broker's log.message.timestamp.difference.max.ms.
  3095  	//
  3096  	// UNSUPPORTED_FOR_MESSAGE_FORMAT is returned if using a Kafka v2 message
  3097  	// format (i.e. RecordBatch) feature (idempotence) while sending v1
  3098  	// messages (i.e. a MessageSet).
  3099  	//
  3100  	// KAFKA_STORAGE_ERROR is returned if the log directory for a partition
  3101  	// is offline.
  3102  	//
  3103  	// NOT_ENOUGH_REPLICAS is returned if all acks are required, but there
  3104  	// are not enough in sync replicas yet.
  3105  	//
  3106  	// NOT_ENOUGH_REPLICAS_AFTER_APPEND is returned on old Kafka versions
  3107  	// (pre 0.11.0.0) when a message was written to disk and then Kafka
  3108  	// noticed not enough replicas existed to replicate the message.
  3109  	//
  3110  	// DUPLICATE_SEQUENCE_NUMBER is returned for Kafka <1.1.0 when a
  3111  	// sequence number is detected as a duplicate. After, out of order
  3112  	// is returned.
  3113  	//
  3114  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the topic or partition
  3115  	// is unknown.
  3116  	//
  3117  	// NOT_LEADER_FOR_PARTITION is returned if the broker is not a leader
  3118  	// for this partition. This means that the client has stale metadata.
  3119  	//
  3120  	// INVALID_PRODUCER_EPOCH is returned if the produce request was
  3121  	// attempted with an old epoch. Either there is a newer producer using
  3122  	// the same transaction ID, or the transaction ID used has expired.
  3123  	//
  3124  	// UNKNOWN_PRODUCER_ID, added in Kafka 1.0.0 (message format v5+) is
  3125  	// returned if the producer used an ID that Kafka does not know about or
  3126  	// if the request has a larger sequence number than Kafka expects.  The
  3127  	// LogStartOffset must be checked in this case. If the offset is greater
  3128  	// than the last acknowledged offset, then no data loss has occurred; the
  3129  	// client just sent data so long ago that Kafka rotated the partition out
  3130  	// of existence and no longer knows of this producer ID. In this case,
  3131  	// reset your sequence numbers to 0. If the log start offset is equal to
  3132  	// or less than what the client sent prior, then data loss has occurred.
  3133  	// See KAFKA-5793 for more details. NOTE: Unfortunately, even UNKNOWN_PRODUCER_ID
  3134  	// is unsafe to handle, so this error should likely be treated the same
  3135  	// as OUT_OF_ORDER_SEQUENCE_NUMER. See KIP-360 for more details.
  3136  	//
  3137  	// OUT_OF_ORDER_SEQUENCE_NUMBER is sent if the batch's FirstSequence was
  3138  	// not what it should be (the last FirstSequence, plus the number of
  3139  	// records in the last batch, plus one). After 1.0.0, this generally
  3140  	// means data loss. Before, there could be confusion on if the broker
  3141  	// actually rotated the partition out of existence (this is why
  3142  	// UNKNOWN_PRODUCER_ID was introduced).
  3143  	ErrorCode int16
  3144  
  3145  	// BaseOffset is the offset that the records in the produce request began
  3146  	// at in the partition.
  3147  	BaseOffset int64
  3148  
  3149  	// LogAppendTime is the millisecond that records were appended to the
  3150  	// partition inside Kafka. This is only not -1 if records were written
  3151  	// with the log append time flag (which producers cannot do).
  3152  	//
  3153  	// This field has a default of -1.
  3154  	LogAppendTime int64 // v2+
  3155  
  3156  	// LogStartOffset, introduced in Kafka 1.0.0, can be used to see if an
  3157  	// UNKNOWN_PRODUCER_ID means Kafka rotated records containing the used
  3158  	// producer ID out of existence, or if Kafka lost data.
  3159  	//
  3160  	// This field has a default of -1.
  3161  	LogStartOffset int64 // v5+
  3162  
  3163  	// ErrorRecords are indices of individual records that caused a batch
  3164  	// to error. This was added for KIP-467.
  3165  	ErrorRecords []ProduceResponseTopicPartitionErrorRecord // v8+
  3166  
  3167  	// ErrorMessage is the global error message of of what caused this batch
  3168  	// to error.
  3169  	ErrorMessage *string // v8+
  3170  
  3171  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3172  	UnknownTags Tags // v9+
  3173  }
  3174  
  3175  // Default sets any default fields. Calling this allows for future compatibility
  3176  // if new fields are added to ProduceResponseTopicPartition.
  3177  func (v *ProduceResponseTopicPartition) Default() {
  3178  	v.LogAppendTime = -1
  3179  	v.LogStartOffset = -1
  3180  }
  3181  
  3182  // NewProduceResponseTopicPartition returns a default ProduceResponseTopicPartition
  3183  // This is a shortcut for creating a struct and calling Default yourself.
  3184  func NewProduceResponseTopicPartition() ProduceResponseTopicPartition {
  3185  	var v ProduceResponseTopicPartition
  3186  	v.Default()
  3187  	return v
  3188  }
  3189  
  3190  type ProduceResponseTopic struct {
  3191  	// Topic is the topic this response pertains to.
  3192  	Topic string
  3193  
  3194  	// Partitions is an array of responses for the partition's that
  3195  	// batches were sent to.
  3196  	Partitions []ProduceResponseTopicPartition
  3197  
  3198  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3199  	UnknownTags Tags // v9+
  3200  }
  3201  
  3202  // Default sets any default fields. Calling this allows for future compatibility
  3203  // if new fields are added to ProduceResponseTopic.
  3204  func (v *ProduceResponseTopic) Default() {
  3205  }
  3206  
  3207  // NewProduceResponseTopic returns a default ProduceResponseTopic
  3208  // This is a shortcut for creating a struct and calling Default yourself.
  3209  func NewProduceResponseTopic() ProduceResponseTopic {
  3210  	var v ProduceResponseTopic
  3211  	v.Default()
  3212  	return v
  3213  }
  3214  
  3215  // ProduceResponse is returned from a ProduceRequest.
  3216  type ProduceResponse struct {
  3217  	// Version is the version of this message used with a Kafka broker.
  3218  	Version int16
  3219  
  3220  	// Topics is an array of responses for the topic's that batches were sent
  3221  	// to.
  3222  	Topics []ProduceResponseTopic
  3223  
  3224  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
  3225  	// after this request.
  3226  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
  3227  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
  3228  	//
  3229  	// This request switched at version 6.
  3230  	ThrottleMillis int32 // v1+
  3231  
  3232  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3233  	UnknownTags Tags // v9+
  3234  }
  3235  
  3236  func (*ProduceResponse) Key() int16                         { return 0 }
  3237  func (*ProduceResponse) MaxVersion() int16                  { return 9 }
  3238  func (v *ProduceResponse) SetVersion(version int16)         { v.Version = version }
  3239  func (v *ProduceResponse) GetVersion() int16                { return v.Version }
  3240  func (v *ProduceResponse) IsFlexible() bool                 { return v.Version >= 9 }
  3241  func (v *ProduceResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 6 }
  3242  func (v *ProduceResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
  3243  func (v *ProduceResponse) RequestKind() Request             { return &ProduceRequest{Version: v.Version} }
  3244  
  3245  func (v *ProduceResponse) AppendTo(dst []byte) []byte {
  3246  	version := v.Version
  3247  	_ = version
  3248  	isFlexible := version >= 9
  3249  	_ = isFlexible
  3250  	{
  3251  		v := v.Topics
  3252  		if isFlexible {
  3253  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  3254  		} else {
  3255  			dst = kbin.AppendArrayLen(dst, len(v))
  3256  		}
  3257  		for i := range v {
  3258  			v := &v[i]
  3259  			{
  3260  				v := v.Topic
  3261  				if isFlexible {
  3262  					dst = kbin.AppendCompactString(dst, v)
  3263  				} else {
  3264  					dst = kbin.AppendString(dst, v)
  3265  				}
  3266  			}
  3267  			{
  3268  				v := v.Partitions
  3269  				if isFlexible {
  3270  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  3271  				} else {
  3272  					dst = kbin.AppendArrayLen(dst, len(v))
  3273  				}
  3274  				for i := range v {
  3275  					v := &v[i]
  3276  					{
  3277  						v := v.Partition
  3278  						dst = kbin.AppendInt32(dst, v)
  3279  					}
  3280  					{
  3281  						v := v.ErrorCode
  3282  						dst = kbin.AppendInt16(dst, v)
  3283  					}
  3284  					{
  3285  						v := v.BaseOffset
  3286  						dst = kbin.AppendInt64(dst, v)
  3287  					}
  3288  					if version >= 2 {
  3289  						v := v.LogAppendTime
  3290  						dst = kbin.AppendInt64(dst, v)
  3291  					}
  3292  					if version >= 5 {
  3293  						v := v.LogStartOffset
  3294  						dst = kbin.AppendInt64(dst, v)
  3295  					}
  3296  					if version >= 8 {
  3297  						v := v.ErrorRecords
  3298  						if isFlexible {
  3299  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  3300  						} else {
  3301  							dst = kbin.AppendArrayLen(dst, len(v))
  3302  						}
  3303  						for i := range v {
  3304  							v := &v[i]
  3305  							{
  3306  								v := v.RelativeOffset
  3307  								dst = kbin.AppendInt32(dst, v)
  3308  							}
  3309  							{
  3310  								v := v.ErrorMessage
  3311  								if isFlexible {
  3312  									dst = kbin.AppendCompactNullableString(dst, v)
  3313  								} else {
  3314  									dst = kbin.AppendNullableString(dst, v)
  3315  								}
  3316  							}
  3317  							if isFlexible {
  3318  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3319  								dst = v.UnknownTags.AppendEach(dst)
  3320  							}
  3321  						}
  3322  					}
  3323  					if version >= 8 {
  3324  						v := v.ErrorMessage
  3325  						if isFlexible {
  3326  							dst = kbin.AppendCompactNullableString(dst, v)
  3327  						} else {
  3328  							dst = kbin.AppendNullableString(dst, v)
  3329  						}
  3330  					}
  3331  					if isFlexible {
  3332  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3333  						dst = v.UnknownTags.AppendEach(dst)
  3334  					}
  3335  				}
  3336  			}
  3337  			if isFlexible {
  3338  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3339  				dst = v.UnknownTags.AppendEach(dst)
  3340  			}
  3341  		}
  3342  	}
  3343  	if version >= 1 {
  3344  		v := v.ThrottleMillis
  3345  		dst = kbin.AppendInt32(dst, v)
  3346  	}
  3347  	if isFlexible {
  3348  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3349  		dst = v.UnknownTags.AppendEach(dst)
  3350  	}
  3351  	return dst
  3352  }
  3353  
  3354  func (v *ProduceResponse) ReadFrom(src []byte) error {
  3355  	return v.readFrom(src, false)
  3356  }
  3357  
  3358  func (v *ProduceResponse) UnsafeReadFrom(src []byte) error {
  3359  	return v.readFrom(src, true)
  3360  }
  3361  
  3362  func (v *ProduceResponse) readFrom(src []byte, unsafe bool) error {
  3363  	v.Default()
  3364  	b := kbin.Reader{Src: src}
  3365  	version := v.Version
  3366  	_ = version
  3367  	isFlexible := version >= 9
  3368  	_ = isFlexible
  3369  	s := v
  3370  	{
  3371  		v := s.Topics
  3372  		a := v
  3373  		var l int32
  3374  		if isFlexible {
  3375  			l = b.CompactArrayLen()
  3376  		} else {
  3377  			l = b.ArrayLen()
  3378  		}
  3379  		if !b.Ok() {
  3380  			return b.Complete()
  3381  		}
  3382  		a = a[:0]
  3383  		if l > 0 {
  3384  			a = append(a, make([]ProduceResponseTopic, l)...)
  3385  		}
  3386  		for i := int32(0); i < l; i++ {
  3387  			v := &a[i]
  3388  			v.Default()
  3389  			s := v
  3390  			{
  3391  				var v string
  3392  				if unsafe {
  3393  					if isFlexible {
  3394  						v = b.UnsafeCompactString()
  3395  					} else {
  3396  						v = b.UnsafeString()
  3397  					}
  3398  				} else {
  3399  					if isFlexible {
  3400  						v = b.CompactString()
  3401  					} else {
  3402  						v = b.String()
  3403  					}
  3404  				}
  3405  				s.Topic = v
  3406  			}
  3407  			{
  3408  				v := s.Partitions
  3409  				a := v
  3410  				var l int32
  3411  				if isFlexible {
  3412  					l = b.CompactArrayLen()
  3413  				} else {
  3414  					l = b.ArrayLen()
  3415  				}
  3416  				if !b.Ok() {
  3417  					return b.Complete()
  3418  				}
  3419  				a = a[:0]
  3420  				if l > 0 {
  3421  					a = append(a, make([]ProduceResponseTopicPartition, l)...)
  3422  				}
  3423  				for i := int32(0); i < l; i++ {
  3424  					v := &a[i]
  3425  					v.Default()
  3426  					s := v
  3427  					{
  3428  						v := b.Int32()
  3429  						s.Partition = v
  3430  					}
  3431  					{
  3432  						v := b.Int16()
  3433  						s.ErrorCode = v
  3434  					}
  3435  					{
  3436  						v := b.Int64()
  3437  						s.BaseOffset = v
  3438  					}
  3439  					if version >= 2 {
  3440  						v := b.Int64()
  3441  						s.LogAppendTime = v
  3442  					}
  3443  					if version >= 5 {
  3444  						v := b.Int64()
  3445  						s.LogStartOffset = v
  3446  					}
  3447  					if version >= 8 {
  3448  						v := s.ErrorRecords
  3449  						a := v
  3450  						var l int32
  3451  						if isFlexible {
  3452  							l = b.CompactArrayLen()
  3453  						} else {
  3454  							l = b.ArrayLen()
  3455  						}
  3456  						if !b.Ok() {
  3457  							return b.Complete()
  3458  						}
  3459  						a = a[:0]
  3460  						if l > 0 {
  3461  							a = append(a, make([]ProduceResponseTopicPartitionErrorRecord, l)...)
  3462  						}
  3463  						for i := int32(0); i < l; i++ {
  3464  							v := &a[i]
  3465  							v.Default()
  3466  							s := v
  3467  							{
  3468  								v := b.Int32()
  3469  								s.RelativeOffset = v
  3470  							}
  3471  							{
  3472  								var v *string
  3473  								if isFlexible {
  3474  									if unsafe {
  3475  										v = b.UnsafeCompactNullableString()
  3476  									} else {
  3477  										v = b.CompactNullableString()
  3478  									}
  3479  								} else {
  3480  									if unsafe {
  3481  										v = b.UnsafeNullableString()
  3482  									} else {
  3483  										v = b.NullableString()
  3484  									}
  3485  								}
  3486  								s.ErrorMessage = v
  3487  							}
  3488  							if isFlexible {
  3489  								s.UnknownTags = internalReadTags(&b)
  3490  							}
  3491  						}
  3492  						v = a
  3493  						s.ErrorRecords = v
  3494  					}
  3495  					if version >= 8 {
  3496  						var v *string
  3497  						if isFlexible {
  3498  							if unsafe {
  3499  								v = b.UnsafeCompactNullableString()
  3500  							} else {
  3501  								v = b.CompactNullableString()
  3502  							}
  3503  						} else {
  3504  							if unsafe {
  3505  								v = b.UnsafeNullableString()
  3506  							} else {
  3507  								v = b.NullableString()
  3508  							}
  3509  						}
  3510  						s.ErrorMessage = v
  3511  					}
  3512  					if isFlexible {
  3513  						s.UnknownTags = internalReadTags(&b)
  3514  					}
  3515  				}
  3516  				v = a
  3517  				s.Partitions = v
  3518  			}
  3519  			if isFlexible {
  3520  				s.UnknownTags = internalReadTags(&b)
  3521  			}
  3522  		}
  3523  		v = a
  3524  		s.Topics = v
  3525  	}
  3526  	if version >= 1 {
  3527  		v := b.Int32()
  3528  		s.ThrottleMillis = v
  3529  	}
  3530  	if isFlexible {
  3531  		s.UnknownTags = internalReadTags(&b)
  3532  	}
  3533  	return b.Complete()
  3534  }
  3535  
  3536  // NewPtrProduceResponse returns a pointer to a default ProduceResponse
  3537  // This is a shortcut for creating a new(struct) and calling Default yourself.
  3538  func NewPtrProduceResponse() *ProduceResponse {
  3539  	var v ProduceResponse
  3540  	v.Default()
  3541  	return &v
  3542  }
  3543  
  3544  // Default sets any default fields. Calling this allows for future compatibility
  3545  // if new fields are added to ProduceResponse.
  3546  func (v *ProduceResponse) Default() {
  3547  }
  3548  
  3549  // NewProduceResponse returns a default ProduceResponse
  3550  // This is a shortcut for creating a struct and calling Default yourself.
  3551  func NewProduceResponse() ProduceResponse {
  3552  	var v ProduceResponse
  3553  	v.Default()
  3554  	return v
  3555  }
  3556  
  3557  type FetchRequestReplicaState struct {
  3558  	// The replica ID of the follower, or -1 if this request is from a consumer.
  3559  	//
  3560  	// This field has a default of -1.
  3561  	ID int32
  3562  
  3563  	// The epoch of this follower, or -1 if not available.
  3564  	//
  3565  	// This field has a default of -1.
  3566  	Epoch int64
  3567  
  3568  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3569  	UnknownTags Tags // v12+
  3570  }
  3571  
  3572  // Default sets any default fields. Calling this allows for future compatibility
  3573  // if new fields are added to FetchRequestReplicaState.
  3574  func (v *FetchRequestReplicaState) Default() {
  3575  	v.ID = -1
  3576  	v.Epoch = -1
  3577  }
  3578  
  3579  // NewFetchRequestReplicaState returns a default FetchRequestReplicaState
  3580  // This is a shortcut for creating a struct and calling Default yourself.
  3581  func NewFetchRequestReplicaState() FetchRequestReplicaState {
  3582  	var v FetchRequestReplicaState
  3583  	v.Default()
  3584  	return v
  3585  }
  3586  
  3587  type FetchRequestTopicPartition struct {
  3588  	// Partition is a partition in a topic to try to fetch records for.
  3589  	Partition int32
  3590  
  3591  	// CurrentLeaderEpoch, proposed in KIP-320 and introduced in Kafka 2.1.0,
  3592  	// allows brokers to check if the client is fenced (has an out of date
  3593  	// leader) or is using an unknown leader.
  3594  	//
  3595  	// The initial leader epoch can be determined from a MetadataResponse.
  3596  	// To skip log truncation checking, use -1.
  3597  	//
  3598  	// This field has a default of -1.
  3599  	CurrentLeaderEpoch int32 // v9+
  3600  
  3601  	// FetchOffset is the offset to begin the fetch from. Kafka will
  3602  	// return records at and after this offset.
  3603  	FetchOffset int64
  3604  
  3605  	// The epoch of the last fetched record, or -1 if there is none.
  3606  	//
  3607  	// This field has a default of -1.
  3608  	LastFetchedEpoch int32 // v12+
  3609  
  3610  	// LogStartOffset is a broker-follower only field added for KIP-107.
  3611  	// This is the start offset of the partition in a follower.
  3612  	//
  3613  	// This field has a default of -1.
  3614  	LogStartOffset int64 // v5+
  3615  
  3616  	// PartitionMaxBytes is the maximum bytes to return for this partition.
  3617  	// This can be used to limit how many bytes an individual partition in
  3618  	// a request is allotted so that it does not dominate all of MaxBytes.
  3619  	PartitionMaxBytes int32
  3620  
  3621  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3622  	UnknownTags Tags // v12+
  3623  }
  3624  
  3625  // Default sets any default fields. Calling this allows for future compatibility
  3626  // if new fields are added to FetchRequestTopicPartition.
  3627  func (v *FetchRequestTopicPartition) Default() {
  3628  	v.CurrentLeaderEpoch = -1
  3629  	v.LastFetchedEpoch = -1
  3630  	v.LogStartOffset = -1
  3631  }
  3632  
  3633  // NewFetchRequestTopicPartition returns a default FetchRequestTopicPartition
  3634  // This is a shortcut for creating a struct and calling Default yourself.
  3635  func NewFetchRequestTopicPartition() FetchRequestTopicPartition {
  3636  	var v FetchRequestTopicPartition
  3637  	v.Default()
  3638  	return v
  3639  }
  3640  
  3641  type FetchRequestTopic struct {
  3642  	// Topic is a topic to try to fetch records for.
  3643  	Topic string // v0-v12
  3644  
  3645  	// TopicID is the uuid of the topic to fetch records for.
  3646  	TopicID [16]byte // v13+
  3647  
  3648  	// Partitions contains partitions in a topic to try to fetch records for.
  3649  	Partitions []FetchRequestTopicPartition
  3650  
  3651  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3652  	UnknownTags Tags // v12+
  3653  }
  3654  
  3655  // Default sets any default fields. Calling this allows for future compatibility
  3656  // if new fields are added to FetchRequestTopic.
  3657  func (v *FetchRequestTopic) Default() {
  3658  }
  3659  
  3660  // NewFetchRequestTopic returns a default FetchRequestTopic
  3661  // This is a shortcut for creating a struct and calling Default yourself.
  3662  func NewFetchRequestTopic() FetchRequestTopic {
  3663  	var v FetchRequestTopic
  3664  	v.Default()
  3665  	return v
  3666  }
  3667  
  3668  type FetchRequestForgottenTopic struct {
  3669  	// Topic is a topic to remove from being tracked (with the partitions below).
  3670  	Topic string // v7-v12
  3671  
  3672  	// TopicID is the uuid of a topic to remove from being tracked (with the
  3673  	// partitions below).
  3674  	TopicID [16]byte // v13+
  3675  
  3676  	// Partitions are partitions to remove from tracking for a topic.
  3677  	Partitions []int32
  3678  
  3679  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3680  	UnknownTags Tags // v12+
  3681  }
  3682  
  3683  // Default sets any default fields. Calling this allows for future compatibility
  3684  // if new fields are added to FetchRequestForgottenTopic.
  3685  func (v *FetchRequestForgottenTopic) Default() {
  3686  }
  3687  
  3688  // NewFetchRequestForgottenTopic returns a default FetchRequestForgottenTopic
  3689  // This is a shortcut for creating a struct and calling Default yourself.
  3690  func NewFetchRequestForgottenTopic() FetchRequestForgottenTopic {
  3691  	var v FetchRequestForgottenTopic
  3692  	v.Default()
  3693  	return v
  3694  }
  3695  
  3696  // FetchRequest is a long-poll request of records from Kafka.
  3697  //
  3698  // Kafka 0.11.0.0 released v4 and changed the returned RecordBatches to contain
  3699  // the RecordBatch type. Prior, Kafka used the MessageSet type (and, for v0 and
  3700  // v1, Kafka used a different type).
  3701  //
  3702  // Note that starting in v3, Kafka began processing partitions in order,
  3703  // meaning the order of partitions in the fetch request is important due to
  3704  // potential size constraints.
  3705  //
  3706  // Starting in v13, topics must use UUIDs rather than their string name
  3707  // identifiers.
  3708  //
  3709  // Version 15 adds the ReplicaState which includes new field ReplicaEpoch and
  3710  // the ReplicaID, and deprecates the old ReplicaID (KIP-903).
  3711  type FetchRequest struct {
  3712  	// Version is the version of this message used with a Kafka broker.
  3713  	Version int16
  3714  
  3715  	// The cluster ID, if known. This is used to validate metadata fetches
  3716  	// prior to broker registration.
  3717  	//
  3718  	// This field has a default of null.
  3719  	ClusterID *string // tag 0
  3720  
  3721  	// ReplicaID is the broker ID of performing the fetch request. Standard
  3722  	// clients should use -1. To be a "debug" replica, use -2. The debug
  3723  	// replica can be used to fetch messages from non-leaders.
  3724  	//
  3725  	// This field has a default of -1.
  3726  	ReplicaID int32 // v0-v14
  3727  
  3728  	// ReplicaState is a broker-only tag for v15+, see KIP-903 for more details.
  3729  	ReplicaState FetchRequestReplicaState // tag 1
  3730  
  3731  	// MaxWaitMillis is how long to wait for MinBytes to be hit before a broker
  3732  	// responds to a fetch request.
  3733  	MaxWaitMillis int32
  3734  
  3735  	// MinBytes is the minimum amount of bytes to attempt to read before a broker
  3736  	// responds to a fetch request.
  3737  	MinBytes int32
  3738  
  3739  	// MaxBytes is the maximum amount of bytes to read in a fetch request. The
  3740  	// response can exceed MaxBytes if the first record in the first non-empty
  3741  	// partition is larger than MaxBytes.
  3742  	//
  3743  	// This field has a default of 0x7fffffff.
  3744  	MaxBytes int32 // v3+
  3745  
  3746  	// IsolationLevel changes which messages are fetched. Follower replica ID's
  3747  	// (non-negative, non-standard-client) fetch from the end.
  3748  	//
  3749  	// Standard clients fetch from the high watermark, which corresponds to
  3750  	// IsolationLevel 0, READ_UNCOMMITTED.
  3751  	//
  3752  	// To only read committed records, use IsolationLevel 1, corresponding to
  3753  	// READ_COMMITTED.
  3754  	IsolationLevel int8 // v4+
  3755  
  3756  	// SessionID is used to potentially reduce the amount of back and forth
  3757  	// data between a client and a broker. If opting in to sessions, the first
  3758  	// ID used should be 0, and thereafter (until session resets) the ID should
  3759  	// be the ID returned in the fetch response.
  3760  	//
  3761  	// Read KIP-227 for more details. Use -1 if you want to disable sessions.
  3762  	SessionID int32 // v7+
  3763  
  3764  	// SessionEpoch is the session epoch for this request if using sessions.
  3765  	//
  3766  	// Read KIP-227 for more details. Use -1 if you are not using sessions.
  3767  	//
  3768  	// This field has a default of -1.
  3769  	SessionEpoch int32 // v7+
  3770  
  3771  	// Topic contains topics to try to fetch records for.
  3772  	Topics []FetchRequestTopic
  3773  
  3774  	// ForgottenTopics contains topics and partitions that a fetch session
  3775  	// wants to remove from its session.
  3776  	//
  3777  	// See KIP-227 for more details.
  3778  	ForgottenTopics []FetchRequestForgottenTopic // v7+
  3779  
  3780  	// Rack of the consumer making this request (see KIP-392; introduced in
  3781  	// Kafka 2.2.0).
  3782  	Rack string // v11+
  3783  
  3784  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  3785  	UnknownTags Tags // v12+
  3786  }
  3787  
  3788  func (*FetchRequest) Key() int16                 { return 1 }
  3789  func (*FetchRequest) MaxVersion() int16          { return 15 }
  3790  func (v *FetchRequest) SetVersion(version int16) { v.Version = version }
  3791  func (v *FetchRequest) GetVersion() int16        { return v.Version }
  3792  func (v *FetchRequest) IsFlexible() bool         { return v.Version >= 12 }
  3793  func (v *FetchRequest) ResponseKind() Response {
  3794  	r := &FetchResponse{Version: v.Version}
  3795  	r.Default()
  3796  	return r
  3797  }
  3798  
  3799  // RequestWith is requests v on r and returns the response or an error.
  3800  // For sharded requests, the response may be merged and still return an error.
  3801  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  3802  func (v *FetchRequest) RequestWith(ctx context.Context, r Requestor) (*FetchResponse, error) {
  3803  	kresp, err := r.Request(ctx, v)
  3804  	resp, _ := kresp.(*FetchResponse)
  3805  	return resp, err
  3806  }
  3807  
  3808  func (v *FetchRequest) AppendTo(dst []byte) []byte {
  3809  	version := v.Version
  3810  	_ = version
  3811  	isFlexible := version >= 12
  3812  	_ = isFlexible
  3813  	if version >= 0 && version <= 14 {
  3814  		v := v.ReplicaID
  3815  		dst = kbin.AppendInt32(dst, v)
  3816  	}
  3817  	{
  3818  		v := v.MaxWaitMillis
  3819  		dst = kbin.AppendInt32(dst, v)
  3820  	}
  3821  	{
  3822  		v := v.MinBytes
  3823  		dst = kbin.AppendInt32(dst, v)
  3824  	}
  3825  	if version >= 3 {
  3826  		v := v.MaxBytes
  3827  		dst = kbin.AppendInt32(dst, v)
  3828  	}
  3829  	if version >= 4 {
  3830  		v := v.IsolationLevel
  3831  		dst = kbin.AppendInt8(dst, v)
  3832  	}
  3833  	if version >= 7 {
  3834  		v := v.SessionID
  3835  		dst = kbin.AppendInt32(dst, v)
  3836  	}
  3837  	if version >= 7 {
  3838  		v := v.SessionEpoch
  3839  		dst = kbin.AppendInt32(dst, v)
  3840  	}
  3841  	{
  3842  		v := v.Topics
  3843  		if isFlexible {
  3844  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  3845  		} else {
  3846  			dst = kbin.AppendArrayLen(dst, len(v))
  3847  		}
  3848  		for i := range v {
  3849  			v := &v[i]
  3850  			if version >= 0 && version <= 12 {
  3851  				v := v.Topic
  3852  				if isFlexible {
  3853  					dst = kbin.AppendCompactString(dst, v)
  3854  				} else {
  3855  					dst = kbin.AppendString(dst, v)
  3856  				}
  3857  			}
  3858  			if version >= 13 {
  3859  				v := v.TopicID
  3860  				dst = kbin.AppendUuid(dst, v)
  3861  			}
  3862  			{
  3863  				v := v.Partitions
  3864  				if isFlexible {
  3865  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  3866  				} else {
  3867  					dst = kbin.AppendArrayLen(dst, len(v))
  3868  				}
  3869  				for i := range v {
  3870  					v := &v[i]
  3871  					{
  3872  						v := v.Partition
  3873  						dst = kbin.AppendInt32(dst, v)
  3874  					}
  3875  					if version >= 9 {
  3876  						v := v.CurrentLeaderEpoch
  3877  						dst = kbin.AppendInt32(dst, v)
  3878  					}
  3879  					{
  3880  						v := v.FetchOffset
  3881  						dst = kbin.AppendInt64(dst, v)
  3882  					}
  3883  					if version >= 12 {
  3884  						v := v.LastFetchedEpoch
  3885  						dst = kbin.AppendInt32(dst, v)
  3886  					}
  3887  					if version >= 5 {
  3888  						v := v.LogStartOffset
  3889  						dst = kbin.AppendInt64(dst, v)
  3890  					}
  3891  					{
  3892  						v := v.PartitionMaxBytes
  3893  						dst = kbin.AppendInt32(dst, v)
  3894  					}
  3895  					if isFlexible {
  3896  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3897  						dst = v.UnknownTags.AppendEach(dst)
  3898  					}
  3899  				}
  3900  			}
  3901  			if isFlexible {
  3902  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3903  				dst = v.UnknownTags.AppendEach(dst)
  3904  			}
  3905  		}
  3906  	}
  3907  	if version >= 7 {
  3908  		v := v.ForgottenTopics
  3909  		if isFlexible {
  3910  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  3911  		} else {
  3912  			dst = kbin.AppendArrayLen(dst, len(v))
  3913  		}
  3914  		for i := range v {
  3915  			v := &v[i]
  3916  			if version >= 7 && version <= 12 {
  3917  				v := v.Topic
  3918  				if isFlexible {
  3919  					dst = kbin.AppendCompactString(dst, v)
  3920  				} else {
  3921  					dst = kbin.AppendString(dst, v)
  3922  				}
  3923  			}
  3924  			if version >= 13 {
  3925  				v := v.TopicID
  3926  				dst = kbin.AppendUuid(dst, v)
  3927  			}
  3928  			{
  3929  				v := v.Partitions
  3930  				if isFlexible {
  3931  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  3932  				} else {
  3933  					dst = kbin.AppendArrayLen(dst, len(v))
  3934  				}
  3935  				for i := range v {
  3936  					v := v[i]
  3937  					dst = kbin.AppendInt32(dst, v)
  3938  				}
  3939  			}
  3940  			if isFlexible {
  3941  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  3942  				dst = v.UnknownTags.AppendEach(dst)
  3943  			}
  3944  		}
  3945  	}
  3946  	if version >= 11 {
  3947  		v := v.Rack
  3948  		if isFlexible {
  3949  			dst = kbin.AppendCompactString(dst, v)
  3950  		} else {
  3951  			dst = kbin.AppendString(dst, v)
  3952  		}
  3953  	}
  3954  	if isFlexible {
  3955  		var toEncode []uint32
  3956  		if v.ClusterID != nil {
  3957  			toEncode = append(toEncode, 0)
  3958  		}
  3959  		if !reflect.DeepEqual(v.ReplicaState, (func() FetchRequestReplicaState { var v FetchRequestReplicaState; v.Default(); return v })()) {
  3960  			toEncode = append(toEncode, 1)
  3961  		}
  3962  		dst = kbin.AppendUvarint(dst, uint32(len(toEncode)+v.UnknownTags.Len()))
  3963  		for _, tag := range toEncode {
  3964  			switch tag {
  3965  			case 0:
  3966  				{
  3967  					v := v.ClusterID
  3968  					dst = kbin.AppendUvarint(dst, 0)
  3969  					sized := false
  3970  					lenAt := len(dst)
  3971  				fClusterID:
  3972  					if isFlexible {
  3973  						dst = kbin.AppendCompactNullableString(dst, v)
  3974  					} else {
  3975  						dst = kbin.AppendNullableString(dst, v)
  3976  					}
  3977  					if !sized {
  3978  						dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
  3979  						sized = true
  3980  						goto fClusterID
  3981  					}
  3982  				}
  3983  			case 1:
  3984  				{
  3985  					v := v.ReplicaState
  3986  					dst = kbin.AppendUvarint(dst, 1)
  3987  					sized := false
  3988  					lenAt := len(dst)
  3989  				fReplicaState:
  3990  					{
  3991  						v := v.ID
  3992  						dst = kbin.AppendInt32(dst, v)
  3993  					}
  3994  					{
  3995  						v := v.Epoch
  3996  						dst = kbin.AppendInt64(dst, v)
  3997  					}
  3998  					if isFlexible {
  3999  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4000  						dst = v.UnknownTags.AppendEach(dst)
  4001  					}
  4002  					if !sized {
  4003  						dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
  4004  						sized = true
  4005  						goto fReplicaState
  4006  					}
  4007  				}
  4008  			}
  4009  		}
  4010  		dst = v.UnknownTags.AppendEach(dst)
  4011  	}
  4012  	return dst
  4013  }
  4014  
  4015  func (v *FetchRequest) ReadFrom(src []byte) error {
  4016  	return v.readFrom(src, false)
  4017  }
  4018  
  4019  func (v *FetchRequest) UnsafeReadFrom(src []byte) error {
  4020  	return v.readFrom(src, true)
  4021  }
  4022  
  4023  func (v *FetchRequest) readFrom(src []byte, unsafe bool) error {
  4024  	v.Default()
  4025  	b := kbin.Reader{Src: src}
  4026  	version := v.Version
  4027  	_ = version
  4028  	isFlexible := version >= 12
  4029  	_ = isFlexible
  4030  	s := v
  4031  	if version >= 0 && version <= 14 {
  4032  		v := b.Int32()
  4033  		s.ReplicaID = v
  4034  	}
  4035  	{
  4036  		v := b.Int32()
  4037  		s.MaxWaitMillis = v
  4038  	}
  4039  	{
  4040  		v := b.Int32()
  4041  		s.MinBytes = v
  4042  	}
  4043  	if version >= 3 {
  4044  		v := b.Int32()
  4045  		s.MaxBytes = v
  4046  	}
  4047  	if version >= 4 {
  4048  		v := b.Int8()
  4049  		s.IsolationLevel = v
  4050  	}
  4051  	if version >= 7 {
  4052  		v := b.Int32()
  4053  		s.SessionID = v
  4054  	}
  4055  	if version >= 7 {
  4056  		v := b.Int32()
  4057  		s.SessionEpoch = v
  4058  	}
  4059  	{
  4060  		v := s.Topics
  4061  		a := v
  4062  		var l int32
  4063  		if isFlexible {
  4064  			l = b.CompactArrayLen()
  4065  		} else {
  4066  			l = b.ArrayLen()
  4067  		}
  4068  		if !b.Ok() {
  4069  			return b.Complete()
  4070  		}
  4071  		a = a[:0]
  4072  		if l > 0 {
  4073  			a = append(a, make([]FetchRequestTopic, l)...)
  4074  		}
  4075  		for i := int32(0); i < l; i++ {
  4076  			v := &a[i]
  4077  			v.Default()
  4078  			s := v
  4079  			if version >= 0 && version <= 12 {
  4080  				var v string
  4081  				if unsafe {
  4082  					if isFlexible {
  4083  						v = b.UnsafeCompactString()
  4084  					} else {
  4085  						v = b.UnsafeString()
  4086  					}
  4087  				} else {
  4088  					if isFlexible {
  4089  						v = b.CompactString()
  4090  					} else {
  4091  						v = b.String()
  4092  					}
  4093  				}
  4094  				s.Topic = v
  4095  			}
  4096  			if version >= 13 {
  4097  				v := b.Uuid()
  4098  				s.TopicID = v
  4099  			}
  4100  			{
  4101  				v := s.Partitions
  4102  				a := v
  4103  				var l int32
  4104  				if isFlexible {
  4105  					l = b.CompactArrayLen()
  4106  				} else {
  4107  					l = b.ArrayLen()
  4108  				}
  4109  				if !b.Ok() {
  4110  					return b.Complete()
  4111  				}
  4112  				a = a[:0]
  4113  				if l > 0 {
  4114  					a = append(a, make([]FetchRequestTopicPartition, l)...)
  4115  				}
  4116  				for i := int32(0); i < l; i++ {
  4117  					v := &a[i]
  4118  					v.Default()
  4119  					s := v
  4120  					{
  4121  						v := b.Int32()
  4122  						s.Partition = v
  4123  					}
  4124  					if version >= 9 {
  4125  						v := b.Int32()
  4126  						s.CurrentLeaderEpoch = v
  4127  					}
  4128  					{
  4129  						v := b.Int64()
  4130  						s.FetchOffset = v
  4131  					}
  4132  					if version >= 12 {
  4133  						v := b.Int32()
  4134  						s.LastFetchedEpoch = v
  4135  					}
  4136  					if version >= 5 {
  4137  						v := b.Int64()
  4138  						s.LogStartOffset = v
  4139  					}
  4140  					{
  4141  						v := b.Int32()
  4142  						s.PartitionMaxBytes = v
  4143  					}
  4144  					if isFlexible {
  4145  						s.UnknownTags = internalReadTags(&b)
  4146  					}
  4147  				}
  4148  				v = a
  4149  				s.Partitions = v
  4150  			}
  4151  			if isFlexible {
  4152  				s.UnknownTags = internalReadTags(&b)
  4153  			}
  4154  		}
  4155  		v = a
  4156  		s.Topics = v
  4157  	}
  4158  	if version >= 7 {
  4159  		v := s.ForgottenTopics
  4160  		a := v
  4161  		var l int32
  4162  		if isFlexible {
  4163  			l = b.CompactArrayLen()
  4164  		} else {
  4165  			l = b.ArrayLen()
  4166  		}
  4167  		if !b.Ok() {
  4168  			return b.Complete()
  4169  		}
  4170  		a = a[:0]
  4171  		if l > 0 {
  4172  			a = append(a, make([]FetchRequestForgottenTopic, l)...)
  4173  		}
  4174  		for i := int32(0); i < l; i++ {
  4175  			v := &a[i]
  4176  			v.Default()
  4177  			s := v
  4178  			if version >= 7 && version <= 12 {
  4179  				var v string
  4180  				if unsafe {
  4181  					if isFlexible {
  4182  						v = b.UnsafeCompactString()
  4183  					} else {
  4184  						v = b.UnsafeString()
  4185  					}
  4186  				} else {
  4187  					if isFlexible {
  4188  						v = b.CompactString()
  4189  					} else {
  4190  						v = b.String()
  4191  					}
  4192  				}
  4193  				s.Topic = v
  4194  			}
  4195  			if version >= 13 {
  4196  				v := b.Uuid()
  4197  				s.TopicID = v
  4198  			}
  4199  			{
  4200  				v := s.Partitions
  4201  				a := v
  4202  				var l int32
  4203  				if isFlexible {
  4204  					l = b.CompactArrayLen()
  4205  				} else {
  4206  					l = b.ArrayLen()
  4207  				}
  4208  				if !b.Ok() {
  4209  					return b.Complete()
  4210  				}
  4211  				a = a[:0]
  4212  				if l > 0 {
  4213  					a = append(a, make([]int32, l)...)
  4214  				}
  4215  				for i := int32(0); i < l; i++ {
  4216  					v := b.Int32()
  4217  					a[i] = v
  4218  				}
  4219  				v = a
  4220  				s.Partitions = v
  4221  			}
  4222  			if isFlexible {
  4223  				s.UnknownTags = internalReadTags(&b)
  4224  			}
  4225  		}
  4226  		v = a
  4227  		s.ForgottenTopics = v
  4228  	}
  4229  	if version >= 11 {
  4230  		var v string
  4231  		if unsafe {
  4232  			if isFlexible {
  4233  				v = b.UnsafeCompactString()
  4234  			} else {
  4235  				v = b.UnsafeString()
  4236  			}
  4237  		} else {
  4238  			if isFlexible {
  4239  				v = b.CompactString()
  4240  			} else {
  4241  				v = b.String()
  4242  			}
  4243  		}
  4244  		s.Rack = v
  4245  	}
  4246  	if isFlexible {
  4247  		for i := b.Uvarint(); i > 0; i-- {
  4248  			switch key := b.Uvarint(); key {
  4249  			default:
  4250  				s.UnknownTags.Set(key, b.Span(int(b.Uvarint())))
  4251  			case 0:
  4252  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
  4253  				var v *string
  4254  				if isFlexible {
  4255  					if unsafe {
  4256  						v = b.UnsafeCompactNullableString()
  4257  					} else {
  4258  						v = b.CompactNullableString()
  4259  					}
  4260  				} else {
  4261  					if unsafe {
  4262  						v = b.UnsafeNullableString()
  4263  					} else {
  4264  						v = b.NullableString()
  4265  					}
  4266  				}
  4267  				s.ClusterID = v
  4268  				if err := b.Complete(); err != nil {
  4269  					return err
  4270  				}
  4271  			case 1:
  4272  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
  4273  				v := &s.ReplicaState
  4274  				v.Default()
  4275  				s := v
  4276  				{
  4277  					v := b.Int32()
  4278  					s.ID = v
  4279  				}
  4280  				{
  4281  					v := b.Int64()
  4282  					s.Epoch = v
  4283  				}
  4284  				if isFlexible {
  4285  					s.UnknownTags = internalReadTags(&b)
  4286  				}
  4287  				if err := b.Complete(); err != nil {
  4288  					return err
  4289  				}
  4290  			}
  4291  		}
  4292  	}
  4293  	return b.Complete()
  4294  }
  4295  
  4296  // NewPtrFetchRequest returns a pointer to a default FetchRequest
  4297  // This is a shortcut for creating a new(struct) and calling Default yourself.
  4298  func NewPtrFetchRequest() *FetchRequest {
  4299  	var v FetchRequest
  4300  	v.Default()
  4301  	return &v
  4302  }
  4303  
  4304  // Default sets any default fields. Calling this allows for future compatibility
  4305  // if new fields are added to FetchRequest.
  4306  func (v *FetchRequest) Default() {
  4307  	v.ClusterID = nil
  4308  	v.ReplicaID = -1
  4309  	{
  4310  		v := &v.ReplicaState
  4311  		_ = v
  4312  		v.ID = -1
  4313  		v.Epoch = -1
  4314  	}
  4315  	v.MaxBytes = 2147483647
  4316  	v.SessionEpoch = -1
  4317  }
  4318  
  4319  // NewFetchRequest returns a default FetchRequest
  4320  // This is a shortcut for creating a struct and calling Default yourself.
  4321  func NewFetchRequest() FetchRequest {
  4322  	var v FetchRequest
  4323  	v.Default()
  4324  	return v
  4325  }
  4326  
  4327  type FetchResponseTopicPartitionDivergingEpoch struct {
  4328  	// This field has a default of -1.
  4329  	Epoch int32
  4330  
  4331  	// This field has a default of -1.
  4332  	EndOffset int64
  4333  
  4334  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4335  	UnknownTags Tags // v12+
  4336  }
  4337  
  4338  // Default sets any default fields. Calling this allows for future compatibility
  4339  // if new fields are added to FetchResponseTopicPartitionDivergingEpoch.
  4340  func (v *FetchResponseTopicPartitionDivergingEpoch) Default() {
  4341  	v.Epoch = -1
  4342  	v.EndOffset = -1
  4343  }
  4344  
  4345  // NewFetchResponseTopicPartitionDivergingEpoch returns a default FetchResponseTopicPartitionDivergingEpoch
  4346  // This is a shortcut for creating a struct and calling Default yourself.
  4347  func NewFetchResponseTopicPartitionDivergingEpoch() FetchResponseTopicPartitionDivergingEpoch {
  4348  	var v FetchResponseTopicPartitionDivergingEpoch
  4349  	v.Default()
  4350  	return v
  4351  }
  4352  
  4353  type FetchResponseTopicPartitionCurrentLeader struct {
  4354  	// The ID of the current leader, or -1 if unknown.
  4355  	//
  4356  	// This field has a default of -1.
  4357  	LeaderID int32
  4358  
  4359  	// The latest known leader epoch.
  4360  	//
  4361  	// This field has a default of -1.
  4362  	LeaderEpoch int32
  4363  
  4364  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4365  	UnknownTags Tags // v12+
  4366  }
  4367  
  4368  // Default sets any default fields. Calling this allows for future compatibility
  4369  // if new fields are added to FetchResponseTopicPartitionCurrentLeader.
  4370  func (v *FetchResponseTopicPartitionCurrentLeader) Default() {
  4371  	v.LeaderID = -1
  4372  	v.LeaderEpoch = -1
  4373  }
  4374  
  4375  // NewFetchResponseTopicPartitionCurrentLeader returns a default FetchResponseTopicPartitionCurrentLeader
  4376  // This is a shortcut for creating a struct and calling Default yourself.
  4377  func NewFetchResponseTopicPartitionCurrentLeader() FetchResponseTopicPartitionCurrentLeader {
  4378  	var v FetchResponseTopicPartitionCurrentLeader
  4379  	v.Default()
  4380  	return v
  4381  }
  4382  
  4383  type FetchResponseTopicPartitionSnapshotID struct {
  4384  	// This field has a default of -1.
  4385  	EndOffset int64
  4386  
  4387  	// This field has a default of -1.
  4388  	Epoch int32
  4389  
  4390  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4391  	UnknownTags Tags // v12+
  4392  }
  4393  
  4394  // Default sets any default fields. Calling this allows for future compatibility
  4395  // if new fields are added to FetchResponseTopicPartitionSnapshotID.
  4396  func (v *FetchResponseTopicPartitionSnapshotID) Default() {
  4397  	v.EndOffset = -1
  4398  	v.Epoch = -1
  4399  }
  4400  
  4401  // NewFetchResponseTopicPartitionSnapshotID returns a default FetchResponseTopicPartitionSnapshotID
  4402  // This is a shortcut for creating a struct and calling Default yourself.
  4403  func NewFetchResponseTopicPartitionSnapshotID() FetchResponseTopicPartitionSnapshotID {
  4404  	var v FetchResponseTopicPartitionSnapshotID
  4405  	v.Default()
  4406  	return v
  4407  }
  4408  
  4409  type FetchResponseTopicPartitionAbortedTransaction struct {
  4410  	// ProducerID is the producer ID that caused this aborted transaction.
  4411  	ProducerID int64
  4412  
  4413  	// FirstOffset is the offset where this aborted transaction began.
  4414  	FirstOffset int64
  4415  
  4416  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4417  	UnknownTags Tags // v12+
  4418  }
  4419  
  4420  // Default sets any default fields. Calling this allows for future compatibility
  4421  // if new fields are added to FetchResponseTopicPartitionAbortedTransaction.
  4422  func (v *FetchResponseTopicPartitionAbortedTransaction) Default() {
  4423  }
  4424  
  4425  // NewFetchResponseTopicPartitionAbortedTransaction returns a default FetchResponseTopicPartitionAbortedTransaction
  4426  // This is a shortcut for creating a struct and calling Default yourself.
  4427  func NewFetchResponseTopicPartitionAbortedTransaction() FetchResponseTopicPartitionAbortedTransaction {
  4428  	var v FetchResponseTopicPartitionAbortedTransaction
  4429  	v.Default()
  4430  	return v
  4431  }
  4432  
  4433  type FetchResponseTopicPartition struct {
  4434  	// Partition is a partition in a topic that records may have been
  4435  	// received for.
  4436  	Partition int32
  4437  
  4438  	// ErrorCode is an error returned for an individual partition in a
  4439  	// fetch request.
  4440  	//
  4441  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not
  4442  	// authorized to read the partition.
  4443  	//
  4444  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the topic or partition
  4445  	// does not exist on this broker.
  4446  	//
  4447  	// UNSUPPORTED_COMPRESSION_TYPE is returned if the request version was
  4448  	// under 10 and the batch is compressed with zstd.
  4449  	//
  4450  	// UNSUPPORTED_VERSION is returned if the broker has records newer than
  4451  	// the client can support (magic value) and the broker has disabled
  4452  	// message downconversion.
  4453  	//
  4454  	// NOT_LEADER_FOR_PARTITION is returned if requesting data for this
  4455  	// partition as a follower (non-negative ReplicaID) and the broker
  4456  	// is not the leader for this partition.
  4457  	//
  4458  	// REPLICA_NOT_AVAILABLE is returned if the partition exists but
  4459  	// the requested broker is not the leader for it.
  4460  	//
  4461  	// KAFKA_STORAGE_EXCEPTION is returned if the requested partition is
  4462  	// offline.
  4463  	//
  4464  	// UNKNOWN_LEADER_EPOCH is returned if the request used a larger leader
  4465  	// epoch than the broker knows of.
  4466  	//
  4467  	// FENCED_LEADER_EPOCH is returned if the request used a smaller leader
  4468  	// epoch than the broker is at (see KIP-320).
  4469  	//
  4470  	// OFFSET_OUT_OF_RANGE is returned if requesting an offset past the
  4471  	// current end offset or before the beginning offset.
  4472  	//
  4473  	// UNKNOWN_TOPIC_ID is returned if using uuid's and the uuid is unknown
  4474  	// (v13+ / Kafka 3.1+).
  4475  	//
  4476  	// OFFSET_MOVED_TO_TIERED_STORAGE is returned if a follower is trying to
  4477  	// fetch from an offset that is now in tiered storage.
  4478  	ErrorCode int16
  4479  
  4480  	// HighWatermark is the current high watermark for this partition,
  4481  	// that is, the current offset that is on all in sync replicas.
  4482  	HighWatermark int64
  4483  
  4484  	// LastStableOffset is the offset at which all prior offsets have
  4485  	// been "decided". Non transactional records are always decided
  4486  	// immediately, but transactional records are only decided once
  4487  	// they are commited or aborted.
  4488  	//
  4489  	// The LastStableOffset will always be at or under the HighWatermark.
  4490  	//
  4491  	// This field has a default of -1.
  4492  	LastStableOffset int64 // v4+
  4493  
  4494  	// LogStartOffset is the beginning offset for this partition.
  4495  	// This field was added for KIP-107.
  4496  	//
  4497  	// This field has a default of -1.
  4498  	LogStartOffset int64 // v5+
  4499  
  4500  	// In case divergence is detected based on the LastFetchedEpoch and
  4501  	// FetchOffset in the request, this field indicates the largest epoch and
  4502  	// its end offset such that subsequent records are known to diverge.
  4503  	DivergingEpoch FetchResponseTopicPartitionDivergingEpoch // tag 0
  4504  
  4505  	// CurrentLeader is the currently known leader ID and epoch for this
  4506  	// partition.
  4507  	CurrentLeader FetchResponseTopicPartitionCurrentLeader // tag 1
  4508  
  4509  	// In the case of fetching an offset less than the LogStartOffset, this
  4510  	// is the end offset and epoch that should be used in the FetchSnapshot
  4511  	// request.
  4512  	SnapshotID FetchResponseTopicPartitionSnapshotID // tag 2
  4513  
  4514  	// AbortedTransactions is an array of aborted transactions within the
  4515  	// returned offset range. This is only returned if the requested
  4516  	// isolation level was READ_COMMITTED.
  4517  	AbortedTransactions []FetchResponseTopicPartitionAbortedTransaction // v4+
  4518  
  4519  	// PreferredReadReplica is the preferred replica for the consumer
  4520  	// to use on its next fetch request. See KIP-392.
  4521  	//
  4522  	// This field has a default of -1.
  4523  	PreferredReadReplica int32 // v11+
  4524  
  4525  	// RecordBatches is an array of record batches for a topic partition.
  4526  	//
  4527  	// This is encoded as a raw byte array, with the standard int32 size
  4528  	// prefix. One important catch to note is that the final element of the
  4529  	// array may be **partial**. This is an optimization in Kafka that
  4530  	// clients must deal with by discarding a partial trailing batch.
  4531  	//
  4532  	// Starting v2, this transitioned to the MessageSet v1 format (and this
  4533  	// would contain many MessageV1 structs).
  4534  	//
  4535  	// Starting v4, this transitioned to the RecordBatch format (thus this
  4536  	// contains many RecordBatch structs).
  4537  	RecordBatches []byte
  4538  
  4539  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4540  	UnknownTags Tags // v12+
  4541  }
  4542  
  4543  // Default sets any default fields. Calling this allows for future compatibility
  4544  // if new fields are added to FetchResponseTopicPartition.
  4545  func (v *FetchResponseTopicPartition) Default() {
  4546  	v.LastStableOffset = -1
  4547  	v.LogStartOffset = -1
  4548  	{
  4549  		v := &v.DivergingEpoch
  4550  		_ = v
  4551  		v.Epoch = -1
  4552  		v.EndOffset = -1
  4553  	}
  4554  	{
  4555  		v := &v.CurrentLeader
  4556  		_ = v
  4557  		v.LeaderID = -1
  4558  		v.LeaderEpoch = -1
  4559  	}
  4560  	{
  4561  		v := &v.SnapshotID
  4562  		_ = v
  4563  		v.EndOffset = -1
  4564  		v.Epoch = -1
  4565  	}
  4566  	v.PreferredReadReplica = -1
  4567  }
  4568  
  4569  // NewFetchResponseTopicPartition returns a default FetchResponseTopicPartition
  4570  // This is a shortcut for creating a struct and calling Default yourself.
  4571  func NewFetchResponseTopicPartition() FetchResponseTopicPartition {
  4572  	var v FetchResponseTopicPartition
  4573  	v.Default()
  4574  	return v
  4575  }
  4576  
  4577  type FetchResponseTopic struct {
  4578  	// Topic is a topic that records may have been received for.
  4579  	Topic string // v0-v12
  4580  
  4581  	// TopicID is the uuid of a topic that records may have been received for.
  4582  	TopicID [16]byte // v13+
  4583  
  4584  	// Partitions contains partitions in a topic that records may have
  4585  	// been received for.
  4586  	Partitions []FetchResponseTopicPartition
  4587  
  4588  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4589  	UnknownTags Tags // v12+
  4590  }
  4591  
  4592  // Default sets any default fields. Calling this allows for future compatibility
  4593  // if new fields are added to FetchResponseTopic.
  4594  func (v *FetchResponseTopic) Default() {
  4595  }
  4596  
  4597  // NewFetchResponseTopic returns a default FetchResponseTopic
  4598  // This is a shortcut for creating a struct and calling Default yourself.
  4599  func NewFetchResponseTopic() FetchResponseTopic {
  4600  	var v FetchResponseTopic
  4601  	v.Default()
  4602  	return v
  4603  }
  4604  
  4605  // FetchResponse is returned from a FetchRequest.
  4606  type FetchResponse struct {
  4607  	// Version is the version of this message used with a Kafka broker.
  4608  	Version int16
  4609  
  4610  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
  4611  	// after this request.
  4612  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
  4613  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
  4614  	//
  4615  	// This request switched at version 8.
  4616  	ThrottleMillis int32 // v1+
  4617  
  4618  	// ErrorCode is a full-response error code for a fetch request. This was
  4619  	// added in support of KIP-227. This error is only non-zero if using fetch
  4620  	// sessions.
  4621  	//
  4622  	// FETCH_SESSION_ID_NOT_FOUND is returned if the request used a
  4623  	// session ID that the broker does not know of.
  4624  	//
  4625  	// INVALID_FETCH_SESSION_EPOCH is returned if the request used an
  4626  	// invalid session epoch.
  4627  	ErrorCode int16 // v7+
  4628  
  4629  	// SessionID is the id for this session if using sessions.
  4630  	//
  4631  	// See KIP-227 for more details.
  4632  	SessionID int32 // v7+
  4633  
  4634  	// Topics contains an array of topic partitions and the records received
  4635  	// for them.
  4636  	Topics []FetchResponseTopic
  4637  
  4638  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  4639  	UnknownTags Tags // v12+
  4640  }
  4641  
  4642  func (*FetchResponse) Key() int16                         { return 1 }
  4643  func (*FetchResponse) MaxVersion() int16                  { return 15 }
  4644  func (v *FetchResponse) SetVersion(version int16)         { v.Version = version }
  4645  func (v *FetchResponse) GetVersion() int16                { return v.Version }
  4646  func (v *FetchResponse) IsFlexible() bool                 { return v.Version >= 12 }
  4647  func (v *FetchResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 8 }
  4648  func (v *FetchResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
  4649  func (v *FetchResponse) RequestKind() Request             { return &FetchRequest{Version: v.Version} }
  4650  
  4651  func (v *FetchResponse) AppendTo(dst []byte) []byte {
  4652  	version := v.Version
  4653  	_ = version
  4654  	isFlexible := version >= 12
  4655  	_ = isFlexible
  4656  	if version >= 1 {
  4657  		v := v.ThrottleMillis
  4658  		dst = kbin.AppendInt32(dst, v)
  4659  	}
  4660  	if version >= 7 {
  4661  		v := v.ErrorCode
  4662  		dst = kbin.AppendInt16(dst, v)
  4663  	}
  4664  	if version >= 7 {
  4665  		v := v.SessionID
  4666  		dst = kbin.AppendInt32(dst, v)
  4667  	}
  4668  	{
  4669  		v := v.Topics
  4670  		if isFlexible {
  4671  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  4672  		} else {
  4673  			dst = kbin.AppendArrayLen(dst, len(v))
  4674  		}
  4675  		for i := range v {
  4676  			v := &v[i]
  4677  			if version >= 0 && version <= 12 {
  4678  				v := v.Topic
  4679  				if isFlexible {
  4680  					dst = kbin.AppendCompactString(dst, v)
  4681  				} else {
  4682  					dst = kbin.AppendString(dst, v)
  4683  				}
  4684  			}
  4685  			if version >= 13 {
  4686  				v := v.TopicID
  4687  				dst = kbin.AppendUuid(dst, v)
  4688  			}
  4689  			{
  4690  				v := v.Partitions
  4691  				if isFlexible {
  4692  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  4693  				} else {
  4694  					dst = kbin.AppendArrayLen(dst, len(v))
  4695  				}
  4696  				for i := range v {
  4697  					v := &v[i]
  4698  					{
  4699  						v := v.Partition
  4700  						dst = kbin.AppendInt32(dst, v)
  4701  					}
  4702  					{
  4703  						v := v.ErrorCode
  4704  						dst = kbin.AppendInt16(dst, v)
  4705  					}
  4706  					{
  4707  						v := v.HighWatermark
  4708  						dst = kbin.AppendInt64(dst, v)
  4709  					}
  4710  					if version >= 4 {
  4711  						v := v.LastStableOffset
  4712  						dst = kbin.AppendInt64(dst, v)
  4713  					}
  4714  					if version >= 5 {
  4715  						v := v.LogStartOffset
  4716  						dst = kbin.AppendInt64(dst, v)
  4717  					}
  4718  					if version >= 4 {
  4719  						v := v.AbortedTransactions
  4720  						if isFlexible {
  4721  							dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
  4722  						} else {
  4723  							dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
  4724  						}
  4725  						for i := range v {
  4726  							v := &v[i]
  4727  							{
  4728  								v := v.ProducerID
  4729  								dst = kbin.AppendInt64(dst, v)
  4730  							}
  4731  							{
  4732  								v := v.FirstOffset
  4733  								dst = kbin.AppendInt64(dst, v)
  4734  							}
  4735  							if isFlexible {
  4736  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4737  								dst = v.UnknownTags.AppendEach(dst)
  4738  							}
  4739  						}
  4740  					}
  4741  					if version >= 11 {
  4742  						v := v.PreferredReadReplica
  4743  						dst = kbin.AppendInt32(dst, v)
  4744  					}
  4745  					{
  4746  						v := v.RecordBatches
  4747  						if isFlexible {
  4748  							dst = kbin.AppendCompactNullableBytes(dst, v)
  4749  						} else {
  4750  							dst = kbin.AppendNullableBytes(dst, v)
  4751  						}
  4752  					}
  4753  					if isFlexible {
  4754  						var toEncode []uint32
  4755  						if !reflect.DeepEqual(v.DivergingEpoch, (func() FetchResponseTopicPartitionDivergingEpoch {
  4756  							var v FetchResponseTopicPartitionDivergingEpoch
  4757  							v.Default()
  4758  							return v
  4759  						})()) {
  4760  							toEncode = append(toEncode, 0)
  4761  						}
  4762  						if !reflect.DeepEqual(v.CurrentLeader, (func() FetchResponseTopicPartitionCurrentLeader {
  4763  							var v FetchResponseTopicPartitionCurrentLeader
  4764  							v.Default()
  4765  							return v
  4766  						})()) {
  4767  							toEncode = append(toEncode, 1)
  4768  						}
  4769  						if !reflect.DeepEqual(v.SnapshotID, (func() FetchResponseTopicPartitionSnapshotID {
  4770  							var v FetchResponseTopicPartitionSnapshotID
  4771  							v.Default()
  4772  							return v
  4773  						})()) {
  4774  							toEncode = append(toEncode, 2)
  4775  						}
  4776  						dst = kbin.AppendUvarint(dst, uint32(len(toEncode)+v.UnknownTags.Len()))
  4777  						for _, tag := range toEncode {
  4778  							switch tag {
  4779  							case 0:
  4780  								{
  4781  									v := v.DivergingEpoch
  4782  									dst = kbin.AppendUvarint(dst, 0)
  4783  									sized := false
  4784  									lenAt := len(dst)
  4785  								fDivergingEpoch:
  4786  									{
  4787  										v := v.Epoch
  4788  										dst = kbin.AppendInt32(dst, v)
  4789  									}
  4790  									{
  4791  										v := v.EndOffset
  4792  										dst = kbin.AppendInt64(dst, v)
  4793  									}
  4794  									if isFlexible {
  4795  										dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4796  										dst = v.UnknownTags.AppendEach(dst)
  4797  									}
  4798  									if !sized {
  4799  										dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
  4800  										sized = true
  4801  										goto fDivergingEpoch
  4802  									}
  4803  								}
  4804  							case 1:
  4805  								{
  4806  									v := v.CurrentLeader
  4807  									dst = kbin.AppendUvarint(dst, 1)
  4808  									sized := false
  4809  									lenAt := len(dst)
  4810  								fCurrentLeader:
  4811  									{
  4812  										v := v.LeaderID
  4813  										dst = kbin.AppendInt32(dst, v)
  4814  									}
  4815  									{
  4816  										v := v.LeaderEpoch
  4817  										dst = kbin.AppendInt32(dst, v)
  4818  									}
  4819  									if isFlexible {
  4820  										dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4821  										dst = v.UnknownTags.AppendEach(dst)
  4822  									}
  4823  									if !sized {
  4824  										dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
  4825  										sized = true
  4826  										goto fCurrentLeader
  4827  									}
  4828  								}
  4829  							case 2:
  4830  								{
  4831  									v := v.SnapshotID
  4832  									dst = kbin.AppendUvarint(dst, 2)
  4833  									sized := false
  4834  									lenAt := len(dst)
  4835  								fSnapshotID:
  4836  									{
  4837  										v := v.EndOffset
  4838  										dst = kbin.AppendInt64(dst, v)
  4839  									}
  4840  									{
  4841  										v := v.Epoch
  4842  										dst = kbin.AppendInt32(dst, v)
  4843  									}
  4844  									if isFlexible {
  4845  										dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4846  										dst = v.UnknownTags.AppendEach(dst)
  4847  									}
  4848  									if !sized {
  4849  										dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
  4850  										sized = true
  4851  										goto fSnapshotID
  4852  									}
  4853  								}
  4854  							}
  4855  						}
  4856  						dst = v.UnknownTags.AppendEach(dst)
  4857  					}
  4858  				}
  4859  			}
  4860  			if isFlexible {
  4861  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4862  				dst = v.UnknownTags.AppendEach(dst)
  4863  			}
  4864  		}
  4865  	}
  4866  	if isFlexible {
  4867  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  4868  		dst = v.UnknownTags.AppendEach(dst)
  4869  	}
  4870  	return dst
  4871  }
  4872  
  4873  func (v *FetchResponse) ReadFrom(src []byte) error {
  4874  	return v.readFrom(src, false)
  4875  }
  4876  
  4877  func (v *FetchResponse) UnsafeReadFrom(src []byte) error {
  4878  	return v.readFrom(src, true)
  4879  }
  4880  
  4881  func (v *FetchResponse) readFrom(src []byte, unsafe bool) error {
  4882  	v.Default()
  4883  	b := kbin.Reader{Src: src}
  4884  	version := v.Version
  4885  	_ = version
  4886  	isFlexible := version >= 12
  4887  	_ = isFlexible
  4888  	s := v
  4889  	if version >= 1 {
  4890  		v := b.Int32()
  4891  		s.ThrottleMillis = v
  4892  	}
  4893  	if version >= 7 {
  4894  		v := b.Int16()
  4895  		s.ErrorCode = v
  4896  	}
  4897  	if version >= 7 {
  4898  		v := b.Int32()
  4899  		s.SessionID = v
  4900  	}
  4901  	{
  4902  		v := s.Topics
  4903  		a := v
  4904  		var l int32
  4905  		if isFlexible {
  4906  			l = b.CompactArrayLen()
  4907  		} else {
  4908  			l = b.ArrayLen()
  4909  		}
  4910  		if !b.Ok() {
  4911  			return b.Complete()
  4912  		}
  4913  		a = a[:0]
  4914  		if l > 0 {
  4915  			a = append(a, make([]FetchResponseTopic, l)...)
  4916  		}
  4917  		for i := int32(0); i < l; i++ {
  4918  			v := &a[i]
  4919  			v.Default()
  4920  			s := v
  4921  			if version >= 0 && version <= 12 {
  4922  				var v string
  4923  				if unsafe {
  4924  					if isFlexible {
  4925  						v = b.UnsafeCompactString()
  4926  					} else {
  4927  						v = b.UnsafeString()
  4928  					}
  4929  				} else {
  4930  					if isFlexible {
  4931  						v = b.CompactString()
  4932  					} else {
  4933  						v = b.String()
  4934  					}
  4935  				}
  4936  				s.Topic = v
  4937  			}
  4938  			if version >= 13 {
  4939  				v := b.Uuid()
  4940  				s.TopicID = v
  4941  			}
  4942  			{
  4943  				v := s.Partitions
  4944  				a := v
  4945  				var l int32
  4946  				if isFlexible {
  4947  					l = b.CompactArrayLen()
  4948  				} else {
  4949  					l = b.ArrayLen()
  4950  				}
  4951  				if !b.Ok() {
  4952  					return b.Complete()
  4953  				}
  4954  				a = a[:0]
  4955  				if l > 0 {
  4956  					a = append(a, make([]FetchResponseTopicPartition, l)...)
  4957  				}
  4958  				for i := int32(0); i < l; i++ {
  4959  					v := &a[i]
  4960  					v.Default()
  4961  					s := v
  4962  					{
  4963  						v := b.Int32()
  4964  						s.Partition = v
  4965  					}
  4966  					{
  4967  						v := b.Int16()
  4968  						s.ErrorCode = v
  4969  					}
  4970  					{
  4971  						v := b.Int64()
  4972  						s.HighWatermark = v
  4973  					}
  4974  					if version >= 4 {
  4975  						v := b.Int64()
  4976  						s.LastStableOffset = v
  4977  					}
  4978  					if version >= 5 {
  4979  						v := b.Int64()
  4980  						s.LogStartOffset = v
  4981  					}
  4982  					if version >= 4 {
  4983  						v := s.AbortedTransactions
  4984  						a := v
  4985  						var l int32
  4986  						if isFlexible {
  4987  							l = b.CompactArrayLen()
  4988  						} else {
  4989  							l = b.ArrayLen()
  4990  						}
  4991  						if version < 0 || l == 0 {
  4992  							a = []FetchResponseTopicPartitionAbortedTransaction{}
  4993  						}
  4994  						if !b.Ok() {
  4995  							return b.Complete()
  4996  						}
  4997  						a = a[:0]
  4998  						if l > 0 {
  4999  							a = append(a, make([]FetchResponseTopicPartitionAbortedTransaction, l)...)
  5000  						}
  5001  						for i := int32(0); i < l; i++ {
  5002  							v := &a[i]
  5003  							v.Default()
  5004  							s := v
  5005  							{
  5006  								v := b.Int64()
  5007  								s.ProducerID = v
  5008  							}
  5009  							{
  5010  								v := b.Int64()
  5011  								s.FirstOffset = v
  5012  							}
  5013  							if isFlexible {
  5014  								s.UnknownTags = internalReadTags(&b)
  5015  							}
  5016  						}
  5017  						v = a
  5018  						s.AbortedTransactions = v
  5019  					}
  5020  					if version >= 11 {
  5021  						v := b.Int32()
  5022  						s.PreferredReadReplica = v
  5023  					}
  5024  					{
  5025  						var v []byte
  5026  						if isFlexible {
  5027  							v = b.CompactNullableBytes()
  5028  						} else {
  5029  							v = b.NullableBytes()
  5030  						}
  5031  						s.RecordBatches = v
  5032  					}
  5033  					if isFlexible {
  5034  						for i := b.Uvarint(); i > 0; i-- {
  5035  							switch key := b.Uvarint(); key {
  5036  							default:
  5037  								s.UnknownTags.Set(key, b.Span(int(b.Uvarint())))
  5038  							case 0:
  5039  								b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
  5040  								v := &s.DivergingEpoch
  5041  								v.Default()
  5042  								s := v
  5043  								{
  5044  									v := b.Int32()
  5045  									s.Epoch = v
  5046  								}
  5047  								{
  5048  									v := b.Int64()
  5049  									s.EndOffset = v
  5050  								}
  5051  								if isFlexible {
  5052  									s.UnknownTags = internalReadTags(&b)
  5053  								}
  5054  								if err := b.Complete(); err != nil {
  5055  									return err
  5056  								}
  5057  							case 1:
  5058  								b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
  5059  								v := &s.CurrentLeader
  5060  								v.Default()
  5061  								s := v
  5062  								{
  5063  									v := b.Int32()
  5064  									s.LeaderID = v
  5065  								}
  5066  								{
  5067  									v := b.Int32()
  5068  									s.LeaderEpoch = v
  5069  								}
  5070  								if isFlexible {
  5071  									s.UnknownTags = internalReadTags(&b)
  5072  								}
  5073  								if err := b.Complete(); err != nil {
  5074  									return err
  5075  								}
  5076  							case 2:
  5077  								b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
  5078  								v := &s.SnapshotID
  5079  								v.Default()
  5080  								s := v
  5081  								{
  5082  									v := b.Int64()
  5083  									s.EndOffset = v
  5084  								}
  5085  								{
  5086  									v := b.Int32()
  5087  									s.Epoch = v
  5088  								}
  5089  								if isFlexible {
  5090  									s.UnknownTags = internalReadTags(&b)
  5091  								}
  5092  								if err := b.Complete(); err != nil {
  5093  									return err
  5094  								}
  5095  							}
  5096  						}
  5097  					}
  5098  				}
  5099  				v = a
  5100  				s.Partitions = v
  5101  			}
  5102  			if isFlexible {
  5103  				s.UnknownTags = internalReadTags(&b)
  5104  			}
  5105  		}
  5106  		v = a
  5107  		s.Topics = v
  5108  	}
  5109  	if isFlexible {
  5110  		s.UnknownTags = internalReadTags(&b)
  5111  	}
  5112  	return b.Complete()
  5113  }
  5114  
  5115  // NewPtrFetchResponse returns a pointer to a default FetchResponse
  5116  // This is a shortcut for creating a new(struct) and calling Default yourself.
  5117  func NewPtrFetchResponse() *FetchResponse {
  5118  	var v FetchResponse
  5119  	v.Default()
  5120  	return &v
  5121  }
  5122  
  5123  // Default sets any default fields. Calling this allows for future compatibility
  5124  // if new fields are added to FetchResponse.
  5125  func (v *FetchResponse) Default() {
  5126  }
  5127  
  5128  // NewFetchResponse returns a default FetchResponse
  5129  // This is a shortcut for creating a struct and calling Default yourself.
  5130  func NewFetchResponse() FetchResponse {
  5131  	var v FetchResponse
  5132  	v.Default()
  5133  	return v
  5134  }
  5135  
  5136  type ListOffsetsRequestTopicPartition struct {
  5137  	// Partition is a partition of a topic to get offsets for.
  5138  	Partition int32
  5139  
  5140  	// CurrentLeaderEpoch, proposed in KIP-320 and introduced in Kafka 2.1.0,
  5141  	// allows brokers to check if the client is fenced (has an out of date
  5142  	// leader) or is using an unknown leader.
  5143  	//
  5144  	// The initial leader epoch can be determined from a MetadataResponse.
  5145  	// To skip log truncation checking, use -1.
  5146  	//
  5147  	// This field has a default of -1.
  5148  	CurrentLeaderEpoch int32 // v4+
  5149  
  5150  	// Timestamp controls which offset to return in a response for this
  5151  	// partition.
  5152  	//
  5153  	// The offset returned will be the one of the message whose timestamp is
  5154  	// the first timestamp greater than or equal to this requested timestamp.
  5155  	//
  5156  	// If no such message is found, then no offset is returned (-1).
  5157  	//
  5158  	// There exist two special timestamps: -2 corresponds to the earliest
  5159  	// timestamp, and -1 corresponds to the latest.
  5160  	//
  5161  	// If you are talking to Kafka 3.0+, there exists an additional special
  5162  	// timestamp -3 that returns the latest timestamp produced so far and its
  5163  	// corresponding offset. This is subtly different from the latest offset,
  5164  	// because timestamps are client-side generated. More importantly though,
  5165  	// because this returns the latest produced timestamp, this can be used
  5166  	// to determine topic "liveness" (when was the last produce?).
  5167  	// Previously, this was not easy to determine. See KIP-734 for more
  5168  	// detail.
  5169  	//
  5170  	// If you are talking to Kafka 3.4+ and using request version 8+ (for
  5171  	// KIP-405), the new special timestamp -4 returns the local log start
  5172  	// offset. In the context of tiered storage, the earliest local log start
  5173  	// offset is the offset actually available on disk on the broker.
  5174  	Timestamp int64
  5175  
  5176  	// MaxNumOffsets is the maximum number of offsets to report.
  5177  	// This was removed after v0.
  5178  	//
  5179  	// This field has a default of 1.
  5180  	MaxNumOffsets int32
  5181  
  5182  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5183  	UnknownTags Tags // v6+
  5184  }
  5185  
  5186  // Default sets any default fields. Calling this allows for future compatibility
  5187  // if new fields are added to ListOffsetsRequestTopicPartition.
  5188  func (v *ListOffsetsRequestTopicPartition) Default() {
  5189  	v.CurrentLeaderEpoch = -1
  5190  	v.MaxNumOffsets = 1
  5191  }
  5192  
  5193  // NewListOffsetsRequestTopicPartition returns a default ListOffsetsRequestTopicPartition
  5194  // This is a shortcut for creating a struct and calling Default yourself.
  5195  func NewListOffsetsRequestTopicPartition() ListOffsetsRequestTopicPartition {
  5196  	var v ListOffsetsRequestTopicPartition
  5197  	v.Default()
  5198  	return v
  5199  }
  5200  
  5201  type ListOffsetsRequestTopic struct {
  5202  	// Topic is a topic to get offsets for.
  5203  	Topic string
  5204  
  5205  	// Partitions is an array of partitions in a topic to get offsets for.
  5206  	Partitions []ListOffsetsRequestTopicPartition
  5207  
  5208  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5209  	UnknownTags Tags // v6+
  5210  }
  5211  
  5212  // Default sets any default fields. Calling this allows for future compatibility
  5213  // if new fields are added to ListOffsetsRequestTopic.
  5214  func (v *ListOffsetsRequestTopic) Default() {
  5215  }
  5216  
  5217  // NewListOffsetsRequestTopic returns a default ListOffsetsRequestTopic
  5218  // This is a shortcut for creating a struct and calling Default yourself.
  5219  func NewListOffsetsRequestTopic() ListOffsetsRequestTopic {
  5220  	var v ListOffsetsRequestTopic
  5221  	v.Default()
  5222  	return v
  5223  }
  5224  
  5225  // ListOffsetsRequest requests partition offsets from Kafka for use in
  5226  // consuming records.
  5227  //
  5228  // Version 5, introduced in Kafka 2.2.0, is the same as version 4. Using
  5229  // version 5 implies you support Kafka's OffsetNotAvailableException
  5230  // See KIP-207 for details.
  5231  //
  5232  // Version 7, introduced in Kafka 3.0, supports -3 as a timestamp to return
  5233  // the timestamp and offset for the record with the largest timestamp.
  5234  //
  5235  // Version 8, introduced in Kafka 3.4, supports -4 as a timestamp to return
  5236  // the local log start offset (in the context of tiered storage, see KIP-405).
  5237  type ListOffsetsRequest struct {
  5238  	// Version is the version of this message used with a Kafka broker.
  5239  	Version int16
  5240  
  5241  	// ReplicaID is the broker ID to get offsets from. As a Kafka client, use -1.
  5242  	// The consumer replica ID (-1) causes requests to only succeed if issued
  5243  	// against the leader broker.
  5244  	//
  5245  	// This field has a default of -1.
  5246  	ReplicaID int32
  5247  
  5248  	// IsolationLevel configures which record offsets are visible in the
  5249  	// response. READ_UNCOMMITTED (0) makes all records visible. READ_COMMITTED
  5250  	// (1) makes non-transactional and committed transactional records visible.
  5251  	// READ_COMMITTED means all offsets smaller than the last stable offset and
  5252  	// includes aborted transactions (allowing consumers to discard aborted
  5253  	// records).
  5254  	IsolationLevel int8 // v2+
  5255  
  5256  	// Topics is an array of topics to get offsets for.
  5257  	Topics []ListOffsetsRequestTopic
  5258  
  5259  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5260  	UnknownTags Tags // v6+
  5261  }
  5262  
  5263  func (*ListOffsetsRequest) Key() int16                 { return 2 }
  5264  func (*ListOffsetsRequest) MaxVersion() int16          { return 8 }
  5265  func (v *ListOffsetsRequest) SetVersion(version int16) { v.Version = version }
  5266  func (v *ListOffsetsRequest) GetVersion() int16        { return v.Version }
  5267  func (v *ListOffsetsRequest) IsFlexible() bool         { return v.Version >= 6 }
  5268  func (v *ListOffsetsRequest) ResponseKind() Response {
  5269  	r := &ListOffsetsResponse{Version: v.Version}
  5270  	r.Default()
  5271  	return r
  5272  }
  5273  
  5274  // RequestWith is requests v on r and returns the response or an error.
  5275  // For sharded requests, the response may be merged and still return an error.
  5276  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  5277  func (v *ListOffsetsRequest) RequestWith(ctx context.Context, r Requestor) (*ListOffsetsResponse, error) {
  5278  	kresp, err := r.Request(ctx, v)
  5279  	resp, _ := kresp.(*ListOffsetsResponse)
  5280  	return resp, err
  5281  }
  5282  
  5283  func (v *ListOffsetsRequest) AppendTo(dst []byte) []byte {
  5284  	version := v.Version
  5285  	_ = version
  5286  	isFlexible := version >= 6
  5287  	_ = isFlexible
  5288  	{
  5289  		v := v.ReplicaID
  5290  		dst = kbin.AppendInt32(dst, v)
  5291  	}
  5292  	if version >= 2 {
  5293  		v := v.IsolationLevel
  5294  		dst = kbin.AppendInt8(dst, v)
  5295  	}
  5296  	{
  5297  		v := v.Topics
  5298  		if isFlexible {
  5299  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  5300  		} else {
  5301  			dst = kbin.AppendArrayLen(dst, len(v))
  5302  		}
  5303  		for i := range v {
  5304  			v := &v[i]
  5305  			{
  5306  				v := v.Topic
  5307  				if isFlexible {
  5308  					dst = kbin.AppendCompactString(dst, v)
  5309  				} else {
  5310  					dst = kbin.AppendString(dst, v)
  5311  				}
  5312  			}
  5313  			{
  5314  				v := v.Partitions
  5315  				if isFlexible {
  5316  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  5317  				} else {
  5318  					dst = kbin.AppendArrayLen(dst, len(v))
  5319  				}
  5320  				for i := range v {
  5321  					v := &v[i]
  5322  					{
  5323  						v := v.Partition
  5324  						dst = kbin.AppendInt32(dst, v)
  5325  					}
  5326  					if version >= 4 {
  5327  						v := v.CurrentLeaderEpoch
  5328  						dst = kbin.AppendInt32(dst, v)
  5329  					}
  5330  					{
  5331  						v := v.Timestamp
  5332  						dst = kbin.AppendInt64(dst, v)
  5333  					}
  5334  					if version >= 0 && version <= 0 {
  5335  						v := v.MaxNumOffsets
  5336  						dst = kbin.AppendInt32(dst, v)
  5337  					}
  5338  					if isFlexible {
  5339  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  5340  						dst = v.UnknownTags.AppendEach(dst)
  5341  					}
  5342  				}
  5343  			}
  5344  			if isFlexible {
  5345  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  5346  				dst = v.UnknownTags.AppendEach(dst)
  5347  			}
  5348  		}
  5349  	}
  5350  	if isFlexible {
  5351  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  5352  		dst = v.UnknownTags.AppendEach(dst)
  5353  	}
  5354  	return dst
  5355  }
  5356  
  5357  func (v *ListOffsetsRequest) ReadFrom(src []byte) error {
  5358  	return v.readFrom(src, false)
  5359  }
  5360  
  5361  func (v *ListOffsetsRequest) UnsafeReadFrom(src []byte) error {
  5362  	return v.readFrom(src, true)
  5363  }
  5364  
  5365  func (v *ListOffsetsRequest) readFrom(src []byte, unsafe bool) error {
  5366  	v.Default()
  5367  	b := kbin.Reader{Src: src}
  5368  	version := v.Version
  5369  	_ = version
  5370  	isFlexible := version >= 6
  5371  	_ = isFlexible
  5372  	s := v
  5373  	{
  5374  		v := b.Int32()
  5375  		s.ReplicaID = v
  5376  	}
  5377  	if version >= 2 {
  5378  		v := b.Int8()
  5379  		s.IsolationLevel = v
  5380  	}
  5381  	{
  5382  		v := s.Topics
  5383  		a := v
  5384  		var l int32
  5385  		if isFlexible {
  5386  			l = b.CompactArrayLen()
  5387  		} else {
  5388  			l = b.ArrayLen()
  5389  		}
  5390  		if !b.Ok() {
  5391  			return b.Complete()
  5392  		}
  5393  		a = a[:0]
  5394  		if l > 0 {
  5395  			a = append(a, make([]ListOffsetsRequestTopic, l)...)
  5396  		}
  5397  		for i := int32(0); i < l; i++ {
  5398  			v := &a[i]
  5399  			v.Default()
  5400  			s := v
  5401  			{
  5402  				var v string
  5403  				if unsafe {
  5404  					if isFlexible {
  5405  						v = b.UnsafeCompactString()
  5406  					} else {
  5407  						v = b.UnsafeString()
  5408  					}
  5409  				} else {
  5410  					if isFlexible {
  5411  						v = b.CompactString()
  5412  					} else {
  5413  						v = b.String()
  5414  					}
  5415  				}
  5416  				s.Topic = v
  5417  			}
  5418  			{
  5419  				v := s.Partitions
  5420  				a := v
  5421  				var l int32
  5422  				if isFlexible {
  5423  					l = b.CompactArrayLen()
  5424  				} else {
  5425  					l = b.ArrayLen()
  5426  				}
  5427  				if !b.Ok() {
  5428  					return b.Complete()
  5429  				}
  5430  				a = a[:0]
  5431  				if l > 0 {
  5432  					a = append(a, make([]ListOffsetsRequestTopicPartition, l)...)
  5433  				}
  5434  				for i := int32(0); i < l; i++ {
  5435  					v := &a[i]
  5436  					v.Default()
  5437  					s := v
  5438  					{
  5439  						v := b.Int32()
  5440  						s.Partition = v
  5441  					}
  5442  					if version >= 4 {
  5443  						v := b.Int32()
  5444  						s.CurrentLeaderEpoch = v
  5445  					}
  5446  					{
  5447  						v := b.Int64()
  5448  						s.Timestamp = v
  5449  					}
  5450  					if version >= 0 && version <= 0 {
  5451  						v := b.Int32()
  5452  						s.MaxNumOffsets = v
  5453  					}
  5454  					if isFlexible {
  5455  						s.UnknownTags = internalReadTags(&b)
  5456  					}
  5457  				}
  5458  				v = a
  5459  				s.Partitions = v
  5460  			}
  5461  			if isFlexible {
  5462  				s.UnknownTags = internalReadTags(&b)
  5463  			}
  5464  		}
  5465  		v = a
  5466  		s.Topics = v
  5467  	}
  5468  	if isFlexible {
  5469  		s.UnknownTags = internalReadTags(&b)
  5470  	}
  5471  	return b.Complete()
  5472  }
  5473  
  5474  // NewPtrListOffsetsRequest returns a pointer to a default ListOffsetsRequest
  5475  // This is a shortcut for creating a new(struct) and calling Default yourself.
  5476  func NewPtrListOffsetsRequest() *ListOffsetsRequest {
  5477  	var v ListOffsetsRequest
  5478  	v.Default()
  5479  	return &v
  5480  }
  5481  
  5482  // Default sets any default fields. Calling this allows for future compatibility
  5483  // if new fields are added to ListOffsetsRequest.
  5484  func (v *ListOffsetsRequest) Default() {
  5485  	v.ReplicaID = -1
  5486  }
  5487  
  5488  // NewListOffsetsRequest returns a default ListOffsetsRequest
  5489  // This is a shortcut for creating a struct and calling Default yourself.
  5490  func NewListOffsetsRequest() ListOffsetsRequest {
  5491  	var v ListOffsetsRequest
  5492  	v.Default()
  5493  	return v
  5494  }
  5495  
  5496  type ListOffsetsResponseTopicPartition struct {
  5497  	// Partition is the partition this array slot is for.
  5498  	Partition int32
  5499  
  5500  	// ErrorCode is any error for a topic partition in a ListOffsets request.
  5501  	//
  5502  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized
  5503  	// to describe the topic.
  5504  	//
  5505  	// INVALID_REQUEST is returned if the requested topic partitions had
  5506  	// contained duplicates.
  5507  	//
  5508  	// KAFKA_STORAGE_EXCEPTION is returned if the topic / partition is in
  5509  	// an offline log directory.
  5510  	//
  5511  	// UNSUPPORTED_FOR_MESSAGE_FORMAT is returned if the broker is using
  5512  	// Kafka 0.10.0 messages and the requested timestamp was not -1 nor -2.
  5513  	//
  5514  	// NOT_LEADER_FOR_PARTITION is returned if the broker is not a leader
  5515  	// for this partition. This means that the client has stale metadata.
  5516  	// If the request used the debug replica ID, the returned error will
  5517  	// be REPLICA_NOT_AVAILABLE.
  5518  	//
  5519  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know
  5520  	// of the requested topic or partition.
  5521  	//
  5522  	// FENCED_LEADER_EPOCH is returned if the broker has a higher leader
  5523  	// epoch than what the request sent.
  5524  	//
  5525  	// UNKNOWN_LEADER_EPOCH is returned if the request used a leader epoch
  5526  	// that the broker does not know about.
  5527  	//
  5528  	// OFFSET_NOT_AVAILABLE, introduced in Kafka 2.2.0 with produce request
  5529  	// v5+, is returned when talking to a broker that is a new leader while
  5530  	// that broker's high water mark catches up. This avoids situations where
  5531  	// the old broker returned higher offsets than the new broker would. Note
  5532  	// that if unclean leader election is allowed, you could still run into
  5533  	// the situation where offsets returned from list offsets requests are
  5534  	// not monotonically increasing. This error is only returned if the
  5535  	// request used the consumer replica ID (-1). If the client did not use
  5536  	// a v5+ list offsets request, LEADER_NOT_AVAILABLE is returned.
  5537  	// See KIP-207 for more details.
  5538  	ErrorCode int16
  5539  
  5540  	// OldStyleOffsets is a list of offsets. This was removed after
  5541  	// version 0 and, since it is so historic, is undocumented.
  5542  	OldStyleOffsets []int64
  5543  
  5544  	// If the request was for the earliest or latest timestamp (-2 or -1), or
  5545  	// if an offset could not be found after the requested one, this will be -1.
  5546  	//
  5547  	// This field has a default of -1.
  5548  	Timestamp int64 // v1+
  5549  
  5550  	// Offset is the offset corresponding to the record on or after the
  5551  	// requested timestamp. If one could not be found, this will be -1.
  5552  	//
  5553  	// This field has a default of -1.
  5554  	Offset int64 // v1+
  5555  
  5556  	// LeaderEpoch is the leader epoch of the record at this offset,
  5557  	// or -1 if there was no leader epoch.
  5558  	//
  5559  	// This field has a default of -1.
  5560  	LeaderEpoch int32 // v4+
  5561  
  5562  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5563  	UnknownTags Tags // v6+
  5564  }
  5565  
  5566  // Default sets any default fields. Calling this allows for future compatibility
  5567  // if new fields are added to ListOffsetsResponseTopicPartition.
  5568  func (v *ListOffsetsResponseTopicPartition) Default() {
  5569  	v.Timestamp = -1
  5570  	v.Offset = -1
  5571  	v.LeaderEpoch = -1
  5572  }
  5573  
  5574  // NewListOffsetsResponseTopicPartition returns a default ListOffsetsResponseTopicPartition
  5575  // This is a shortcut for creating a struct and calling Default yourself.
  5576  func NewListOffsetsResponseTopicPartition() ListOffsetsResponseTopicPartition {
  5577  	var v ListOffsetsResponseTopicPartition
  5578  	v.Default()
  5579  	return v
  5580  }
  5581  
  5582  type ListOffsetsResponseTopic struct {
  5583  	// Topic is the topic this array slot is for.
  5584  	Topic string
  5585  
  5586  	// Partitions is an array of partition responses corresponding to
  5587  	// the requested partitions for a topic.
  5588  	Partitions []ListOffsetsResponseTopicPartition
  5589  
  5590  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5591  	UnknownTags Tags // v6+
  5592  }
  5593  
  5594  // Default sets any default fields. Calling this allows for future compatibility
  5595  // if new fields are added to ListOffsetsResponseTopic.
  5596  func (v *ListOffsetsResponseTopic) Default() {
  5597  }
  5598  
  5599  // NewListOffsetsResponseTopic returns a default ListOffsetsResponseTopic
  5600  // This is a shortcut for creating a struct and calling Default yourself.
  5601  func NewListOffsetsResponseTopic() ListOffsetsResponseTopic {
  5602  	var v ListOffsetsResponseTopic
  5603  	v.Default()
  5604  	return v
  5605  }
  5606  
  5607  // ListOffsetsResponse is returned from a ListOffsetsRequest.
  5608  type ListOffsetsResponse struct {
  5609  	// Version is the version of this message used with a Kafka broker.
  5610  	Version int16
  5611  
  5612  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
  5613  	// after this request.
  5614  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
  5615  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
  5616  	//
  5617  	// This request switched at version 3.
  5618  	ThrottleMillis int32 // v2+
  5619  
  5620  	// Topics is an array of topic / partition responses corresponding to
  5621  	// the requested topics and partitions.
  5622  	Topics []ListOffsetsResponseTopic
  5623  
  5624  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5625  	UnknownTags Tags // v6+
  5626  }
  5627  
  5628  func (*ListOffsetsResponse) Key() int16                         { return 2 }
  5629  func (*ListOffsetsResponse) MaxVersion() int16                  { return 8 }
  5630  func (v *ListOffsetsResponse) SetVersion(version int16)         { v.Version = version }
  5631  func (v *ListOffsetsResponse) GetVersion() int16                { return v.Version }
  5632  func (v *ListOffsetsResponse) IsFlexible() bool                 { return v.Version >= 6 }
  5633  func (v *ListOffsetsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 3 }
  5634  func (v *ListOffsetsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
  5635  func (v *ListOffsetsResponse) RequestKind() Request             { return &ListOffsetsRequest{Version: v.Version} }
  5636  
  5637  func (v *ListOffsetsResponse) AppendTo(dst []byte) []byte {
  5638  	version := v.Version
  5639  	_ = version
  5640  	isFlexible := version >= 6
  5641  	_ = isFlexible
  5642  	if version >= 2 {
  5643  		v := v.ThrottleMillis
  5644  		dst = kbin.AppendInt32(dst, v)
  5645  	}
  5646  	{
  5647  		v := v.Topics
  5648  		if isFlexible {
  5649  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  5650  		} else {
  5651  			dst = kbin.AppendArrayLen(dst, len(v))
  5652  		}
  5653  		for i := range v {
  5654  			v := &v[i]
  5655  			{
  5656  				v := v.Topic
  5657  				if isFlexible {
  5658  					dst = kbin.AppendCompactString(dst, v)
  5659  				} else {
  5660  					dst = kbin.AppendString(dst, v)
  5661  				}
  5662  			}
  5663  			{
  5664  				v := v.Partitions
  5665  				if isFlexible {
  5666  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  5667  				} else {
  5668  					dst = kbin.AppendArrayLen(dst, len(v))
  5669  				}
  5670  				for i := range v {
  5671  					v := &v[i]
  5672  					{
  5673  						v := v.Partition
  5674  						dst = kbin.AppendInt32(dst, v)
  5675  					}
  5676  					{
  5677  						v := v.ErrorCode
  5678  						dst = kbin.AppendInt16(dst, v)
  5679  					}
  5680  					if version >= 0 && version <= 0 {
  5681  						v := v.OldStyleOffsets
  5682  						if isFlexible {
  5683  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  5684  						} else {
  5685  							dst = kbin.AppendArrayLen(dst, len(v))
  5686  						}
  5687  						for i := range v {
  5688  							v := v[i]
  5689  							dst = kbin.AppendInt64(dst, v)
  5690  						}
  5691  					}
  5692  					if version >= 1 {
  5693  						v := v.Timestamp
  5694  						dst = kbin.AppendInt64(dst, v)
  5695  					}
  5696  					if version >= 1 {
  5697  						v := v.Offset
  5698  						dst = kbin.AppendInt64(dst, v)
  5699  					}
  5700  					if version >= 4 {
  5701  						v := v.LeaderEpoch
  5702  						dst = kbin.AppendInt32(dst, v)
  5703  					}
  5704  					if isFlexible {
  5705  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  5706  						dst = v.UnknownTags.AppendEach(dst)
  5707  					}
  5708  				}
  5709  			}
  5710  			if isFlexible {
  5711  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  5712  				dst = v.UnknownTags.AppendEach(dst)
  5713  			}
  5714  		}
  5715  	}
  5716  	if isFlexible {
  5717  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  5718  		dst = v.UnknownTags.AppendEach(dst)
  5719  	}
  5720  	return dst
  5721  }
  5722  
  5723  func (v *ListOffsetsResponse) ReadFrom(src []byte) error {
  5724  	return v.readFrom(src, false)
  5725  }
  5726  
  5727  func (v *ListOffsetsResponse) UnsafeReadFrom(src []byte) error {
  5728  	return v.readFrom(src, true)
  5729  }
  5730  
  5731  func (v *ListOffsetsResponse) readFrom(src []byte, unsafe bool) error {
  5732  	v.Default()
  5733  	b := kbin.Reader{Src: src}
  5734  	version := v.Version
  5735  	_ = version
  5736  	isFlexible := version >= 6
  5737  	_ = isFlexible
  5738  	s := v
  5739  	if version >= 2 {
  5740  		v := b.Int32()
  5741  		s.ThrottleMillis = v
  5742  	}
  5743  	{
  5744  		v := s.Topics
  5745  		a := v
  5746  		var l int32
  5747  		if isFlexible {
  5748  			l = b.CompactArrayLen()
  5749  		} else {
  5750  			l = b.ArrayLen()
  5751  		}
  5752  		if !b.Ok() {
  5753  			return b.Complete()
  5754  		}
  5755  		a = a[:0]
  5756  		if l > 0 {
  5757  			a = append(a, make([]ListOffsetsResponseTopic, l)...)
  5758  		}
  5759  		for i := int32(0); i < l; i++ {
  5760  			v := &a[i]
  5761  			v.Default()
  5762  			s := v
  5763  			{
  5764  				var v string
  5765  				if unsafe {
  5766  					if isFlexible {
  5767  						v = b.UnsafeCompactString()
  5768  					} else {
  5769  						v = b.UnsafeString()
  5770  					}
  5771  				} else {
  5772  					if isFlexible {
  5773  						v = b.CompactString()
  5774  					} else {
  5775  						v = b.String()
  5776  					}
  5777  				}
  5778  				s.Topic = v
  5779  			}
  5780  			{
  5781  				v := s.Partitions
  5782  				a := v
  5783  				var l int32
  5784  				if isFlexible {
  5785  					l = b.CompactArrayLen()
  5786  				} else {
  5787  					l = b.ArrayLen()
  5788  				}
  5789  				if !b.Ok() {
  5790  					return b.Complete()
  5791  				}
  5792  				a = a[:0]
  5793  				if l > 0 {
  5794  					a = append(a, make([]ListOffsetsResponseTopicPartition, l)...)
  5795  				}
  5796  				for i := int32(0); i < l; i++ {
  5797  					v := &a[i]
  5798  					v.Default()
  5799  					s := v
  5800  					{
  5801  						v := b.Int32()
  5802  						s.Partition = v
  5803  					}
  5804  					{
  5805  						v := b.Int16()
  5806  						s.ErrorCode = v
  5807  					}
  5808  					if version >= 0 && version <= 0 {
  5809  						v := s.OldStyleOffsets
  5810  						a := v
  5811  						var l int32
  5812  						if isFlexible {
  5813  							l = b.CompactArrayLen()
  5814  						} else {
  5815  							l = b.ArrayLen()
  5816  						}
  5817  						if !b.Ok() {
  5818  							return b.Complete()
  5819  						}
  5820  						a = a[:0]
  5821  						if l > 0 {
  5822  							a = append(a, make([]int64, l)...)
  5823  						}
  5824  						for i := int32(0); i < l; i++ {
  5825  							v := b.Int64()
  5826  							a[i] = v
  5827  						}
  5828  						v = a
  5829  						s.OldStyleOffsets = v
  5830  					}
  5831  					if version >= 1 {
  5832  						v := b.Int64()
  5833  						s.Timestamp = v
  5834  					}
  5835  					if version >= 1 {
  5836  						v := b.Int64()
  5837  						s.Offset = v
  5838  					}
  5839  					if version >= 4 {
  5840  						v := b.Int32()
  5841  						s.LeaderEpoch = v
  5842  					}
  5843  					if isFlexible {
  5844  						s.UnknownTags = internalReadTags(&b)
  5845  					}
  5846  				}
  5847  				v = a
  5848  				s.Partitions = v
  5849  			}
  5850  			if isFlexible {
  5851  				s.UnknownTags = internalReadTags(&b)
  5852  			}
  5853  		}
  5854  		v = a
  5855  		s.Topics = v
  5856  	}
  5857  	if isFlexible {
  5858  		s.UnknownTags = internalReadTags(&b)
  5859  	}
  5860  	return b.Complete()
  5861  }
  5862  
  5863  // NewPtrListOffsetsResponse returns a pointer to a default ListOffsetsResponse
  5864  // This is a shortcut for creating a new(struct) and calling Default yourself.
  5865  func NewPtrListOffsetsResponse() *ListOffsetsResponse {
  5866  	var v ListOffsetsResponse
  5867  	v.Default()
  5868  	return &v
  5869  }
  5870  
  5871  // Default sets any default fields. Calling this allows for future compatibility
  5872  // if new fields are added to ListOffsetsResponse.
  5873  func (v *ListOffsetsResponse) Default() {
  5874  }
  5875  
  5876  // NewListOffsetsResponse returns a default ListOffsetsResponse
  5877  // This is a shortcut for creating a struct and calling Default yourself.
  5878  func NewListOffsetsResponse() ListOffsetsResponse {
  5879  	var v ListOffsetsResponse
  5880  	v.Default()
  5881  	return v
  5882  }
  5883  
  5884  type MetadataRequestTopic struct {
  5885  	// The topic ID. Only one of either topic ID or topic name should be used.
  5886  	// If using the topic name, this should just be the default empty value.
  5887  	TopicID [16]byte // v10+
  5888  
  5889  	// Topic is the topic to request metadata for. Version 10 switched this
  5890  	// from a string to a nullable string; if using a topic ID, this field
  5891  	// should be null.
  5892  	Topic *string
  5893  
  5894  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5895  	UnknownTags Tags // v9+
  5896  }
  5897  
  5898  // Default sets any default fields. Calling this allows for future compatibility
  5899  // if new fields are added to MetadataRequestTopic.
  5900  func (v *MetadataRequestTopic) Default() {
  5901  }
  5902  
  5903  // NewMetadataRequestTopic returns a default MetadataRequestTopic
  5904  // This is a shortcut for creating a struct and calling Default yourself.
  5905  func NewMetadataRequestTopic() MetadataRequestTopic {
  5906  	var v MetadataRequestTopic
  5907  	v.Default()
  5908  	return v
  5909  }
  5910  
  5911  // MetadataRequest requests metadata from Kafka.
  5912  type MetadataRequest struct {
  5913  	// Version is the version of this message used with a Kafka broker.
  5914  	Version int16
  5915  
  5916  	// Topics is a list of topics to return metadata about. If this is null
  5917  	// in v1+, all topics are included. If this is empty, no topics are.
  5918  	// For v0 (<Kafka 0.10.0.0), if this is empty, all topics are included.
  5919  	Topics []MetadataRequestTopic
  5920  
  5921  	// AllowAutoTopicCreation, introduced in Kafka 0.11.0.0, allows topic
  5922  	// auto creation of the topics in this request if they do not exist.
  5923  	AllowAutoTopicCreation bool // v4+
  5924  
  5925  	// IncludeClusterAuthorizedOperations, introduced in Kakfa 2.3.0, specifies
  5926  	// whether to return a bitfield of AclOperations that this client can perform
  5927  	// on the cluster. See KIP-430 for more details.
  5928  	//
  5929  	// This field was removed in Kafka 2.8.0 in favor of the new DescribeClusterRequest.
  5930  	IncludeClusterAuthorizedOperations bool // v8-v10
  5931  
  5932  	// IncludeTopicAuthorizedOperations, introduced in Kakfa 2.3.0, specifies
  5933  	// whether to return a bitfield of AclOperations that this client can perform
  5934  	// on individual topics. See KIP-430 for more details.
  5935  	//
  5936  	// This field was removed in Kafka 2.8.0 in favor of the new DescribeClusterRequest.
  5937  	IncludeTopicAuthorizedOperations bool // v8+
  5938  
  5939  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  5940  	UnknownTags Tags // v9+
  5941  }
  5942  
  5943  func (*MetadataRequest) Key() int16                 { return 3 }
  5944  func (*MetadataRequest) MaxVersion() int16          { return 12 }
  5945  func (v *MetadataRequest) SetVersion(version int16) { v.Version = version }
  5946  func (v *MetadataRequest) GetVersion() int16        { return v.Version }
  5947  func (v *MetadataRequest) IsFlexible() bool         { return v.Version >= 9 }
  5948  func (v *MetadataRequest) ResponseKind() Response {
  5949  	r := &MetadataResponse{Version: v.Version}
  5950  	r.Default()
  5951  	return r
  5952  }
  5953  
  5954  // RequestWith is requests v on r and returns the response or an error.
  5955  // For sharded requests, the response may be merged and still return an error.
  5956  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  5957  func (v *MetadataRequest) RequestWith(ctx context.Context, r Requestor) (*MetadataResponse, error) {
  5958  	kresp, err := r.Request(ctx, v)
  5959  	resp, _ := kresp.(*MetadataResponse)
  5960  	return resp, err
  5961  }
  5962  
  5963  func (v *MetadataRequest) AppendTo(dst []byte) []byte {
  5964  	version := v.Version
  5965  	_ = version
  5966  	isFlexible := version >= 9
  5967  	_ = isFlexible
  5968  	{
  5969  		v := v.Topics
  5970  		if version >= 1 {
  5971  			if isFlexible {
  5972  				dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
  5973  			} else {
  5974  				dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
  5975  			}
  5976  		} else {
  5977  			if isFlexible {
  5978  				dst = kbin.AppendCompactArrayLen(dst, len(v))
  5979  			} else {
  5980  				dst = kbin.AppendArrayLen(dst, len(v))
  5981  			}
  5982  		}
  5983  		for i := range v {
  5984  			v := &v[i]
  5985  			if version >= 10 {
  5986  				v := v.TopicID
  5987  				dst = kbin.AppendUuid(dst, v)
  5988  			}
  5989  			{
  5990  				v := v.Topic
  5991  				if version < 10 {
  5992  					var vv string
  5993  					if v != nil {
  5994  						vv = *v
  5995  					}
  5996  					{
  5997  						v := vv
  5998  						if isFlexible {
  5999  							dst = kbin.AppendCompactString(dst, v)
  6000  						} else {
  6001  							dst = kbin.AppendString(dst, v)
  6002  						}
  6003  					}
  6004  				} else {
  6005  					if isFlexible {
  6006  						dst = kbin.AppendCompactNullableString(dst, v)
  6007  					} else {
  6008  						dst = kbin.AppendNullableString(dst, v)
  6009  					}
  6010  				}
  6011  			}
  6012  			if isFlexible {
  6013  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  6014  				dst = v.UnknownTags.AppendEach(dst)
  6015  			}
  6016  		}
  6017  	}
  6018  	if version >= 4 {
  6019  		v := v.AllowAutoTopicCreation
  6020  		dst = kbin.AppendBool(dst, v)
  6021  	}
  6022  	if version >= 8 && version <= 10 {
  6023  		v := v.IncludeClusterAuthorizedOperations
  6024  		dst = kbin.AppendBool(dst, v)
  6025  	}
  6026  	if version >= 8 {
  6027  		v := v.IncludeTopicAuthorizedOperations
  6028  		dst = kbin.AppendBool(dst, v)
  6029  	}
  6030  	if isFlexible {
  6031  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  6032  		dst = v.UnknownTags.AppendEach(dst)
  6033  	}
  6034  	return dst
  6035  }
  6036  
  6037  func (v *MetadataRequest) ReadFrom(src []byte) error {
  6038  	return v.readFrom(src, false)
  6039  }
  6040  
  6041  func (v *MetadataRequest) UnsafeReadFrom(src []byte) error {
  6042  	return v.readFrom(src, true)
  6043  }
  6044  
  6045  func (v *MetadataRequest) readFrom(src []byte, unsafe bool) error {
  6046  	v.Default()
  6047  	b := kbin.Reader{Src: src}
  6048  	version := v.Version
  6049  	_ = version
  6050  	isFlexible := version >= 9
  6051  	_ = isFlexible
  6052  	s := v
  6053  	{
  6054  		v := s.Topics
  6055  		a := v
  6056  		var l int32
  6057  		if isFlexible {
  6058  			l = b.CompactArrayLen()
  6059  		} else {
  6060  			l = b.ArrayLen()
  6061  		}
  6062  		if version < 1 || l == 0 {
  6063  			a = []MetadataRequestTopic{}
  6064  		}
  6065  		if !b.Ok() {
  6066  			return b.Complete()
  6067  		}
  6068  		a = a[:0]
  6069  		if l > 0 {
  6070  			a = append(a, make([]MetadataRequestTopic, l)...)
  6071  		}
  6072  		for i := int32(0); i < l; i++ {
  6073  			v := &a[i]
  6074  			v.Default()
  6075  			s := v
  6076  			if version >= 10 {
  6077  				v := b.Uuid()
  6078  				s.TopicID = v
  6079  			}
  6080  			{
  6081  				var v *string
  6082  				if version < 10 {
  6083  					var vv string
  6084  					if isFlexible {
  6085  						if unsafe {
  6086  							vv = b.UnsafeCompactString()
  6087  						} else {
  6088  							vv = b.CompactString()
  6089  						}
  6090  					} else {
  6091  						if unsafe {
  6092  							vv = b.UnsafeString()
  6093  						} else {
  6094  							vv = b.String()
  6095  						}
  6096  					}
  6097  					v = &vv
  6098  				} else {
  6099  					if isFlexible {
  6100  						if unsafe {
  6101  							v = b.UnsafeCompactNullableString()
  6102  						} else {
  6103  							v = b.CompactNullableString()
  6104  						}
  6105  					} else {
  6106  						if unsafe {
  6107  							v = b.UnsafeNullableString()
  6108  						} else {
  6109  							v = b.NullableString()
  6110  						}
  6111  					}
  6112  				}
  6113  				s.Topic = v
  6114  			}
  6115  			if isFlexible {
  6116  				s.UnknownTags = internalReadTags(&b)
  6117  			}
  6118  		}
  6119  		v = a
  6120  		s.Topics = v
  6121  	}
  6122  	if version >= 4 {
  6123  		v := b.Bool()
  6124  		s.AllowAutoTopicCreation = v
  6125  	}
  6126  	if version >= 8 && version <= 10 {
  6127  		v := b.Bool()
  6128  		s.IncludeClusterAuthorizedOperations = v
  6129  	}
  6130  	if version >= 8 {
  6131  		v := b.Bool()
  6132  		s.IncludeTopicAuthorizedOperations = v
  6133  	}
  6134  	if isFlexible {
  6135  		s.UnknownTags = internalReadTags(&b)
  6136  	}
  6137  	return b.Complete()
  6138  }
  6139  
  6140  // NewPtrMetadataRequest returns a pointer to a default MetadataRequest
  6141  // This is a shortcut for creating a new(struct) and calling Default yourself.
  6142  func NewPtrMetadataRequest() *MetadataRequest {
  6143  	var v MetadataRequest
  6144  	v.Default()
  6145  	return &v
  6146  }
  6147  
  6148  // Default sets any default fields. Calling this allows for future compatibility
  6149  // if new fields are added to MetadataRequest.
  6150  func (v *MetadataRequest) Default() {
  6151  }
  6152  
  6153  // NewMetadataRequest returns a default MetadataRequest
  6154  // This is a shortcut for creating a struct and calling Default yourself.
  6155  func NewMetadataRequest() MetadataRequest {
  6156  	var v MetadataRequest
  6157  	v.Default()
  6158  	return v
  6159  }
  6160  
  6161  type MetadataResponseBroker struct {
  6162  	// NodeID is the node ID of a Kafka broker.
  6163  	NodeID int32
  6164  
  6165  	// Host is the hostname of a Kafka broker.
  6166  	Host string
  6167  
  6168  	// Port is the port of a Kafka broker.
  6169  	Port int32
  6170  
  6171  	// Rack is the rack this Kafka broker is in.
  6172  	Rack *string // v1+
  6173  
  6174  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6175  	UnknownTags Tags // v9+
  6176  }
  6177  
  6178  // Default sets any default fields. Calling this allows for future compatibility
  6179  // if new fields are added to MetadataResponseBroker.
  6180  func (v *MetadataResponseBroker) Default() {
  6181  }
  6182  
  6183  // NewMetadataResponseBroker returns a default MetadataResponseBroker
  6184  // This is a shortcut for creating a struct and calling Default yourself.
  6185  func NewMetadataResponseBroker() MetadataResponseBroker {
  6186  	var v MetadataResponseBroker
  6187  	v.Default()
  6188  	return v
  6189  }
  6190  
  6191  type MetadataResponseTopicPartition struct {
  6192  	// ErrorCode is any error for a partition in topic metadata.
  6193  	//
  6194  	// LEADER_NOT_AVAILABLE is returned if a leader is unavailable for this
  6195  	// partition. For v0 metadata responses, this is also returned if a
  6196  	// partition leader's listener does not exist.
  6197  	//
  6198  	// LISTENER_NOT_FOUND is returned if a leader ID is known but the
  6199  	// listener for it is not (v1+).
  6200  	//
  6201  	// REPLICA_NOT_AVAILABLE is returned in v0 responses if any replica is
  6202  	// unavailable.
  6203  	//
  6204  	// UNKNOWN_TOPIC_ID is returned if using a topic ID and the ID does not
  6205  	// exist.
  6206  	ErrorCode int16
  6207  
  6208  	// Partition is a partition number for a topic.
  6209  	Partition int32
  6210  
  6211  	// Leader is the broker leader for this partition. This will be -1
  6212  	// on leader / listener error.
  6213  	Leader int32
  6214  
  6215  	// LeaderEpoch, proposed in KIP-320 and introduced in Kafka 2.1.0 is the
  6216  	// epoch of the broker leader.
  6217  	//
  6218  	// This field has a default of -1.
  6219  	LeaderEpoch int32 // v7+
  6220  
  6221  	// Replicas returns all broker IDs containing replicas of this partition.
  6222  	Replicas []int32
  6223  
  6224  	// ISR returns all broker IDs of in-sync replicas of this partition.
  6225  	ISR []int32
  6226  
  6227  	// OfflineReplicas, proposed in KIP-112 and introduced in Kafka 1.0,
  6228  	// returns all offline broker IDs that should be replicating this partition.
  6229  	OfflineReplicas []int32 // v5+
  6230  
  6231  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6232  	UnknownTags Tags // v9+
  6233  }
  6234  
  6235  // Default sets any default fields. Calling this allows for future compatibility
  6236  // if new fields are added to MetadataResponseTopicPartition.
  6237  func (v *MetadataResponseTopicPartition) Default() {
  6238  	v.LeaderEpoch = -1
  6239  }
  6240  
  6241  // NewMetadataResponseTopicPartition returns a default MetadataResponseTopicPartition
  6242  // This is a shortcut for creating a struct and calling Default yourself.
  6243  func NewMetadataResponseTopicPartition() MetadataResponseTopicPartition {
  6244  	var v MetadataResponseTopicPartition
  6245  	v.Default()
  6246  	return v
  6247  }
  6248  
  6249  type MetadataResponseTopic struct {
  6250  	// ErrorCode is any error for a topic in a metadata request.
  6251  	//
  6252  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized
  6253  	// to describe the topic, or if the metadata request specified topic auto
  6254  	// creation, the topic did not exist, and the user lacks permission to create.
  6255  	//
  6256  	// UNKNOWN_TOPIC_OR_PARTITION is returned if a topic does not exist and
  6257  	// the request did not specify autocreation.
  6258  	//
  6259  	// LEADER_NOT_AVAILABLE is returned if a new topic is created successfully
  6260  	// (since there is no leader on an immediately new topic).
  6261  	//
  6262  	// There can be a myriad of other errors for unsuccessful topic creation.
  6263  	ErrorCode int16
  6264  
  6265  	// Topic is the topic this metadata corresponds to.
  6266  	Topic *string
  6267  
  6268  	// The topic ID.
  6269  	TopicID [16]byte // v10+
  6270  
  6271  	// IsInternal signifies whether this topic is a Kafka internal topic.
  6272  	IsInternal bool // v1+
  6273  
  6274  	// Partitions contains metadata about partitions for a topic.
  6275  	Partitions []MetadataResponseTopicPartition
  6276  
  6277  	// AuthorizedOperations, proposed in KIP-430 and introduced in Kafka 2.3.0,
  6278  	// is a bitfield (corresponding to AclOperation) containing which operations
  6279  	// the client is allowed to perform on this topic.
  6280  	// This is only returned if requested.
  6281  	//
  6282  	// This field has a default of -2147483648.
  6283  	AuthorizedOperations int32 // v8+
  6284  
  6285  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6286  	UnknownTags Tags // v9+
  6287  }
  6288  
  6289  // Default sets any default fields. Calling this allows for future compatibility
  6290  // if new fields are added to MetadataResponseTopic.
  6291  func (v *MetadataResponseTopic) Default() {
  6292  	v.AuthorizedOperations = -2147483648
  6293  }
  6294  
  6295  // NewMetadataResponseTopic returns a default MetadataResponseTopic
  6296  // This is a shortcut for creating a struct and calling Default yourself.
  6297  func NewMetadataResponseTopic() MetadataResponseTopic {
  6298  	var v MetadataResponseTopic
  6299  	v.Default()
  6300  	return v
  6301  }
  6302  
  6303  // MetadataResponse is returned from a MetdataRequest.
  6304  type MetadataResponse struct {
  6305  	// Version is the version of this message used with a Kafka broker.
  6306  	Version int16
  6307  
  6308  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
  6309  	// after this request.
  6310  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
  6311  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
  6312  	//
  6313  	// This request switched at version 6.
  6314  	ThrottleMillis int32 // v3+
  6315  
  6316  	// Brokers is a set of alive Kafka brokers.
  6317  	Brokers []MetadataResponseBroker
  6318  
  6319  	// ClusterID, proposed in KIP-78 and introduced in Kafka 0.10.1.0, is a
  6320  	// unique string specifying the cluster that the replying Kafka belongs to.
  6321  	ClusterID *string // v2+
  6322  
  6323  	// ControllerID is the ID of the controller broker (the admin broker).
  6324  	//
  6325  	// This field has a default of -1.
  6326  	ControllerID int32 // v1+
  6327  
  6328  	// Topics contains metadata about each topic requested in the
  6329  	// MetadataRequest.
  6330  	Topics []MetadataResponseTopic
  6331  
  6332  	// AuthorizedOperations is a bitfield containing which operations the client
  6333  	// is allowed to perform on this cluster.
  6334  	//
  6335  	// This field has a default of -2147483648.
  6336  	AuthorizedOperations int32 // v8-v10
  6337  
  6338  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6339  	UnknownTags Tags // v9+
  6340  }
  6341  
  6342  func (*MetadataResponse) Key() int16                         { return 3 }
  6343  func (*MetadataResponse) MaxVersion() int16                  { return 12 }
  6344  func (v *MetadataResponse) SetVersion(version int16)         { v.Version = version }
  6345  func (v *MetadataResponse) GetVersion() int16                { return v.Version }
  6346  func (v *MetadataResponse) IsFlexible() bool                 { return v.Version >= 9 }
  6347  func (v *MetadataResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 6 }
  6348  func (v *MetadataResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
  6349  func (v *MetadataResponse) RequestKind() Request             { return &MetadataRequest{Version: v.Version} }
  6350  
  6351  func (v *MetadataResponse) AppendTo(dst []byte) []byte {
  6352  	version := v.Version
  6353  	_ = version
  6354  	isFlexible := version >= 9
  6355  	_ = isFlexible
  6356  	if version >= 3 {
  6357  		v := v.ThrottleMillis
  6358  		dst = kbin.AppendInt32(dst, v)
  6359  	}
  6360  	{
  6361  		v := v.Brokers
  6362  		if isFlexible {
  6363  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  6364  		} else {
  6365  			dst = kbin.AppendArrayLen(dst, len(v))
  6366  		}
  6367  		for i := range v {
  6368  			v := &v[i]
  6369  			{
  6370  				v := v.NodeID
  6371  				dst = kbin.AppendInt32(dst, v)
  6372  			}
  6373  			{
  6374  				v := v.Host
  6375  				if isFlexible {
  6376  					dst = kbin.AppendCompactString(dst, v)
  6377  				} else {
  6378  					dst = kbin.AppendString(dst, v)
  6379  				}
  6380  			}
  6381  			{
  6382  				v := v.Port
  6383  				dst = kbin.AppendInt32(dst, v)
  6384  			}
  6385  			if version >= 1 {
  6386  				v := v.Rack
  6387  				if isFlexible {
  6388  					dst = kbin.AppendCompactNullableString(dst, v)
  6389  				} else {
  6390  					dst = kbin.AppendNullableString(dst, v)
  6391  				}
  6392  			}
  6393  			if isFlexible {
  6394  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  6395  				dst = v.UnknownTags.AppendEach(dst)
  6396  			}
  6397  		}
  6398  	}
  6399  	if version >= 2 {
  6400  		v := v.ClusterID
  6401  		if isFlexible {
  6402  			dst = kbin.AppendCompactNullableString(dst, v)
  6403  		} else {
  6404  			dst = kbin.AppendNullableString(dst, v)
  6405  		}
  6406  	}
  6407  	if version >= 1 {
  6408  		v := v.ControllerID
  6409  		dst = kbin.AppendInt32(dst, v)
  6410  	}
  6411  	{
  6412  		v := v.Topics
  6413  		if isFlexible {
  6414  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  6415  		} else {
  6416  			dst = kbin.AppendArrayLen(dst, len(v))
  6417  		}
  6418  		for i := range v {
  6419  			v := &v[i]
  6420  			{
  6421  				v := v.ErrorCode
  6422  				dst = kbin.AppendInt16(dst, v)
  6423  			}
  6424  			{
  6425  				v := v.Topic
  6426  				if version < 12 {
  6427  					var vv string
  6428  					if v != nil {
  6429  						vv = *v
  6430  					}
  6431  					{
  6432  						v := vv
  6433  						if isFlexible {
  6434  							dst = kbin.AppendCompactString(dst, v)
  6435  						} else {
  6436  							dst = kbin.AppendString(dst, v)
  6437  						}
  6438  					}
  6439  				} else {
  6440  					if isFlexible {
  6441  						dst = kbin.AppendCompactNullableString(dst, v)
  6442  					} else {
  6443  						dst = kbin.AppendNullableString(dst, v)
  6444  					}
  6445  				}
  6446  			}
  6447  			if version >= 10 {
  6448  				v := v.TopicID
  6449  				dst = kbin.AppendUuid(dst, v)
  6450  			}
  6451  			if version >= 1 {
  6452  				v := v.IsInternal
  6453  				dst = kbin.AppendBool(dst, v)
  6454  			}
  6455  			{
  6456  				v := v.Partitions
  6457  				if isFlexible {
  6458  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  6459  				} else {
  6460  					dst = kbin.AppendArrayLen(dst, len(v))
  6461  				}
  6462  				for i := range v {
  6463  					v := &v[i]
  6464  					{
  6465  						v := v.ErrorCode
  6466  						dst = kbin.AppendInt16(dst, v)
  6467  					}
  6468  					{
  6469  						v := v.Partition
  6470  						dst = kbin.AppendInt32(dst, v)
  6471  					}
  6472  					{
  6473  						v := v.Leader
  6474  						dst = kbin.AppendInt32(dst, v)
  6475  					}
  6476  					if version >= 7 {
  6477  						v := v.LeaderEpoch
  6478  						dst = kbin.AppendInt32(dst, v)
  6479  					}
  6480  					{
  6481  						v := v.Replicas
  6482  						if isFlexible {
  6483  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  6484  						} else {
  6485  							dst = kbin.AppendArrayLen(dst, len(v))
  6486  						}
  6487  						for i := range v {
  6488  							v := v[i]
  6489  							dst = kbin.AppendInt32(dst, v)
  6490  						}
  6491  					}
  6492  					{
  6493  						v := v.ISR
  6494  						if isFlexible {
  6495  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  6496  						} else {
  6497  							dst = kbin.AppendArrayLen(dst, len(v))
  6498  						}
  6499  						for i := range v {
  6500  							v := v[i]
  6501  							dst = kbin.AppendInt32(dst, v)
  6502  						}
  6503  					}
  6504  					if version >= 5 {
  6505  						v := v.OfflineReplicas
  6506  						if isFlexible {
  6507  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  6508  						} else {
  6509  							dst = kbin.AppendArrayLen(dst, len(v))
  6510  						}
  6511  						for i := range v {
  6512  							v := v[i]
  6513  							dst = kbin.AppendInt32(dst, v)
  6514  						}
  6515  					}
  6516  					if isFlexible {
  6517  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  6518  						dst = v.UnknownTags.AppendEach(dst)
  6519  					}
  6520  				}
  6521  			}
  6522  			if version >= 8 {
  6523  				v := v.AuthorizedOperations
  6524  				dst = kbin.AppendInt32(dst, v)
  6525  			}
  6526  			if isFlexible {
  6527  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  6528  				dst = v.UnknownTags.AppendEach(dst)
  6529  			}
  6530  		}
  6531  	}
  6532  	if version >= 8 && version <= 10 {
  6533  		v := v.AuthorizedOperations
  6534  		dst = kbin.AppendInt32(dst, v)
  6535  	}
  6536  	if isFlexible {
  6537  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  6538  		dst = v.UnknownTags.AppendEach(dst)
  6539  	}
  6540  	return dst
  6541  }
  6542  
  6543  func (v *MetadataResponse) ReadFrom(src []byte) error {
  6544  	return v.readFrom(src, false)
  6545  }
  6546  
  6547  func (v *MetadataResponse) UnsafeReadFrom(src []byte) error {
  6548  	return v.readFrom(src, true)
  6549  }
  6550  
  6551  func (v *MetadataResponse) readFrom(src []byte, unsafe bool) error {
  6552  	v.Default()
  6553  	b := kbin.Reader{Src: src}
  6554  	version := v.Version
  6555  	_ = version
  6556  	isFlexible := version >= 9
  6557  	_ = isFlexible
  6558  	s := v
  6559  	if version >= 3 {
  6560  		v := b.Int32()
  6561  		s.ThrottleMillis = v
  6562  	}
  6563  	{
  6564  		v := s.Brokers
  6565  		a := v
  6566  		var l int32
  6567  		if isFlexible {
  6568  			l = b.CompactArrayLen()
  6569  		} else {
  6570  			l = b.ArrayLen()
  6571  		}
  6572  		if !b.Ok() {
  6573  			return b.Complete()
  6574  		}
  6575  		a = a[:0]
  6576  		if l > 0 {
  6577  			a = append(a, make([]MetadataResponseBroker, l)...)
  6578  		}
  6579  		for i := int32(0); i < l; i++ {
  6580  			v := &a[i]
  6581  			v.Default()
  6582  			s := v
  6583  			{
  6584  				v := b.Int32()
  6585  				s.NodeID = v
  6586  			}
  6587  			{
  6588  				var v string
  6589  				if unsafe {
  6590  					if isFlexible {
  6591  						v = b.UnsafeCompactString()
  6592  					} else {
  6593  						v = b.UnsafeString()
  6594  					}
  6595  				} else {
  6596  					if isFlexible {
  6597  						v = b.CompactString()
  6598  					} else {
  6599  						v = b.String()
  6600  					}
  6601  				}
  6602  				s.Host = v
  6603  			}
  6604  			{
  6605  				v := b.Int32()
  6606  				s.Port = v
  6607  			}
  6608  			if version >= 1 {
  6609  				var v *string
  6610  				if isFlexible {
  6611  					if unsafe {
  6612  						v = b.UnsafeCompactNullableString()
  6613  					} else {
  6614  						v = b.CompactNullableString()
  6615  					}
  6616  				} else {
  6617  					if unsafe {
  6618  						v = b.UnsafeNullableString()
  6619  					} else {
  6620  						v = b.NullableString()
  6621  					}
  6622  				}
  6623  				s.Rack = v
  6624  			}
  6625  			if isFlexible {
  6626  				s.UnknownTags = internalReadTags(&b)
  6627  			}
  6628  		}
  6629  		v = a
  6630  		s.Brokers = v
  6631  	}
  6632  	if version >= 2 {
  6633  		var v *string
  6634  		if isFlexible {
  6635  			if unsafe {
  6636  				v = b.UnsafeCompactNullableString()
  6637  			} else {
  6638  				v = b.CompactNullableString()
  6639  			}
  6640  		} else {
  6641  			if unsafe {
  6642  				v = b.UnsafeNullableString()
  6643  			} else {
  6644  				v = b.NullableString()
  6645  			}
  6646  		}
  6647  		s.ClusterID = v
  6648  	}
  6649  	if version >= 1 {
  6650  		v := b.Int32()
  6651  		s.ControllerID = v
  6652  	}
  6653  	{
  6654  		v := s.Topics
  6655  		a := v
  6656  		var l int32
  6657  		if isFlexible {
  6658  			l = b.CompactArrayLen()
  6659  		} else {
  6660  			l = b.ArrayLen()
  6661  		}
  6662  		if !b.Ok() {
  6663  			return b.Complete()
  6664  		}
  6665  		a = a[:0]
  6666  		if l > 0 {
  6667  			a = append(a, make([]MetadataResponseTopic, l)...)
  6668  		}
  6669  		for i := int32(0); i < l; i++ {
  6670  			v := &a[i]
  6671  			v.Default()
  6672  			s := v
  6673  			{
  6674  				v := b.Int16()
  6675  				s.ErrorCode = v
  6676  			}
  6677  			{
  6678  				var v *string
  6679  				if version < 12 {
  6680  					var vv string
  6681  					if isFlexible {
  6682  						if unsafe {
  6683  							vv = b.UnsafeCompactString()
  6684  						} else {
  6685  							vv = b.CompactString()
  6686  						}
  6687  					} else {
  6688  						if unsafe {
  6689  							vv = b.UnsafeString()
  6690  						} else {
  6691  							vv = b.String()
  6692  						}
  6693  					}
  6694  					v = &vv
  6695  				} else {
  6696  					if isFlexible {
  6697  						if unsafe {
  6698  							v = b.UnsafeCompactNullableString()
  6699  						} else {
  6700  							v = b.CompactNullableString()
  6701  						}
  6702  					} else {
  6703  						if unsafe {
  6704  							v = b.UnsafeNullableString()
  6705  						} else {
  6706  							v = b.NullableString()
  6707  						}
  6708  					}
  6709  				}
  6710  				s.Topic = v
  6711  			}
  6712  			if version >= 10 {
  6713  				v := b.Uuid()
  6714  				s.TopicID = v
  6715  			}
  6716  			if version >= 1 {
  6717  				v := b.Bool()
  6718  				s.IsInternal = v
  6719  			}
  6720  			{
  6721  				v := s.Partitions
  6722  				a := v
  6723  				var l int32
  6724  				if isFlexible {
  6725  					l = b.CompactArrayLen()
  6726  				} else {
  6727  					l = b.ArrayLen()
  6728  				}
  6729  				if !b.Ok() {
  6730  					return b.Complete()
  6731  				}
  6732  				a = a[:0]
  6733  				if l > 0 {
  6734  					a = append(a, make([]MetadataResponseTopicPartition, l)...)
  6735  				}
  6736  				for i := int32(0); i < l; i++ {
  6737  					v := &a[i]
  6738  					v.Default()
  6739  					s := v
  6740  					{
  6741  						v := b.Int16()
  6742  						s.ErrorCode = v
  6743  					}
  6744  					{
  6745  						v := b.Int32()
  6746  						s.Partition = v
  6747  					}
  6748  					{
  6749  						v := b.Int32()
  6750  						s.Leader = v
  6751  					}
  6752  					if version >= 7 {
  6753  						v := b.Int32()
  6754  						s.LeaderEpoch = v
  6755  					}
  6756  					{
  6757  						v := s.Replicas
  6758  						a := v
  6759  						var l int32
  6760  						if isFlexible {
  6761  							l = b.CompactArrayLen()
  6762  						} else {
  6763  							l = b.ArrayLen()
  6764  						}
  6765  						if !b.Ok() {
  6766  							return b.Complete()
  6767  						}
  6768  						a = a[:0]
  6769  						if l > 0 {
  6770  							a = append(a, make([]int32, l)...)
  6771  						}
  6772  						for i := int32(0); i < l; i++ {
  6773  							v := b.Int32()
  6774  							a[i] = v
  6775  						}
  6776  						v = a
  6777  						s.Replicas = v
  6778  					}
  6779  					{
  6780  						v := s.ISR
  6781  						a := v
  6782  						var l int32
  6783  						if isFlexible {
  6784  							l = b.CompactArrayLen()
  6785  						} else {
  6786  							l = b.ArrayLen()
  6787  						}
  6788  						if !b.Ok() {
  6789  							return b.Complete()
  6790  						}
  6791  						a = a[:0]
  6792  						if l > 0 {
  6793  							a = append(a, make([]int32, l)...)
  6794  						}
  6795  						for i := int32(0); i < l; i++ {
  6796  							v := b.Int32()
  6797  							a[i] = v
  6798  						}
  6799  						v = a
  6800  						s.ISR = v
  6801  					}
  6802  					if version >= 5 {
  6803  						v := s.OfflineReplicas
  6804  						a := v
  6805  						var l int32
  6806  						if isFlexible {
  6807  							l = b.CompactArrayLen()
  6808  						} else {
  6809  							l = b.ArrayLen()
  6810  						}
  6811  						if !b.Ok() {
  6812  							return b.Complete()
  6813  						}
  6814  						a = a[:0]
  6815  						if l > 0 {
  6816  							a = append(a, make([]int32, l)...)
  6817  						}
  6818  						for i := int32(0); i < l; i++ {
  6819  							v := b.Int32()
  6820  							a[i] = v
  6821  						}
  6822  						v = a
  6823  						s.OfflineReplicas = v
  6824  					}
  6825  					if isFlexible {
  6826  						s.UnknownTags = internalReadTags(&b)
  6827  					}
  6828  				}
  6829  				v = a
  6830  				s.Partitions = v
  6831  			}
  6832  			if version >= 8 {
  6833  				v := b.Int32()
  6834  				s.AuthorizedOperations = v
  6835  			}
  6836  			if isFlexible {
  6837  				s.UnknownTags = internalReadTags(&b)
  6838  			}
  6839  		}
  6840  		v = a
  6841  		s.Topics = v
  6842  	}
  6843  	if version >= 8 && version <= 10 {
  6844  		v := b.Int32()
  6845  		s.AuthorizedOperations = v
  6846  	}
  6847  	if isFlexible {
  6848  		s.UnknownTags = internalReadTags(&b)
  6849  	}
  6850  	return b.Complete()
  6851  }
  6852  
  6853  // NewPtrMetadataResponse returns a pointer to a default MetadataResponse
  6854  // This is a shortcut for creating a new(struct) and calling Default yourself.
  6855  func NewPtrMetadataResponse() *MetadataResponse {
  6856  	var v MetadataResponse
  6857  	v.Default()
  6858  	return &v
  6859  }
  6860  
  6861  // Default sets any default fields. Calling this allows for future compatibility
  6862  // if new fields are added to MetadataResponse.
  6863  func (v *MetadataResponse) Default() {
  6864  	v.ControllerID = -1
  6865  	v.AuthorizedOperations = -2147483648
  6866  }
  6867  
  6868  // NewMetadataResponse returns a default MetadataResponse
  6869  // This is a shortcut for creating a struct and calling Default yourself.
  6870  func NewMetadataResponse() MetadataResponse {
  6871  	var v MetadataResponse
  6872  	v.Default()
  6873  	return v
  6874  }
  6875  
  6876  // LeaderAndISRRequestTopicPartition is a common struct that is used across
  6877  // different versions of LeaderAndISRRequest.
  6878  type LeaderAndISRRequestTopicPartition struct {
  6879  	Topic string // v0-v1
  6880  
  6881  	Partition int32
  6882  
  6883  	ControllerEpoch int32
  6884  
  6885  	Leader int32
  6886  
  6887  	LeaderEpoch int32
  6888  
  6889  	ISR []int32
  6890  
  6891  	ZKVersion int32
  6892  
  6893  	Replicas []int32
  6894  
  6895  	AddingReplicas []int32 // v3+
  6896  
  6897  	RemovingReplicas []int32 // v3+
  6898  
  6899  	IsNew bool // v1+
  6900  
  6901  	LeaderRecoveryState int8 // v6+
  6902  
  6903  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6904  	UnknownTags Tags // v4+
  6905  }
  6906  
  6907  // Default sets any default fields. Calling this allows for future compatibility
  6908  // if new fields are added to LeaderAndISRRequestTopicPartition.
  6909  func (v *LeaderAndISRRequestTopicPartition) Default() {
  6910  }
  6911  
  6912  // NewLeaderAndISRRequestTopicPartition returns a default LeaderAndISRRequestTopicPartition
  6913  // This is a shortcut for creating a struct and calling Default yourself.
  6914  func NewLeaderAndISRRequestTopicPartition() LeaderAndISRRequestTopicPartition {
  6915  	var v LeaderAndISRRequestTopicPartition
  6916  	v.Default()
  6917  	return v
  6918  }
  6919  
  6920  // LeaderAndISRResponseTopicPartition is a common struct that is used across
  6921  // different versions of LeaderAndISRResponse.
  6922  type LeaderAndISRResponseTopicPartition struct {
  6923  	Topic string // v0-v4
  6924  
  6925  	Partition int32
  6926  
  6927  	ErrorCode int16
  6928  
  6929  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6930  	UnknownTags Tags // v4+
  6931  }
  6932  
  6933  // Default sets any default fields. Calling this allows for future compatibility
  6934  // if new fields are added to LeaderAndISRResponseTopicPartition.
  6935  func (v *LeaderAndISRResponseTopicPartition) Default() {
  6936  }
  6937  
  6938  // NewLeaderAndISRResponseTopicPartition returns a default LeaderAndISRResponseTopicPartition
  6939  // This is a shortcut for creating a struct and calling Default yourself.
  6940  func NewLeaderAndISRResponseTopicPartition() LeaderAndISRResponseTopicPartition {
  6941  	var v LeaderAndISRResponseTopicPartition
  6942  	v.Default()
  6943  	return v
  6944  }
  6945  
  6946  type LeaderAndISRRequestTopicState struct {
  6947  	Topic string
  6948  
  6949  	TopicID [16]byte // v5+
  6950  
  6951  	PartitionStates []LeaderAndISRRequestTopicPartition
  6952  
  6953  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6954  	UnknownTags Tags // v4+
  6955  }
  6956  
  6957  // Default sets any default fields. Calling this allows for future compatibility
  6958  // if new fields are added to LeaderAndISRRequestTopicState.
  6959  func (v *LeaderAndISRRequestTopicState) Default() {
  6960  }
  6961  
  6962  // NewLeaderAndISRRequestTopicState returns a default LeaderAndISRRequestTopicState
  6963  // This is a shortcut for creating a struct and calling Default yourself.
  6964  func NewLeaderAndISRRequestTopicState() LeaderAndISRRequestTopicState {
  6965  	var v LeaderAndISRRequestTopicState
  6966  	v.Default()
  6967  	return v
  6968  }
  6969  
  6970  type LeaderAndISRRequestLiveLeader struct {
  6971  	BrokerID int32
  6972  
  6973  	Host string
  6974  
  6975  	Port int32
  6976  
  6977  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  6978  	UnknownTags Tags // v4+
  6979  }
  6980  
  6981  // Default sets any default fields. Calling this allows for future compatibility
  6982  // if new fields are added to LeaderAndISRRequestLiveLeader.
  6983  func (v *LeaderAndISRRequestLiveLeader) Default() {
  6984  }
  6985  
  6986  // NewLeaderAndISRRequestLiveLeader returns a default LeaderAndISRRequestLiveLeader
  6987  // This is a shortcut for creating a struct and calling Default yourself.
  6988  func NewLeaderAndISRRequestLiveLeader() LeaderAndISRRequestLiveLeader {
  6989  	var v LeaderAndISRRequestLiveLeader
  6990  	v.Default()
  6991  	return v
  6992  }
  6993  
  6994  // LeaderAndISRRequest is an advanced request that controller brokers use
  6995  // to broadcast state to other brokers. Manually using this request is a
  6996  // great way to break your cluster.
  6997  //
  6998  // As this is an advanced request and there is little reason to issue it as a
  6999  // client, this request is undocumented.
  7000  //
  7001  // Kafka 1.0 introduced version 1. Kafka 2.2 introduced version 2, proposed
  7002  // in KIP-380, which changed the layout of the struct to be more memory
  7003  // efficient. Kafka 2.4.0 introduced version 3 with KIP-455.
  7004  // Kafka 3.4 introduced version 7 with KIP-866.
  7005  type LeaderAndISRRequest struct {
  7006  	// Version is the version of this message used with a Kafka broker.
  7007  	Version int16
  7008  
  7009  	ControllerID int32
  7010  
  7011  	// If KRaft controller id is used during migration. See KIP-866.
  7012  	IsKRaftController bool // v7+
  7013  
  7014  	ControllerEpoch int32
  7015  
  7016  	// This field has a default of -1.
  7017  	BrokerEpoch int64 // v2+
  7018  
  7019  	Type int8 // v5+
  7020  
  7021  	PartitionStates []LeaderAndISRRequestTopicPartition // v0-v1
  7022  
  7023  	TopicStates []LeaderAndISRRequestTopicState // v2+
  7024  
  7025  	LiveLeaders []LeaderAndISRRequestLiveLeader
  7026  
  7027  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  7028  	UnknownTags Tags // v4+
  7029  }
  7030  
  7031  func (*LeaderAndISRRequest) Key() int16                 { return 4 }
  7032  func (*LeaderAndISRRequest) MaxVersion() int16          { return 7 }
  7033  func (v *LeaderAndISRRequest) SetVersion(version int16) { v.Version = version }
  7034  func (v *LeaderAndISRRequest) GetVersion() int16        { return v.Version }
  7035  func (v *LeaderAndISRRequest) IsFlexible() bool         { return v.Version >= 4 }
  7036  func (v *LeaderAndISRRequest) ResponseKind() Response {
  7037  	r := &LeaderAndISRResponse{Version: v.Version}
  7038  	r.Default()
  7039  	return r
  7040  }
  7041  
  7042  // RequestWith is requests v on r and returns the response or an error.
  7043  // For sharded requests, the response may be merged and still return an error.
  7044  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  7045  func (v *LeaderAndISRRequest) RequestWith(ctx context.Context, r Requestor) (*LeaderAndISRResponse, error) {
  7046  	kresp, err := r.Request(ctx, v)
  7047  	resp, _ := kresp.(*LeaderAndISRResponse)
  7048  	return resp, err
  7049  }
  7050  
  7051  func (v *LeaderAndISRRequest) AppendTo(dst []byte) []byte {
  7052  	version := v.Version
  7053  	_ = version
  7054  	isFlexible := version >= 4
  7055  	_ = isFlexible
  7056  	{
  7057  		v := v.ControllerID
  7058  		dst = kbin.AppendInt32(dst, v)
  7059  	}
  7060  	if version >= 7 {
  7061  		v := v.IsKRaftController
  7062  		dst = kbin.AppendBool(dst, v)
  7063  	}
  7064  	{
  7065  		v := v.ControllerEpoch
  7066  		dst = kbin.AppendInt32(dst, v)
  7067  	}
  7068  	if version >= 2 {
  7069  		v := v.BrokerEpoch
  7070  		dst = kbin.AppendInt64(dst, v)
  7071  	}
  7072  	if version >= 5 {
  7073  		v := v.Type
  7074  		dst = kbin.AppendInt8(dst, v)
  7075  	}
  7076  	if version >= 0 && version <= 1 {
  7077  		v := v.PartitionStates
  7078  		if isFlexible {
  7079  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  7080  		} else {
  7081  			dst = kbin.AppendArrayLen(dst, len(v))
  7082  		}
  7083  		for i := range v {
  7084  			v := &v[i]
  7085  			if version >= 0 && version <= 1 {
  7086  				v := v.Topic
  7087  				if isFlexible {
  7088  					dst = kbin.AppendCompactString(dst, v)
  7089  				} else {
  7090  					dst = kbin.AppendString(dst, v)
  7091  				}
  7092  			}
  7093  			{
  7094  				v := v.Partition
  7095  				dst = kbin.AppendInt32(dst, v)
  7096  			}
  7097  			{
  7098  				v := v.ControllerEpoch
  7099  				dst = kbin.AppendInt32(dst, v)
  7100  			}
  7101  			{
  7102  				v := v.Leader
  7103  				dst = kbin.AppendInt32(dst, v)
  7104  			}
  7105  			{
  7106  				v := v.LeaderEpoch
  7107  				dst = kbin.AppendInt32(dst, v)
  7108  			}
  7109  			{
  7110  				v := v.ISR
  7111  				if isFlexible {
  7112  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  7113  				} else {
  7114  					dst = kbin.AppendArrayLen(dst, len(v))
  7115  				}
  7116  				for i := range v {
  7117  					v := v[i]
  7118  					dst = kbin.AppendInt32(dst, v)
  7119  				}
  7120  			}
  7121  			{
  7122  				v := v.ZKVersion
  7123  				dst = kbin.AppendInt32(dst, v)
  7124  			}
  7125  			{
  7126  				v := v.Replicas
  7127  				if isFlexible {
  7128  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  7129  				} else {
  7130  					dst = kbin.AppendArrayLen(dst, len(v))
  7131  				}
  7132  				for i := range v {
  7133  					v := v[i]
  7134  					dst = kbin.AppendInt32(dst, v)
  7135  				}
  7136  			}
  7137  			if version >= 3 {
  7138  				v := v.AddingReplicas
  7139  				if isFlexible {
  7140  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  7141  				} else {
  7142  					dst = kbin.AppendArrayLen(dst, len(v))
  7143  				}
  7144  				for i := range v {
  7145  					v := v[i]
  7146  					dst = kbin.AppendInt32(dst, v)
  7147  				}
  7148  			}
  7149  			if version >= 3 {
  7150  				v := v.RemovingReplicas
  7151  				if isFlexible {
  7152  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  7153  				} else {
  7154  					dst = kbin.AppendArrayLen(dst, len(v))
  7155  				}
  7156  				for i := range v {
  7157  					v := v[i]
  7158  					dst = kbin.AppendInt32(dst, v)
  7159  				}
  7160  			}
  7161  			if version >= 1 {
  7162  				v := v.IsNew
  7163  				dst = kbin.AppendBool(dst, v)
  7164  			}
  7165  			if version >= 6 {
  7166  				v := v.LeaderRecoveryState
  7167  				dst = kbin.AppendInt8(dst, v)
  7168  			}
  7169  			if isFlexible {
  7170  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7171  				dst = v.UnknownTags.AppendEach(dst)
  7172  			}
  7173  		}
  7174  	}
  7175  	if version >= 2 {
  7176  		v := v.TopicStates
  7177  		if isFlexible {
  7178  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  7179  		} else {
  7180  			dst = kbin.AppendArrayLen(dst, len(v))
  7181  		}
  7182  		for i := range v {
  7183  			v := &v[i]
  7184  			{
  7185  				v := v.Topic
  7186  				if isFlexible {
  7187  					dst = kbin.AppendCompactString(dst, v)
  7188  				} else {
  7189  					dst = kbin.AppendString(dst, v)
  7190  				}
  7191  			}
  7192  			if version >= 5 {
  7193  				v := v.TopicID
  7194  				dst = kbin.AppendUuid(dst, v)
  7195  			}
  7196  			{
  7197  				v := v.PartitionStates
  7198  				if isFlexible {
  7199  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  7200  				} else {
  7201  					dst = kbin.AppendArrayLen(dst, len(v))
  7202  				}
  7203  				for i := range v {
  7204  					v := &v[i]
  7205  					if version >= 0 && version <= 1 {
  7206  						v := v.Topic
  7207  						if isFlexible {
  7208  							dst = kbin.AppendCompactString(dst, v)
  7209  						} else {
  7210  							dst = kbin.AppendString(dst, v)
  7211  						}
  7212  					}
  7213  					{
  7214  						v := v.Partition
  7215  						dst = kbin.AppendInt32(dst, v)
  7216  					}
  7217  					{
  7218  						v := v.ControllerEpoch
  7219  						dst = kbin.AppendInt32(dst, v)
  7220  					}
  7221  					{
  7222  						v := v.Leader
  7223  						dst = kbin.AppendInt32(dst, v)
  7224  					}
  7225  					{
  7226  						v := v.LeaderEpoch
  7227  						dst = kbin.AppendInt32(dst, v)
  7228  					}
  7229  					{
  7230  						v := v.ISR
  7231  						if isFlexible {
  7232  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  7233  						} else {
  7234  							dst = kbin.AppendArrayLen(dst, len(v))
  7235  						}
  7236  						for i := range v {
  7237  							v := v[i]
  7238  							dst = kbin.AppendInt32(dst, v)
  7239  						}
  7240  					}
  7241  					{
  7242  						v := v.ZKVersion
  7243  						dst = kbin.AppendInt32(dst, v)
  7244  					}
  7245  					{
  7246  						v := v.Replicas
  7247  						if isFlexible {
  7248  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  7249  						} else {
  7250  							dst = kbin.AppendArrayLen(dst, len(v))
  7251  						}
  7252  						for i := range v {
  7253  							v := v[i]
  7254  							dst = kbin.AppendInt32(dst, v)
  7255  						}
  7256  					}
  7257  					if version >= 3 {
  7258  						v := v.AddingReplicas
  7259  						if isFlexible {
  7260  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  7261  						} else {
  7262  							dst = kbin.AppendArrayLen(dst, len(v))
  7263  						}
  7264  						for i := range v {
  7265  							v := v[i]
  7266  							dst = kbin.AppendInt32(dst, v)
  7267  						}
  7268  					}
  7269  					if version >= 3 {
  7270  						v := v.RemovingReplicas
  7271  						if isFlexible {
  7272  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  7273  						} else {
  7274  							dst = kbin.AppendArrayLen(dst, len(v))
  7275  						}
  7276  						for i := range v {
  7277  							v := v[i]
  7278  							dst = kbin.AppendInt32(dst, v)
  7279  						}
  7280  					}
  7281  					if version >= 1 {
  7282  						v := v.IsNew
  7283  						dst = kbin.AppendBool(dst, v)
  7284  					}
  7285  					if version >= 6 {
  7286  						v := v.LeaderRecoveryState
  7287  						dst = kbin.AppendInt8(dst, v)
  7288  					}
  7289  					if isFlexible {
  7290  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7291  						dst = v.UnknownTags.AppendEach(dst)
  7292  					}
  7293  				}
  7294  			}
  7295  			if isFlexible {
  7296  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7297  				dst = v.UnknownTags.AppendEach(dst)
  7298  			}
  7299  		}
  7300  	}
  7301  	{
  7302  		v := v.LiveLeaders
  7303  		if isFlexible {
  7304  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  7305  		} else {
  7306  			dst = kbin.AppendArrayLen(dst, len(v))
  7307  		}
  7308  		for i := range v {
  7309  			v := &v[i]
  7310  			{
  7311  				v := v.BrokerID
  7312  				dst = kbin.AppendInt32(dst, v)
  7313  			}
  7314  			{
  7315  				v := v.Host
  7316  				if isFlexible {
  7317  					dst = kbin.AppendCompactString(dst, v)
  7318  				} else {
  7319  					dst = kbin.AppendString(dst, v)
  7320  				}
  7321  			}
  7322  			{
  7323  				v := v.Port
  7324  				dst = kbin.AppendInt32(dst, v)
  7325  			}
  7326  			if isFlexible {
  7327  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7328  				dst = v.UnknownTags.AppendEach(dst)
  7329  			}
  7330  		}
  7331  	}
  7332  	if isFlexible {
  7333  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7334  		dst = v.UnknownTags.AppendEach(dst)
  7335  	}
  7336  	return dst
  7337  }
  7338  
  7339  func (v *LeaderAndISRRequest) ReadFrom(src []byte) error {
  7340  	return v.readFrom(src, false)
  7341  }
  7342  
  7343  func (v *LeaderAndISRRequest) UnsafeReadFrom(src []byte) error {
  7344  	return v.readFrom(src, true)
  7345  }
  7346  
  7347  func (v *LeaderAndISRRequest) readFrom(src []byte, unsafe bool) error {
  7348  	v.Default()
  7349  	b := kbin.Reader{Src: src}
  7350  	version := v.Version
  7351  	_ = version
  7352  	isFlexible := version >= 4
  7353  	_ = isFlexible
  7354  	s := v
  7355  	{
  7356  		v := b.Int32()
  7357  		s.ControllerID = v
  7358  	}
  7359  	if version >= 7 {
  7360  		v := b.Bool()
  7361  		s.IsKRaftController = v
  7362  	}
  7363  	{
  7364  		v := b.Int32()
  7365  		s.ControllerEpoch = v
  7366  	}
  7367  	if version >= 2 {
  7368  		v := b.Int64()
  7369  		s.BrokerEpoch = v
  7370  	}
  7371  	if version >= 5 {
  7372  		v := b.Int8()
  7373  		s.Type = v
  7374  	}
  7375  	if version >= 0 && version <= 1 {
  7376  		v := s.PartitionStates
  7377  		a := v
  7378  		var l int32
  7379  		if isFlexible {
  7380  			l = b.CompactArrayLen()
  7381  		} else {
  7382  			l = b.ArrayLen()
  7383  		}
  7384  		if !b.Ok() {
  7385  			return b.Complete()
  7386  		}
  7387  		a = a[:0]
  7388  		if l > 0 {
  7389  			a = append(a, make([]LeaderAndISRRequestTopicPartition, l)...)
  7390  		}
  7391  		for i := int32(0); i < l; i++ {
  7392  			v := &a[i]
  7393  			v.Default()
  7394  			s := v
  7395  			if version >= 0 && version <= 1 {
  7396  				var v string
  7397  				if unsafe {
  7398  					if isFlexible {
  7399  						v = b.UnsafeCompactString()
  7400  					} else {
  7401  						v = b.UnsafeString()
  7402  					}
  7403  				} else {
  7404  					if isFlexible {
  7405  						v = b.CompactString()
  7406  					} else {
  7407  						v = b.String()
  7408  					}
  7409  				}
  7410  				s.Topic = v
  7411  			}
  7412  			{
  7413  				v := b.Int32()
  7414  				s.Partition = v
  7415  			}
  7416  			{
  7417  				v := b.Int32()
  7418  				s.ControllerEpoch = v
  7419  			}
  7420  			{
  7421  				v := b.Int32()
  7422  				s.Leader = v
  7423  			}
  7424  			{
  7425  				v := b.Int32()
  7426  				s.LeaderEpoch = v
  7427  			}
  7428  			{
  7429  				v := s.ISR
  7430  				a := v
  7431  				var l int32
  7432  				if isFlexible {
  7433  					l = b.CompactArrayLen()
  7434  				} else {
  7435  					l = b.ArrayLen()
  7436  				}
  7437  				if !b.Ok() {
  7438  					return b.Complete()
  7439  				}
  7440  				a = a[:0]
  7441  				if l > 0 {
  7442  					a = append(a, make([]int32, l)...)
  7443  				}
  7444  				for i := int32(0); i < l; i++ {
  7445  					v := b.Int32()
  7446  					a[i] = v
  7447  				}
  7448  				v = a
  7449  				s.ISR = v
  7450  			}
  7451  			{
  7452  				v := b.Int32()
  7453  				s.ZKVersion = v
  7454  			}
  7455  			{
  7456  				v := s.Replicas
  7457  				a := v
  7458  				var l int32
  7459  				if isFlexible {
  7460  					l = b.CompactArrayLen()
  7461  				} else {
  7462  					l = b.ArrayLen()
  7463  				}
  7464  				if !b.Ok() {
  7465  					return b.Complete()
  7466  				}
  7467  				a = a[:0]
  7468  				if l > 0 {
  7469  					a = append(a, make([]int32, l)...)
  7470  				}
  7471  				for i := int32(0); i < l; i++ {
  7472  					v := b.Int32()
  7473  					a[i] = v
  7474  				}
  7475  				v = a
  7476  				s.Replicas = v
  7477  			}
  7478  			if version >= 3 {
  7479  				v := s.AddingReplicas
  7480  				a := v
  7481  				var l int32
  7482  				if isFlexible {
  7483  					l = b.CompactArrayLen()
  7484  				} else {
  7485  					l = b.ArrayLen()
  7486  				}
  7487  				if !b.Ok() {
  7488  					return b.Complete()
  7489  				}
  7490  				a = a[:0]
  7491  				if l > 0 {
  7492  					a = append(a, make([]int32, l)...)
  7493  				}
  7494  				for i := int32(0); i < l; i++ {
  7495  					v := b.Int32()
  7496  					a[i] = v
  7497  				}
  7498  				v = a
  7499  				s.AddingReplicas = v
  7500  			}
  7501  			if version >= 3 {
  7502  				v := s.RemovingReplicas
  7503  				a := v
  7504  				var l int32
  7505  				if isFlexible {
  7506  					l = b.CompactArrayLen()
  7507  				} else {
  7508  					l = b.ArrayLen()
  7509  				}
  7510  				if !b.Ok() {
  7511  					return b.Complete()
  7512  				}
  7513  				a = a[:0]
  7514  				if l > 0 {
  7515  					a = append(a, make([]int32, l)...)
  7516  				}
  7517  				for i := int32(0); i < l; i++ {
  7518  					v := b.Int32()
  7519  					a[i] = v
  7520  				}
  7521  				v = a
  7522  				s.RemovingReplicas = v
  7523  			}
  7524  			if version >= 1 {
  7525  				v := b.Bool()
  7526  				s.IsNew = v
  7527  			}
  7528  			if version >= 6 {
  7529  				v := b.Int8()
  7530  				s.LeaderRecoveryState = v
  7531  			}
  7532  			if isFlexible {
  7533  				s.UnknownTags = internalReadTags(&b)
  7534  			}
  7535  		}
  7536  		v = a
  7537  		s.PartitionStates = v
  7538  	}
  7539  	if version >= 2 {
  7540  		v := s.TopicStates
  7541  		a := v
  7542  		var l int32
  7543  		if isFlexible {
  7544  			l = b.CompactArrayLen()
  7545  		} else {
  7546  			l = b.ArrayLen()
  7547  		}
  7548  		if !b.Ok() {
  7549  			return b.Complete()
  7550  		}
  7551  		a = a[:0]
  7552  		if l > 0 {
  7553  			a = append(a, make([]LeaderAndISRRequestTopicState, l)...)
  7554  		}
  7555  		for i := int32(0); i < l; i++ {
  7556  			v := &a[i]
  7557  			v.Default()
  7558  			s := v
  7559  			{
  7560  				var v string
  7561  				if unsafe {
  7562  					if isFlexible {
  7563  						v = b.UnsafeCompactString()
  7564  					} else {
  7565  						v = b.UnsafeString()
  7566  					}
  7567  				} else {
  7568  					if isFlexible {
  7569  						v = b.CompactString()
  7570  					} else {
  7571  						v = b.String()
  7572  					}
  7573  				}
  7574  				s.Topic = v
  7575  			}
  7576  			if version >= 5 {
  7577  				v := b.Uuid()
  7578  				s.TopicID = v
  7579  			}
  7580  			{
  7581  				v := s.PartitionStates
  7582  				a := v
  7583  				var l int32
  7584  				if isFlexible {
  7585  					l = b.CompactArrayLen()
  7586  				} else {
  7587  					l = b.ArrayLen()
  7588  				}
  7589  				if !b.Ok() {
  7590  					return b.Complete()
  7591  				}
  7592  				a = a[:0]
  7593  				if l > 0 {
  7594  					a = append(a, make([]LeaderAndISRRequestTopicPartition, l)...)
  7595  				}
  7596  				for i := int32(0); i < l; i++ {
  7597  					v := &a[i]
  7598  					v.Default()
  7599  					s := v
  7600  					if version >= 0 && version <= 1 {
  7601  						var v string
  7602  						if unsafe {
  7603  							if isFlexible {
  7604  								v = b.UnsafeCompactString()
  7605  							} else {
  7606  								v = b.UnsafeString()
  7607  							}
  7608  						} else {
  7609  							if isFlexible {
  7610  								v = b.CompactString()
  7611  							} else {
  7612  								v = b.String()
  7613  							}
  7614  						}
  7615  						s.Topic = v
  7616  					}
  7617  					{
  7618  						v := b.Int32()
  7619  						s.Partition = v
  7620  					}
  7621  					{
  7622  						v := b.Int32()
  7623  						s.ControllerEpoch = v
  7624  					}
  7625  					{
  7626  						v := b.Int32()
  7627  						s.Leader = v
  7628  					}
  7629  					{
  7630  						v := b.Int32()
  7631  						s.LeaderEpoch = v
  7632  					}
  7633  					{
  7634  						v := s.ISR
  7635  						a := v
  7636  						var l int32
  7637  						if isFlexible {
  7638  							l = b.CompactArrayLen()
  7639  						} else {
  7640  							l = b.ArrayLen()
  7641  						}
  7642  						if !b.Ok() {
  7643  							return b.Complete()
  7644  						}
  7645  						a = a[:0]
  7646  						if l > 0 {
  7647  							a = append(a, make([]int32, l)...)
  7648  						}
  7649  						for i := int32(0); i < l; i++ {
  7650  							v := b.Int32()
  7651  							a[i] = v
  7652  						}
  7653  						v = a
  7654  						s.ISR = v
  7655  					}
  7656  					{
  7657  						v := b.Int32()
  7658  						s.ZKVersion = v
  7659  					}
  7660  					{
  7661  						v := s.Replicas
  7662  						a := v
  7663  						var l int32
  7664  						if isFlexible {
  7665  							l = b.CompactArrayLen()
  7666  						} else {
  7667  							l = b.ArrayLen()
  7668  						}
  7669  						if !b.Ok() {
  7670  							return b.Complete()
  7671  						}
  7672  						a = a[:0]
  7673  						if l > 0 {
  7674  							a = append(a, make([]int32, l)...)
  7675  						}
  7676  						for i := int32(0); i < l; i++ {
  7677  							v := b.Int32()
  7678  							a[i] = v
  7679  						}
  7680  						v = a
  7681  						s.Replicas = v
  7682  					}
  7683  					if version >= 3 {
  7684  						v := s.AddingReplicas
  7685  						a := v
  7686  						var l int32
  7687  						if isFlexible {
  7688  							l = b.CompactArrayLen()
  7689  						} else {
  7690  							l = b.ArrayLen()
  7691  						}
  7692  						if !b.Ok() {
  7693  							return b.Complete()
  7694  						}
  7695  						a = a[:0]
  7696  						if l > 0 {
  7697  							a = append(a, make([]int32, l)...)
  7698  						}
  7699  						for i := int32(0); i < l; i++ {
  7700  							v := b.Int32()
  7701  							a[i] = v
  7702  						}
  7703  						v = a
  7704  						s.AddingReplicas = v
  7705  					}
  7706  					if version >= 3 {
  7707  						v := s.RemovingReplicas
  7708  						a := v
  7709  						var l int32
  7710  						if isFlexible {
  7711  							l = b.CompactArrayLen()
  7712  						} else {
  7713  							l = b.ArrayLen()
  7714  						}
  7715  						if !b.Ok() {
  7716  							return b.Complete()
  7717  						}
  7718  						a = a[:0]
  7719  						if l > 0 {
  7720  							a = append(a, make([]int32, l)...)
  7721  						}
  7722  						for i := int32(0); i < l; i++ {
  7723  							v := b.Int32()
  7724  							a[i] = v
  7725  						}
  7726  						v = a
  7727  						s.RemovingReplicas = v
  7728  					}
  7729  					if version >= 1 {
  7730  						v := b.Bool()
  7731  						s.IsNew = v
  7732  					}
  7733  					if version >= 6 {
  7734  						v := b.Int8()
  7735  						s.LeaderRecoveryState = v
  7736  					}
  7737  					if isFlexible {
  7738  						s.UnknownTags = internalReadTags(&b)
  7739  					}
  7740  				}
  7741  				v = a
  7742  				s.PartitionStates = v
  7743  			}
  7744  			if isFlexible {
  7745  				s.UnknownTags = internalReadTags(&b)
  7746  			}
  7747  		}
  7748  		v = a
  7749  		s.TopicStates = v
  7750  	}
  7751  	{
  7752  		v := s.LiveLeaders
  7753  		a := v
  7754  		var l int32
  7755  		if isFlexible {
  7756  			l = b.CompactArrayLen()
  7757  		} else {
  7758  			l = b.ArrayLen()
  7759  		}
  7760  		if !b.Ok() {
  7761  			return b.Complete()
  7762  		}
  7763  		a = a[:0]
  7764  		if l > 0 {
  7765  			a = append(a, make([]LeaderAndISRRequestLiveLeader, l)...)
  7766  		}
  7767  		for i := int32(0); i < l; i++ {
  7768  			v := &a[i]
  7769  			v.Default()
  7770  			s := v
  7771  			{
  7772  				v := b.Int32()
  7773  				s.BrokerID = v
  7774  			}
  7775  			{
  7776  				var v string
  7777  				if unsafe {
  7778  					if isFlexible {
  7779  						v = b.UnsafeCompactString()
  7780  					} else {
  7781  						v = b.UnsafeString()
  7782  					}
  7783  				} else {
  7784  					if isFlexible {
  7785  						v = b.CompactString()
  7786  					} else {
  7787  						v = b.String()
  7788  					}
  7789  				}
  7790  				s.Host = v
  7791  			}
  7792  			{
  7793  				v := b.Int32()
  7794  				s.Port = v
  7795  			}
  7796  			if isFlexible {
  7797  				s.UnknownTags = internalReadTags(&b)
  7798  			}
  7799  		}
  7800  		v = a
  7801  		s.LiveLeaders = v
  7802  	}
  7803  	if isFlexible {
  7804  		s.UnknownTags = internalReadTags(&b)
  7805  	}
  7806  	return b.Complete()
  7807  }
  7808  
  7809  // NewPtrLeaderAndISRRequest returns a pointer to a default LeaderAndISRRequest
  7810  // This is a shortcut for creating a new(struct) and calling Default yourself.
  7811  func NewPtrLeaderAndISRRequest() *LeaderAndISRRequest {
  7812  	var v LeaderAndISRRequest
  7813  	v.Default()
  7814  	return &v
  7815  }
  7816  
  7817  // Default sets any default fields. Calling this allows for future compatibility
  7818  // if new fields are added to LeaderAndISRRequest.
  7819  func (v *LeaderAndISRRequest) Default() {
  7820  	v.BrokerEpoch = -1
  7821  }
  7822  
  7823  // NewLeaderAndISRRequest returns a default LeaderAndISRRequest
  7824  // This is a shortcut for creating a struct and calling Default yourself.
  7825  func NewLeaderAndISRRequest() LeaderAndISRRequest {
  7826  	var v LeaderAndISRRequest
  7827  	v.Default()
  7828  	return v
  7829  }
  7830  
  7831  type LeaderAndISRResponseTopic struct {
  7832  	TopicID [16]byte
  7833  
  7834  	Partitions []LeaderAndISRResponseTopicPartition
  7835  
  7836  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  7837  	UnknownTags Tags // v4+
  7838  }
  7839  
  7840  // Default sets any default fields. Calling this allows for future compatibility
  7841  // if new fields are added to LeaderAndISRResponseTopic.
  7842  func (v *LeaderAndISRResponseTopic) Default() {
  7843  }
  7844  
  7845  // NewLeaderAndISRResponseTopic returns a default LeaderAndISRResponseTopic
  7846  // This is a shortcut for creating a struct and calling Default yourself.
  7847  func NewLeaderAndISRResponseTopic() LeaderAndISRResponseTopic {
  7848  	var v LeaderAndISRResponseTopic
  7849  	v.Default()
  7850  	return v
  7851  }
  7852  
  7853  // LeaderAndISRResponse is returned from a LeaderAndISRRequest.
  7854  type LeaderAndISRResponse struct {
  7855  	// Version is the version of this message used with a Kafka broker.
  7856  	Version int16
  7857  
  7858  	ErrorCode int16
  7859  
  7860  	Partitions []LeaderAndISRResponseTopicPartition // v0-v4
  7861  
  7862  	Topics []LeaderAndISRResponseTopic // v5+
  7863  
  7864  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  7865  	UnknownTags Tags // v4+
  7866  }
  7867  
  7868  func (*LeaderAndISRResponse) Key() int16                 { return 4 }
  7869  func (*LeaderAndISRResponse) MaxVersion() int16          { return 7 }
  7870  func (v *LeaderAndISRResponse) SetVersion(version int16) { v.Version = version }
  7871  func (v *LeaderAndISRResponse) GetVersion() int16        { return v.Version }
  7872  func (v *LeaderAndISRResponse) IsFlexible() bool         { return v.Version >= 4 }
  7873  func (v *LeaderAndISRResponse) RequestKind() Request     { return &LeaderAndISRRequest{Version: v.Version} }
  7874  
  7875  func (v *LeaderAndISRResponse) AppendTo(dst []byte) []byte {
  7876  	version := v.Version
  7877  	_ = version
  7878  	isFlexible := version >= 4
  7879  	_ = isFlexible
  7880  	{
  7881  		v := v.ErrorCode
  7882  		dst = kbin.AppendInt16(dst, v)
  7883  	}
  7884  	if version >= 0 && version <= 4 {
  7885  		v := v.Partitions
  7886  		if isFlexible {
  7887  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  7888  		} else {
  7889  			dst = kbin.AppendArrayLen(dst, len(v))
  7890  		}
  7891  		for i := range v {
  7892  			v := &v[i]
  7893  			if version >= 0 && version <= 4 {
  7894  				v := v.Topic
  7895  				if isFlexible {
  7896  					dst = kbin.AppendCompactString(dst, v)
  7897  				} else {
  7898  					dst = kbin.AppendString(dst, v)
  7899  				}
  7900  			}
  7901  			{
  7902  				v := v.Partition
  7903  				dst = kbin.AppendInt32(dst, v)
  7904  			}
  7905  			{
  7906  				v := v.ErrorCode
  7907  				dst = kbin.AppendInt16(dst, v)
  7908  			}
  7909  			if isFlexible {
  7910  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7911  				dst = v.UnknownTags.AppendEach(dst)
  7912  			}
  7913  		}
  7914  	}
  7915  	if version >= 5 {
  7916  		v := v.Topics
  7917  		if isFlexible {
  7918  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  7919  		} else {
  7920  			dst = kbin.AppendArrayLen(dst, len(v))
  7921  		}
  7922  		for i := range v {
  7923  			v := &v[i]
  7924  			{
  7925  				v := v.TopicID
  7926  				dst = kbin.AppendUuid(dst, v)
  7927  			}
  7928  			{
  7929  				v := v.Partitions
  7930  				if isFlexible {
  7931  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  7932  				} else {
  7933  					dst = kbin.AppendArrayLen(dst, len(v))
  7934  				}
  7935  				for i := range v {
  7936  					v := &v[i]
  7937  					if version >= 0 && version <= 4 {
  7938  						v := v.Topic
  7939  						if isFlexible {
  7940  							dst = kbin.AppendCompactString(dst, v)
  7941  						} else {
  7942  							dst = kbin.AppendString(dst, v)
  7943  						}
  7944  					}
  7945  					{
  7946  						v := v.Partition
  7947  						dst = kbin.AppendInt32(dst, v)
  7948  					}
  7949  					{
  7950  						v := v.ErrorCode
  7951  						dst = kbin.AppendInt16(dst, v)
  7952  					}
  7953  					if isFlexible {
  7954  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7955  						dst = v.UnknownTags.AppendEach(dst)
  7956  					}
  7957  				}
  7958  			}
  7959  			if isFlexible {
  7960  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7961  				dst = v.UnknownTags.AppendEach(dst)
  7962  			}
  7963  		}
  7964  	}
  7965  	if isFlexible {
  7966  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  7967  		dst = v.UnknownTags.AppendEach(dst)
  7968  	}
  7969  	return dst
  7970  }
  7971  
  7972  func (v *LeaderAndISRResponse) ReadFrom(src []byte) error {
  7973  	return v.readFrom(src, false)
  7974  }
  7975  
  7976  func (v *LeaderAndISRResponse) UnsafeReadFrom(src []byte) error {
  7977  	return v.readFrom(src, true)
  7978  }
  7979  
  7980  func (v *LeaderAndISRResponse) readFrom(src []byte, unsafe bool) error {
  7981  	v.Default()
  7982  	b := kbin.Reader{Src: src}
  7983  	version := v.Version
  7984  	_ = version
  7985  	isFlexible := version >= 4
  7986  	_ = isFlexible
  7987  	s := v
  7988  	{
  7989  		v := b.Int16()
  7990  		s.ErrorCode = v
  7991  	}
  7992  	if version >= 0 && version <= 4 {
  7993  		v := s.Partitions
  7994  		a := v
  7995  		var l int32
  7996  		if isFlexible {
  7997  			l = b.CompactArrayLen()
  7998  		} else {
  7999  			l = b.ArrayLen()
  8000  		}
  8001  		if !b.Ok() {
  8002  			return b.Complete()
  8003  		}
  8004  		a = a[:0]
  8005  		if l > 0 {
  8006  			a = append(a, make([]LeaderAndISRResponseTopicPartition, l)...)
  8007  		}
  8008  		for i := int32(0); i < l; i++ {
  8009  			v := &a[i]
  8010  			v.Default()
  8011  			s := v
  8012  			if version >= 0 && version <= 4 {
  8013  				var v string
  8014  				if unsafe {
  8015  					if isFlexible {
  8016  						v = b.UnsafeCompactString()
  8017  					} else {
  8018  						v = b.UnsafeString()
  8019  					}
  8020  				} else {
  8021  					if isFlexible {
  8022  						v = b.CompactString()
  8023  					} else {
  8024  						v = b.String()
  8025  					}
  8026  				}
  8027  				s.Topic = v
  8028  			}
  8029  			{
  8030  				v := b.Int32()
  8031  				s.Partition = v
  8032  			}
  8033  			{
  8034  				v := b.Int16()
  8035  				s.ErrorCode = v
  8036  			}
  8037  			if isFlexible {
  8038  				s.UnknownTags = internalReadTags(&b)
  8039  			}
  8040  		}
  8041  		v = a
  8042  		s.Partitions = v
  8043  	}
  8044  	if version >= 5 {
  8045  		v := s.Topics
  8046  		a := v
  8047  		var l int32
  8048  		if isFlexible {
  8049  			l = b.CompactArrayLen()
  8050  		} else {
  8051  			l = b.ArrayLen()
  8052  		}
  8053  		if !b.Ok() {
  8054  			return b.Complete()
  8055  		}
  8056  		a = a[:0]
  8057  		if l > 0 {
  8058  			a = append(a, make([]LeaderAndISRResponseTopic, l)...)
  8059  		}
  8060  		for i := int32(0); i < l; i++ {
  8061  			v := &a[i]
  8062  			v.Default()
  8063  			s := v
  8064  			{
  8065  				v := b.Uuid()
  8066  				s.TopicID = v
  8067  			}
  8068  			{
  8069  				v := s.Partitions
  8070  				a := v
  8071  				var l int32
  8072  				if isFlexible {
  8073  					l = b.CompactArrayLen()
  8074  				} else {
  8075  					l = b.ArrayLen()
  8076  				}
  8077  				if !b.Ok() {
  8078  					return b.Complete()
  8079  				}
  8080  				a = a[:0]
  8081  				if l > 0 {
  8082  					a = append(a, make([]LeaderAndISRResponseTopicPartition, l)...)
  8083  				}
  8084  				for i := int32(0); i < l; i++ {
  8085  					v := &a[i]
  8086  					v.Default()
  8087  					s := v
  8088  					if version >= 0 && version <= 4 {
  8089  						var v string
  8090  						if unsafe {
  8091  							if isFlexible {
  8092  								v = b.UnsafeCompactString()
  8093  							} else {
  8094  								v = b.UnsafeString()
  8095  							}
  8096  						} else {
  8097  							if isFlexible {
  8098  								v = b.CompactString()
  8099  							} else {
  8100  								v = b.String()
  8101  							}
  8102  						}
  8103  						s.Topic = v
  8104  					}
  8105  					{
  8106  						v := b.Int32()
  8107  						s.Partition = v
  8108  					}
  8109  					{
  8110  						v := b.Int16()
  8111  						s.ErrorCode = v
  8112  					}
  8113  					if isFlexible {
  8114  						s.UnknownTags = internalReadTags(&b)
  8115  					}
  8116  				}
  8117  				v = a
  8118  				s.Partitions = v
  8119  			}
  8120  			if isFlexible {
  8121  				s.UnknownTags = internalReadTags(&b)
  8122  			}
  8123  		}
  8124  		v = a
  8125  		s.Topics = v
  8126  	}
  8127  	if isFlexible {
  8128  		s.UnknownTags = internalReadTags(&b)
  8129  	}
  8130  	return b.Complete()
  8131  }
  8132  
  8133  // NewPtrLeaderAndISRResponse returns a pointer to a default LeaderAndISRResponse
  8134  // This is a shortcut for creating a new(struct) and calling Default yourself.
  8135  func NewPtrLeaderAndISRResponse() *LeaderAndISRResponse {
  8136  	var v LeaderAndISRResponse
  8137  	v.Default()
  8138  	return &v
  8139  }
  8140  
  8141  // Default sets any default fields. Calling this allows for future compatibility
  8142  // if new fields are added to LeaderAndISRResponse.
  8143  func (v *LeaderAndISRResponse) Default() {
  8144  }
  8145  
  8146  // NewLeaderAndISRResponse returns a default LeaderAndISRResponse
  8147  // This is a shortcut for creating a struct and calling Default yourself.
  8148  func NewLeaderAndISRResponse() LeaderAndISRResponse {
  8149  	var v LeaderAndISRResponse
  8150  	v.Default()
  8151  	return v
  8152  }
  8153  
  8154  type StopReplicaRequestTopicPartitionState struct {
  8155  	Partition int32
  8156  
  8157  	// This field has a default of -1.
  8158  	LeaderEpoch int32
  8159  
  8160  	Delete bool
  8161  
  8162  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8163  	UnknownTags Tags // v2+
  8164  }
  8165  
  8166  // Default sets any default fields. Calling this allows for future compatibility
  8167  // if new fields are added to StopReplicaRequestTopicPartitionState.
  8168  func (v *StopReplicaRequestTopicPartitionState) Default() {
  8169  	v.LeaderEpoch = -1
  8170  }
  8171  
  8172  // NewStopReplicaRequestTopicPartitionState returns a default StopReplicaRequestTopicPartitionState
  8173  // This is a shortcut for creating a struct and calling Default yourself.
  8174  func NewStopReplicaRequestTopicPartitionState() StopReplicaRequestTopicPartitionState {
  8175  	var v StopReplicaRequestTopicPartitionState
  8176  	v.Default()
  8177  	return v
  8178  }
  8179  
  8180  type StopReplicaRequestTopic struct {
  8181  	Topic string
  8182  
  8183  	Partition int32
  8184  
  8185  	Partitions []int32 // v1-v2
  8186  
  8187  	PartitionStates []StopReplicaRequestTopicPartitionState // v3+
  8188  
  8189  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8190  	UnknownTags Tags // v2+
  8191  }
  8192  
  8193  // Default sets any default fields. Calling this allows for future compatibility
  8194  // if new fields are added to StopReplicaRequestTopic.
  8195  func (v *StopReplicaRequestTopic) Default() {
  8196  }
  8197  
  8198  // NewStopReplicaRequestTopic returns a default StopReplicaRequestTopic
  8199  // This is a shortcut for creating a struct and calling Default yourself.
  8200  func NewStopReplicaRequestTopic() StopReplicaRequestTopic {
  8201  	var v StopReplicaRequestTopic
  8202  	v.Default()
  8203  	return v
  8204  }
  8205  
  8206  // StopReplicaRequest is an advanced request that brokers use to stop replicas.
  8207  //
  8208  // As this is an advanced request and there is little reason to issue it as a
  8209  // client, this request is undocumented.
  8210  //
  8211  // Kafka 2.2 introduced version 1, proposed in KIP-380, which changed the
  8212  // layout of the struct to be more memory efficient.
  8213  //
  8214  // Kafka 2.6 introduced version 3, proposed in KIP-570, reorganizes partitions
  8215  // to be stored and adds the leader epoch and delete partition fields per partition.
  8216  // Kafka 3.4 introduced version 4 with KIP-866.
  8217  type StopReplicaRequest struct {
  8218  	// Version is the version of this message used with a Kafka broker.
  8219  	Version int16
  8220  
  8221  	ControllerID int32
  8222  
  8223  	ControllerEpoch int32
  8224  
  8225  	// If KRaft controller id is used during migration. See KIP-866.
  8226  	IsKRaftController bool // v4+
  8227  
  8228  	// This field has a default of -1.
  8229  	BrokerEpoch int64 // v1+
  8230  
  8231  	DeletePartitions bool // v0-v2
  8232  
  8233  	Topics []StopReplicaRequestTopic
  8234  
  8235  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8236  	UnknownTags Tags // v2+
  8237  }
  8238  
  8239  func (*StopReplicaRequest) Key() int16                 { return 5 }
  8240  func (*StopReplicaRequest) MaxVersion() int16          { return 4 }
  8241  func (v *StopReplicaRequest) SetVersion(version int16) { v.Version = version }
  8242  func (v *StopReplicaRequest) GetVersion() int16        { return v.Version }
  8243  func (v *StopReplicaRequest) IsFlexible() bool         { return v.Version >= 2 }
  8244  func (v *StopReplicaRequest) ResponseKind() Response {
  8245  	r := &StopReplicaResponse{Version: v.Version}
  8246  	r.Default()
  8247  	return r
  8248  }
  8249  
  8250  // RequestWith is requests v on r and returns the response or an error.
  8251  // For sharded requests, the response may be merged and still return an error.
  8252  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  8253  func (v *StopReplicaRequest) RequestWith(ctx context.Context, r Requestor) (*StopReplicaResponse, error) {
  8254  	kresp, err := r.Request(ctx, v)
  8255  	resp, _ := kresp.(*StopReplicaResponse)
  8256  	return resp, err
  8257  }
  8258  
  8259  func (v *StopReplicaRequest) AppendTo(dst []byte) []byte {
  8260  	version := v.Version
  8261  	_ = version
  8262  	isFlexible := version >= 2
  8263  	_ = isFlexible
  8264  	{
  8265  		v := v.ControllerID
  8266  		dst = kbin.AppendInt32(dst, v)
  8267  	}
  8268  	{
  8269  		v := v.ControllerEpoch
  8270  		dst = kbin.AppendInt32(dst, v)
  8271  	}
  8272  	if version >= 4 {
  8273  		v := v.IsKRaftController
  8274  		dst = kbin.AppendBool(dst, v)
  8275  	}
  8276  	if version >= 1 {
  8277  		v := v.BrokerEpoch
  8278  		dst = kbin.AppendInt64(dst, v)
  8279  	}
  8280  	if version >= 0 && version <= 2 {
  8281  		v := v.DeletePartitions
  8282  		dst = kbin.AppendBool(dst, v)
  8283  	}
  8284  	{
  8285  		v := v.Topics
  8286  		if isFlexible {
  8287  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  8288  		} else {
  8289  			dst = kbin.AppendArrayLen(dst, len(v))
  8290  		}
  8291  		for i := range v {
  8292  			v := &v[i]
  8293  			{
  8294  				v := v.Topic
  8295  				if isFlexible {
  8296  					dst = kbin.AppendCompactString(dst, v)
  8297  				} else {
  8298  					dst = kbin.AppendString(dst, v)
  8299  				}
  8300  			}
  8301  			if version >= 0 && version <= 0 {
  8302  				v := v.Partition
  8303  				dst = kbin.AppendInt32(dst, v)
  8304  			}
  8305  			if version >= 1 && version <= 2 {
  8306  				v := v.Partitions
  8307  				if isFlexible {
  8308  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  8309  				} else {
  8310  					dst = kbin.AppendArrayLen(dst, len(v))
  8311  				}
  8312  				for i := range v {
  8313  					v := v[i]
  8314  					dst = kbin.AppendInt32(dst, v)
  8315  				}
  8316  			}
  8317  			if version >= 3 {
  8318  				v := v.PartitionStates
  8319  				if isFlexible {
  8320  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  8321  				} else {
  8322  					dst = kbin.AppendArrayLen(dst, len(v))
  8323  				}
  8324  				for i := range v {
  8325  					v := &v[i]
  8326  					{
  8327  						v := v.Partition
  8328  						dst = kbin.AppendInt32(dst, v)
  8329  					}
  8330  					{
  8331  						v := v.LeaderEpoch
  8332  						dst = kbin.AppendInt32(dst, v)
  8333  					}
  8334  					{
  8335  						v := v.Delete
  8336  						dst = kbin.AppendBool(dst, v)
  8337  					}
  8338  					if isFlexible {
  8339  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  8340  						dst = v.UnknownTags.AppendEach(dst)
  8341  					}
  8342  				}
  8343  			}
  8344  			if isFlexible {
  8345  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  8346  				dst = v.UnknownTags.AppendEach(dst)
  8347  			}
  8348  		}
  8349  	}
  8350  	if isFlexible {
  8351  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  8352  		dst = v.UnknownTags.AppendEach(dst)
  8353  	}
  8354  	return dst
  8355  }
  8356  
  8357  func (v *StopReplicaRequest) ReadFrom(src []byte) error {
  8358  	return v.readFrom(src, false)
  8359  }
  8360  
  8361  func (v *StopReplicaRequest) UnsafeReadFrom(src []byte) error {
  8362  	return v.readFrom(src, true)
  8363  }
  8364  
  8365  func (v *StopReplicaRequest) readFrom(src []byte, unsafe bool) error {
  8366  	v.Default()
  8367  	b := kbin.Reader{Src: src}
  8368  	version := v.Version
  8369  	_ = version
  8370  	isFlexible := version >= 2
  8371  	_ = isFlexible
  8372  	s := v
  8373  	{
  8374  		v := b.Int32()
  8375  		s.ControllerID = v
  8376  	}
  8377  	{
  8378  		v := b.Int32()
  8379  		s.ControllerEpoch = v
  8380  	}
  8381  	if version >= 4 {
  8382  		v := b.Bool()
  8383  		s.IsKRaftController = v
  8384  	}
  8385  	if version >= 1 {
  8386  		v := b.Int64()
  8387  		s.BrokerEpoch = v
  8388  	}
  8389  	if version >= 0 && version <= 2 {
  8390  		v := b.Bool()
  8391  		s.DeletePartitions = v
  8392  	}
  8393  	{
  8394  		v := s.Topics
  8395  		a := v
  8396  		var l int32
  8397  		if isFlexible {
  8398  			l = b.CompactArrayLen()
  8399  		} else {
  8400  			l = b.ArrayLen()
  8401  		}
  8402  		if !b.Ok() {
  8403  			return b.Complete()
  8404  		}
  8405  		a = a[:0]
  8406  		if l > 0 {
  8407  			a = append(a, make([]StopReplicaRequestTopic, l)...)
  8408  		}
  8409  		for i := int32(0); i < l; i++ {
  8410  			v := &a[i]
  8411  			v.Default()
  8412  			s := v
  8413  			{
  8414  				var v string
  8415  				if unsafe {
  8416  					if isFlexible {
  8417  						v = b.UnsafeCompactString()
  8418  					} else {
  8419  						v = b.UnsafeString()
  8420  					}
  8421  				} else {
  8422  					if isFlexible {
  8423  						v = b.CompactString()
  8424  					} else {
  8425  						v = b.String()
  8426  					}
  8427  				}
  8428  				s.Topic = v
  8429  			}
  8430  			if version >= 0 && version <= 0 {
  8431  				v := b.Int32()
  8432  				s.Partition = v
  8433  			}
  8434  			if version >= 1 && version <= 2 {
  8435  				v := s.Partitions
  8436  				a := v
  8437  				var l int32
  8438  				if isFlexible {
  8439  					l = b.CompactArrayLen()
  8440  				} else {
  8441  					l = b.ArrayLen()
  8442  				}
  8443  				if !b.Ok() {
  8444  					return b.Complete()
  8445  				}
  8446  				a = a[:0]
  8447  				if l > 0 {
  8448  					a = append(a, make([]int32, l)...)
  8449  				}
  8450  				for i := int32(0); i < l; i++ {
  8451  					v := b.Int32()
  8452  					a[i] = v
  8453  				}
  8454  				v = a
  8455  				s.Partitions = v
  8456  			}
  8457  			if version >= 3 {
  8458  				v := s.PartitionStates
  8459  				a := v
  8460  				var l int32
  8461  				if isFlexible {
  8462  					l = b.CompactArrayLen()
  8463  				} else {
  8464  					l = b.ArrayLen()
  8465  				}
  8466  				if !b.Ok() {
  8467  					return b.Complete()
  8468  				}
  8469  				a = a[:0]
  8470  				if l > 0 {
  8471  					a = append(a, make([]StopReplicaRequestTopicPartitionState, l)...)
  8472  				}
  8473  				for i := int32(0); i < l; i++ {
  8474  					v := &a[i]
  8475  					v.Default()
  8476  					s := v
  8477  					{
  8478  						v := b.Int32()
  8479  						s.Partition = v
  8480  					}
  8481  					{
  8482  						v := b.Int32()
  8483  						s.LeaderEpoch = v
  8484  					}
  8485  					{
  8486  						v := b.Bool()
  8487  						s.Delete = v
  8488  					}
  8489  					if isFlexible {
  8490  						s.UnknownTags = internalReadTags(&b)
  8491  					}
  8492  				}
  8493  				v = a
  8494  				s.PartitionStates = v
  8495  			}
  8496  			if isFlexible {
  8497  				s.UnknownTags = internalReadTags(&b)
  8498  			}
  8499  		}
  8500  		v = a
  8501  		s.Topics = v
  8502  	}
  8503  	if isFlexible {
  8504  		s.UnknownTags = internalReadTags(&b)
  8505  	}
  8506  	return b.Complete()
  8507  }
  8508  
  8509  // NewPtrStopReplicaRequest returns a pointer to a default StopReplicaRequest
  8510  // This is a shortcut for creating a new(struct) and calling Default yourself.
  8511  func NewPtrStopReplicaRequest() *StopReplicaRequest {
  8512  	var v StopReplicaRequest
  8513  	v.Default()
  8514  	return &v
  8515  }
  8516  
  8517  // Default sets any default fields. Calling this allows for future compatibility
  8518  // if new fields are added to StopReplicaRequest.
  8519  func (v *StopReplicaRequest) Default() {
  8520  	v.BrokerEpoch = -1
  8521  }
  8522  
  8523  // NewStopReplicaRequest returns a default StopReplicaRequest
  8524  // This is a shortcut for creating a struct and calling Default yourself.
  8525  func NewStopReplicaRequest() StopReplicaRequest {
  8526  	var v StopReplicaRequest
  8527  	v.Default()
  8528  	return v
  8529  }
  8530  
  8531  type StopReplicaResponsePartition struct {
  8532  	Topic string
  8533  
  8534  	Partition int32
  8535  
  8536  	ErrorCode int16
  8537  
  8538  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8539  	UnknownTags Tags // v2+
  8540  }
  8541  
  8542  // Default sets any default fields. Calling this allows for future compatibility
  8543  // if new fields are added to StopReplicaResponsePartition.
  8544  func (v *StopReplicaResponsePartition) Default() {
  8545  }
  8546  
  8547  // NewStopReplicaResponsePartition returns a default StopReplicaResponsePartition
  8548  // This is a shortcut for creating a struct and calling Default yourself.
  8549  func NewStopReplicaResponsePartition() StopReplicaResponsePartition {
  8550  	var v StopReplicaResponsePartition
  8551  	v.Default()
  8552  	return v
  8553  }
  8554  
  8555  // StopReplicasResponse is returned from a StopReplicasRequest.
  8556  type StopReplicaResponse struct {
  8557  	// Version is the version of this message used with a Kafka broker.
  8558  	Version int16
  8559  
  8560  	// Version 3 returns FENCED_LEADER_EPOCH if the leader is stale (KIP-570).
  8561  	ErrorCode int16
  8562  
  8563  	Partitions []StopReplicaResponsePartition
  8564  
  8565  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8566  	UnknownTags Tags // v2+
  8567  }
  8568  
  8569  func (*StopReplicaResponse) Key() int16                 { return 5 }
  8570  func (*StopReplicaResponse) MaxVersion() int16          { return 4 }
  8571  func (v *StopReplicaResponse) SetVersion(version int16) { v.Version = version }
  8572  func (v *StopReplicaResponse) GetVersion() int16        { return v.Version }
  8573  func (v *StopReplicaResponse) IsFlexible() bool         { return v.Version >= 2 }
  8574  func (v *StopReplicaResponse) RequestKind() Request     { return &StopReplicaRequest{Version: v.Version} }
  8575  
  8576  func (v *StopReplicaResponse) AppendTo(dst []byte) []byte {
  8577  	version := v.Version
  8578  	_ = version
  8579  	isFlexible := version >= 2
  8580  	_ = isFlexible
  8581  	{
  8582  		v := v.ErrorCode
  8583  		dst = kbin.AppendInt16(dst, v)
  8584  	}
  8585  	{
  8586  		v := v.Partitions
  8587  		if isFlexible {
  8588  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  8589  		} else {
  8590  			dst = kbin.AppendArrayLen(dst, len(v))
  8591  		}
  8592  		for i := range v {
  8593  			v := &v[i]
  8594  			{
  8595  				v := v.Topic
  8596  				if isFlexible {
  8597  					dst = kbin.AppendCompactString(dst, v)
  8598  				} else {
  8599  					dst = kbin.AppendString(dst, v)
  8600  				}
  8601  			}
  8602  			{
  8603  				v := v.Partition
  8604  				dst = kbin.AppendInt32(dst, v)
  8605  			}
  8606  			{
  8607  				v := v.ErrorCode
  8608  				dst = kbin.AppendInt16(dst, v)
  8609  			}
  8610  			if isFlexible {
  8611  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  8612  				dst = v.UnknownTags.AppendEach(dst)
  8613  			}
  8614  		}
  8615  	}
  8616  	if isFlexible {
  8617  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  8618  		dst = v.UnknownTags.AppendEach(dst)
  8619  	}
  8620  	return dst
  8621  }
  8622  
  8623  func (v *StopReplicaResponse) ReadFrom(src []byte) error {
  8624  	return v.readFrom(src, false)
  8625  }
  8626  
  8627  func (v *StopReplicaResponse) UnsafeReadFrom(src []byte) error {
  8628  	return v.readFrom(src, true)
  8629  }
  8630  
  8631  func (v *StopReplicaResponse) readFrom(src []byte, unsafe bool) error {
  8632  	v.Default()
  8633  	b := kbin.Reader{Src: src}
  8634  	version := v.Version
  8635  	_ = version
  8636  	isFlexible := version >= 2
  8637  	_ = isFlexible
  8638  	s := v
  8639  	{
  8640  		v := b.Int16()
  8641  		s.ErrorCode = v
  8642  	}
  8643  	{
  8644  		v := s.Partitions
  8645  		a := v
  8646  		var l int32
  8647  		if isFlexible {
  8648  			l = b.CompactArrayLen()
  8649  		} else {
  8650  			l = b.ArrayLen()
  8651  		}
  8652  		if !b.Ok() {
  8653  			return b.Complete()
  8654  		}
  8655  		a = a[:0]
  8656  		if l > 0 {
  8657  			a = append(a, make([]StopReplicaResponsePartition, l)...)
  8658  		}
  8659  		for i := int32(0); i < l; i++ {
  8660  			v := &a[i]
  8661  			v.Default()
  8662  			s := v
  8663  			{
  8664  				var v string
  8665  				if unsafe {
  8666  					if isFlexible {
  8667  						v = b.UnsafeCompactString()
  8668  					} else {
  8669  						v = b.UnsafeString()
  8670  					}
  8671  				} else {
  8672  					if isFlexible {
  8673  						v = b.CompactString()
  8674  					} else {
  8675  						v = b.String()
  8676  					}
  8677  				}
  8678  				s.Topic = v
  8679  			}
  8680  			{
  8681  				v := b.Int32()
  8682  				s.Partition = v
  8683  			}
  8684  			{
  8685  				v := b.Int16()
  8686  				s.ErrorCode = v
  8687  			}
  8688  			if isFlexible {
  8689  				s.UnknownTags = internalReadTags(&b)
  8690  			}
  8691  		}
  8692  		v = a
  8693  		s.Partitions = v
  8694  	}
  8695  	if isFlexible {
  8696  		s.UnknownTags = internalReadTags(&b)
  8697  	}
  8698  	return b.Complete()
  8699  }
  8700  
  8701  // NewPtrStopReplicaResponse returns a pointer to a default StopReplicaResponse
  8702  // This is a shortcut for creating a new(struct) and calling Default yourself.
  8703  func NewPtrStopReplicaResponse() *StopReplicaResponse {
  8704  	var v StopReplicaResponse
  8705  	v.Default()
  8706  	return &v
  8707  }
  8708  
  8709  // Default sets any default fields. Calling this allows for future compatibility
  8710  // if new fields are added to StopReplicaResponse.
  8711  func (v *StopReplicaResponse) Default() {
  8712  }
  8713  
  8714  // NewStopReplicaResponse returns a default StopReplicaResponse
  8715  // This is a shortcut for creating a struct and calling Default yourself.
  8716  func NewStopReplicaResponse() StopReplicaResponse {
  8717  	var v StopReplicaResponse
  8718  	v.Default()
  8719  	return v
  8720  }
  8721  
  8722  type UpdateMetadataRequestTopicPartition struct {
  8723  	Topic string // v0-v4
  8724  
  8725  	Partition int32
  8726  
  8727  	ControllerEpoch int32
  8728  
  8729  	Leader int32
  8730  
  8731  	LeaderEpoch int32
  8732  
  8733  	ISR []int32
  8734  
  8735  	ZKVersion int32
  8736  
  8737  	Replicas []int32
  8738  
  8739  	OfflineReplicas []int32 // v4+
  8740  
  8741  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8742  	UnknownTags Tags // v6+
  8743  }
  8744  
  8745  // Default sets any default fields. Calling this allows for future compatibility
  8746  // if new fields are added to UpdateMetadataRequestTopicPartition.
  8747  func (v *UpdateMetadataRequestTopicPartition) Default() {
  8748  }
  8749  
  8750  // NewUpdateMetadataRequestTopicPartition returns a default UpdateMetadataRequestTopicPartition
  8751  // This is a shortcut for creating a struct and calling Default yourself.
  8752  func NewUpdateMetadataRequestTopicPartition() UpdateMetadataRequestTopicPartition {
  8753  	var v UpdateMetadataRequestTopicPartition
  8754  	v.Default()
  8755  	return v
  8756  }
  8757  
  8758  type UpdateMetadataRequestTopicState struct {
  8759  	Topic string
  8760  
  8761  	TopicID [16]byte // v7+
  8762  
  8763  	PartitionStates []UpdateMetadataRequestTopicPartition
  8764  
  8765  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8766  	UnknownTags Tags // v6+
  8767  }
  8768  
  8769  // Default sets any default fields. Calling this allows for future compatibility
  8770  // if new fields are added to UpdateMetadataRequestTopicState.
  8771  func (v *UpdateMetadataRequestTopicState) Default() {
  8772  }
  8773  
  8774  // NewUpdateMetadataRequestTopicState returns a default UpdateMetadataRequestTopicState
  8775  // This is a shortcut for creating a struct and calling Default yourself.
  8776  func NewUpdateMetadataRequestTopicState() UpdateMetadataRequestTopicState {
  8777  	var v UpdateMetadataRequestTopicState
  8778  	v.Default()
  8779  	return v
  8780  }
  8781  
  8782  type UpdateMetadataRequestLiveBrokerEndpoint struct {
  8783  	Port int32
  8784  
  8785  	Host string
  8786  
  8787  	ListenerName string // v3+
  8788  
  8789  	SecurityProtocol int16
  8790  
  8791  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8792  	UnknownTags Tags // v6+
  8793  }
  8794  
  8795  // Default sets any default fields. Calling this allows for future compatibility
  8796  // if new fields are added to UpdateMetadataRequestLiveBrokerEndpoint.
  8797  func (v *UpdateMetadataRequestLiveBrokerEndpoint) Default() {
  8798  }
  8799  
  8800  // NewUpdateMetadataRequestLiveBrokerEndpoint returns a default UpdateMetadataRequestLiveBrokerEndpoint
  8801  // This is a shortcut for creating a struct and calling Default yourself.
  8802  func NewUpdateMetadataRequestLiveBrokerEndpoint() UpdateMetadataRequestLiveBrokerEndpoint {
  8803  	var v UpdateMetadataRequestLiveBrokerEndpoint
  8804  	v.Default()
  8805  	return v
  8806  }
  8807  
  8808  type UpdateMetadataRequestLiveBroker struct {
  8809  	ID int32
  8810  
  8811  	Host string
  8812  
  8813  	Port int32
  8814  
  8815  	Endpoints []UpdateMetadataRequestLiveBrokerEndpoint // v1+
  8816  
  8817  	Rack *string // v2+
  8818  
  8819  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8820  	UnknownTags Tags // v6+
  8821  }
  8822  
  8823  // Default sets any default fields. Calling this allows for future compatibility
  8824  // if new fields are added to UpdateMetadataRequestLiveBroker.
  8825  func (v *UpdateMetadataRequestLiveBroker) Default() {
  8826  }
  8827  
  8828  // NewUpdateMetadataRequestLiveBroker returns a default UpdateMetadataRequestLiveBroker
  8829  // This is a shortcut for creating a struct and calling Default yourself.
  8830  func NewUpdateMetadataRequestLiveBroker() UpdateMetadataRequestLiveBroker {
  8831  	var v UpdateMetadataRequestLiveBroker
  8832  	v.Default()
  8833  	return v
  8834  }
  8835  
  8836  // UpdateMetadataRequest is an advanced request that brokers use to
  8837  // issue metadata updates to each other.
  8838  //
  8839  // As this is an advanced request and there is little reason to issue it as a
  8840  // client, this request is undocumented.
  8841  //
  8842  // Version 1 changed the layout of the live brokers.
  8843  //
  8844  // Kafka 2.2 introduced version 5, proposed in KIP-380, which changed the
  8845  // layout of the struct to be more memory efficient.
  8846  // Kafka 3.4 introduced version 8 with KIP-866.
  8847  type UpdateMetadataRequest struct {
  8848  	// Version is the version of this message used with a Kafka broker.
  8849  	Version int16
  8850  
  8851  	ControllerID int32
  8852  
  8853  	// If KRaft controller id is used during migration. See KIP-866.
  8854  	IsKRaftController bool // v8+
  8855  
  8856  	ControllerEpoch int32
  8857  
  8858  	// This field has a default of -1.
  8859  	BrokerEpoch int64 // v5+
  8860  
  8861  	PartitionStates []UpdateMetadataRequestTopicPartition // v0-v4
  8862  
  8863  	TopicStates []UpdateMetadataRequestTopicState // v5+
  8864  
  8865  	LiveBrokers []UpdateMetadataRequestLiveBroker
  8866  
  8867  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  8868  	UnknownTags Tags // v6+
  8869  }
  8870  
  8871  func (*UpdateMetadataRequest) Key() int16                 { return 6 }
  8872  func (*UpdateMetadataRequest) MaxVersion() int16          { return 8 }
  8873  func (v *UpdateMetadataRequest) SetVersion(version int16) { v.Version = version }
  8874  func (v *UpdateMetadataRequest) GetVersion() int16        { return v.Version }
  8875  func (v *UpdateMetadataRequest) IsFlexible() bool         { return v.Version >= 6 }
  8876  func (v *UpdateMetadataRequest) ResponseKind() Response {
  8877  	r := &UpdateMetadataResponse{Version: v.Version}
  8878  	r.Default()
  8879  	return r
  8880  }
  8881  
  8882  // RequestWith is requests v on r and returns the response or an error.
  8883  // For sharded requests, the response may be merged and still return an error.
  8884  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  8885  func (v *UpdateMetadataRequest) RequestWith(ctx context.Context, r Requestor) (*UpdateMetadataResponse, error) {
  8886  	kresp, err := r.Request(ctx, v)
  8887  	resp, _ := kresp.(*UpdateMetadataResponse)
  8888  	return resp, err
  8889  }
  8890  
  8891  func (v *UpdateMetadataRequest) AppendTo(dst []byte) []byte {
  8892  	version := v.Version
  8893  	_ = version
  8894  	isFlexible := version >= 6
  8895  	_ = isFlexible
  8896  	{
  8897  		v := v.ControllerID
  8898  		dst = kbin.AppendInt32(dst, v)
  8899  	}
  8900  	if version >= 8 {
  8901  		v := v.IsKRaftController
  8902  		dst = kbin.AppendBool(dst, v)
  8903  	}
  8904  	{
  8905  		v := v.ControllerEpoch
  8906  		dst = kbin.AppendInt32(dst, v)
  8907  	}
  8908  	if version >= 5 {
  8909  		v := v.BrokerEpoch
  8910  		dst = kbin.AppendInt64(dst, v)
  8911  	}
  8912  	if version >= 0 && version <= 4 {
  8913  		v := v.PartitionStates
  8914  		if isFlexible {
  8915  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  8916  		} else {
  8917  			dst = kbin.AppendArrayLen(dst, len(v))
  8918  		}
  8919  		for i := range v {
  8920  			v := &v[i]
  8921  			if version >= 0 && version <= 4 {
  8922  				v := v.Topic
  8923  				if isFlexible {
  8924  					dst = kbin.AppendCompactString(dst, v)
  8925  				} else {
  8926  					dst = kbin.AppendString(dst, v)
  8927  				}
  8928  			}
  8929  			{
  8930  				v := v.Partition
  8931  				dst = kbin.AppendInt32(dst, v)
  8932  			}
  8933  			{
  8934  				v := v.ControllerEpoch
  8935  				dst = kbin.AppendInt32(dst, v)
  8936  			}
  8937  			{
  8938  				v := v.Leader
  8939  				dst = kbin.AppendInt32(dst, v)
  8940  			}
  8941  			{
  8942  				v := v.LeaderEpoch
  8943  				dst = kbin.AppendInt32(dst, v)
  8944  			}
  8945  			{
  8946  				v := v.ISR
  8947  				if isFlexible {
  8948  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  8949  				} else {
  8950  					dst = kbin.AppendArrayLen(dst, len(v))
  8951  				}
  8952  				for i := range v {
  8953  					v := v[i]
  8954  					dst = kbin.AppendInt32(dst, v)
  8955  				}
  8956  			}
  8957  			{
  8958  				v := v.ZKVersion
  8959  				dst = kbin.AppendInt32(dst, v)
  8960  			}
  8961  			{
  8962  				v := v.Replicas
  8963  				if isFlexible {
  8964  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  8965  				} else {
  8966  					dst = kbin.AppendArrayLen(dst, len(v))
  8967  				}
  8968  				for i := range v {
  8969  					v := v[i]
  8970  					dst = kbin.AppendInt32(dst, v)
  8971  				}
  8972  			}
  8973  			if version >= 4 {
  8974  				v := v.OfflineReplicas
  8975  				if isFlexible {
  8976  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  8977  				} else {
  8978  					dst = kbin.AppendArrayLen(dst, len(v))
  8979  				}
  8980  				for i := range v {
  8981  					v := v[i]
  8982  					dst = kbin.AppendInt32(dst, v)
  8983  				}
  8984  			}
  8985  			if isFlexible {
  8986  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  8987  				dst = v.UnknownTags.AppendEach(dst)
  8988  			}
  8989  		}
  8990  	}
  8991  	if version >= 5 {
  8992  		v := v.TopicStates
  8993  		if isFlexible {
  8994  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  8995  		} else {
  8996  			dst = kbin.AppendArrayLen(dst, len(v))
  8997  		}
  8998  		for i := range v {
  8999  			v := &v[i]
  9000  			{
  9001  				v := v.Topic
  9002  				if isFlexible {
  9003  					dst = kbin.AppendCompactString(dst, v)
  9004  				} else {
  9005  					dst = kbin.AppendString(dst, v)
  9006  				}
  9007  			}
  9008  			if version >= 7 {
  9009  				v := v.TopicID
  9010  				dst = kbin.AppendUuid(dst, v)
  9011  			}
  9012  			{
  9013  				v := v.PartitionStates
  9014  				if isFlexible {
  9015  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  9016  				} else {
  9017  					dst = kbin.AppendArrayLen(dst, len(v))
  9018  				}
  9019  				for i := range v {
  9020  					v := &v[i]
  9021  					if version >= 0 && version <= 4 {
  9022  						v := v.Topic
  9023  						if isFlexible {
  9024  							dst = kbin.AppendCompactString(dst, v)
  9025  						} else {
  9026  							dst = kbin.AppendString(dst, v)
  9027  						}
  9028  					}
  9029  					{
  9030  						v := v.Partition
  9031  						dst = kbin.AppendInt32(dst, v)
  9032  					}
  9033  					{
  9034  						v := v.ControllerEpoch
  9035  						dst = kbin.AppendInt32(dst, v)
  9036  					}
  9037  					{
  9038  						v := v.Leader
  9039  						dst = kbin.AppendInt32(dst, v)
  9040  					}
  9041  					{
  9042  						v := v.LeaderEpoch
  9043  						dst = kbin.AppendInt32(dst, v)
  9044  					}
  9045  					{
  9046  						v := v.ISR
  9047  						if isFlexible {
  9048  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  9049  						} else {
  9050  							dst = kbin.AppendArrayLen(dst, len(v))
  9051  						}
  9052  						for i := range v {
  9053  							v := v[i]
  9054  							dst = kbin.AppendInt32(dst, v)
  9055  						}
  9056  					}
  9057  					{
  9058  						v := v.ZKVersion
  9059  						dst = kbin.AppendInt32(dst, v)
  9060  					}
  9061  					{
  9062  						v := v.Replicas
  9063  						if isFlexible {
  9064  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  9065  						} else {
  9066  							dst = kbin.AppendArrayLen(dst, len(v))
  9067  						}
  9068  						for i := range v {
  9069  							v := v[i]
  9070  							dst = kbin.AppendInt32(dst, v)
  9071  						}
  9072  					}
  9073  					if version >= 4 {
  9074  						v := v.OfflineReplicas
  9075  						if isFlexible {
  9076  							dst = kbin.AppendCompactArrayLen(dst, len(v))
  9077  						} else {
  9078  							dst = kbin.AppendArrayLen(dst, len(v))
  9079  						}
  9080  						for i := range v {
  9081  							v := v[i]
  9082  							dst = kbin.AppendInt32(dst, v)
  9083  						}
  9084  					}
  9085  					if isFlexible {
  9086  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9087  						dst = v.UnknownTags.AppendEach(dst)
  9088  					}
  9089  				}
  9090  			}
  9091  			if isFlexible {
  9092  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9093  				dst = v.UnknownTags.AppendEach(dst)
  9094  			}
  9095  		}
  9096  	}
  9097  	{
  9098  		v := v.LiveBrokers
  9099  		if isFlexible {
  9100  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  9101  		} else {
  9102  			dst = kbin.AppendArrayLen(dst, len(v))
  9103  		}
  9104  		for i := range v {
  9105  			v := &v[i]
  9106  			{
  9107  				v := v.ID
  9108  				dst = kbin.AppendInt32(dst, v)
  9109  			}
  9110  			if version >= 0 && version <= 0 {
  9111  				v := v.Host
  9112  				if isFlexible {
  9113  					dst = kbin.AppendCompactString(dst, v)
  9114  				} else {
  9115  					dst = kbin.AppendString(dst, v)
  9116  				}
  9117  			}
  9118  			if version >= 0 && version <= 0 {
  9119  				v := v.Port
  9120  				dst = kbin.AppendInt32(dst, v)
  9121  			}
  9122  			if version >= 1 {
  9123  				v := v.Endpoints
  9124  				if isFlexible {
  9125  					dst = kbin.AppendCompactArrayLen(dst, len(v))
  9126  				} else {
  9127  					dst = kbin.AppendArrayLen(dst, len(v))
  9128  				}
  9129  				for i := range v {
  9130  					v := &v[i]
  9131  					{
  9132  						v := v.Port
  9133  						dst = kbin.AppendInt32(dst, v)
  9134  					}
  9135  					{
  9136  						v := v.Host
  9137  						if isFlexible {
  9138  							dst = kbin.AppendCompactString(dst, v)
  9139  						} else {
  9140  							dst = kbin.AppendString(dst, v)
  9141  						}
  9142  					}
  9143  					if version >= 3 {
  9144  						v := v.ListenerName
  9145  						if isFlexible {
  9146  							dst = kbin.AppendCompactString(dst, v)
  9147  						} else {
  9148  							dst = kbin.AppendString(dst, v)
  9149  						}
  9150  					}
  9151  					{
  9152  						v := v.SecurityProtocol
  9153  						dst = kbin.AppendInt16(dst, v)
  9154  					}
  9155  					if isFlexible {
  9156  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9157  						dst = v.UnknownTags.AppendEach(dst)
  9158  					}
  9159  				}
  9160  			}
  9161  			if version >= 2 {
  9162  				v := v.Rack
  9163  				if isFlexible {
  9164  					dst = kbin.AppendCompactNullableString(dst, v)
  9165  				} else {
  9166  					dst = kbin.AppendNullableString(dst, v)
  9167  				}
  9168  			}
  9169  			if isFlexible {
  9170  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9171  				dst = v.UnknownTags.AppendEach(dst)
  9172  			}
  9173  		}
  9174  	}
  9175  	if isFlexible {
  9176  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9177  		dst = v.UnknownTags.AppendEach(dst)
  9178  	}
  9179  	return dst
  9180  }
  9181  
  9182  func (v *UpdateMetadataRequest) ReadFrom(src []byte) error {
  9183  	return v.readFrom(src, false)
  9184  }
  9185  
  9186  func (v *UpdateMetadataRequest) UnsafeReadFrom(src []byte) error {
  9187  	return v.readFrom(src, true)
  9188  }
  9189  
  9190  func (v *UpdateMetadataRequest) readFrom(src []byte, unsafe bool) error {
  9191  	v.Default()
  9192  	b := kbin.Reader{Src: src}
  9193  	version := v.Version
  9194  	_ = version
  9195  	isFlexible := version >= 6
  9196  	_ = isFlexible
  9197  	s := v
  9198  	{
  9199  		v := b.Int32()
  9200  		s.ControllerID = v
  9201  	}
  9202  	if version >= 8 {
  9203  		v := b.Bool()
  9204  		s.IsKRaftController = v
  9205  	}
  9206  	{
  9207  		v := b.Int32()
  9208  		s.ControllerEpoch = v
  9209  	}
  9210  	if version >= 5 {
  9211  		v := b.Int64()
  9212  		s.BrokerEpoch = v
  9213  	}
  9214  	if version >= 0 && version <= 4 {
  9215  		v := s.PartitionStates
  9216  		a := v
  9217  		var l int32
  9218  		if isFlexible {
  9219  			l = b.CompactArrayLen()
  9220  		} else {
  9221  			l = b.ArrayLen()
  9222  		}
  9223  		if !b.Ok() {
  9224  			return b.Complete()
  9225  		}
  9226  		a = a[:0]
  9227  		if l > 0 {
  9228  			a = append(a, make([]UpdateMetadataRequestTopicPartition, l)...)
  9229  		}
  9230  		for i := int32(0); i < l; i++ {
  9231  			v := &a[i]
  9232  			v.Default()
  9233  			s := v
  9234  			if version >= 0 && version <= 4 {
  9235  				var v string
  9236  				if unsafe {
  9237  					if isFlexible {
  9238  						v = b.UnsafeCompactString()
  9239  					} else {
  9240  						v = b.UnsafeString()
  9241  					}
  9242  				} else {
  9243  					if isFlexible {
  9244  						v = b.CompactString()
  9245  					} else {
  9246  						v = b.String()
  9247  					}
  9248  				}
  9249  				s.Topic = v
  9250  			}
  9251  			{
  9252  				v := b.Int32()
  9253  				s.Partition = v
  9254  			}
  9255  			{
  9256  				v := b.Int32()
  9257  				s.ControllerEpoch = v
  9258  			}
  9259  			{
  9260  				v := b.Int32()
  9261  				s.Leader = v
  9262  			}
  9263  			{
  9264  				v := b.Int32()
  9265  				s.LeaderEpoch = v
  9266  			}
  9267  			{
  9268  				v := s.ISR
  9269  				a := v
  9270  				var l int32
  9271  				if isFlexible {
  9272  					l = b.CompactArrayLen()
  9273  				} else {
  9274  					l = b.ArrayLen()
  9275  				}
  9276  				if !b.Ok() {
  9277  					return b.Complete()
  9278  				}
  9279  				a = a[:0]
  9280  				if l > 0 {
  9281  					a = append(a, make([]int32, l)...)
  9282  				}
  9283  				for i := int32(0); i < l; i++ {
  9284  					v := b.Int32()
  9285  					a[i] = v
  9286  				}
  9287  				v = a
  9288  				s.ISR = v
  9289  			}
  9290  			{
  9291  				v := b.Int32()
  9292  				s.ZKVersion = v
  9293  			}
  9294  			{
  9295  				v := s.Replicas
  9296  				a := v
  9297  				var l int32
  9298  				if isFlexible {
  9299  					l = b.CompactArrayLen()
  9300  				} else {
  9301  					l = b.ArrayLen()
  9302  				}
  9303  				if !b.Ok() {
  9304  					return b.Complete()
  9305  				}
  9306  				a = a[:0]
  9307  				if l > 0 {
  9308  					a = append(a, make([]int32, l)...)
  9309  				}
  9310  				for i := int32(0); i < l; i++ {
  9311  					v := b.Int32()
  9312  					a[i] = v
  9313  				}
  9314  				v = a
  9315  				s.Replicas = v
  9316  			}
  9317  			if version >= 4 {
  9318  				v := s.OfflineReplicas
  9319  				a := v
  9320  				var l int32
  9321  				if isFlexible {
  9322  					l = b.CompactArrayLen()
  9323  				} else {
  9324  					l = b.ArrayLen()
  9325  				}
  9326  				if !b.Ok() {
  9327  					return b.Complete()
  9328  				}
  9329  				a = a[:0]
  9330  				if l > 0 {
  9331  					a = append(a, make([]int32, l)...)
  9332  				}
  9333  				for i := int32(0); i < l; i++ {
  9334  					v := b.Int32()
  9335  					a[i] = v
  9336  				}
  9337  				v = a
  9338  				s.OfflineReplicas = v
  9339  			}
  9340  			if isFlexible {
  9341  				s.UnknownTags = internalReadTags(&b)
  9342  			}
  9343  		}
  9344  		v = a
  9345  		s.PartitionStates = v
  9346  	}
  9347  	if version >= 5 {
  9348  		v := s.TopicStates
  9349  		a := v
  9350  		var l int32
  9351  		if isFlexible {
  9352  			l = b.CompactArrayLen()
  9353  		} else {
  9354  			l = b.ArrayLen()
  9355  		}
  9356  		if !b.Ok() {
  9357  			return b.Complete()
  9358  		}
  9359  		a = a[:0]
  9360  		if l > 0 {
  9361  			a = append(a, make([]UpdateMetadataRequestTopicState, l)...)
  9362  		}
  9363  		for i := int32(0); i < l; i++ {
  9364  			v := &a[i]
  9365  			v.Default()
  9366  			s := v
  9367  			{
  9368  				var v string
  9369  				if unsafe {
  9370  					if isFlexible {
  9371  						v = b.UnsafeCompactString()
  9372  					} else {
  9373  						v = b.UnsafeString()
  9374  					}
  9375  				} else {
  9376  					if isFlexible {
  9377  						v = b.CompactString()
  9378  					} else {
  9379  						v = b.String()
  9380  					}
  9381  				}
  9382  				s.Topic = v
  9383  			}
  9384  			if version >= 7 {
  9385  				v := b.Uuid()
  9386  				s.TopicID = v
  9387  			}
  9388  			{
  9389  				v := s.PartitionStates
  9390  				a := v
  9391  				var l int32
  9392  				if isFlexible {
  9393  					l = b.CompactArrayLen()
  9394  				} else {
  9395  					l = b.ArrayLen()
  9396  				}
  9397  				if !b.Ok() {
  9398  					return b.Complete()
  9399  				}
  9400  				a = a[:0]
  9401  				if l > 0 {
  9402  					a = append(a, make([]UpdateMetadataRequestTopicPartition, l)...)
  9403  				}
  9404  				for i := int32(0); i < l; i++ {
  9405  					v := &a[i]
  9406  					v.Default()
  9407  					s := v
  9408  					if version >= 0 && version <= 4 {
  9409  						var v string
  9410  						if unsafe {
  9411  							if isFlexible {
  9412  								v = b.UnsafeCompactString()
  9413  							} else {
  9414  								v = b.UnsafeString()
  9415  							}
  9416  						} else {
  9417  							if isFlexible {
  9418  								v = b.CompactString()
  9419  							} else {
  9420  								v = b.String()
  9421  							}
  9422  						}
  9423  						s.Topic = v
  9424  					}
  9425  					{
  9426  						v := b.Int32()
  9427  						s.Partition = v
  9428  					}
  9429  					{
  9430  						v := b.Int32()
  9431  						s.ControllerEpoch = v
  9432  					}
  9433  					{
  9434  						v := b.Int32()
  9435  						s.Leader = v
  9436  					}
  9437  					{
  9438  						v := b.Int32()
  9439  						s.LeaderEpoch = v
  9440  					}
  9441  					{
  9442  						v := s.ISR
  9443  						a := v
  9444  						var l int32
  9445  						if isFlexible {
  9446  							l = b.CompactArrayLen()
  9447  						} else {
  9448  							l = b.ArrayLen()
  9449  						}
  9450  						if !b.Ok() {
  9451  							return b.Complete()
  9452  						}
  9453  						a = a[:0]
  9454  						if l > 0 {
  9455  							a = append(a, make([]int32, l)...)
  9456  						}
  9457  						for i := int32(0); i < l; i++ {
  9458  							v := b.Int32()
  9459  							a[i] = v
  9460  						}
  9461  						v = a
  9462  						s.ISR = v
  9463  					}
  9464  					{
  9465  						v := b.Int32()
  9466  						s.ZKVersion = v
  9467  					}
  9468  					{
  9469  						v := s.Replicas
  9470  						a := v
  9471  						var l int32
  9472  						if isFlexible {
  9473  							l = b.CompactArrayLen()
  9474  						} else {
  9475  							l = b.ArrayLen()
  9476  						}
  9477  						if !b.Ok() {
  9478  							return b.Complete()
  9479  						}
  9480  						a = a[:0]
  9481  						if l > 0 {
  9482  							a = append(a, make([]int32, l)...)
  9483  						}
  9484  						for i := int32(0); i < l; i++ {
  9485  							v := b.Int32()
  9486  							a[i] = v
  9487  						}
  9488  						v = a
  9489  						s.Replicas = v
  9490  					}
  9491  					if version >= 4 {
  9492  						v := s.OfflineReplicas
  9493  						a := v
  9494  						var l int32
  9495  						if isFlexible {
  9496  							l = b.CompactArrayLen()
  9497  						} else {
  9498  							l = b.ArrayLen()
  9499  						}
  9500  						if !b.Ok() {
  9501  							return b.Complete()
  9502  						}
  9503  						a = a[:0]
  9504  						if l > 0 {
  9505  							a = append(a, make([]int32, l)...)
  9506  						}
  9507  						for i := int32(0); i < l; i++ {
  9508  							v := b.Int32()
  9509  							a[i] = v
  9510  						}
  9511  						v = a
  9512  						s.OfflineReplicas = v
  9513  					}
  9514  					if isFlexible {
  9515  						s.UnknownTags = internalReadTags(&b)
  9516  					}
  9517  				}
  9518  				v = a
  9519  				s.PartitionStates = v
  9520  			}
  9521  			if isFlexible {
  9522  				s.UnknownTags = internalReadTags(&b)
  9523  			}
  9524  		}
  9525  		v = a
  9526  		s.TopicStates = v
  9527  	}
  9528  	{
  9529  		v := s.LiveBrokers
  9530  		a := v
  9531  		var l int32
  9532  		if isFlexible {
  9533  			l = b.CompactArrayLen()
  9534  		} else {
  9535  			l = b.ArrayLen()
  9536  		}
  9537  		if !b.Ok() {
  9538  			return b.Complete()
  9539  		}
  9540  		a = a[:0]
  9541  		if l > 0 {
  9542  			a = append(a, make([]UpdateMetadataRequestLiveBroker, l)...)
  9543  		}
  9544  		for i := int32(0); i < l; i++ {
  9545  			v := &a[i]
  9546  			v.Default()
  9547  			s := v
  9548  			{
  9549  				v := b.Int32()
  9550  				s.ID = v
  9551  			}
  9552  			if version >= 0 && version <= 0 {
  9553  				var v string
  9554  				if unsafe {
  9555  					if isFlexible {
  9556  						v = b.UnsafeCompactString()
  9557  					} else {
  9558  						v = b.UnsafeString()
  9559  					}
  9560  				} else {
  9561  					if isFlexible {
  9562  						v = b.CompactString()
  9563  					} else {
  9564  						v = b.String()
  9565  					}
  9566  				}
  9567  				s.Host = v
  9568  			}
  9569  			if version >= 0 && version <= 0 {
  9570  				v := b.Int32()
  9571  				s.Port = v
  9572  			}
  9573  			if version >= 1 {
  9574  				v := s.Endpoints
  9575  				a := v
  9576  				var l int32
  9577  				if isFlexible {
  9578  					l = b.CompactArrayLen()
  9579  				} else {
  9580  					l = b.ArrayLen()
  9581  				}
  9582  				if !b.Ok() {
  9583  					return b.Complete()
  9584  				}
  9585  				a = a[:0]
  9586  				if l > 0 {
  9587  					a = append(a, make([]UpdateMetadataRequestLiveBrokerEndpoint, l)...)
  9588  				}
  9589  				for i := int32(0); i < l; i++ {
  9590  					v := &a[i]
  9591  					v.Default()
  9592  					s := v
  9593  					{
  9594  						v := b.Int32()
  9595  						s.Port = v
  9596  					}
  9597  					{
  9598  						var v string
  9599  						if unsafe {
  9600  							if isFlexible {
  9601  								v = b.UnsafeCompactString()
  9602  							} else {
  9603  								v = b.UnsafeString()
  9604  							}
  9605  						} else {
  9606  							if isFlexible {
  9607  								v = b.CompactString()
  9608  							} else {
  9609  								v = b.String()
  9610  							}
  9611  						}
  9612  						s.Host = v
  9613  					}
  9614  					if version >= 3 {
  9615  						var v string
  9616  						if unsafe {
  9617  							if isFlexible {
  9618  								v = b.UnsafeCompactString()
  9619  							} else {
  9620  								v = b.UnsafeString()
  9621  							}
  9622  						} else {
  9623  							if isFlexible {
  9624  								v = b.CompactString()
  9625  							} else {
  9626  								v = b.String()
  9627  							}
  9628  						}
  9629  						s.ListenerName = v
  9630  					}
  9631  					{
  9632  						v := b.Int16()
  9633  						s.SecurityProtocol = v
  9634  					}
  9635  					if isFlexible {
  9636  						s.UnknownTags = internalReadTags(&b)
  9637  					}
  9638  				}
  9639  				v = a
  9640  				s.Endpoints = v
  9641  			}
  9642  			if version >= 2 {
  9643  				var v *string
  9644  				if isFlexible {
  9645  					if unsafe {
  9646  						v = b.UnsafeCompactNullableString()
  9647  					} else {
  9648  						v = b.CompactNullableString()
  9649  					}
  9650  				} else {
  9651  					if unsafe {
  9652  						v = b.UnsafeNullableString()
  9653  					} else {
  9654  						v = b.NullableString()
  9655  					}
  9656  				}
  9657  				s.Rack = v
  9658  			}
  9659  			if isFlexible {
  9660  				s.UnknownTags = internalReadTags(&b)
  9661  			}
  9662  		}
  9663  		v = a
  9664  		s.LiveBrokers = v
  9665  	}
  9666  	if isFlexible {
  9667  		s.UnknownTags = internalReadTags(&b)
  9668  	}
  9669  	return b.Complete()
  9670  }
  9671  
  9672  // NewPtrUpdateMetadataRequest returns a pointer to a default UpdateMetadataRequest
  9673  // This is a shortcut for creating a new(struct) and calling Default yourself.
  9674  func NewPtrUpdateMetadataRequest() *UpdateMetadataRequest {
  9675  	var v UpdateMetadataRequest
  9676  	v.Default()
  9677  	return &v
  9678  }
  9679  
  9680  // Default sets any default fields. Calling this allows for future compatibility
  9681  // if new fields are added to UpdateMetadataRequest.
  9682  func (v *UpdateMetadataRequest) Default() {
  9683  	v.BrokerEpoch = -1
  9684  }
  9685  
  9686  // NewUpdateMetadataRequest returns a default UpdateMetadataRequest
  9687  // This is a shortcut for creating a struct and calling Default yourself.
  9688  func NewUpdateMetadataRequest() UpdateMetadataRequest {
  9689  	var v UpdateMetadataRequest
  9690  	v.Default()
  9691  	return v
  9692  }
  9693  
  9694  // UpdateMetadataResponses is returned from an UpdateMetadataRequest.
  9695  type UpdateMetadataResponse struct {
  9696  	// Version is the version of this message used with a Kafka broker.
  9697  	Version int16
  9698  
  9699  	ErrorCode int16
  9700  
  9701  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  9702  	UnknownTags Tags // v6+
  9703  }
  9704  
  9705  func (*UpdateMetadataResponse) Key() int16                 { return 6 }
  9706  func (*UpdateMetadataResponse) MaxVersion() int16          { return 8 }
  9707  func (v *UpdateMetadataResponse) SetVersion(version int16) { v.Version = version }
  9708  func (v *UpdateMetadataResponse) GetVersion() int16        { return v.Version }
  9709  func (v *UpdateMetadataResponse) IsFlexible() bool         { return v.Version >= 6 }
  9710  func (v *UpdateMetadataResponse) RequestKind() Request {
  9711  	return &UpdateMetadataRequest{Version: v.Version}
  9712  }
  9713  
  9714  func (v *UpdateMetadataResponse) AppendTo(dst []byte) []byte {
  9715  	version := v.Version
  9716  	_ = version
  9717  	isFlexible := version >= 6
  9718  	_ = isFlexible
  9719  	{
  9720  		v := v.ErrorCode
  9721  		dst = kbin.AppendInt16(dst, v)
  9722  	}
  9723  	if isFlexible {
  9724  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9725  		dst = v.UnknownTags.AppendEach(dst)
  9726  	}
  9727  	return dst
  9728  }
  9729  
  9730  func (v *UpdateMetadataResponse) ReadFrom(src []byte) error {
  9731  	return v.readFrom(src, false)
  9732  }
  9733  
  9734  func (v *UpdateMetadataResponse) UnsafeReadFrom(src []byte) error {
  9735  	return v.readFrom(src, true)
  9736  }
  9737  
  9738  func (v *UpdateMetadataResponse) readFrom(src []byte, unsafe bool) error {
  9739  	v.Default()
  9740  	b := kbin.Reader{Src: src}
  9741  	version := v.Version
  9742  	_ = version
  9743  	isFlexible := version >= 6
  9744  	_ = isFlexible
  9745  	s := v
  9746  	{
  9747  		v := b.Int16()
  9748  		s.ErrorCode = v
  9749  	}
  9750  	if isFlexible {
  9751  		s.UnknownTags = internalReadTags(&b)
  9752  	}
  9753  	return b.Complete()
  9754  }
  9755  
  9756  // NewPtrUpdateMetadataResponse returns a pointer to a default UpdateMetadataResponse
  9757  // This is a shortcut for creating a new(struct) and calling Default yourself.
  9758  func NewPtrUpdateMetadataResponse() *UpdateMetadataResponse {
  9759  	var v UpdateMetadataResponse
  9760  	v.Default()
  9761  	return &v
  9762  }
  9763  
  9764  // Default sets any default fields. Calling this allows for future compatibility
  9765  // if new fields are added to UpdateMetadataResponse.
  9766  func (v *UpdateMetadataResponse) Default() {
  9767  }
  9768  
  9769  // NewUpdateMetadataResponse returns a default UpdateMetadataResponse
  9770  // This is a shortcut for creating a struct and calling Default yourself.
  9771  func NewUpdateMetadataResponse() UpdateMetadataResponse {
  9772  	var v UpdateMetadataResponse
  9773  	v.Default()
  9774  	return v
  9775  }
  9776  
  9777  // ControlledShutdownRequest is an advanced request that can be used to
  9778  // sthudown a broker in a controlled manner.
  9779  //
  9780  // As this is an advanced request and there is little reason to issue it as a
  9781  // client, this request is undocumented. However, the minimal amount of fields
  9782  // here makes the usage rather obvious.
  9783  //
  9784  // Kafka 2.2.0 introduced version 2, proposed in KIP-380.
  9785  //
  9786  // Note that version 0 of this request uses a special encoding format
  9787  // where the request does not include the client ID.
  9788  type ControlledShutdownRequest struct {
  9789  	// Version is the version of this message used with a Kafka broker.
  9790  	Version int16
  9791  
  9792  	BrokerID int32
  9793  
  9794  	// This field has a default of -1.
  9795  	BrokerEpoch int64 // v2+
  9796  
  9797  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  9798  	UnknownTags Tags // v3+
  9799  }
  9800  
  9801  func (*ControlledShutdownRequest) Key() int16                 { return 7 }
  9802  func (*ControlledShutdownRequest) MaxVersion() int16          { return 3 }
  9803  func (v *ControlledShutdownRequest) SetVersion(version int16) { v.Version = version }
  9804  func (v *ControlledShutdownRequest) GetVersion() int16        { return v.Version }
  9805  func (v *ControlledShutdownRequest) IsFlexible() bool         { return v.Version >= 3 }
  9806  func (v *ControlledShutdownRequest) ResponseKind() Response {
  9807  	r := &ControlledShutdownResponse{Version: v.Version}
  9808  	r.Default()
  9809  	return r
  9810  }
  9811  
  9812  // RequestWith is requests v on r and returns the response or an error.
  9813  // For sharded requests, the response may be merged and still return an error.
  9814  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
  9815  func (v *ControlledShutdownRequest) RequestWith(ctx context.Context, r Requestor) (*ControlledShutdownResponse, error) {
  9816  	kresp, err := r.Request(ctx, v)
  9817  	resp, _ := kresp.(*ControlledShutdownResponse)
  9818  	return resp, err
  9819  }
  9820  
  9821  func (v *ControlledShutdownRequest) AppendTo(dst []byte) []byte {
  9822  	version := v.Version
  9823  	_ = version
  9824  	isFlexible := version >= 3
  9825  	_ = isFlexible
  9826  	{
  9827  		v := v.BrokerID
  9828  		dst = kbin.AppendInt32(dst, v)
  9829  	}
  9830  	if version >= 2 {
  9831  		v := v.BrokerEpoch
  9832  		dst = kbin.AppendInt64(dst, v)
  9833  	}
  9834  	if isFlexible {
  9835  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9836  		dst = v.UnknownTags.AppendEach(dst)
  9837  	}
  9838  	return dst
  9839  }
  9840  
  9841  func (v *ControlledShutdownRequest) ReadFrom(src []byte) error {
  9842  	return v.readFrom(src, false)
  9843  }
  9844  
  9845  func (v *ControlledShutdownRequest) UnsafeReadFrom(src []byte) error {
  9846  	return v.readFrom(src, true)
  9847  }
  9848  
  9849  func (v *ControlledShutdownRequest) readFrom(src []byte, unsafe bool) error {
  9850  	v.Default()
  9851  	b := kbin.Reader{Src: src}
  9852  	version := v.Version
  9853  	_ = version
  9854  	isFlexible := version >= 3
  9855  	_ = isFlexible
  9856  	s := v
  9857  	{
  9858  		v := b.Int32()
  9859  		s.BrokerID = v
  9860  	}
  9861  	if version >= 2 {
  9862  		v := b.Int64()
  9863  		s.BrokerEpoch = v
  9864  	}
  9865  	if isFlexible {
  9866  		s.UnknownTags = internalReadTags(&b)
  9867  	}
  9868  	return b.Complete()
  9869  }
  9870  
  9871  // NewPtrControlledShutdownRequest returns a pointer to a default ControlledShutdownRequest
  9872  // This is a shortcut for creating a new(struct) and calling Default yourself.
  9873  func NewPtrControlledShutdownRequest() *ControlledShutdownRequest {
  9874  	var v ControlledShutdownRequest
  9875  	v.Default()
  9876  	return &v
  9877  }
  9878  
  9879  // Default sets any default fields. Calling this allows for future compatibility
  9880  // if new fields are added to ControlledShutdownRequest.
  9881  func (v *ControlledShutdownRequest) Default() {
  9882  	v.BrokerEpoch = -1
  9883  }
  9884  
  9885  // NewControlledShutdownRequest returns a default ControlledShutdownRequest
  9886  // This is a shortcut for creating a struct and calling Default yourself.
  9887  func NewControlledShutdownRequest() ControlledShutdownRequest {
  9888  	var v ControlledShutdownRequest
  9889  	v.Default()
  9890  	return v
  9891  }
  9892  
  9893  type ControlledShutdownResponsePartitionsRemaining struct {
  9894  	Topic string
  9895  
  9896  	Partition int32
  9897  
  9898  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  9899  	UnknownTags Tags // v3+
  9900  }
  9901  
  9902  // Default sets any default fields. Calling this allows for future compatibility
  9903  // if new fields are added to ControlledShutdownResponsePartitionsRemaining.
  9904  func (v *ControlledShutdownResponsePartitionsRemaining) Default() {
  9905  }
  9906  
  9907  // NewControlledShutdownResponsePartitionsRemaining returns a default ControlledShutdownResponsePartitionsRemaining
  9908  // This is a shortcut for creating a struct and calling Default yourself.
  9909  func NewControlledShutdownResponsePartitionsRemaining() ControlledShutdownResponsePartitionsRemaining {
  9910  	var v ControlledShutdownResponsePartitionsRemaining
  9911  	v.Default()
  9912  	return v
  9913  }
  9914  
  9915  // ControlledShutdownResponse is returned from a ControlledShutdownRequest.
  9916  type ControlledShutdownResponse struct {
  9917  	// Version is the version of this message used with a Kafka broker.
  9918  	Version int16
  9919  
  9920  	ErrorCode int16
  9921  
  9922  	PartitionsRemaining []ControlledShutdownResponsePartitionsRemaining
  9923  
  9924  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
  9925  	UnknownTags Tags // v3+
  9926  }
  9927  
  9928  func (*ControlledShutdownResponse) Key() int16                 { return 7 }
  9929  func (*ControlledShutdownResponse) MaxVersion() int16          { return 3 }
  9930  func (v *ControlledShutdownResponse) SetVersion(version int16) { v.Version = version }
  9931  func (v *ControlledShutdownResponse) GetVersion() int16        { return v.Version }
  9932  func (v *ControlledShutdownResponse) IsFlexible() bool         { return v.Version >= 3 }
  9933  func (v *ControlledShutdownResponse) RequestKind() Request {
  9934  	return &ControlledShutdownRequest{Version: v.Version}
  9935  }
  9936  
  9937  func (v *ControlledShutdownResponse) AppendTo(dst []byte) []byte {
  9938  	version := v.Version
  9939  	_ = version
  9940  	isFlexible := version >= 3
  9941  	_ = isFlexible
  9942  	{
  9943  		v := v.ErrorCode
  9944  		dst = kbin.AppendInt16(dst, v)
  9945  	}
  9946  	{
  9947  		v := v.PartitionsRemaining
  9948  		if isFlexible {
  9949  			dst = kbin.AppendCompactArrayLen(dst, len(v))
  9950  		} else {
  9951  			dst = kbin.AppendArrayLen(dst, len(v))
  9952  		}
  9953  		for i := range v {
  9954  			v := &v[i]
  9955  			{
  9956  				v := v.Topic
  9957  				if isFlexible {
  9958  					dst = kbin.AppendCompactString(dst, v)
  9959  				} else {
  9960  					dst = kbin.AppendString(dst, v)
  9961  				}
  9962  			}
  9963  			{
  9964  				v := v.Partition
  9965  				dst = kbin.AppendInt32(dst, v)
  9966  			}
  9967  			if isFlexible {
  9968  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9969  				dst = v.UnknownTags.AppendEach(dst)
  9970  			}
  9971  		}
  9972  	}
  9973  	if isFlexible {
  9974  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
  9975  		dst = v.UnknownTags.AppendEach(dst)
  9976  	}
  9977  	return dst
  9978  }
  9979  
  9980  func (v *ControlledShutdownResponse) ReadFrom(src []byte) error {
  9981  	return v.readFrom(src, false)
  9982  }
  9983  
  9984  func (v *ControlledShutdownResponse) UnsafeReadFrom(src []byte) error {
  9985  	return v.readFrom(src, true)
  9986  }
  9987  
  9988  func (v *ControlledShutdownResponse) readFrom(src []byte, unsafe bool) error {
  9989  	v.Default()
  9990  	b := kbin.Reader{Src: src}
  9991  	version := v.Version
  9992  	_ = version
  9993  	isFlexible := version >= 3
  9994  	_ = isFlexible
  9995  	s := v
  9996  	{
  9997  		v := b.Int16()
  9998  		s.ErrorCode = v
  9999  	}
 10000  	{
 10001  		v := s.PartitionsRemaining
 10002  		a := v
 10003  		var l int32
 10004  		if isFlexible {
 10005  			l = b.CompactArrayLen()
 10006  		} else {
 10007  			l = b.ArrayLen()
 10008  		}
 10009  		if !b.Ok() {
 10010  			return b.Complete()
 10011  		}
 10012  		a = a[:0]
 10013  		if l > 0 {
 10014  			a = append(a, make([]ControlledShutdownResponsePartitionsRemaining, l)...)
 10015  		}
 10016  		for i := int32(0); i < l; i++ {
 10017  			v := &a[i]
 10018  			v.Default()
 10019  			s := v
 10020  			{
 10021  				var v string
 10022  				if unsafe {
 10023  					if isFlexible {
 10024  						v = b.UnsafeCompactString()
 10025  					} else {
 10026  						v = b.UnsafeString()
 10027  					}
 10028  				} else {
 10029  					if isFlexible {
 10030  						v = b.CompactString()
 10031  					} else {
 10032  						v = b.String()
 10033  					}
 10034  				}
 10035  				s.Topic = v
 10036  			}
 10037  			{
 10038  				v := b.Int32()
 10039  				s.Partition = v
 10040  			}
 10041  			if isFlexible {
 10042  				s.UnknownTags = internalReadTags(&b)
 10043  			}
 10044  		}
 10045  		v = a
 10046  		s.PartitionsRemaining = v
 10047  	}
 10048  	if isFlexible {
 10049  		s.UnknownTags = internalReadTags(&b)
 10050  	}
 10051  	return b.Complete()
 10052  }
 10053  
 10054  // NewPtrControlledShutdownResponse returns a pointer to a default ControlledShutdownResponse
 10055  // This is a shortcut for creating a new(struct) and calling Default yourself.
 10056  func NewPtrControlledShutdownResponse() *ControlledShutdownResponse {
 10057  	var v ControlledShutdownResponse
 10058  	v.Default()
 10059  	return &v
 10060  }
 10061  
 10062  // Default sets any default fields. Calling this allows for future compatibility
 10063  // if new fields are added to ControlledShutdownResponse.
 10064  func (v *ControlledShutdownResponse) Default() {
 10065  }
 10066  
 10067  // NewControlledShutdownResponse returns a default ControlledShutdownResponse
 10068  // This is a shortcut for creating a struct and calling Default yourself.
 10069  func NewControlledShutdownResponse() ControlledShutdownResponse {
 10070  	var v ControlledShutdownResponse
 10071  	v.Default()
 10072  	return v
 10073  }
 10074  
 10075  type OffsetCommitRequestTopicPartition struct {
 10076  	// Partition if a partition to commit offsets for.
 10077  	Partition int32
 10078  
 10079  	// Offset is an offset to commit.
 10080  	Offset int64
 10081  
 10082  	// Timestamp is the first iteration of tracking how long offset commits
 10083  	// should persist in Kafka. This field only existed for v1.
 10084  	// The expiration would be timestamp + offset.retention.minutes, or, if
 10085  	// timestamp was zero, current time + offset.retention.minutes.
 10086  	//
 10087  	// This field has a default of -1.
 10088  	Timestamp int64 // v1-v1
 10089  
 10090  	// LeaderEpoch, proposed in KIP-320 and introduced in Kafka 2.1.0,
 10091  	// is the leader epoch of the record this request is committing.
 10092  	//
 10093  	// The initial leader epoch can be determined from a MetadataResponse.
 10094  	// To skip log truncation checking, use -1.
 10095  	//
 10096  	// This field has a default of -1.
 10097  	LeaderEpoch int32 // v6+
 10098  
 10099  	// Metadata is optional data to include with committing the offset. This
 10100  	// can contain information such as which node is doing the committing, etc.
 10101  	Metadata *string
 10102  
 10103  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10104  	UnknownTags Tags // v8+
 10105  }
 10106  
 10107  // Default sets any default fields. Calling this allows for future compatibility
 10108  // if new fields are added to OffsetCommitRequestTopicPartition.
 10109  func (v *OffsetCommitRequestTopicPartition) Default() {
 10110  	v.Timestamp = -1
 10111  	v.LeaderEpoch = -1
 10112  }
 10113  
 10114  // NewOffsetCommitRequestTopicPartition returns a default OffsetCommitRequestTopicPartition
 10115  // This is a shortcut for creating a struct and calling Default yourself.
 10116  func NewOffsetCommitRequestTopicPartition() OffsetCommitRequestTopicPartition {
 10117  	var v OffsetCommitRequestTopicPartition
 10118  	v.Default()
 10119  	return v
 10120  }
 10121  
 10122  type OffsetCommitRequestTopic struct {
 10123  	// Topic is a topic to commit offsets for.
 10124  	Topic string
 10125  
 10126  	// Partitions contains partitions in a topic for which to commit offsets.
 10127  	Partitions []OffsetCommitRequestTopicPartition
 10128  
 10129  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10130  	UnknownTags Tags // v8+
 10131  }
 10132  
 10133  // Default sets any default fields. Calling this allows for future compatibility
 10134  // if new fields are added to OffsetCommitRequestTopic.
 10135  func (v *OffsetCommitRequestTopic) Default() {
 10136  }
 10137  
 10138  // NewOffsetCommitRequestTopic returns a default OffsetCommitRequestTopic
 10139  // This is a shortcut for creating a struct and calling Default yourself.
 10140  func NewOffsetCommitRequestTopic() OffsetCommitRequestTopic {
 10141  	var v OffsetCommitRequestTopic
 10142  	v.Default()
 10143  	return v
 10144  }
 10145  
 10146  // OffsetCommitRequest commits offsets for consumed topics / partitions in
 10147  // a group.
 10148  type OffsetCommitRequest struct {
 10149  	// Version is the version of this message used with a Kafka broker.
 10150  	Version int16
 10151  
 10152  	// Group is the group this request is committing offsets to.
 10153  	Group string
 10154  
 10155  	// Generation being -1 and group being empty means the group is being used
 10156  	// to store offsets only. No generation validation, no rebalancing.
 10157  	//
 10158  	// This field has a default of -1.
 10159  	Generation int32 // v1+
 10160  
 10161  	// MemberID is the ID of the client issuing this request in the group.
 10162  	MemberID string // v1+
 10163  
 10164  	// InstanceID is the instance ID of this member in the group (KIP-345).
 10165  	InstanceID *string // v7+
 10166  
 10167  	// RetentionTimeMillis is how long this commit will persist in Kafka.
 10168  	//
 10169  	// This was introduced in v2, replacing an individual topic/partition's
 10170  	// Timestamp from v1, and was removed in v5 with Kafka 2.1.0.
 10171  	//
 10172  	// This was removed because rarely committing consumers could have their
 10173  	// offsets expired before committing, even though the consumer was still
 10174  	// active. After restarting or rebalancing, the consumer would now not know
 10175  	// the last committed offset and would have to start at the beginning or end,
 10176  	// leading to duplicates or log loss.
 10177  	//
 10178  	// Post 2.1.0, if this field is empty, offsets are only deleted once the
 10179  	// group is empty. Read KIP-211 for more details.
 10180  	//
 10181  	// This field has a default of -1.
 10182  	RetentionTimeMillis int64 // v2-v4
 10183  
 10184  	// Topics is contains topics and partitions for which to commit offsets.
 10185  	Topics []OffsetCommitRequestTopic
 10186  
 10187  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10188  	UnknownTags Tags // v8+
 10189  }
 10190  
 10191  func (*OffsetCommitRequest) Key() int16                   { return 8 }
 10192  func (*OffsetCommitRequest) MaxVersion() int16            { return 8 }
 10193  func (v *OffsetCommitRequest) SetVersion(version int16)   { v.Version = version }
 10194  func (v *OffsetCommitRequest) GetVersion() int16          { return v.Version }
 10195  func (v *OffsetCommitRequest) IsFlexible() bool           { return v.Version >= 8 }
 10196  func (v *OffsetCommitRequest) IsGroupCoordinatorRequest() {}
 10197  func (v *OffsetCommitRequest) ResponseKind() Response {
 10198  	r := &OffsetCommitResponse{Version: v.Version}
 10199  	r.Default()
 10200  	return r
 10201  }
 10202  
 10203  // RequestWith is requests v on r and returns the response or an error.
 10204  // For sharded requests, the response may be merged and still return an error.
 10205  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 10206  func (v *OffsetCommitRequest) RequestWith(ctx context.Context, r Requestor) (*OffsetCommitResponse, error) {
 10207  	kresp, err := r.Request(ctx, v)
 10208  	resp, _ := kresp.(*OffsetCommitResponse)
 10209  	return resp, err
 10210  }
 10211  
 10212  func (v *OffsetCommitRequest) AppendTo(dst []byte) []byte {
 10213  	version := v.Version
 10214  	_ = version
 10215  	isFlexible := version >= 8
 10216  	_ = isFlexible
 10217  	{
 10218  		v := v.Group
 10219  		if isFlexible {
 10220  			dst = kbin.AppendCompactString(dst, v)
 10221  		} else {
 10222  			dst = kbin.AppendString(dst, v)
 10223  		}
 10224  	}
 10225  	if version >= 1 {
 10226  		v := v.Generation
 10227  		dst = kbin.AppendInt32(dst, v)
 10228  	}
 10229  	if version >= 1 {
 10230  		v := v.MemberID
 10231  		if isFlexible {
 10232  			dst = kbin.AppendCompactString(dst, v)
 10233  		} else {
 10234  			dst = kbin.AppendString(dst, v)
 10235  		}
 10236  	}
 10237  	if version >= 7 {
 10238  		v := v.InstanceID
 10239  		if isFlexible {
 10240  			dst = kbin.AppendCompactNullableString(dst, v)
 10241  		} else {
 10242  			dst = kbin.AppendNullableString(dst, v)
 10243  		}
 10244  	}
 10245  	if version >= 2 && version <= 4 {
 10246  		v := v.RetentionTimeMillis
 10247  		dst = kbin.AppendInt64(dst, v)
 10248  	}
 10249  	{
 10250  		v := v.Topics
 10251  		if isFlexible {
 10252  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 10253  		} else {
 10254  			dst = kbin.AppendArrayLen(dst, len(v))
 10255  		}
 10256  		for i := range v {
 10257  			v := &v[i]
 10258  			{
 10259  				v := v.Topic
 10260  				if isFlexible {
 10261  					dst = kbin.AppendCompactString(dst, v)
 10262  				} else {
 10263  					dst = kbin.AppendString(dst, v)
 10264  				}
 10265  			}
 10266  			{
 10267  				v := v.Partitions
 10268  				if isFlexible {
 10269  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 10270  				} else {
 10271  					dst = kbin.AppendArrayLen(dst, len(v))
 10272  				}
 10273  				for i := range v {
 10274  					v := &v[i]
 10275  					{
 10276  						v := v.Partition
 10277  						dst = kbin.AppendInt32(dst, v)
 10278  					}
 10279  					{
 10280  						v := v.Offset
 10281  						dst = kbin.AppendInt64(dst, v)
 10282  					}
 10283  					if version >= 1 && version <= 1 {
 10284  						v := v.Timestamp
 10285  						dst = kbin.AppendInt64(dst, v)
 10286  					}
 10287  					if version >= 6 {
 10288  						v := v.LeaderEpoch
 10289  						dst = kbin.AppendInt32(dst, v)
 10290  					}
 10291  					{
 10292  						v := v.Metadata
 10293  						if isFlexible {
 10294  							dst = kbin.AppendCompactNullableString(dst, v)
 10295  						} else {
 10296  							dst = kbin.AppendNullableString(dst, v)
 10297  						}
 10298  					}
 10299  					if isFlexible {
 10300  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10301  						dst = v.UnknownTags.AppendEach(dst)
 10302  					}
 10303  				}
 10304  			}
 10305  			if isFlexible {
 10306  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10307  				dst = v.UnknownTags.AppendEach(dst)
 10308  			}
 10309  		}
 10310  	}
 10311  	if isFlexible {
 10312  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10313  		dst = v.UnknownTags.AppendEach(dst)
 10314  	}
 10315  	return dst
 10316  }
 10317  
 10318  func (v *OffsetCommitRequest) ReadFrom(src []byte) error {
 10319  	return v.readFrom(src, false)
 10320  }
 10321  
 10322  func (v *OffsetCommitRequest) UnsafeReadFrom(src []byte) error {
 10323  	return v.readFrom(src, true)
 10324  }
 10325  
 10326  func (v *OffsetCommitRequest) readFrom(src []byte, unsafe bool) error {
 10327  	v.Default()
 10328  	b := kbin.Reader{Src: src}
 10329  	version := v.Version
 10330  	_ = version
 10331  	isFlexible := version >= 8
 10332  	_ = isFlexible
 10333  	s := v
 10334  	{
 10335  		var v string
 10336  		if unsafe {
 10337  			if isFlexible {
 10338  				v = b.UnsafeCompactString()
 10339  			} else {
 10340  				v = b.UnsafeString()
 10341  			}
 10342  		} else {
 10343  			if isFlexible {
 10344  				v = b.CompactString()
 10345  			} else {
 10346  				v = b.String()
 10347  			}
 10348  		}
 10349  		s.Group = v
 10350  	}
 10351  	if version >= 1 {
 10352  		v := b.Int32()
 10353  		s.Generation = v
 10354  	}
 10355  	if version >= 1 {
 10356  		var v string
 10357  		if unsafe {
 10358  			if isFlexible {
 10359  				v = b.UnsafeCompactString()
 10360  			} else {
 10361  				v = b.UnsafeString()
 10362  			}
 10363  		} else {
 10364  			if isFlexible {
 10365  				v = b.CompactString()
 10366  			} else {
 10367  				v = b.String()
 10368  			}
 10369  		}
 10370  		s.MemberID = v
 10371  	}
 10372  	if version >= 7 {
 10373  		var v *string
 10374  		if isFlexible {
 10375  			if unsafe {
 10376  				v = b.UnsafeCompactNullableString()
 10377  			} else {
 10378  				v = b.CompactNullableString()
 10379  			}
 10380  		} else {
 10381  			if unsafe {
 10382  				v = b.UnsafeNullableString()
 10383  			} else {
 10384  				v = b.NullableString()
 10385  			}
 10386  		}
 10387  		s.InstanceID = v
 10388  	}
 10389  	if version >= 2 && version <= 4 {
 10390  		v := b.Int64()
 10391  		s.RetentionTimeMillis = v
 10392  	}
 10393  	{
 10394  		v := s.Topics
 10395  		a := v
 10396  		var l int32
 10397  		if isFlexible {
 10398  			l = b.CompactArrayLen()
 10399  		} else {
 10400  			l = b.ArrayLen()
 10401  		}
 10402  		if !b.Ok() {
 10403  			return b.Complete()
 10404  		}
 10405  		a = a[:0]
 10406  		if l > 0 {
 10407  			a = append(a, make([]OffsetCommitRequestTopic, l)...)
 10408  		}
 10409  		for i := int32(0); i < l; i++ {
 10410  			v := &a[i]
 10411  			v.Default()
 10412  			s := v
 10413  			{
 10414  				var v string
 10415  				if unsafe {
 10416  					if isFlexible {
 10417  						v = b.UnsafeCompactString()
 10418  					} else {
 10419  						v = b.UnsafeString()
 10420  					}
 10421  				} else {
 10422  					if isFlexible {
 10423  						v = b.CompactString()
 10424  					} else {
 10425  						v = b.String()
 10426  					}
 10427  				}
 10428  				s.Topic = v
 10429  			}
 10430  			{
 10431  				v := s.Partitions
 10432  				a := v
 10433  				var l int32
 10434  				if isFlexible {
 10435  					l = b.CompactArrayLen()
 10436  				} else {
 10437  					l = b.ArrayLen()
 10438  				}
 10439  				if !b.Ok() {
 10440  					return b.Complete()
 10441  				}
 10442  				a = a[:0]
 10443  				if l > 0 {
 10444  					a = append(a, make([]OffsetCommitRequestTopicPartition, l)...)
 10445  				}
 10446  				for i := int32(0); i < l; i++ {
 10447  					v := &a[i]
 10448  					v.Default()
 10449  					s := v
 10450  					{
 10451  						v := b.Int32()
 10452  						s.Partition = v
 10453  					}
 10454  					{
 10455  						v := b.Int64()
 10456  						s.Offset = v
 10457  					}
 10458  					if version >= 1 && version <= 1 {
 10459  						v := b.Int64()
 10460  						s.Timestamp = v
 10461  					}
 10462  					if version >= 6 {
 10463  						v := b.Int32()
 10464  						s.LeaderEpoch = v
 10465  					}
 10466  					{
 10467  						var v *string
 10468  						if isFlexible {
 10469  							if unsafe {
 10470  								v = b.UnsafeCompactNullableString()
 10471  							} else {
 10472  								v = b.CompactNullableString()
 10473  							}
 10474  						} else {
 10475  							if unsafe {
 10476  								v = b.UnsafeNullableString()
 10477  							} else {
 10478  								v = b.NullableString()
 10479  							}
 10480  						}
 10481  						s.Metadata = v
 10482  					}
 10483  					if isFlexible {
 10484  						s.UnknownTags = internalReadTags(&b)
 10485  					}
 10486  				}
 10487  				v = a
 10488  				s.Partitions = v
 10489  			}
 10490  			if isFlexible {
 10491  				s.UnknownTags = internalReadTags(&b)
 10492  			}
 10493  		}
 10494  		v = a
 10495  		s.Topics = v
 10496  	}
 10497  	if isFlexible {
 10498  		s.UnknownTags = internalReadTags(&b)
 10499  	}
 10500  	return b.Complete()
 10501  }
 10502  
 10503  // NewPtrOffsetCommitRequest returns a pointer to a default OffsetCommitRequest
 10504  // This is a shortcut for creating a new(struct) and calling Default yourself.
 10505  func NewPtrOffsetCommitRequest() *OffsetCommitRequest {
 10506  	var v OffsetCommitRequest
 10507  	v.Default()
 10508  	return &v
 10509  }
 10510  
 10511  // Default sets any default fields. Calling this allows for future compatibility
 10512  // if new fields are added to OffsetCommitRequest.
 10513  func (v *OffsetCommitRequest) Default() {
 10514  	v.Generation = -1
 10515  	v.RetentionTimeMillis = -1
 10516  }
 10517  
 10518  // NewOffsetCommitRequest returns a default OffsetCommitRequest
 10519  // This is a shortcut for creating a struct and calling Default yourself.
 10520  func NewOffsetCommitRequest() OffsetCommitRequest {
 10521  	var v OffsetCommitRequest
 10522  	v.Default()
 10523  	return v
 10524  }
 10525  
 10526  type OffsetCommitResponseTopicPartition struct {
 10527  	// Partition is the partition in a topic this array slot corresponds to.
 10528  	Partition int32
 10529  
 10530  	// ErrorCode is the error for this partition response.
 10531  	//
 10532  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 10533  	// for the group.
 10534  	//
 10535  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized
 10536  	// for the topic / partition.
 10537  	//
 10538  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the topic / partition does
 10539  	// not exist.
 10540  	//
 10541  	// OFFSET_METADATA_TOO_LARGE is returned if the request metadata is
 10542  	// larger than the brokers offset.metadata.max.bytes.
 10543  	//
 10544  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 10545  	//
 10546  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available
 10547  	// (due to the requested broker shutting down or it has not completed startup).
 10548  	//
 10549  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is loading.
 10550  	//
 10551  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 10552  	// for the requested group.
 10553  	//
 10554  	// ILLEGAL_GENERATION is returned if the request's generation ID is invalid.
 10555  	//
 10556  	// UNKNOWN_MEMBER_ID is returned if the group is dead or the group does not
 10557  	// know of the request's member ID.
 10558  	//
 10559  	// REBALANCE_IN_PROGRESS is returned if the group is finishing a rebalance.
 10560  	//
 10561  	// INVALID_COMMIT_OFFSET_SIZE is returned if the offset commit results in
 10562  	// a record batch that is too large (likely due to large metadata).
 10563  	ErrorCode int16
 10564  
 10565  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10566  	UnknownTags Tags // v8+
 10567  }
 10568  
 10569  // Default sets any default fields. Calling this allows for future compatibility
 10570  // if new fields are added to OffsetCommitResponseTopicPartition.
 10571  func (v *OffsetCommitResponseTopicPartition) Default() {
 10572  }
 10573  
 10574  // NewOffsetCommitResponseTopicPartition returns a default OffsetCommitResponseTopicPartition
 10575  // This is a shortcut for creating a struct and calling Default yourself.
 10576  func NewOffsetCommitResponseTopicPartition() OffsetCommitResponseTopicPartition {
 10577  	var v OffsetCommitResponseTopicPartition
 10578  	v.Default()
 10579  	return v
 10580  }
 10581  
 10582  type OffsetCommitResponseTopic struct {
 10583  	// Topic is the topic this offset commit response corresponds to.
 10584  	Topic string
 10585  
 10586  	// Partitions contains responses for each requested partition in
 10587  	// a topic.
 10588  	Partitions []OffsetCommitResponseTopicPartition
 10589  
 10590  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10591  	UnknownTags Tags // v8+
 10592  }
 10593  
 10594  // Default sets any default fields. Calling this allows for future compatibility
 10595  // if new fields are added to OffsetCommitResponseTopic.
 10596  func (v *OffsetCommitResponseTopic) Default() {
 10597  }
 10598  
 10599  // NewOffsetCommitResponseTopic returns a default OffsetCommitResponseTopic
 10600  // This is a shortcut for creating a struct and calling Default yourself.
 10601  func NewOffsetCommitResponseTopic() OffsetCommitResponseTopic {
 10602  	var v OffsetCommitResponseTopic
 10603  	v.Default()
 10604  	return v
 10605  }
 10606  
 10607  // OffsetCommitResponse is returned from an OffsetCommitRequest.
 10608  type OffsetCommitResponse struct {
 10609  	// Version is the version of this message used with a Kafka broker.
 10610  	Version int16
 10611  
 10612  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 10613  	// after this request.
 10614  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 10615  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 10616  	//
 10617  	// This request switched at version 4.
 10618  	ThrottleMillis int32 // v3+
 10619  
 10620  	// Topics contains responses for each topic / partition in the commit request.
 10621  	Topics []OffsetCommitResponseTopic
 10622  
 10623  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10624  	UnknownTags Tags // v8+
 10625  }
 10626  
 10627  func (*OffsetCommitResponse) Key() int16                         { return 8 }
 10628  func (*OffsetCommitResponse) MaxVersion() int16                  { return 8 }
 10629  func (v *OffsetCommitResponse) SetVersion(version int16)         { v.Version = version }
 10630  func (v *OffsetCommitResponse) GetVersion() int16                { return v.Version }
 10631  func (v *OffsetCommitResponse) IsFlexible() bool                 { return v.Version >= 8 }
 10632  func (v *OffsetCommitResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 4 }
 10633  func (v *OffsetCommitResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 10634  func (v *OffsetCommitResponse) RequestKind() Request             { return &OffsetCommitRequest{Version: v.Version} }
 10635  
 10636  func (v *OffsetCommitResponse) AppendTo(dst []byte) []byte {
 10637  	version := v.Version
 10638  	_ = version
 10639  	isFlexible := version >= 8
 10640  	_ = isFlexible
 10641  	if version >= 3 {
 10642  		v := v.ThrottleMillis
 10643  		dst = kbin.AppendInt32(dst, v)
 10644  	}
 10645  	{
 10646  		v := v.Topics
 10647  		if isFlexible {
 10648  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 10649  		} else {
 10650  			dst = kbin.AppendArrayLen(dst, len(v))
 10651  		}
 10652  		for i := range v {
 10653  			v := &v[i]
 10654  			{
 10655  				v := v.Topic
 10656  				if isFlexible {
 10657  					dst = kbin.AppendCompactString(dst, v)
 10658  				} else {
 10659  					dst = kbin.AppendString(dst, v)
 10660  				}
 10661  			}
 10662  			{
 10663  				v := v.Partitions
 10664  				if isFlexible {
 10665  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 10666  				} else {
 10667  					dst = kbin.AppendArrayLen(dst, len(v))
 10668  				}
 10669  				for i := range v {
 10670  					v := &v[i]
 10671  					{
 10672  						v := v.Partition
 10673  						dst = kbin.AppendInt32(dst, v)
 10674  					}
 10675  					{
 10676  						v := v.ErrorCode
 10677  						dst = kbin.AppendInt16(dst, v)
 10678  					}
 10679  					if isFlexible {
 10680  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10681  						dst = v.UnknownTags.AppendEach(dst)
 10682  					}
 10683  				}
 10684  			}
 10685  			if isFlexible {
 10686  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10687  				dst = v.UnknownTags.AppendEach(dst)
 10688  			}
 10689  		}
 10690  	}
 10691  	if isFlexible {
 10692  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10693  		dst = v.UnknownTags.AppendEach(dst)
 10694  	}
 10695  	return dst
 10696  }
 10697  
 10698  func (v *OffsetCommitResponse) ReadFrom(src []byte) error {
 10699  	return v.readFrom(src, false)
 10700  }
 10701  
 10702  func (v *OffsetCommitResponse) UnsafeReadFrom(src []byte) error {
 10703  	return v.readFrom(src, true)
 10704  }
 10705  
 10706  func (v *OffsetCommitResponse) readFrom(src []byte, unsafe bool) error {
 10707  	v.Default()
 10708  	b := kbin.Reader{Src: src}
 10709  	version := v.Version
 10710  	_ = version
 10711  	isFlexible := version >= 8
 10712  	_ = isFlexible
 10713  	s := v
 10714  	if version >= 3 {
 10715  		v := b.Int32()
 10716  		s.ThrottleMillis = v
 10717  	}
 10718  	{
 10719  		v := s.Topics
 10720  		a := v
 10721  		var l int32
 10722  		if isFlexible {
 10723  			l = b.CompactArrayLen()
 10724  		} else {
 10725  			l = b.ArrayLen()
 10726  		}
 10727  		if !b.Ok() {
 10728  			return b.Complete()
 10729  		}
 10730  		a = a[:0]
 10731  		if l > 0 {
 10732  			a = append(a, make([]OffsetCommitResponseTopic, l)...)
 10733  		}
 10734  		for i := int32(0); i < l; i++ {
 10735  			v := &a[i]
 10736  			v.Default()
 10737  			s := v
 10738  			{
 10739  				var v string
 10740  				if unsafe {
 10741  					if isFlexible {
 10742  						v = b.UnsafeCompactString()
 10743  					} else {
 10744  						v = b.UnsafeString()
 10745  					}
 10746  				} else {
 10747  					if isFlexible {
 10748  						v = b.CompactString()
 10749  					} else {
 10750  						v = b.String()
 10751  					}
 10752  				}
 10753  				s.Topic = v
 10754  			}
 10755  			{
 10756  				v := s.Partitions
 10757  				a := v
 10758  				var l int32
 10759  				if isFlexible {
 10760  					l = b.CompactArrayLen()
 10761  				} else {
 10762  					l = b.ArrayLen()
 10763  				}
 10764  				if !b.Ok() {
 10765  					return b.Complete()
 10766  				}
 10767  				a = a[:0]
 10768  				if l > 0 {
 10769  					a = append(a, make([]OffsetCommitResponseTopicPartition, l)...)
 10770  				}
 10771  				for i := int32(0); i < l; i++ {
 10772  					v := &a[i]
 10773  					v.Default()
 10774  					s := v
 10775  					{
 10776  						v := b.Int32()
 10777  						s.Partition = v
 10778  					}
 10779  					{
 10780  						v := b.Int16()
 10781  						s.ErrorCode = v
 10782  					}
 10783  					if isFlexible {
 10784  						s.UnknownTags = internalReadTags(&b)
 10785  					}
 10786  				}
 10787  				v = a
 10788  				s.Partitions = v
 10789  			}
 10790  			if isFlexible {
 10791  				s.UnknownTags = internalReadTags(&b)
 10792  			}
 10793  		}
 10794  		v = a
 10795  		s.Topics = v
 10796  	}
 10797  	if isFlexible {
 10798  		s.UnknownTags = internalReadTags(&b)
 10799  	}
 10800  	return b.Complete()
 10801  }
 10802  
 10803  // NewPtrOffsetCommitResponse returns a pointer to a default OffsetCommitResponse
 10804  // This is a shortcut for creating a new(struct) and calling Default yourself.
 10805  func NewPtrOffsetCommitResponse() *OffsetCommitResponse {
 10806  	var v OffsetCommitResponse
 10807  	v.Default()
 10808  	return &v
 10809  }
 10810  
 10811  // Default sets any default fields. Calling this allows for future compatibility
 10812  // if new fields are added to OffsetCommitResponse.
 10813  func (v *OffsetCommitResponse) Default() {
 10814  }
 10815  
 10816  // NewOffsetCommitResponse returns a default OffsetCommitResponse
 10817  // This is a shortcut for creating a struct and calling Default yourself.
 10818  func NewOffsetCommitResponse() OffsetCommitResponse {
 10819  	var v OffsetCommitResponse
 10820  	v.Default()
 10821  	return v
 10822  }
 10823  
 10824  type OffsetFetchRequestTopic struct {
 10825  	// Topic is a topic to fetch offsets for.
 10826  	Topic string
 10827  
 10828  	// Partitions in a list of partitions in a group to fetch offsets for.
 10829  	Partitions []int32
 10830  
 10831  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10832  	UnknownTags Tags // v6+
 10833  }
 10834  
 10835  // Default sets any default fields. Calling this allows for future compatibility
 10836  // if new fields are added to OffsetFetchRequestTopic.
 10837  func (v *OffsetFetchRequestTopic) Default() {
 10838  }
 10839  
 10840  // NewOffsetFetchRequestTopic returns a default OffsetFetchRequestTopic
 10841  // This is a shortcut for creating a struct and calling Default yourself.
 10842  func NewOffsetFetchRequestTopic() OffsetFetchRequestTopic {
 10843  	var v OffsetFetchRequestTopic
 10844  	v.Default()
 10845  	return v
 10846  }
 10847  
 10848  type OffsetFetchRequestGroupTopic struct {
 10849  	Topic string
 10850  
 10851  	Partitions []int32
 10852  
 10853  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10854  	UnknownTags Tags // v6+
 10855  }
 10856  
 10857  // Default sets any default fields. Calling this allows for future compatibility
 10858  // if new fields are added to OffsetFetchRequestGroupTopic.
 10859  func (v *OffsetFetchRequestGroupTopic) Default() {
 10860  }
 10861  
 10862  // NewOffsetFetchRequestGroupTopic returns a default OffsetFetchRequestGroupTopic
 10863  // This is a shortcut for creating a struct and calling Default yourself.
 10864  func NewOffsetFetchRequestGroupTopic() OffsetFetchRequestGroupTopic {
 10865  	var v OffsetFetchRequestGroupTopic
 10866  	v.Default()
 10867  	return v
 10868  }
 10869  
 10870  type OffsetFetchRequestGroup struct {
 10871  	Group string
 10872  
 10873  	Topics []OffsetFetchRequestGroupTopic
 10874  
 10875  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10876  	UnknownTags Tags // v6+
 10877  }
 10878  
 10879  // Default sets any default fields. Calling this allows for future compatibility
 10880  // if new fields are added to OffsetFetchRequestGroup.
 10881  func (v *OffsetFetchRequestGroup) Default() {
 10882  }
 10883  
 10884  // NewOffsetFetchRequestGroup returns a default OffsetFetchRequestGroup
 10885  // This is a shortcut for creating a struct and calling Default yourself.
 10886  func NewOffsetFetchRequestGroup() OffsetFetchRequestGroup {
 10887  	var v OffsetFetchRequestGroup
 10888  	v.Default()
 10889  	return v
 10890  }
 10891  
 10892  // OffsetFetchRequest requests the most recent committed offsets for topic
 10893  // partitions in a group.
 10894  type OffsetFetchRequest struct {
 10895  	// Version is the version of this message used with a Kafka broker.
 10896  	Version int16
 10897  
 10898  	// Group is the group to fetch offsets for.
 10899  	Group string // v0-v7
 10900  
 10901  	// Topics contains topics to fetch offets for. Version 2+ allows this to be
 10902  	// null to return all topics the client is authorized to describe in the group.
 10903  	Topics []OffsetFetchRequestTopic // v0-v7
 10904  
 10905  	// Groups, introduced in v8 (Kafka 3.0), allows for fetching offsets for
 10906  	// multiple groups at a time.
 10907  	//
 10908  	// The fields here mirror the old top level fields on the request, thus they
 10909  	// are left undocumented. Refer to the top level documentation if necessary.
 10910  	Groups []OffsetFetchRequestGroup // v8+
 10911  
 10912  	// RequireStable signifies whether the broker should wait on returning
 10913  	// unstable offsets, instead setting a retryable error on the relevant
 10914  	// unstable partitions (UNSTABLE_OFFSET_COMMIT). See KIP-447 for more
 10915  	// details.
 10916  	RequireStable bool // v7+
 10917  
 10918  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 10919  	UnknownTags Tags // v6+
 10920  }
 10921  
 10922  func (*OffsetFetchRequest) Key() int16                   { return 9 }
 10923  func (*OffsetFetchRequest) MaxVersion() int16            { return 8 }
 10924  func (v *OffsetFetchRequest) SetVersion(version int16)   { v.Version = version }
 10925  func (v *OffsetFetchRequest) GetVersion() int16          { return v.Version }
 10926  func (v *OffsetFetchRequest) IsFlexible() bool           { return v.Version >= 6 }
 10927  func (v *OffsetFetchRequest) IsGroupCoordinatorRequest() {}
 10928  func (v *OffsetFetchRequest) ResponseKind() Response {
 10929  	r := &OffsetFetchResponse{Version: v.Version}
 10930  	r.Default()
 10931  	return r
 10932  }
 10933  
 10934  // RequestWith is requests v on r and returns the response or an error.
 10935  // For sharded requests, the response may be merged and still return an error.
 10936  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 10937  func (v *OffsetFetchRequest) RequestWith(ctx context.Context, r Requestor) (*OffsetFetchResponse, error) {
 10938  	kresp, err := r.Request(ctx, v)
 10939  	resp, _ := kresp.(*OffsetFetchResponse)
 10940  	return resp, err
 10941  }
 10942  
 10943  func (v *OffsetFetchRequest) AppendTo(dst []byte) []byte {
 10944  	version := v.Version
 10945  	_ = version
 10946  	isFlexible := version >= 6
 10947  	_ = isFlexible
 10948  	if version >= 0 && version <= 7 {
 10949  		v := v.Group
 10950  		if isFlexible {
 10951  			dst = kbin.AppendCompactString(dst, v)
 10952  		} else {
 10953  			dst = kbin.AppendString(dst, v)
 10954  		}
 10955  	}
 10956  	if version >= 0 && version <= 7 {
 10957  		v := v.Topics
 10958  		if version >= 2 {
 10959  			if isFlexible {
 10960  				dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 10961  			} else {
 10962  				dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 10963  			}
 10964  		} else {
 10965  			if isFlexible {
 10966  				dst = kbin.AppendCompactArrayLen(dst, len(v))
 10967  			} else {
 10968  				dst = kbin.AppendArrayLen(dst, len(v))
 10969  			}
 10970  		}
 10971  		for i := range v {
 10972  			v := &v[i]
 10973  			{
 10974  				v := v.Topic
 10975  				if isFlexible {
 10976  					dst = kbin.AppendCompactString(dst, v)
 10977  				} else {
 10978  					dst = kbin.AppendString(dst, v)
 10979  				}
 10980  			}
 10981  			{
 10982  				v := v.Partitions
 10983  				if isFlexible {
 10984  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 10985  				} else {
 10986  					dst = kbin.AppendArrayLen(dst, len(v))
 10987  				}
 10988  				for i := range v {
 10989  					v := v[i]
 10990  					dst = kbin.AppendInt32(dst, v)
 10991  				}
 10992  			}
 10993  			if isFlexible {
 10994  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 10995  				dst = v.UnknownTags.AppendEach(dst)
 10996  			}
 10997  		}
 10998  	}
 10999  	if version >= 8 {
 11000  		v := v.Groups
 11001  		if isFlexible {
 11002  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 11003  		} else {
 11004  			dst = kbin.AppendArrayLen(dst, len(v))
 11005  		}
 11006  		for i := range v {
 11007  			v := &v[i]
 11008  			{
 11009  				v := v.Group
 11010  				if isFlexible {
 11011  					dst = kbin.AppendCompactString(dst, v)
 11012  				} else {
 11013  					dst = kbin.AppendString(dst, v)
 11014  				}
 11015  			}
 11016  			{
 11017  				v := v.Topics
 11018  				if isFlexible {
 11019  					dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 11020  				} else {
 11021  					dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 11022  				}
 11023  				for i := range v {
 11024  					v := &v[i]
 11025  					{
 11026  						v := v.Topic
 11027  						if isFlexible {
 11028  							dst = kbin.AppendCompactString(dst, v)
 11029  						} else {
 11030  							dst = kbin.AppendString(dst, v)
 11031  						}
 11032  					}
 11033  					{
 11034  						v := v.Partitions
 11035  						if isFlexible {
 11036  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 11037  						} else {
 11038  							dst = kbin.AppendArrayLen(dst, len(v))
 11039  						}
 11040  						for i := range v {
 11041  							v := v[i]
 11042  							dst = kbin.AppendInt32(dst, v)
 11043  						}
 11044  					}
 11045  					if isFlexible {
 11046  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11047  						dst = v.UnknownTags.AppendEach(dst)
 11048  					}
 11049  				}
 11050  			}
 11051  			if isFlexible {
 11052  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11053  				dst = v.UnknownTags.AppendEach(dst)
 11054  			}
 11055  		}
 11056  	}
 11057  	if version >= 7 {
 11058  		v := v.RequireStable
 11059  		dst = kbin.AppendBool(dst, v)
 11060  	}
 11061  	if isFlexible {
 11062  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11063  		dst = v.UnknownTags.AppendEach(dst)
 11064  	}
 11065  	return dst
 11066  }
 11067  
 11068  func (v *OffsetFetchRequest) ReadFrom(src []byte) error {
 11069  	return v.readFrom(src, false)
 11070  }
 11071  
 11072  func (v *OffsetFetchRequest) UnsafeReadFrom(src []byte) error {
 11073  	return v.readFrom(src, true)
 11074  }
 11075  
 11076  func (v *OffsetFetchRequest) readFrom(src []byte, unsafe bool) error {
 11077  	v.Default()
 11078  	b := kbin.Reader{Src: src}
 11079  	version := v.Version
 11080  	_ = version
 11081  	isFlexible := version >= 6
 11082  	_ = isFlexible
 11083  	s := v
 11084  	if version >= 0 && version <= 7 {
 11085  		var v string
 11086  		if unsafe {
 11087  			if isFlexible {
 11088  				v = b.UnsafeCompactString()
 11089  			} else {
 11090  				v = b.UnsafeString()
 11091  			}
 11092  		} else {
 11093  			if isFlexible {
 11094  				v = b.CompactString()
 11095  			} else {
 11096  				v = b.String()
 11097  			}
 11098  		}
 11099  		s.Group = v
 11100  	}
 11101  	if version >= 0 && version <= 7 {
 11102  		v := s.Topics
 11103  		a := v
 11104  		var l int32
 11105  		if isFlexible {
 11106  			l = b.CompactArrayLen()
 11107  		} else {
 11108  			l = b.ArrayLen()
 11109  		}
 11110  		if version < 2 || l == 0 {
 11111  			a = []OffsetFetchRequestTopic{}
 11112  		}
 11113  		if !b.Ok() {
 11114  			return b.Complete()
 11115  		}
 11116  		a = a[:0]
 11117  		if l > 0 {
 11118  			a = append(a, make([]OffsetFetchRequestTopic, l)...)
 11119  		}
 11120  		for i := int32(0); i < l; i++ {
 11121  			v := &a[i]
 11122  			v.Default()
 11123  			s := v
 11124  			{
 11125  				var v string
 11126  				if unsafe {
 11127  					if isFlexible {
 11128  						v = b.UnsafeCompactString()
 11129  					} else {
 11130  						v = b.UnsafeString()
 11131  					}
 11132  				} else {
 11133  					if isFlexible {
 11134  						v = b.CompactString()
 11135  					} else {
 11136  						v = b.String()
 11137  					}
 11138  				}
 11139  				s.Topic = v
 11140  			}
 11141  			{
 11142  				v := s.Partitions
 11143  				a := v
 11144  				var l int32
 11145  				if isFlexible {
 11146  					l = b.CompactArrayLen()
 11147  				} else {
 11148  					l = b.ArrayLen()
 11149  				}
 11150  				if !b.Ok() {
 11151  					return b.Complete()
 11152  				}
 11153  				a = a[:0]
 11154  				if l > 0 {
 11155  					a = append(a, make([]int32, l)...)
 11156  				}
 11157  				for i := int32(0); i < l; i++ {
 11158  					v := b.Int32()
 11159  					a[i] = v
 11160  				}
 11161  				v = a
 11162  				s.Partitions = v
 11163  			}
 11164  			if isFlexible {
 11165  				s.UnknownTags = internalReadTags(&b)
 11166  			}
 11167  		}
 11168  		v = a
 11169  		s.Topics = v
 11170  	}
 11171  	if version >= 8 {
 11172  		v := s.Groups
 11173  		a := v
 11174  		var l int32
 11175  		if isFlexible {
 11176  			l = b.CompactArrayLen()
 11177  		} else {
 11178  			l = b.ArrayLen()
 11179  		}
 11180  		if !b.Ok() {
 11181  			return b.Complete()
 11182  		}
 11183  		a = a[:0]
 11184  		if l > 0 {
 11185  			a = append(a, make([]OffsetFetchRequestGroup, l)...)
 11186  		}
 11187  		for i := int32(0); i < l; i++ {
 11188  			v := &a[i]
 11189  			v.Default()
 11190  			s := v
 11191  			{
 11192  				var v string
 11193  				if unsafe {
 11194  					if isFlexible {
 11195  						v = b.UnsafeCompactString()
 11196  					} else {
 11197  						v = b.UnsafeString()
 11198  					}
 11199  				} else {
 11200  					if isFlexible {
 11201  						v = b.CompactString()
 11202  					} else {
 11203  						v = b.String()
 11204  					}
 11205  				}
 11206  				s.Group = v
 11207  			}
 11208  			{
 11209  				v := s.Topics
 11210  				a := v
 11211  				var l int32
 11212  				if isFlexible {
 11213  					l = b.CompactArrayLen()
 11214  				} else {
 11215  					l = b.ArrayLen()
 11216  				}
 11217  				if version < 0 || l == 0 {
 11218  					a = []OffsetFetchRequestGroupTopic{}
 11219  				}
 11220  				if !b.Ok() {
 11221  					return b.Complete()
 11222  				}
 11223  				a = a[:0]
 11224  				if l > 0 {
 11225  					a = append(a, make([]OffsetFetchRequestGroupTopic, l)...)
 11226  				}
 11227  				for i := int32(0); i < l; i++ {
 11228  					v := &a[i]
 11229  					v.Default()
 11230  					s := v
 11231  					{
 11232  						var v string
 11233  						if unsafe {
 11234  							if isFlexible {
 11235  								v = b.UnsafeCompactString()
 11236  							} else {
 11237  								v = b.UnsafeString()
 11238  							}
 11239  						} else {
 11240  							if isFlexible {
 11241  								v = b.CompactString()
 11242  							} else {
 11243  								v = b.String()
 11244  							}
 11245  						}
 11246  						s.Topic = v
 11247  					}
 11248  					{
 11249  						v := s.Partitions
 11250  						a := v
 11251  						var l int32
 11252  						if isFlexible {
 11253  							l = b.CompactArrayLen()
 11254  						} else {
 11255  							l = b.ArrayLen()
 11256  						}
 11257  						if !b.Ok() {
 11258  							return b.Complete()
 11259  						}
 11260  						a = a[:0]
 11261  						if l > 0 {
 11262  							a = append(a, make([]int32, l)...)
 11263  						}
 11264  						for i := int32(0); i < l; i++ {
 11265  							v := b.Int32()
 11266  							a[i] = v
 11267  						}
 11268  						v = a
 11269  						s.Partitions = v
 11270  					}
 11271  					if isFlexible {
 11272  						s.UnknownTags = internalReadTags(&b)
 11273  					}
 11274  				}
 11275  				v = a
 11276  				s.Topics = v
 11277  			}
 11278  			if isFlexible {
 11279  				s.UnknownTags = internalReadTags(&b)
 11280  			}
 11281  		}
 11282  		v = a
 11283  		s.Groups = v
 11284  	}
 11285  	if version >= 7 {
 11286  		v := b.Bool()
 11287  		s.RequireStable = v
 11288  	}
 11289  	if isFlexible {
 11290  		s.UnknownTags = internalReadTags(&b)
 11291  	}
 11292  	return b.Complete()
 11293  }
 11294  
 11295  // NewPtrOffsetFetchRequest returns a pointer to a default OffsetFetchRequest
 11296  // This is a shortcut for creating a new(struct) and calling Default yourself.
 11297  func NewPtrOffsetFetchRequest() *OffsetFetchRequest {
 11298  	var v OffsetFetchRequest
 11299  	v.Default()
 11300  	return &v
 11301  }
 11302  
 11303  // Default sets any default fields. Calling this allows for future compatibility
 11304  // if new fields are added to OffsetFetchRequest.
 11305  func (v *OffsetFetchRequest) Default() {
 11306  }
 11307  
 11308  // NewOffsetFetchRequest returns a default OffsetFetchRequest
 11309  // This is a shortcut for creating a struct and calling Default yourself.
 11310  func NewOffsetFetchRequest() OffsetFetchRequest {
 11311  	var v OffsetFetchRequest
 11312  	v.Default()
 11313  	return v
 11314  }
 11315  
 11316  type OffsetFetchResponseTopicPartition struct {
 11317  	// Partition is the partition in a topic this array slot corresponds to.
 11318  	Partition int32
 11319  
 11320  	// Offset is the most recently committed offset for this topic partition
 11321  	// in a group.
 11322  	Offset int64
 11323  
 11324  	// LeaderEpoch is the leader epoch of the last consumed record.
 11325  	//
 11326  	// This was proposed in KIP-320 and introduced in Kafka 2.1.0 and allows
 11327  	// clients to detect log truncation. See the KIP for more details.
 11328  	//
 11329  	// This field has a default of -1.
 11330  	LeaderEpoch int32 // v5+
 11331  
 11332  	// Metadata is client provided metadata corresponding to the offset commit.
 11333  	// This can be useful for adding who made the commit, etc.
 11334  	Metadata *string
 11335  
 11336  	// ErrorCode is the error for this partition response.
 11337  	//
 11338  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 11339  	// to the group.
 11340  	//
 11341  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 11342  	//
 11343  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available
 11344  	// (due to the requested broker shutting down or it has not completed startup).
 11345  	//
 11346  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is loading.
 11347  	//
 11348  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 11349  	// for the requested group.
 11350  	//
 11351  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the requested topic or partition
 11352  	// is unknown.
 11353  	//
 11354  	// UNSTABLE_OFFSET_COMMIT is returned for v7+ if the request set RequireStable.
 11355  	// See KIP-447 for more details.
 11356  	ErrorCode int16
 11357  
 11358  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 11359  	UnknownTags Tags // v6+
 11360  }
 11361  
 11362  // Default sets any default fields. Calling this allows for future compatibility
 11363  // if new fields are added to OffsetFetchResponseTopicPartition.
 11364  func (v *OffsetFetchResponseTopicPartition) Default() {
 11365  	v.LeaderEpoch = -1
 11366  }
 11367  
 11368  // NewOffsetFetchResponseTopicPartition returns a default OffsetFetchResponseTopicPartition
 11369  // This is a shortcut for creating a struct and calling Default yourself.
 11370  func NewOffsetFetchResponseTopicPartition() OffsetFetchResponseTopicPartition {
 11371  	var v OffsetFetchResponseTopicPartition
 11372  	v.Default()
 11373  	return v
 11374  }
 11375  
 11376  type OffsetFetchResponseTopic struct {
 11377  	// Topic is the topic this offset fetch response corresponds to.
 11378  	Topic string
 11379  
 11380  	// Partitions contains responses for each requested partition in
 11381  	// a topic.
 11382  	Partitions []OffsetFetchResponseTopicPartition
 11383  
 11384  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 11385  	UnknownTags Tags // v6+
 11386  }
 11387  
 11388  // Default sets any default fields. Calling this allows for future compatibility
 11389  // if new fields are added to OffsetFetchResponseTopic.
 11390  func (v *OffsetFetchResponseTopic) Default() {
 11391  }
 11392  
 11393  // NewOffsetFetchResponseTopic returns a default OffsetFetchResponseTopic
 11394  // This is a shortcut for creating a struct and calling Default yourself.
 11395  func NewOffsetFetchResponseTopic() OffsetFetchResponseTopic {
 11396  	var v OffsetFetchResponseTopic
 11397  	v.Default()
 11398  	return v
 11399  }
 11400  
 11401  type OffsetFetchResponseGroupTopicPartition struct {
 11402  	Partition int32
 11403  
 11404  	Offset int64
 11405  
 11406  	// This field has a default of -1.
 11407  	LeaderEpoch int32
 11408  
 11409  	Metadata *string
 11410  
 11411  	ErrorCode int16
 11412  
 11413  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 11414  	UnknownTags Tags // v6+
 11415  }
 11416  
 11417  // Default sets any default fields. Calling this allows for future compatibility
 11418  // if new fields are added to OffsetFetchResponseGroupTopicPartition.
 11419  func (v *OffsetFetchResponseGroupTopicPartition) Default() {
 11420  	v.LeaderEpoch = -1
 11421  }
 11422  
 11423  // NewOffsetFetchResponseGroupTopicPartition returns a default OffsetFetchResponseGroupTopicPartition
 11424  // This is a shortcut for creating a struct and calling Default yourself.
 11425  func NewOffsetFetchResponseGroupTopicPartition() OffsetFetchResponseGroupTopicPartition {
 11426  	var v OffsetFetchResponseGroupTopicPartition
 11427  	v.Default()
 11428  	return v
 11429  }
 11430  
 11431  type OffsetFetchResponseGroupTopic struct {
 11432  	Topic string
 11433  
 11434  	Partitions []OffsetFetchResponseGroupTopicPartition
 11435  
 11436  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 11437  	UnknownTags Tags // v6+
 11438  }
 11439  
 11440  // Default sets any default fields. Calling this allows for future compatibility
 11441  // if new fields are added to OffsetFetchResponseGroupTopic.
 11442  func (v *OffsetFetchResponseGroupTopic) Default() {
 11443  }
 11444  
 11445  // NewOffsetFetchResponseGroupTopic returns a default OffsetFetchResponseGroupTopic
 11446  // This is a shortcut for creating a struct and calling Default yourself.
 11447  func NewOffsetFetchResponseGroupTopic() OffsetFetchResponseGroupTopic {
 11448  	var v OffsetFetchResponseGroupTopic
 11449  	v.Default()
 11450  	return v
 11451  }
 11452  
 11453  type OffsetFetchResponseGroup struct {
 11454  	Group string
 11455  
 11456  	Topics []OffsetFetchResponseGroupTopic
 11457  
 11458  	ErrorCode int16
 11459  
 11460  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 11461  	UnknownTags Tags // v6+
 11462  }
 11463  
 11464  // Default sets any default fields. Calling this allows for future compatibility
 11465  // if new fields are added to OffsetFetchResponseGroup.
 11466  func (v *OffsetFetchResponseGroup) Default() {
 11467  }
 11468  
 11469  // NewOffsetFetchResponseGroup returns a default OffsetFetchResponseGroup
 11470  // This is a shortcut for creating a struct and calling Default yourself.
 11471  func NewOffsetFetchResponseGroup() OffsetFetchResponseGroup {
 11472  	var v OffsetFetchResponseGroup
 11473  	v.Default()
 11474  	return v
 11475  }
 11476  
 11477  // OffsetFetchResponse is returned from an OffsetFetchRequest.
 11478  type OffsetFetchResponse struct {
 11479  	// Version is the version of this message used with a Kafka broker.
 11480  	Version int16
 11481  
 11482  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 11483  	// after this request.
 11484  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 11485  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 11486  	//
 11487  	// This request switched at version 4.
 11488  	ThrottleMillis int32 // v3+
 11489  
 11490  	// Topics contains responses for each requested topic/partition.
 11491  	Topics []OffsetFetchResponseTopic // v0-v7
 11492  
 11493  	// ErrorCode is a top level error code that applies to all topic/partitions.
 11494  	// This will be any group error.
 11495  	ErrorCode int16 // v2-v7
 11496  
 11497  	// Groups is the response for all groups. Each field mirrors the fields in the
 11498  	// top level request, thus they are left undocumented. Refer to the top level
 11499  	// documentation if necessary.
 11500  	Groups []OffsetFetchResponseGroup // v8+
 11501  
 11502  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 11503  	UnknownTags Tags // v6+
 11504  }
 11505  
 11506  func (*OffsetFetchResponse) Key() int16                         { return 9 }
 11507  func (*OffsetFetchResponse) MaxVersion() int16                  { return 8 }
 11508  func (v *OffsetFetchResponse) SetVersion(version int16)         { v.Version = version }
 11509  func (v *OffsetFetchResponse) GetVersion() int16                { return v.Version }
 11510  func (v *OffsetFetchResponse) IsFlexible() bool                 { return v.Version >= 6 }
 11511  func (v *OffsetFetchResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 4 }
 11512  func (v *OffsetFetchResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 11513  func (v *OffsetFetchResponse) RequestKind() Request             { return &OffsetFetchRequest{Version: v.Version} }
 11514  
 11515  func (v *OffsetFetchResponse) AppendTo(dst []byte) []byte {
 11516  	version := v.Version
 11517  	_ = version
 11518  	isFlexible := version >= 6
 11519  	_ = isFlexible
 11520  	if version >= 3 {
 11521  		v := v.ThrottleMillis
 11522  		dst = kbin.AppendInt32(dst, v)
 11523  	}
 11524  	if version >= 0 && version <= 7 {
 11525  		v := v.Topics
 11526  		if isFlexible {
 11527  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 11528  		} else {
 11529  			dst = kbin.AppendArrayLen(dst, len(v))
 11530  		}
 11531  		for i := range v {
 11532  			v := &v[i]
 11533  			{
 11534  				v := v.Topic
 11535  				if isFlexible {
 11536  					dst = kbin.AppendCompactString(dst, v)
 11537  				} else {
 11538  					dst = kbin.AppendString(dst, v)
 11539  				}
 11540  			}
 11541  			{
 11542  				v := v.Partitions
 11543  				if isFlexible {
 11544  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 11545  				} else {
 11546  					dst = kbin.AppendArrayLen(dst, len(v))
 11547  				}
 11548  				for i := range v {
 11549  					v := &v[i]
 11550  					{
 11551  						v := v.Partition
 11552  						dst = kbin.AppendInt32(dst, v)
 11553  					}
 11554  					{
 11555  						v := v.Offset
 11556  						dst = kbin.AppendInt64(dst, v)
 11557  					}
 11558  					if version >= 5 {
 11559  						v := v.LeaderEpoch
 11560  						dst = kbin.AppendInt32(dst, v)
 11561  					}
 11562  					{
 11563  						v := v.Metadata
 11564  						if isFlexible {
 11565  							dst = kbin.AppendCompactNullableString(dst, v)
 11566  						} else {
 11567  							dst = kbin.AppendNullableString(dst, v)
 11568  						}
 11569  					}
 11570  					{
 11571  						v := v.ErrorCode
 11572  						dst = kbin.AppendInt16(dst, v)
 11573  					}
 11574  					if isFlexible {
 11575  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11576  						dst = v.UnknownTags.AppendEach(dst)
 11577  					}
 11578  				}
 11579  			}
 11580  			if isFlexible {
 11581  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11582  				dst = v.UnknownTags.AppendEach(dst)
 11583  			}
 11584  		}
 11585  	}
 11586  	if version >= 2 && version <= 7 {
 11587  		v := v.ErrorCode
 11588  		dst = kbin.AppendInt16(dst, v)
 11589  	}
 11590  	if version >= 8 {
 11591  		v := v.Groups
 11592  		if isFlexible {
 11593  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 11594  		} else {
 11595  			dst = kbin.AppendArrayLen(dst, len(v))
 11596  		}
 11597  		for i := range v {
 11598  			v := &v[i]
 11599  			{
 11600  				v := v.Group
 11601  				if isFlexible {
 11602  					dst = kbin.AppendCompactString(dst, v)
 11603  				} else {
 11604  					dst = kbin.AppendString(dst, v)
 11605  				}
 11606  			}
 11607  			{
 11608  				v := v.Topics
 11609  				if isFlexible {
 11610  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 11611  				} else {
 11612  					dst = kbin.AppendArrayLen(dst, len(v))
 11613  				}
 11614  				for i := range v {
 11615  					v := &v[i]
 11616  					{
 11617  						v := v.Topic
 11618  						if isFlexible {
 11619  							dst = kbin.AppendCompactString(dst, v)
 11620  						} else {
 11621  							dst = kbin.AppendString(dst, v)
 11622  						}
 11623  					}
 11624  					{
 11625  						v := v.Partitions
 11626  						if isFlexible {
 11627  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 11628  						} else {
 11629  							dst = kbin.AppendArrayLen(dst, len(v))
 11630  						}
 11631  						for i := range v {
 11632  							v := &v[i]
 11633  							{
 11634  								v := v.Partition
 11635  								dst = kbin.AppendInt32(dst, v)
 11636  							}
 11637  							{
 11638  								v := v.Offset
 11639  								dst = kbin.AppendInt64(dst, v)
 11640  							}
 11641  							{
 11642  								v := v.LeaderEpoch
 11643  								dst = kbin.AppendInt32(dst, v)
 11644  							}
 11645  							{
 11646  								v := v.Metadata
 11647  								if isFlexible {
 11648  									dst = kbin.AppendCompactNullableString(dst, v)
 11649  								} else {
 11650  									dst = kbin.AppendNullableString(dst, v)
 11651  								}
 11652  							}
 11653  							{
 11654  								v := v.ErrorCode
 11655  								dst = kbin.AppendInt16(dst, v)
 11656  							}
 11657  							if isFlexible {
 11658  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11659  								dst = v.UnknownTags.AppendEach(dst)
 11660  							}
 11661  						}
 11662  					}
 11663  					if isFlexible {
 11664  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11665  						dst = v.UnknownTags.AppendEach(dst)
 11666  					}
 11667  				}
 11668  			}
 11669  			{
 11670  				v := v.ErrorCode
 11671  				dst = kbin.AppendInt16(dst, v)
 11672  			}
 11673  			if isFlexible {
 11674  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11675  				dst = v.UnknownTags.AppendEach(dst)
 11676  			}
 11677  		}
 11678  	}
 11679  	if isFlexible {
 11680  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 11681  		dst = v.UnknownTags.AppendEach(dst)
 11682  	}
 11683  	return dst
 11684  }
 11685  
 11686  func (v *OffsetFetchResponse) ReadFrom(src []byte) error {
 11687  	return v.readFrom(src, false)
 11688  }
 11689  
 11690  func (v *OffsetFetchResponse) UnsafeReadFrom(src []byte) error {
 11691  	return v.readFrom(src, true)
 11692  }
 11693  
 11694  func (v *OffsetFetchResponse) readFrom(src []byte, unsafe bool) error {
 11695  	v.Default()
 11696  	b := kbin.Reader{Src: src}
 11697  	version := v.Version
 11698  	_ = version
 11699  	isFlexible := version >= 6
 11700  	_ = isFlexible
 11701  	s := v
 11702  	if version >= 3 {
 11703  		v := b.Int32()
 11704  		s.ThrottleMillis = v
 11705  	}
 11706  	if version >= 0 && version <= 7 {
 11707  		v := s.Topics
 11708  		a := v
 11709  		var l int32
 11710  		if isFlexible {
 11711  			l = b.CompactArrayLen()
 11712  		} else {
 11713  			l = b.ArrayLen()
 11714  		}
 11715  		if !b.Ok() {
 11716  			return b.Complete()
 11717  		}
 11718  		a = a[:0]
 11719  		if l > 0 {
 11720  			a = append(a, make([]OffsetFetchResponseTopic, l)...)
 11721  		}
 11722  		for i := int32(0); i < l; i++ {
 11723  			v := &a[i]
 11724  			v.Default()
 11725  			s := v
 11726  			{
 11727  				var v string
 11728  				if unsafe {
 11729  					if isFlexible {
 11730  						v = b.UnsafeCompactString()
 11731  					} else {
 11732  						v = b.UnsafeString()
 11733  					}
 11734  				} else {
 11735  					if isFlexible {
 11736  						v = b.CompactString()
 11737  					} else {
 11738  						v = b.String()
 11739  					}
 11740  				}
 11741  				s.Topic = v
 11742  			}
 11743  			{
 11744  				v := s.Partitions
 11745  				a := v
 11746  				var l int32
 11747  				if isFlexible {
 11748  					l = b.CompactArrayLen()
 11749  				} else {
 11750  					l = b.ArrayLen()
 11751  				}
 11752  				if !b.Ok() {
 11753  					return b.Complete()
 11754  				}
 11755  				a = a[:0]
 11756  				if l > 0 {
 11757  					a = append(a, make([]OffsetFetchResponseTopicPartition, l)...)
 11758  				}
 11759  				for i := int32(0); i < l; i++ {
 11760  					v := &a[i]
 11761  					v.Default()
 11762  					s := v
 11763  					{
 11764  						v := b.Int32()
 11765  						s.Partition = v
 11766  					}
 11767  					{
 11768  						v := b.Int64()
 11769  						s.Offset = v
 11770  					}
 11771  					if version >= 5 {
 11772  						v := b.Int32()
 11773  						s.LeaderEpoch = v
 11774  					}
 11775  					{
 11776  						var v *string
 11777  						if isFlexible {
 11778  							if unsafe {
 11779  								v = b.UnsafeCompactNullableString()
 11780  							} else {
 11781  								v = b.CompactNullableString()
 11782  							}
 11783  						} else {
 11784  							if unsafe {
 11785  								v = b.UnsafeNullableString()
 11786  							} else {
 11787  								v = b.NullableString()
 11788  							}
 11789  						}
 11790  						s.Metadata = v
 11791  					}
 11792  					{
 11793  						v := b.Int16()
 11794  						s.ErrorCode = v
 11795  					}
 11796  					if isFlexible {
 11797  						s.UnknownTags = internalReadTags(&b)
 11798  					}
 11799  				}
 11800  				v = a
 11801  				s.Partitions = v
 11802  			}
 11803  			if isFlexible {
 11804  				s.UnknownTags = internalReadTags(&b)
 11805  			}
 11806  		}
 11807  		v = a
 11808  		s.Topics = v
 11809  	}
 11810  	if version >= 2 && version <= 7 {
 11811  		v := b.Int16()
 11812  		s.ErrorCode = v
 11813  	}
 11814  	if version >= 8 {
 11815  		v := s.Groups
 11816  		a := v
 11817  		var l int32
 11818  		if isFlexible {
 11819  			l = b.CompactArrayLen()
 11820  		} else {
 11821  			l = b.ArrayLen()
 11822  		}
 11823  		if !b.Ok() {
 11824  			return b.Complete()
 11825  		}
 11826  		a = a[:0]
 11827  		if l > 0 {
 11828  			a = append(a, make([]OffsetFetchResponseGroup, l)...)
 11829  		}
 11830  		for i := int32(0); i < l; i++ {
 11831  			v := &a[i]
 11832  			v.Default()
 11833  			s := v
 11834  			{
 11835  				var v string
 11836  				if unsafe {
 11837  					if isFlexible {
 11838  						v = b.UnsafeCompactString()
 11839  					} else {
 11840  						v = b.UnsafeString()
 11841  					}
 11842  				} else {
 11843  					if isFlexible {
 11844  						v = b.CompactString()
 11845  					} else {
 11846  						v = b.String()
 11847  					}
 11848  				}
 11849  				s.Group = v
 11850  			}
 11851  			{
 11852  				v := s.Topics
 11853  				a := v
 11854  				var l int32
 11855  				if isFlexible {
 11856  					l = b.CompactArrayLen()
 11857  				} else {
 11858  					l = b.ArrayLen()
 11859  				}
 11860  				if !b.Ok() {
 11861  					return b.Complete()
 11862  				}
 11863  				a = a[:0]
 11864  				if l > 0 {
 11865  					a = append(a, make([]OffsetFetchResponseGroupTopic, l)...)
 11866  				}
 11867  				for i := int32(0); i < l; i++ {
 11868  					v := &a[i]
 11869  					v.Default()
 11870  					s := v
 11871  					{
 11872  						var v string
 11873  						if unsafe {
 11874  							if isFlexible {
 11875  								v = b.UnsafeCompactString()
 11876  							} else {
 11877  								v = b.UnsafeString()
 11878  							}
 11879  						} else {
 11880  							if isFlexible {
 11881  								v = b.CompactString()
 11882  							} else {
 11883  								v = b.String()
 11884  							}
 11885  						}
 11886  						s.Topic = v
 11887  					}
 11888  					{
 11889  						v := s.Partitions
 11890  						a := v
 11891  						var l int32
 11892  						if isFlexible {
 11893  							l = b.CompactArrayLen()
 11894  						} else {
 11895  							l = b.ArrayLen()
 11896  						}
 11897  						if !b.Ok() {
 11898  							return b.Complete()
 11899  						}
 11900  						a = a[:0]
 11901  						if l > 0 {
 11902  							a = append(a, make([]OffsetFetchResponseGroupTopicPartition, l)...)
 11903  						}
 11904  						for i := int32(0); i < l; i++ {
 11905  							v := &a[i]
 11906  							v.Default()
 11907  							s := v
 11908  							{
 11909  								v := b.Int32()
 11910  								s.Partition = v
 11911  							}
 11912  							{
 11913  								v := b.Int64()
 11914  								s.Offset = v
 11915  							}
 11916  							{
 11917  								v := b.Int32()
 11918  								s.LeaderEpoch = v
 11919  							}
 11920  							{
 11921  								var v *string
 11922  								if isFlexible {
 11923  									if unsafe {
 11924  										v = b.UnsafeCompactNullableString()
 11925  									} else {
 11926  										v = b.CompactNullableString()
 11927  									}
 11928  								} else {
 11929  									if unsafe {
 11930  										v = b.UnsafeNullableString()
 11931  									} else {
 11932  										v = b.NullableString()
 11933  									}
 11934  								}
 11935  								s.Metadata = v
 11936  							}
 11937  							{
 11938  								v := b.Int16()
 11939  								s.ErrorCode = v
 11940  							}
 11941  							if isFlexible {
 11942  								s.UnknownTags = internalReadTags(&b)
 11943  							}
 11944  						}
 11945  						v = a
 11946  						s.Partitions = v
 11947  					}
 11948  					if isFlexible {
 11949  						s.UnknownTags = internalReadTags(&b)
 11950  					}
 11951  				}
 11952  				v = a
 11953  				s.Topics = v
 11954  			}
 11955  			{
 11956  				v := b.Int16()
 11957  				s.ErrorCode = v
 11958  			}
 11959  			if isFlexible {
 11960  				s.UnknownTags = internalReadTags(&b)
 11961  			}
 11962  		}
 11963  		v = a
 11964  		s.Groups = v
 11965  	}
 11966  	if isFlexible {
 11967  		s.UnknownTags = internalReadTags(&b)
 11968  	}
 11969  	return b.Complete()
 11970  }
 11971  
 11972  // NewPtrOffsetFetchResponse returns a pointer to a default OffsetFetchResponse
 11973  // This is a shortcut for creating a new(struct) and calling Default yourself.
 11974  func NewPtrOffsetFetchResponse() *OffsetFetchResponse {
 11975  	var v OffsetFetchResponse
 11976  	v.Default()
 11977  	return &v
 11978  }
 11979  
 11980  // Default sets any default fields. Calling this allows for future compatibility
 11981  // if new fields are added to OffsetFetchResponse.
 11982  func (v *OffsetFetchResponse) Default() {
 11983  }
 11984  
 11985  // NewOffsetFetchResponse returns a default OffsetFetchResponse
 11986  // This is a shortcut for creating a struct and calling Default yourself.
 11987  func NewOffsetFetchResponse() OffsetFetchResponse {
 11988  	var v OffsetFetchResponse
 11989  	v.Default()
 11990  	return v
 11991  }
 11992  
 11993  // FindCoordinatorRequest requests the coordinator for a group or transaction.
 11994  //
 11995  // This coordinator is different from the broker leader coordinator. This
 11996  // coordinator is the partition leader for the partition that is storing
 11997  // the group or transaction ID.
 11998  type FindCoordinatorRequest struct {
 11999  	// Version is the version of this message used with a Kafka broker.
 12000  	Version int16
 12001  
 12002  	// CoordinatorKey is the ID to use for finding the coordinator. For groups,
 12003  	// this is the group name, for transactional producer, this is the
 12004  	// transactional ID.
 12005  	CoordinatorKey string // v0-v3
 12006  
 12007  	// CoordinatorType is the type that key is. Groups are type 0,
 12008  	// transactional IDs are type 1.
 12009  	CoordinatorType int8 // v1+
 12010  
 12011  	// CoordinatorKeys contains all keys to find the coordinator for.
 12012  	CoordinatorKeys []string // v4+
 12013  
 12014  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 12015  	UnknownTags Tags // v3+
 12016  }
 12017  
 12018  func (*FindCoordinatorRequest) Key() int16                 { return 10 }
 12019  func (*FindCoordinatorRequest) MaxVersion() int16          { return 4 }
 12020  func (v *FindCoordinatorRequest) SetVersion(version int16) { v.Version = version }
 12021  func (v *FindCoordinatorRequest) GetVersion() int16        { return v.Version }
 12022  func (v *FindCoordinatorRequest) IsFlexible() bool         { return v.Version >= 3 }
 12023  func (v *FindCoordinatorRequest) ResponseKind() Response {
 12024  	r := &FindCoordinatorResponse{Version: v.Version}
 12025  	r.Default()
 12026  	return r
 12027  }
 12028  
 12029  // RequestWith is requests v on r and returns the response or an error.
 12030  // For sharded requests, the response may be merged and still return an error.
 12031  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 12032  func (v *FindCoordinatorRequest) RequestWith(ctx context.Context, r Requestor) (*FindCoordinatorResponse, error) {
 12033  	kresp, err := r.Request(ctx, v)
 12034  	resp, _ := kresp.(*FindCoordinatorResponse)
 12035  	return resp, err
 12036  }
 12037  
 12038  func (v *FindCoordinatorRequest) AppendTo(dst []byte) []byte {
 12039  	version := v.Version
 12040  	_ = version
 12041  	isFlexible := version >= 3
 12042  	_ = isFlexible
 12043  	if version >= 0 && version <= 3 {
 12044  		v := v.CoordinatorKey
 12045  		if isFlexible {
 12046  			dst = kbin.AppendCompactString(dst, v)
 12047  		} else {
 12048  			dst = kbin.AppendString(dst, v)
 12049  		}
 12050  	}
 12051  	if version >= 1 {
 12052  		v := v.CoordinatorType
 12053  		dst = kbin.AppendInt8(dst, v)
 12054  	}
 12055  	if version >= 4 {
 12056  		v := v.CoordinatorKeys
 12057  		if isFlexible {
 12058  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 12059  		} else {
 12060  			dst = kbin.AppendArrayLen(dst, len(v))
 12061  		}
 12062  		for i := range v {
 12063  			v := v[i]
 12064  			if isFlexible {
 12065  				dst = kbin.AppendCompactString(dst, v)
 12066  			} else {
 12067  				dst = kbin.AppendString(dst, v)
 12068  			}
 12069  		}
 12070  	}
 12071  	if isFlexible {
 12072  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 12073  		dst = v.UnknownTags.AppendEach(dst)
 12074  	}
 12075  	return dst
 12076  }
 12077  
 12078  func (v *FindCoordinatorRequest) ReadFrom(src []byte) error {
 12079  	return v.readFrom(src, false)
 12080  }
 12081  
 12082  func (v *FindCoordinatorRequest) UnsafeReadFrom(src []byte) error {
 12083  	return v.readFrom(src, true)
 12084  }
 12085  
 12086  func (v *FindCoordinatorRequest) readFrom(src []byte, unsafe bool) error {
 12087  	v.Default()
 12088  	b := kbin.Reader{Src: src}
 12089  	version := v.Version
 12090  	_ = version
 12091  	isFlexible := version >= 3
 12092  	_ = isFlexible
 12093  	s := v
 12094  	if version >= 0 && version <= 3 {
 12095  		var v string
 12096  		if unsafe {
 12097  			if isFlexible {
 12098  				v = b.UnsafeCompactString()
 12099  			} else {
 12100  				v = b.UnsafeString()
 12101  			}
 12102  		} else {
 12103  			if isFlexible {
 12104  				v = b.CompactString()
 12105  			} else {
 12106  				v = b.String()
 12107  			}
 12108  		}
 12109  		s.CoordinatorKey = v
 12110  	}
 12111  	if version >= 1 {
 12112  		v := b.Int8()
 12113  		s.CoordinatorType = v
 12114  	}
 12115  	if version >= 4 {
 12116  		v := s.CoordinatorKeys
 12117  		a := v
 12118  		var l int32
 12119  		if isFlexible {
 12120  			l = b.CompactArrayLen()
 12121  		} else {
 12122  			l = b.ArrayLen()
 12123  		}
 12124  		if !b.Ok() {
 12125  			return b.Complete()
 12126  		}
 12127  		a = a[:0]
 12128  		if l > 0 {
 12129  			a = append(a, make([]string, l)...)
 12130  		}
 12131  		for i := int32(0); i < l; i++ {
 12132  			var v string
 12133  			if unsafe {
 12134  				if isFlexible {
 12135  					v = b.UnsafeCompactString()
 12136  				} else {
 12137  					v = b.UnsafeString()
 12138  				}
 12139  			} else {
 12140  				if isFlexible {
 12141  					v = b.CompactString()
 12142  				} else {
 12143  					v = b.String()
 12144  				}
 12145  			}
 12146  			a[i] = v
 12147  		}
 12148  		v = a
 12149  		s.CoordinatorKeys = v
 12150  	}
 12151  	if isFlexible {
 12152  		s.UnknownTags = internalReadTags(&b)
 12153  	}
 12154  	return b.Complete()
 12155  }
 12156  
 12157  // NewPtrFindCoordinatorRequest returns a pointer to a default FindCoordinatorRequest
 12158  // This is a shortcut for creating a new(struct) and calling Default yourself.
 12159  func NewPtrFindCoordinatorRequest() *FindCoordinatorRequest {
 12160  	var v FindCoordinatorRequest
 12161  	v.Default()
 12162  	return &v
 12163  }
 12164  
 12165  // Default sets any default fields. Calling this allows for future compatibility
 12166  // if new fields are added to FindCoordinatorRequest.
 12167  func (v *FindCoordinatorRequest) Default() {
 12168  }
 12169  
 12170  // NewFindCoordinatorRequest returns a default FindCoordinatorRequest
 12171  // This is a shortcut for creating a struct and calling Default yourself.
 12172  func NewFindCoordinatorRequest() FindCoordinatorRequest {
 12173  	var v FindCoordinatorRequest
 12174  	v.Default()
 12175  	return v
 12176  }
 12177  
 12178  type FindCoordinatorResponseCoordinator struct {
 12179  	Key string
 12180  
 12181  	NodeID int32
 12182  
 12183  	Host string
 12184  
 12185  	Port int32
 12186  
 12187  	ErrorCode int16
 12188  
 12189  	ErrorMessage *string
 12190  
 12191  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 12192  	UnknownTags Tags // v3+
 12193  }
 12194  
 12195  // Default sets any default fields. Calling this allows for future compatibility
 12196  // if new fields are added to FindCoordinatorResponseCoordinator.
 12197  func (v *FindCoordinatorResponseCoordinator) Default() {
 12198  }
 12199  
 12200  // NewFindCoordinatorResponseCoordinator returns a default FindCoordinatorResponseCoordinator
 12201  // This is a shortcut for creating a struct and calling Default yourself.
 12202  func NewFindCoordinatorResponseCoordinator() FindCoordinatorResponseCoordinator {
 12203  	var v FindCoordinatorResponseCoordinator
 12204  	v.Default()
 12205  	return v
 12206  }
 12207  
 12208  // FindCoordinatorResponse is returned from a FindCoordinatorRequest.
 12209  type FindCoordinatorResponse struct {
 12210  	// Version is the version of this message used with a Kafka broker.
 12211  	Version int16
 12212  
 12213  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 12214  	// after this request.
 12215  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 12216  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 12217  	//
 12218  	// This request switched at version 2.
 12219  	ThrottleMillis int32 // v1+
 12220  
 12221  	// ErrorCode is the error returned for the request.
 12222  	//
 12223  	// GROUP_AUTHORIZATION_FAILED is returned if for a group ID request and the
 12224  	// client is not authorized to describe groups.
 12225  	//
 12226  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned for a transactional ID
 12227  	// request and the client is not authorized to describe transactional IDs.
 12228  	//
 12229  	// INVALID_REQUEST is returned if not asking for a known type (group,
 12230  	// or transaction).
 12231  	//
 12232  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available
 12233  	// for the requested ID, which would be if the group or transactional topic
 12234  	// does not exist or the partition the requested key maps to is not available.
 12235  	ErrorCode int16 // v0-v3
 12236  
 12237  	// ErrorMessage is an informative message if the request errored.
 12238  	ErrorMessage *string // v1-v3
 12239  
 12240  	// NodeID is the broker ID of the coordinator.
 12241  	NodeID int32 // v0-v3
 12242  
 12243  	// Host is the host of the coordinator.
 12244  	Host string // v0-v3
 12245  
 12246  	// Port is the port of the coordinator.
 12247  	Port int32 // v0-v3
 12248  
 12249  	// Coordinators, introduced for KIP-699, is the bulk response for
 12250  	// coordinators. The fields in the struct exactly match the original fields
 12251  	// in the FindCoordinatorResponse, thus they are left undocumented.
 12252  	Coordinators []FindCoordinatorResponseCoordinator // v4+
 12253  
 12254  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 12255  	UnknownTags Tags // v3+
 12256  }
 12257  
 12258  func (*FindCoordinatorResponse) Key() int16                 { return 10 }
 12259  func (*FindCoordinatorResponse) MaxVersion() int16          { return 4 }
 12260  func (v *FindCoordinatorResponse) SetVersion(version int16) { v.Version = version }
 12261  func (v *FindCoordinatorResponse) GetVersion() int16        { return v.Version }
 12262  func (v *FindCoordinatorResponse) IsFlexible() bool         { return v.Version >= 3 }
 12263  func (v *FindCoordinatorResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 2 }
 12264  func (v *FindCoordinatorResponse) SetThrottle(throttleMillis int32) {
 12265  	v.ThrottleMillis = throttleMillis
 12266  }
 12267  
 12268  func (v *FindCoordinatorResponse) RequestKind() Request {
 12269  	return &FindCoordinatorRequest{Version: v.Version}
 12270  }
 12271  
 12272  func (v *FindCoordinatorResponse) AppendTo(dst []byte) []byte {
 12273  	version := v.Version
 12274  	_ = version
 12275  	isFlexible := version >= 3
 12276  	_ = isFlexible
 12277  	if version >= 1 {
 12278  		v := v.ThrottleMillis
 12279  		dst = kbin.AppendInt32(dst, v)
 12280  	}
 12281  	if version >= 0 && version <= 3 {
 12282  		v := v.ErrorCode
 12283  		dst = kbin.AppendInt16(dst, v)
 12284  	}
 12285  	if version >= 1 && version <= 3 {
 12286  		v := v.ErrorMessage
 12287  		if isFlexible {
 12288  			dst = kbin.AppendCompactNullableString(dst, v)
 12289  		} else {
 12290  			dst = kbin.AppendNullableString(dst, v)
 12291  		}
 12292  	}
 12293  	if version >= 0 && version <= 3 {
 12294  		v := v.NodeID
 12295  		dst = kbin.AppendInt32(dst, v)
 12296  	}
 12297  	if version >= 0 && version <= 3 {
 12298  		v := v.Host
 12299  		if isFlexible {
 12300  			dst = kbin.AppendCompactString(dst, v)
 12301  		} else {
 12302  			dst = kbin.AppendString(dst, v)
 12303  		}
 12304  	}
 12305  	if version >= 0 && version <= 3 {
 12306  		v := v.Port
 12307  		dst = kbin.AppendInt32(dst, v)
 12308  	}
 12309  	if version >= 4 {
 12310  		v := v.Coordinators
 12311  		if isFlexible {
 12312  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 12313  		} else {
 12314  			dst = kbin.AppendArrayLen(dst, len(v))
 12315  		}
 12316  		for i := range v {
 12317  			v := &v[i]
 12318  			{
 12319  				v := v.Key
 12320  				if isFlexible {
 12321  					dst = kbin.AppendCompactString(dst, v)
 12322  				} else {
 12323  					dst = kbin.AppendString(dst, v)
 12324  				}
 12325  			}
 12326  			{
 12327  				v := v.NodeID
 12328  				dst = kbin.AppendInt32(dst, v)
 12329  			}
 12330  			{
 12331  				v := v.Host
 12332  				if isFlexible {
 12333  					dst = kbin.AppendCompactString(dst, v)
 12334  				} else {
 12335  					dst = kbin.AppendString(dst, v)
 12336  				}
 12337  			}
 12338  			{
 12339  				v := v.Port
 12340  				dst = kbin.AppendInt32(dst, v)
 12341  			}
 12342  			{
 12343  				v := v.ErrorCode
 12344  				dst = kbin.AppendInt16(dst, v)
 12345  			}
 12346  			{
 12347  				v := v.ErrorMessage
 12348  				if isFlexible {
 12349  					dst = kbin.AppendCompactNullableString(dst, v)
 12350  				} else {
 12351  					dst = kbin.AppendNullableString(dst, v)
 12352  				}
 12353  			}
 12354  			if isFlexible {
 12355  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 12356  				dst = v.UnknownTags.AppendEach(dst)
 12357  			}
 12358  		}
 12359  	}
 12360  	if isFlexible {
 12361  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 12362  		dst = v.UnknownTags.AppendEach(dst)
 12363  	}
 12364  	return dst
 12365  }
 12366  
 12367  func (v *FindCoordinatorResponse) ReadFrom(src []byte) error {
 12368  	return v.readFrom(src, false)
 12369  }
 12370  
 12371  func (v *FindCoordinatorResponse) UnsafeReadFrom(src []byte) error {
 12372  	return v.readFrom(src, true)
 12373  }
 12374  
 12375  func (v *FindCoordinatorResponse) readFrom(src []byte, unsafe bool) error {
 12376  	v.Default()
 12377  	b := kbin.Reader{Src: src}
 12378  	version := v.Version
 12379  	_ = version
 12380  	isFlexible := version >= 3
 12381  	_ = isFlexible
 12382  	s := v
 12383  	if version >= 1 {
 12384  		v := b.Int32()
 12385  		s.ThrottleMillis = v
 12386  	}
 12387  	if version >= 0 && version <= 3 {
 12388  		v := b.Int16()
 12389  		s.ErrorCode = v
 12390  	}
 12391  	if version >= 1 && version <= 3 {
 12392  		var v *string
 12393  		if isFlexible {
 12394  			if unsafe {
 12395  				v = b.UnsafeCompactNullableString()
 12396  			} else {
 12397  				v = b.CompactNullableString()
 12398  			}
 12399  		} else {
 12400  			if unsafe {
 12401  				v = b.UnsafeNullableString()
 12402  			} else {
 12403  				v = b.NullableString()
 12404  			}
 12405  		}
 12406  		s.ErrorMessage = v
 12407  	}
 12408  	if version >= 0 && version <= 3 {
 12409  		v := b.Int32()
 12410  		s.NodeID = v
 12411  	}
 12412  	if version >= 0 && version <= 3 {
 12413  		var v string
 12414  		if unsafe {
 12415  			if isFlexible {
 12416  				v = b.UnsafeCompactString()
 12417  			} else {
 12418  				v = b.UnsafeString()
 12419  			}
 12420  		} else {
 12421  			if isFlexible {
 12422  				v = b.CompactString()
 12423  			} else {
 12424  				v = b.String()
 12425  			}
 12426  		}
 12427  		s.Host = v
 12428  	}
 12429  	if version >= 0 && version <= 3 {
 12430  		v := b.Int32()
 12431  		s.Port = v
 12432  	}
 12433  	if version >= 4 {
 12434  		v := s.Coordinators
 12435  		a := v
 12436  		var l int32
 12437  		if isFlexible {
 12438  			l = b.CompactArrayLen()
 12439  		} else {
 12440  			l = b.ArrayLen()
 12441  		}
 12442  		if !b.Ok() {
 12443  			return b.Complete()
 12444  		}
 12445  		a = a[:0]
 12446  		if l > 0 {
 12447  			a = append(a, make([]FindCoordinatorResponseCoordinator, l)...)
 12448  		}
 12449  		for i := int32(0); i < l; i++ {
 12450  			v := &a[i]
 12451  			v.Default()
 12452  			s := v
 12453  			{
 12454  				var v string
 12455  				if unsafe {
 12456  					if isFlexible {
 12457  						v = b.UnsafeCompactString()
 12458  					} else {
 12459  						v = b.UnsafeString()
 12460  					}
 12461  				} else {
 12462  					if isFlexible {
 12463  						v = b.CompactString()
 12464  					} else {
 12465  						v = b.String()
 12466  					}
 12467  				}
 12468  				s.Key = v
 12469  			}
 12470  			{
 12471  				v := b.Int32()
 12472  				s.NodeID = v
 12473  			}
 12474  			{
 12475  				var v string
 12476  				if unsafe {
 12477  					if isFlexible {
 12478  						v = b.UnsafeCompactString()
 12479  					} else {
 12480  						v = b.UnsafeString()
 12481  					}
 12482  				} else {
 12483  					if isFlexible {
 12484  						v = b.CompactString()
 12485  					} else {
 12486  						v = b.String()
 12487  					}
 12488  				}
 12489  				s.Host = v
 12490  			}
 12491  			{
 12492  				v := b.Int32()
 12493  				s.Port = v
 12494  			}
 12495  			{
 12496  				v := b.Int16()
 12497  				s.ErrorCode = v
 12498  			}
 12499  			{
 12500  				var v *string
 12501  				if isFlexible {
 12502  					if unsafe {
 12503  						v = b.UnsafeCompactNullableString()
 12504  					} else {
 12505  						v = b.CompactNullableString()
 12506  					}
 12507  				} else {
 12508  					if unsafe {
 12509  						v = b.UnsafeNullableString()
 12510  					} else {
 12511  						v = b.NullableString()
 12512  					}
 12513  				}
 12514  				s.ErrorMessage = v
 12515  			}
 12516  			if isFlexible {
 12517  				s.UnknownTags = internalReadTags(&b)
 12518  			}
 12519  		}
 12520  		v = a
 12521  		s.Coordinators = v
 12522  	}
 12523  	if isFlexible {
 12524  		s.UnknownTags = internalReadTags(&b)
 12525  	}
 12526  	return b.Complete()
 12527  }
 12528  
 12529  // NewPtrFindCoordinatorResponse returns a pointer to a default FindCoordinatorResponse
 12530  // This is a shortcut for creating a new(struct) and calling Default yourself.
 12531  func NewPtrFindCoordinatorResponse() *FindCoordinatorResponse {
 12532  	var v FindCoordinatorResponse
 12533  	v.Default()
 12534  	return &v
 12535  }
 12536  
 12537  // Default sets any default fields. Calling this allows for future compatibility
 12538  // if new fields are added to FindCoordinatorResponse.
 12539  func (v *FindCoordinatorResponse) Default() {
 12540  }
 12541  
 12542  // NewFindCoordinatorResponse returns a default FindCoordinatorResponse
 12543  // This is a shortcut for creating a struct and calling Default yourself.
 12544  func NewFindCoordinatorResponse() FindCoordinatorResponse {
 12545  	var v FindCoordinatorResponse
 12546  	v.Default()
 12547  	return v
 12548  }
 12549  
 12550  type JoinGroupRequestProtocol struct {
 12551  	// Name is a name of a protocol. This is arbitrary, but is used
 12552  	// in the official client to agree on a partition balancing strategy.
 12553  	//
 12554  	// The official client uses range, roundrobin, or sticky (which was
 12555  	// introduced in KIP-54).
 12556  	Name string
 12557  
 12558  	// Metadata is arbitrary information to pass along with this
 12559  	// protocol name for this member.
 12560  	//
 12561  	// Note that while this is not documented in any protocol page,
 12562  	// this is usually a serialized GroupMemberMetadata as described in
 12563  	// https://cwiki.apache.org/confluence/display/KAFKA/Kafka+Client-side+Assignment+Proposal.
 12564  	//
 12565  	// The protocol metadata is where group members will communicate which
 12566  	// topics they collectively as a group want to consume.
 12567  	Metadata []byte
 12568  
 12569  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 12570  	UnknownTags Tags // v6+
 12571  }
 12572  
 12573  // Default sets any default fields. Calling this allows for future compatibility
 12574  // if new fields are added to JoinGroupRequestProtocol.
 12575  func (v *JoinGroupRequestProtocol) Default() {
 12576  }
 12577  
 12578  // NewJoinGroupRequestProtocol returns a default JoinGroupRequestProtocol
 12579  // This is a shortcut for creating a struct and calling Default yourself.
 12580  func NewJoinGroupRequestProtocol() JoinGroupRequestProtocol {
 12581  	var v JoinGroupRequestProtocol
 12582  	v.Default()
 12583  	return v
 12584  }
 12585  
 12586  // JoinGroupRequest issues a request to join a Kafka group. This will create a
 12587  // group if one does not exist. If joining an existing group, this may trigger
 12588  // a group rebalance.
 12589  //
 12590  // This will trigger a group rebalance if the request is from the group leader,
 12591  // or if the request is from a group member with different metadata, or if the
 12592  // request is with a new group member.
 12593  //
 12594  // Version 4 introduced replying to joins of existing groups with
 12595  // MEMBER_ID_REQUIRED, which requires re-issuing the join group with the
 12596  // returned member ID. See KIP-394 for more details.
 12597  //
 12598  // Version 5 introduced InstanceID, allowing for more "static" membership.
 12599  // See KIP-345 for more details.
 12600  type JoinGroupRequest struct {
 12601  	// Version is the version of this message used with a Kafka broker.
 12602  	Version int16
 12603  
 12604  	// Group is the group to join.
 12605  	Group string
 12606  
 12607  	// SessionTimeoutMillis is how long a member in the group can go between
 12608  	// heartbeats. If a member does not send a heartbeat within this timeout,
 12609  	// the broker will remove the member from the group and initiate a rebalance.
 12610  	SessionTimeoutMillis int32
 12611  
 12612  	// RebalanceTimeoutMillis is how long the broker waits for members to join a group
 12613  	// once a rebalance begins. Kafka waits for the longest rebalance of all
 12614  	// members in the group. Member sessions are still alive; heartbeats will be
 12615  	// replied to with REBALANCE_IN_PROGRESS. Those members must transition to
 12616  	// joining within this rebalance timeout. Members that do not rejoin within
 12617  	// this timeout will be removed from the group. Members must commit offsets
 12618  	// within this timeout.
 12619  	//
 12620  	// The first join for a new group has a 3 second grace period for other
 12621  	// members to join; this grace period is extended until the RebalanceTimeoutMillis
 12622  	// is up or until 3 seconds lapse with no new members.
 12623  	//
 12624  	// This field has a default of -1.
 12625  	RebalanceTimeoutMillis int32 // v1+
 12626  
 12627  	// MemberID is the member ID to join the group with. When joining a group for
 12628  	// the first time, use the empty string. The response will contain the member
 12629  	// ID that should be used going forward.
 12630  	MemberID string
 12631  
 12632  	// InstanceID is a user configured ID that is used for making a group
 12633  	// member "static", allowing many rebalances to be avoided.
 12634  	InstanceID *string // v5+
 12635  
 12636  	// ProtocolType is the "type" of protocol being used for the join group.
 12637  	// The initial group creation sets the type; all additional members must
 12638  	// have the same type or they will be rejected.
 12639  	//
 12640  	// This is completely arbitrary, but the Java client and everything else
 12641  	// uses "consumer" as the protocol type.
 12642  	ProtocolType string
 12643  
 12644  	// Protocols contains arbitrary information that group members use
 12645  	// for rebalancing. All group members must agree on at least one protocol
 12646  	// name.
 12647  	Protocols []JoinGroupRequestProtocol
 12648  
 12649  	// Reason is an optional reason the member is joining (or rejoining) the
 12650  	// group (KIP-800, Kafka 3.2+).
 12651  	Reason *string // v8+
 12652  
 12653  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 12654  	UnknownTags Tags // v6+
 12655  }
 12656  
 12657  func (*JoinGroupRequest) Key() int16                   { return 11 }
 12658  func (*JoinGroupRequest) MaxVersion() int16            { return 9 }
 12659  func (v *JoinGroupRequest) SetVersion(version int16)   { v.Version = version }
 12660  func (v *JoinGroupRequest) GetVersion() int16          { return v.Version }
 12661  func (v *JoinGroupRequest) IsFlexible() bool           { return v.Version >= 6 }
 12662  func (v *JoinGroupRequest) IsGroupCoordinatorRequest() {}
 12663  func (v *JoinGroupRequest) ResponseKind() Response {
 12664  	r := &JoinGroupResponse{Version: v.Version}
 12665  	r.Default()
 12666  	return r
 12667  }
 12668  
 12669  // RequestWith is requests v on r and returns the response or an error.
 12670  // For sharded requests, the response may be merged and still return an error.
 12671  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 12672  func (v *JoinGroupRequest) RequestWith(ctx context.Context, r Requestor) (*JoinGroupResponse, error) {
 12673  	kresp, err := r.Request(ctx, v)
 12674  	resp, _ := kresp.(*JoinGroupResponse)
 12675  	return resp, err
 12676  }
 12677  
 12678  func (v *JoinGroupRequest) AppendTo(dst []byte) []byte {
 12679  	version := v.Version
 12680  	_ = version
 12681  	isFlexible := version >= 6
 12682  	_ = isFlexible
 12683  	{
 12684  		v := v.Group
 12685  		if isFlexible {
 12686  			dst = kbin.AppendCompactString(dst, v)
 12687  		} else {
 12688  			dst = kbin.AppendString(dst, v)
 12689  		}
 12690  	}
 12691  	{
 12692  		v := v.SessionTimeoutMillis
 12693  		dst = kbin.AppendInt32(dst, v)
 12694  	}
 12695  	if version >= 1 {
 12696  		v := v.RebalanceTimeoutMillis
 12697  		dst = kbin.AppendInt32(dst, v)
 12698  	}
 12699  	{
 12700  		v := v.MemberID
 12701  		if isFlexible {
 12702  			dst = kbin.AppendCompactString(dst, v)
 12703  		} else {
 12704  			dst = kbin.AppendString(dst, v)
 12705  		}
 12706  	}
 12707  	if version >= 5 {
 12708  		v := v.InstanceID
 12709  		if isFlexible {
 12710  			dst = kbin.AppendCompactNullableString(dst, v)
 12711  		} else {
 12712  			dst = kbin.AppendNullableString(dst, v)
 12713  		}
 12714  	}
 12715  	{
 12716  		v := v.ProtocolType
 12717  		if isFlexible {
 12718  			dst = kbin.AppendCompactString(dst, v)
 12719  		} else {
 12720  			dst = kbin.AppendString(dst, v)
 12721  		}
 12722  	}
 12723  	{
 12724  		v := v.Protocols
 12725  		if isFlexible {
 12726  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 12727  		} else {
 12728  			dst = kbin.AppendArrayLen(dst, len(v))
 12729  		}
 12730  		for i := range v {
 12731  			v := &v[i]
 12732  			{
 12733  				v := v.Name
 12734  				if isFlexible {
 12735  					dst = kbin.AppendCompactString(dst, v)
 12736  				} else {
 12737  					dst = kbin.AppendString(dst, v)
 12738  				}
 12739  			}
 12740  			{
 12741  				v := v.Metadata
 12742  				if isFlexible {
 12743  					dst = kbin.AppendCompactBytes(dst, v)
 12744  				} else {
 12745  					dst = kbin.AppendBytes(dst, v)
 12746  				}
 12747  			}
 12748  			if isFlexible {
 12749  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 12750  				dst = v.UnknownTags.AppendEach(dst)
 12751  			}
 12752  		}
 12753  	}
 12754  	if version >= 8 {
 12755  		v := v.Reason
 12756  		if isFlexible {
 12757  			dst = kbin.AppendCompactNullableString(dst, v)
 12758  		} else {
 12759  			dst = kbin.AppendNullableString(dst, v)
 12760  		}
 12761  	}
 12762  	if isFlexible {
 12763  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 12764  		dst = v.UnknownTags.AppendEach(dst)
 12765  	}
 12766  	return dst
 12767  }
 12768  
 12769  func (v *JoinGroupRequest) ReadFrom(src []byte) error {
 12770  	return v.readFrom(src, false)
 12771  }
 12772  
 12773  func (v *JoinGroupRequest) UnsafeReadFrom(src []byte) error {
 12774  	return v.readFrom(src, true)
 12775  }
 12776  
 12777  func (v *JoinGroupRequest) readFrom(src []byte, unsafe bool) error {
 12778  	v.Default()
 12779  	b := kbin.Reader{Src: src}
 12780  	version := v.Version
 12781  	_ = version
 12782  	isFlexible := version >= 6
 12783  	_ = isFlexible
 12784  	s := v
 12785  	{
 12786  		var v string
 12787  		if unsafe {
 12788  			if isFlexible {
 12789  				v = b.UnsafeCompactString()
 12790  			} else {
 12791  				v = b.UnsafeString()
 12792  			}
 12793  		} else {
 12794  			if isFlexible {
 12795  				v = b.CompactString()
 12796  			} else {
 12797  				v = b.String()
 12798  			}
 12799  		}
 12800  		s.Group = v
 12801  	}
 12802  	{
 12803  		v := b.Int32()
 12804  		s.SessionTimeoutMillis = v
 12805  	}
 12806  	if version >= 1 {
 12807  		v := b.Int32()
 12808  		s.RebalanceTimeoutMillis = v
 12809  	}
 12810  	{
 12811  		var v string
 12812  		if unsafe {
 12813  			if isFlexible {
 12814  				v = b.UnsafeCompactString()
 12815  			} else {
 12816  				v = b.UnsafeString()
 12817  			}
 12818  		} else {
 12819  			if isFlexible {
 12820  				v = b.CompactString()
 12821  			} else {
 12822  				v = b.String()
 12823  			}
 12824  		}
 12825  		s.MemberID = v
 12826  	}
 12827  	if version >= 5 {
 12828  		var v *string
 12829  		if isFlexible {
 12830  			if unsafe {
 12831  				v = b.UnsafeCompactNullableString()
 12832  			} else {
 12833  				v = b.CompactNullableString()
 12834  			}
 12835  		} else {
 12836  			if unsafe {
 12837  				v = b.UnsafeNullableString()
 12838  			} else {
 12839  				v = b.NullableString()
 12840  			}
 12841  		}
 12842  		s.InstanceID = v
 12843  	}
 12844  	{
 12845  		var v string
 12846  		if unsafe {
 12847  			if isFlexible {
 12848  				v = b.UnsafeCompactString()
 12849  			} else {
 12850  				v = b.UnsafeString()
 12851  			}
 12852  		} else {
 12853  			if isFlexible {
 12854  				v = b.CompactString()
 12855  			} else {
 12856  				v = b.String()
 12857  			}
 12858  		}
 12859  		s.ProtocolType = v
 12860  	}
 12861  	{
 12862  		v := s.Protocols
 12863  		a := v
 12864  		var l int32
 12865  		if isFlexible {
 12866  			l = b.CompactArrayLen()
 12867  		} else {
 12868  			l = b.ArrayLen()
 12869  		}
 12870  		if !b.Ok() {
 12871  			return b.Complete()
 12872  		}
 12873  		a = a[:0]
 12874  		if l > 0 {
 12875  			a = append(a, make([]JoinGroupRequestProtocol, l)...)
 12876  		}
 12877  		for i := int32(0); i < l; i++ {
 12878  			v := &a[i]
 12879  			v.Default()
 12880  			s := v
 12881  			{
 12882  				var v string
 12883  				if unsafe {
 12884  					if isFlexible {
 12885  						v = b.UnsafeCompactString()
 12886  					} else {
 12887  						v = b.UnsafeString()
 12888  					}
 12889  				} else {
 12890  					if isFlexible {
 12891  						v = b.CompactString()
 12892  					} else {
 12893  						v = b.String()
 12894  					}
 12895  				}
 12896  				s.Name = v
 12897  			}
 12898  			{
 12899  				var v []byte
 12900  				if isFlexible {
 12901  					v = b.CompactBytes()
 12902  				} else {
 12903  					v = b.Bytes()
 12904  				}
 12905  				s.Metadata = v
 12906  			}
 12907  			if isFlexible {
 12908  				s.UnknownTags = internalReadTags(&b)
 12909  			}
 12910  		}
 12911  		v = a
 12912  		s.Protocols = v
 12913  	}
 12914  	if version >= 8 {
 12915  		var v *string
 12916  		if isFlexible {
 12917  			if unsafe {
 12918  				v = b.UnsafeCompactNullableString()
 12919  			} else {
 12920  				v = b.CompactNullableString()
 12921  			}
 12922  		} else {
 12923  			if unsafe {
 12924  				v = b.UnsafeNullableString()
 12925  			} else {
 12926  				v = b.NullableString()
 12927  			}
 12928  		}
 12929  		s.Reason = v
 12930  	}
 12931  	if isFlexible {
 12932  		s.UnknownTags = internalReadTags(&b)
 12933  	}
 12934  	return b.Complete()
 12935  }
 12936  
 12937  // NewPtrJoinGroupRequest returns a pointer to a default JoinGroupRequest
 12938  // This is a shortcut for creating a new(struct) and calling Default yourself.
 12939  func NewPtrJoinGroupRequest() *JoinGroupRequest {
 12940  	var v JoinGroupRequest
 12941  	v.Default()
 12942  	return &v
 12943  }
 12944  
 12945  // Default sets any default fields. Calling this allows for future compatibility
 12946  // if new fields are added to JoinGroupRequest.
 12947  func (v *JoinGroupRequest) Default() {
 12948  	v.RebalanceTimeoutMillis = -1
 12949  }
 12950  
 12951  // NewJoinGroupRequest returns a default JoinGroupRequest
 12952  // This is a shortcut for creating a struct and calling Default yourself.
 12953  func NewJoinGroupRequest() JoinGroupRequest {
 12954  	var v JoinGroupRequest
 12955  	v.Default()
 12956  	return v
 12957  }
 12958  
 12959  type JoinGroupResponseMember struct {
 12960  	// MemberID is a member in this group.
 12961  	MemberID string
 12962  
 12963  	// InstanceID is an instance ID of a member in this group (KIP-345).
 12964  	InstanceID *string // v5+
 12965  
 12966  	// ProtocolMetadata is the metadata for this member for this protocol.
 12967  	// This is usually of type GroupMemberMetadata.
 12968  	ProtocolMetadata []byte
 12969  
 12970  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 12971  	UnknownTags Tags // v6+
 12972  }
 12973  
 12974  // Default sets any default fields. Calling this allows for future compatibility
 12975  // if new fields are added to JoinGroupResponseMember.
 12976  func (v *JoinGroupResponseMember) Default() {
 12977  }
 12978  
 12979  // NewJoinGroupResponseMember returns a default JoinGroupResponseMember
 12980  // This is a shortcut for creating a struct and calling Default yourself.
 12981  func NewJoinGroupResponseMember() JoinGroupResponseMember {
 12982  	var v JoinGroupResponseMember
 12983  	v.Default()
 12984  	return v
 12985  }
 12986  
 12987  // JoinGroupResponse is returned from a JoinGroupRequest.
 12988  type JoinGroupResponse struct {
 12989  	// Version is the version of this message used with a Kafka broker.
 12990  	Version int16
 12991  
 12992  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 12993  	// after this request.
 12994  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 12995  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 12996  	//
 12997  	// This request switched at version 3.
 12998  	ThrottleMillis int32 // v2+
 12999  
 13000  	// ErrorCode is the error for the join group request.
 13001  	//
 13002  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 13003  	// to the group (no read perms).
 13004  	//
 13005  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 13006  	//
 13007  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available
 13008  	// (due to the requested broker shutting down or it has not completed startup).
 13009  	//
 13010  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is loading.
 13011  	//
 13012  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 13013  	// for the requested group.
 13014  	//
 13015  	// INVALID_SESSION_TIMEOUT is returned if the requested SessionTimeout is
 13016  	// not within the broker's group.{min,max}.session.timeout.ms.
 13017  	//
 13018  	// INCONSISTENT_GROUP_PROTOCOL is returned if the requested protocols are
 13019  	// incompatible with the existing group member's protocols, or if the join
 13020  	// was for a new group but contained no protocols.
 13021  	//
 13022  	// UNKNOWN_MEMBER_ID is returned is the requested group is dead (likely
 13023  	// just migrated to another coordinator or the group is temporarily unstable),
 13024  	// or if the request was for a new group but contained a non-empty member ID,
 13025  	// or if the group does not have the requested member ID (and the client must
 13026  	// do the new-join-group dance).
 13027  	//
 13028  	// MEMBER_ID_REQUIRED is returned on the initial join of an existing group.
 13029  	// This error was proposed in KIP-394 and introduced in Kafka 2.2.0 to
 13030  	// prevent flaky clients from continually triggering rebalances and prevent
 13031  	// these clients from consuming RAM with metadata. If a client sees
 13032  	// this error, it should re-issue the join with the MemberID in the response.
 13033  	// Non-flaky clients will join with this new member ID, but flaky clients
 13034  	// will not join quickly enough before the pending member ID is rotated out
 13035  	// due to hitting the session.timeout.ms.
 13036  	//
 13037  	// GROUP_MAX_SIZE_REACHED is returned as of Kafka 2.2.0 if the group has
 13038  	// reached a broker's group.max.size.
 13039  	ErrorCode int16
 13040  
 13041  	// Generation is the current "generation" of this group.
 13042  	//
 13043  	// This field has a default of -1.
 13044  	Generation int32
 13045  
 13046  	// ProtocolType is the "type" of protocol being used for this group.
 13047  	ProtocolType *string // v7+
 13048  
 13049  	// Protocol is the agreed upon protocol name (i.e. "sticky", "range").
 13050  	//
 13051  	// v7 of this response changed this field to be nullable.
 13052  	Protocol *string
 13053  
 13054  	// LeaderID is the leader member.
 13055  	LeaderID string
 13056  
 13057  	// True if the leader must skip running the assignment (KIP-814, Kafka 3.2+).
 13058  	SkipAssignment bool // v9+
 13059  
 13060  	// MemberID is the member of the receiving client.
 13061  	MemberID string
 13062  
 13063  	// Members contains all other members of this group. Only the group leader
 13064  	// receives the members. The leader is responsible for balancing subscribed
 13065  	// topic partitions and replying appropriately in a SyncGroup request.
 13066  	Members []JoinGroupResponseMember
 13067  
 13068  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 13069  	UnknownTags Tags // v6+
 13070  }
 13071  
 13072  func (*JoinGroupResponse) Key() int16                         { return 11 }
 13073  func (*JoinGroupResponse) MaxVersion() int16                  { return 9 }
 13074  func (v *JoinGroupResponse) SetVersion(version int16)         { v.Version = version }
 13075  func (v *JoinGroupResponse) GetVersion() int16                { return v.Version }
 13076  func (v *JoinGroupResponse) IsFlexible() bool                 { return v.Version >= 6 }
 13077  func (v *JoinGroupResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 3 }
 13078  func (v *JoinGroupResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 13079  func (v *JoinGroupResponse) RequestKind() Request             { return &JoinGroupRequest{Version: v.Version} }
 13080  
 13081  func (v *JoinGroupResponse) AppendTo(dst []byte) []byte {
 13082  	version := v.Version
 13083  	_ = version
 13084  	isFlexible := version >= 6
 13085  	_ = isFlexible
 13086  	if version >= 2 {
 13087  		v := v.ThrottleMillis
 13088  		dst = kbin.AppendInt32(dst, v)
 13089  	}
 13090  	{
 13091  		v := v.ErrorCode
 13092  		dst = kbin.AppendInt16(dst, v)
 13093  	}
 13094  	{
 13095  		v := v.Generation
 13096  		dst = kbin.AppendInt32(dst, v)
 13097  	}
 13098  	if version >= 7 {
 13099  		v := v.ProtocolType
 13100  		if isFlexible {
 13101  			dst = kbin.AppendCompactNullableString(dst, v)
 13102  		} else {
 13103  			dst = kbin.AppendNullableString(dst, v)
 13104  		}
 13105  	}
 13106  	{
 13107  		v := v.Protocol
 13108  		if version < 7 {
 13109  			var vv string
 13110  			if v != nil {
 13111  				vv = *v
 13112  			}
 13113  			{
 13114  				v := vv
 13115  				if isFlexible {
 13116  					dst = kbin.AppendCompactString(dst, v)
 13117  				} else {
 13118  					dst = kbin.AppendString(dst, v)
 13119  				}
 13120  			}
 13121  		} else {
 13122  			if isFlexible {
 13123  				dst = kbin.AppendCompactNullableString(dst, v)
 13124  			} else {
 13125  				dst = kbin.AppendNullableString(dst, v)
 13126  			}
 13127  		}
 13128  	}
 13129  	{
 13130  		v := v.LeaderID
 13131  		if isFlexible {
 13132  			dst = kbin.AppendCompactString(dst, v)
 13133  		} else {
 13134  			dst = kbin.AppendString(dst, v)
 13135  		}
 13136  	}
 13137  	if version >= 9 {
 13138  		v := v.SkipAssignment
 13139  		dst = kbin.AppendBool(dst, v)
 13140  	}
 13141  	{
 13142  		v := v.MemberID
 13143  		if isFlexible {
 13144  			dst = kbin.AppendCompactString(dst, v)
 13145  		} else {
 13146  			dst = kbin.AppendString(dst, v)
 13147  		}
 13148  	}
 13149  	{
 13150  		v := v.Members
 13151  		if isFlexible {
 13152  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 13153  		} else {
 13154  			dst = kbin.AppendArrayLen(dst, len(v))
 13155  		}
 13156  		for i := range v {
 13157  			v := &v[i]
 13158  			{
 13159  				v := v.MemberID
 13160  				if isFlexible {
 13161  					dst = kbin.AppendCompactString(dst, v)
 13162  				} else {
 13163  					dst = kbin.AppendString(dst, v)
 13164  				}
 13165  			}
 13166  			if version >= 5 {
 13167  				v := v.InstanceID
 13168  				if isFlexible {
 13169  					dst = kbin.AppendCompactNullableString(dst, v)
 13170  				} else {
 13171  					dst = kbin.AppendNullableString(dst, v)
 13172  				}
 13173  			}
 13174  			{
 13175  				v := v.ProtocolMetadata
 13176  				if isFlexible {
 13177  					dst = kbin.AppendCompactBytes(dst, v)
 13178  				} else {
 13179  					dst = kbin.AppendBytes(dst, v)
 13180  				}
 13181  			}
 13182  			if isFlexible {
 13183  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 13184  				dst = v.UnknownTags.AppendEach(dst)
 13185  			}
 13186  		}
 13187  	}
 13188  	if isFlexible {
 13189  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 13190  		dst = v.UnknownTags.AppendEach(dst)
 13191  	}
 13192  	return dst
 13193  }
 13194  
 13195  func (v *JoinGroupResponse) ReadFrom(src []byte) error {
 13196  	return v.readFrom(src, false)
 13197  }
 13198  
 13199  func (v *JoinGroupResponse) UnsafeReadFrom(src []byte) error {
 13200  	return v.readFrom(src, true)
 13201  }
 13202  
 13203  func (v *JoinGroupResponse) readFrom(src []byte, unsafe bool) error {
 13204  	v.Default()
 13205  	b := kbin.Reader{Src: src}
 13206  	version := v.Version
 13207  	_ = version
 13208  	isFlexible := version >= 6
 13209  	_ = isFlexible
 13210  	s := v
 13211  	if version >= 2 {
 13212  		v := b.Int32()
 13213  		s.ThrottleMillis = v
 13214  	}
 13215  	{
 13216  		v := b.Int16()
 13217  		s.ErrorCode = v
 13218  	}
 13219  	{
 13220  		v := b.Int32()
 13221  		s.Generation = v
 13222  	}
 13223  	if version >= 7 {
 13224  		var v *string
 13225  		if isFlexible {
 13226  			if unsafe {
 13227  				v = b.UnsafeCompactNullableString()
 13228  			} else {
 13229  				v = b.CompactNullableString()
 13230  			}
 13231  		} else {
 13232  			if unsafe {
 13233  				v = b.UnsafeNullableString()
 13234  			} else {
 13235  				v = b.NullableString()
 13236  			}
 13237  		}
 13238  		s.ProtocolType = v
 13239  	}
 13240  	{
 13241  		var v *string
 13242  		if version < 7 {
 13243  			var vv string
 13244  			if isFlexible {
 13245  				if unsafe {
 13246  					vv = b.UnsafeCompactString()
 13247  				} else {
 13248  					vv = b.CompactString()
 13249  				}
 13250  			} else {
 13251  				if unsafe {
 13252  					vv = b.UnsafeString()
 13253  				} else {
 13254  					vv = b.String()
 13255  				}
 13256  			}
 13257  			v = &vv
 13258  		} else {
 13259  			if isFlexible {
 13260  				if unsafe {
 13261  					v = b.UnsafeCompactNullableString()
 13262  				} else {
 13263  					v = b.CompactNullableString()
 13264  				}
 13265  			} else {
 13266  				if unsafe {
 13267  					v = b.UnsafeNullableString()
 13268  				} else {
 13269  					v = b.NullableString()
 13270  				}
 13271  			}
 13272  		}
 13273  		s.Protocol = v
 13274  	}
 13275  	{
 13276  		var v string
 13277  		if unsafe {
 13278  			if isFlexible {
 13279  				v = b.UnsafeCompactString()
 13280  			} else {
 13281  				v = b.UnsafeString()
 13282  			}
 13283  		} else {
 13284  			if isFlexible {
 13285  				v = b.CompactString()
 13286  			} else {
 13287  				v = b.String()
 13288  			}
 13289  		}
 13290  		s.LeaderID = v
 13291  	}
 13292  	if version >= 9 {
 13293  		v := b.Bool()
 13294  		s.SkipAssignment = v
 13295  	}
 13296  	{
 13297  		var v string
 13298  		if unsafe {
 13299  			if isFlexible {
 13300  				v = b.UnsafeCompactString()
 13301  			} else {
 13302  				v = b.UnsafeString()
 13303  			}
 13304  		} else {
 13305  			if isFlexible {
 13306  				v = b.CompactString()
 13307  			} else {
 13308  				v = b.String()
 13309  			}
 13310  		}
 13311  		s.MemberID = v
 13312  	}
 13313  	{
 13314  		v := s.Members
 13315  		a := v
 13316  		var l int32
 13317  		if isFlexible {
 13318  			l = b.CompactArrayLen()
 13319  		} else {
 13320  			l = b.ArrayLen()
 13321  		}
 13322  		if !b.Ok() {
 13323  			return b.Complete()
 13324  		}
 13325  		a = a[:0]
 13326  		if l > 0 {
 13327  			a = append(a, make([]JoinGroupResponseMember, l)...)
 13328  		}
 13329  		for i := int32(0); i < l; i++ {
 13330  			v := &a[i]
 13331  			v.Default()
 13332  			s := v
 13333  			{
 13334  				var v string
 13335  				if unsafe {
 13336  					if isFlexible {
 13337  						v = b.UnsafeCompactString()
 13338  					} else {
 13339  						v = b.UnsafeString()
 13340  					}
 13341  				} else {
 13342  					if isFlexible {
 13343  						v = b.CompactString()
 13344  					} else {
 13345  						v = b.String()
 13346  					}
 13347  				}
 13348  				s.MemberID = v
 13349  			}
 13350  			if version >= 5 {
 13351  				var v *string
 13352  				if isFlexible {
 13353  					if unsafe {
 13354  						v = b.UnsafeCompactNullableString()
 13355  					} else {
 13356  						v = b.CompactNullableString()
 13357  					}
 13358  				} else {
 13359  					if unsafe {
 13360  						v = b.UnsafeNullableString()
 13361  					} else {
 13362  						v = b.NullableString()
 13363  					}
 13364  				}
 13365  				s.InstanceID = v
 13366  			}
 13367  			{
 13368  				var v []byte
 13369  				if isFlexible {
 13370  					v = b.CompactBytes()
 13371  				} else {
 13372  					v = b.Bytes()
 13373  				}
 13374  				s.ProtocolMetadata = v
 13375  			}
 13376  			if isFlexible {
 13377  				s.UnknownTags = internalReadTags(&b)
 13378  			}
 13379  		}
 13380  		v = a
 13381  		s.Members = v
 13382  	}
 13383  	if isFlexible {
 13384  		s.UnknownTags = internalReadTags(&b)
 13385  	}
 13386  	return b.Complete()
 13387  }
 13388  
 13389  // NewPtrJoinGroupResponse returns a pointer to a default JoinGroupResponse
 13390  // This is a shortcut for creating a new(struct) and calling Default yourself.
 13391  func NewPtrJoinGroupResponse() *JoinGroupResponse {
 13392  	var v JoinGroupResponse
 13393  	v.Default()
 13394  	return &v
 13395  }
 13396  
 13397  // Default sets any default fields. Calling this allows for future compatibility
 13398  // if new fields are added to JoinGroupResponse.
 13399  func (v *JoinGroupResponse) Default() {
 13400  	v.Generation = -1
 13401  }
 13402  
 13403  // NewJoinGroupResponse returns a default JoinGroupResponse
 13404  // This is a shortcut for creating a struct and calling Default yourself.
 13405  func NewJoinGroupResponse() JoinGroupResponse {
 13406  	var v JoinGroupResponse
 13407  	v.Default()
 13408  	return v
 13409  }
 13410  
 13411  // HeartbeatRequest issues a heartbeat for a member in a group, ensuring that
 13412  // Kafka does not expire the member from the group.
 13413  type HeartbeatRequest struct {
 13414  	// Version is the version of this message used with a Kafka broker.
 13415  	Version int16
 13416  
 13417  	// Group is the group ID this heartbeat is for.
 13418  	Group string
 13419  
 13420  	// Generation is the group generation this heartbeat is for.
 13421  	Generation int32
 13422  
 13423  	// MemberID is the member ID this member is for.
 13424  	MemberID string
 13425  
 13426  	// InstanceID is the instance ID of this member in the group (KIP-345).
 13427  	InstanceID *string // v3+
 13428  
 13429  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 13430  	UnknownTags Tags // v4+
 13431  }
 13432  
 13433  func (*HeartbeatRequest) Key() int16                   { return 12 }
 13434  func (*HeartbeatRequest) MaxVersion() int16            { return 4 }
 13435  func (v *HeartbeatRequest) SetVersion(version int16)   { v.Version = version }
 13436  func (v *HeartbeatRequest) GetVersion() int16          { return v.Version }
 13437  func (v *HeartbeatRequest) IsFlexible() bool           { return v.Version >= 4 }
 13438  func (v *HeartbeatRequest) IsGroupCoordinatorRequest() {}
 13439  func (v *HeartbeatRequest) ResponseKind() Response {
 13440  	r := &HeartbeatResponse{Version: v.Version}
 13441  	r.Default()
 13442  	return r
 13443  }
 13444  
 13445  // RequestWith is requests v on r and returns the response or an error.
 13446  // For sharded requests, the response may be merged and still return an error.
 13447  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 13448  func (v *HeartbeatRequest) RequestWith(ctx context.Context, r Requestor) (*HeartbeatResponse, error) {
 13449  	kresp, err := r.Request(ctx, v)
 13450  	resp, _ := kresp.(*HeartbeatResponse)
 13451  	return resp, err
 13452  }
 13453  
 13454  func (v *HeartbeatRequest) AppendTo(dst []byte) []byte {
 13455  	version := v.Version
 13456  	_ = version
 13457  	isFlexible := version >= 4
 13458  	_ = isFlexible
 13459  	{
 13460  		v := v.Group
 13461  		if isFlexible {
 13462  			dst = kbin.AppendCompactString(dst, v)
 13463  		} else {
 13464  			dst = kbin.AppendString(dst, v)
 13465  		}
 13466  	}
 13467  	{
 13468  		v := v.Generation
 13469  		dst = kbin.AppendInt32(dst, v)
 13470  	}
 13471  	{
 13472  		v := v.MemberID
 13473  		if isFlexible {
 13474  			dst = kbin.AppendCompactString(dst, v)
 13475  		} else {
 13476  			dst = kbin.AppendString(dst, v)
 13477  		}
 13478  	}
 13479  	if version >= 3 {
 13480  		v := v.InstanceID
 13481  		if isFlexible {
 13482  			dst = kbin.AppendCompactNullableString(dst, v)
 13483  		} else {
 13484  			dst = kbin.AppendNullableString(dst, v)
 13485  		}
 13486  	}
 13487  	if isFlexible {
 13488  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 13489  		dst = v.UnknownTags.AppendEach(dst)
 13490  	}
 13491  	return dst
 13492  }
 13493  
 13494  func (v *HeartbeatRequest) ReadFrom(src []byte) error {
 13495  	return v.readFrom(src, false)
 13496  }
 13497  
 13498  func (v *HeartbeatRequest) UnsafeReadFrom(src []byte) error {
 13499  	return v.readFrom(src, true)
 13500  }
 13501  
 13502  func (v *HeartbeatRequest) readFrom(src []byte, unsafe bool) error {
 13503  	v.Default()
 13504  	b := kbin.Reader{Src: src}
 13505  	version := v.Version
 13506  	_ = version
 13507  	isFlexible := version >= 4
 13508  	_ = isFlexible
 13509  	s := v
 13510  	{
 13511  		var v string
 13512  		if unsafe {
 13513  			if isFlexible {
 13514  				v = b.UnsafeCompactString()
 13515  			} else {
 13516  				v = b.UnsafeString()
 13517  			}
 13518  		} else {
 13519  			if isFlexible {
 13520  				v = b.CompactString()
 13521  			} else {
 13522  				v = b.String()
 13523  			}
 13524  		}
 13525  		s.Group = v
 13526  	}
 13527  	{
 13528  		v := b.Int32()
 13529  		s.Generation = v
 13530  	}
 13531  	{
 13532  		var v string
 13533  		if unsafe {
 13534  			if isFlexible {
 13535  				v = b.UnsafeCompactString()
 13536  			} else {
 13537  				v = b.UnsafeString()
 13538  			}
 13539  		} else {
 13540  			if isFlexible {
 13541  				v = b.CompactString()
 13542  			} else {
 13543  				v = b.String()
 13544  			}
 13545  		}
 13546  		s.MemberID = v
 13547  	}
 13548  	if version >= 3 {
 13549  		var v *string
 13550  		if isFlexible {
 13551  			if unsafe {
 13552  				v = b.UnsafeCompactNullableString()
 13553  			} else {
 13554  				v = b.CompactNullableString()
 13555  			}
 13556  		} else {
 13557  			if unsafe {
 13558  				v = b.UnsafeNullableString()
 13559  			} else {
 13560  				v = b.NullableString()
 13561  			}
 13562  		}
 13563  		s.InstanceID = v
 13564  	}
 13565  	if isFlexible {
 13566  		s.UnknownTags = internalReadTags(&b)
 13567  	}
 13568  	return b.Complete()
 13569  }
 13570  
 13571  // NewPtrHeartbeatRequest returns a pointer to a default HeartbeatRequest
 13572  // This is a shortcut for creating a new(struct) and calling Default yourself.
 13573  func NewPtrHeartbeatRequest() *HeartbeatRequest {
 13574  	var v HeartbeatRequest
 13575  	v.Default()
 13576  	return &v
 13577  }
 13578  
 13579  // Default sets any default fields. Calling this allows for future compatibility
 13580  // if new fields are added to HeartbeatRequest.
 13581  func (v *HeartbeatRequest) Default() {
 13582  }
 13583  
 13584  // NewHeartbeatRequest returns a default HeartbeatRequest
 13585  // This is a shortcut for creating a struct and calling Default yourself.
 13586  func NewHeartbeatRequest() HeartbeatRequest {
 13587  	var v HeartbeatRequest
 13588  	v.Default()
 13589  	return v
 13590  }
 13591  
 13592  // HeartbeatResponse is returned from a HeartbeatRequest.
 13593  type HeartbeatResponse struct {
 13594  	// Version is the version of this message used with a Kafka broker.
 13595  	Version int16
 13596  
 13597  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 13598  	// after this request.
 13599  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 13600  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 13601  	//
 13602  	// This request switched at version 2.
 13603  	ThrottleMillis int32 // v1+
 13604  
 13605  	// ErrorCode is the error for the heartbeat request.
 13606  	//
 13607  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 13608  	// to the group (no read perms).
 13609  	//
 13610  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 13611  	//
 13612  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available
 13613  	// (due to the requested broker shutting down or it has not completed startup).
 13614  	//
 13615  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 13616  	// for the requested group.
 13617  	//
 13618  	// UNKNOWN_MEMBER_ID is returned if the member ID is not a part of the group,
 13619  	// or if the group is empty or dead.
 13620  	//
 13621  	// ILLEGAL_GENERATION is returned if the request's generation ID is invalid.
 13622  	//
 13623  	// REBALANCE_IN_PROGRESS is returned if the group is currently rebalancing.
 13624  	ErrorCode int16
 13625  
 13626  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 13627  	UnknownTags Tags // v4+
 13628  }
 13629  
 13630  func (*HeartbeatResponse) Key() int16                         { return 12 }
 13631  func (*HeartbeatResponse) MaxVersion() int16                  { return 4 }
 13632  func (v *HeartbeatResponse) SetVersion(version int16)         { v.Version = version }
 13633  func (v *HeartbeatResponse) GetVersion() int16                { return v.Version }
 13634  func (v *HeartbeatResponse) IsFlexible() bool                 { return v.Version >= 4 }
 13635  func (v *HeartbeatResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 13636  func (v *HeartbeatResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 13637  func (v *HeartbeatResponse) RequestKind() Request             { return &HeartbeatRequest{Version: v.Version} }
 13638  
 13639  func (v *HeartbeatResponse) AppendTo(dst []byte) []byte {
 13640  	version := v.Version
 13641  	_ = version
 13642  	isFlexible := version >= 4
 13643  	_ = isFlexible
 13644  	if version >= 1 {
 13645  		v := v.ThrottleMillis
 13646  		dst = kbin.AppendInt32(dst, v)
 13647  	}
 13648  	{
 13649  		v := v.ErrorCode
 13650  		dst = kbin.AppendInt16(dst, v)
 13651  	}
 13652  	if isFlexible {
 13653  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 13654  		dst = v.UnknownTags.AppendEach(dst)
 13655  	}
 13656  	return dst
 13657  }
 13658  
 13659  func (v *HeartbeatResponse) ReadFrom(src []byte) error {
 13660  	return v.readFrom(src, false)
 13661  }
 13662  
 13663  func (v *HeartbeatResponse) UnsafeReadFrom(src []byte) error {
 13664  	return v.readFrom(src, true)
 13665  }
 13666  
 13667  func (v *HeartbeatResponse) readFrom(src []byte, unsafe bool) error {
 13668  	v.Default()
 13669  	b := kbin.Reader{Src: src}
 13670  	version := v.Version
 13671  	_ = version
 13672  	isFlexible := version >= 4
 13673  	_ = isFlexible
 13674  	s := v
 13675  	if version >= 1 {
 13676  		v := b.Int32()
 13677  		s.ThrottleMillis = v
 13678  	}
 13679  	{
 13680  		v := b.Int16()
 13681  		s.ErrorCode = v
 13682  	}
 13683  	if isFlexible {
 13684  		s.UnknownTags = internalReadTags(&b)
 13685  	}
 13686  	return b.Complete()
 13687  }
 13688  
 13689  // NewPtrHeartbeatResponse returns a pointer to a default HeartbeatResponse
 13690  // This is a shortcut for creating a new(struct) and calling Default yourself.
 13691  func NewPtrHeartbeatResponse() *HeartbeatResponse {
 13692  	var v HeartbeatResponse
 13693  	v.Default()
 13694  	return &v
 13695  }
 13696  
 13697  // Default sets any default fields. Calling this allows for future compatibility
 13698  // if new fields are added to HeartbeatResponse.
 13699  func (v *HeartbeatResponse) Default() {
 13700  }
 13701  
 13702  // NewHeartbeatResponse returns a default HeartbeatResponse
 13703  // This is a shortcut for creating a struct and calling Default yourself.
 13704  func NewHeartbeatResponse() HeartbeatResponse {
 13705  	var v HeartbeatResponse
 13706  	v.Default()
 13707  	return v
 13708  }
 13709  
 13710  type LeaveGroupRequestMember struct {
 13711  	MemberID string
 13712  
 13713  	InstanceID *string
 13714  
 13715  	// Reason is an optional reason why this member is leaving the group
 13716  	// (KIP-800, Kafka 3.2+).
 13717  	Reason *string // v5+
 13718  
 13719  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 13720  	UnknownTags Tags // v4+
 13721  }
 13722  
 13723  // Default sets any default fields. Calling this allows for future compatibility
 13724  // if new fields are added to LeaveGroupRequestMember.
 13725  func (v *LeaveGroupRequestMember) Default() {
 13726  }
 13727  
 13728  // NewLeaveGroupRequestMember returns a default LeaveGroupRequestMember
 13729  // This is a shortcut for creating a struct and calling Default yourself.
 13730  func NewLeaveGroupRequestMember() LeaveGroupRequestMember {
 13731  	var v LeaveGroupRequestMember
 13732  	v.Default()
 13733  	return v
 13734  }
 13735  
 13736  // LeaveGroupRequest issues a request for a group member to leave the group,
 13737  // triggering a group rebalance.
 13738  //
 13739  // Version 3 changed removed MemberID and added a batch instance+member ID
 13740  // way of leaving a group.
 13741  type LeaveGroupRequest struct {
 13742  	// Version is the version of this message used with a Kafka broker.
 13743  	Version int16
 13744  
 13745  	// Group is the group to leave.
 13746  	Group string
 13747  
 13748  	// MemberID is the member that is leaving.
 13749  	MemberID string // v0-v2
 13750  
 13751  	// Members are member and group instance IDs to cause to leave a group.
 13752  	Members []LeaveGroupRequestMember // v3+
 13753  
 13754  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 13755  	UnknownTags Tags // v4+
 13756  }
 13757  
 13758  func (*LeaveGroupRequest) Key() int16                   { return 13 }
 13759  func (*LeaveGroupRequest) MaxVersion() int16            { return 5 }
 13760  func (v *LeaveGroupRequest) SetVersion(version int16)   { v.Version = version }
 13761  func (v *LeaveGroupRequest) GetVersion() int16          { return v.Version }
 13762  func (v *LeaveGroupRequest) IsFlexible() bool           { return v.Version >= 4 }
 13763  func (v *LeaveGroupRequest) IsGroupCoordinatorRequest() {}
 13764  func (v *LeaveGroupRequest) ResponseKind() Response {
 13765  	r := &LeaveGroupResponse{Version: v.Version}
 13766  	r.Default()
 13767  	return r
 13768  }
 13769  
 13770  // RequestWith is requests v on r and returns the response or an error.
 13771  // For sharded requests, the response may be merged and still return an error.
 13772  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 13773  func (v *LeaveGroupRequest) RequestWith(ctx context.Context, r Requestor) (*LeaveGroupResponse, error) {
 13774  	kresp, err := r.Request(ctx, v)
 13775  	resp, _ := kresp.(*LeaveGroupResponse)
 13776  	return resp, err
 13777  }
 13778  
 13779  func (v *LeaveGroupRequest) AppendTo(dst []byte) []byte {
 13780  	version := v.Version
 13781  	_ = version
 13782  	isFlexible := version >= 4
 13783  	_ = isFlexible
 13784  	{
 13785  		v := v.Group
 13786  		if isFlexible {
 13787  			dst = kbin.AppendCompactString(dst, v)
 13788  		} else {
 13789  			dst = kbin.AppendString(dst, v)
 13790  		}
 13791  	}
 13792  	if version >= 0 && version <= 2 {
 13793  		v := v.MemberID
 13794  		if isFlexible {
 13795  			dst = kbin.AppendCompactString(dst, v)
 13796  		} else {
 13797  			dst = kbin.AppendString(dst, v)
 13798  		}
 13799  	}
 13800  	if version >= 3 {
 13801  		v := v.Members
 13802  		if isFlexible {
 13803  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 13804  		} else {
 13805  			dst = kbin.AppendArrayLen(dst, len(v))
 13806  		}
 13807  		for i := range v {
 13808  			v := &v[i]
 13809  			{
 13810  				v := v.MemberID
 13811  				if isFlexible {
 13812  					dst = kbin.AppendCompactString(dst, v)
 13813  				} else {
 13814  					dst = kbin.AppendString(dst, v)
 13815  				}
 13816  			}
 13817  			{
 13818  				v := v.InstanceID
 13819  				if isFlexible {
 13820  					dst = kbin.AppendCompactNullableString(dst, v)
 13821  				} else {
 13822  					dst = kbin.AppendNullableString(dst, v)
 13823  				}
 13824  			}
 13825  			if version >= 5 {
 13826  				v := v.Reason
 13827  				if isFlexible {
 13828  					dst = kbin.AppendCompactNullableString(dst, v)
 13829  				} else {
 13830  					dst = kbin.AppendNullableString(dst, v)
 13831  				}
 13832  			}
 13833  			if isFlexible {
 13834  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 13835  				dst = v.UnknownTags.AppendEach(dst)
 13836  			}
 13837  		}
 13838  	}
 13839  	if isFlexible {
 13840  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 13841  		dst = v.UnknownTags.AppendEach(dst)
 13842  	}
 13843  	return dst
 13844  }
 13845  
 13846  func (v *LeaveGroupRequest) ReadFrom(src []byte) error {
 13847  	return v.readFrom(src, false)
 13848  }
 13849  
 13850  func (v *LeaveGroupRequest) UnsafeReadFrom(src []byte) error {
 13851  	return v.readFrom(src, true)
 13852  }
 13853  
 13854  func (v *LeaveGroupRequest) readFrom(src []byte, unsafe bool) error {
 13855  	v.Default()
 13856  	b := kbin.Reader{Src: src}
 13857  	version := v.Version
 13858  	_ = version
 13859  	isFlexible := version >= 4
 13860  	_ = isFlexible
 13861  	s := v
 13862  	{
 13863  		var v string
 13864  		if unsafe {
 13865  			if isFlexible {
 13866  				v = b.UnsafeCompactString()
 13867  			} else {
 13868  				v = b.UnsafeString()
 13869  			}
 13870  		} else {
 13871  			if isFlexible {
 13872  				v = b.CompactString()
 13873  			} else {
 13874  				v = b.String()
 13875  			}
 13876  		}
 13877  		s.Group = v
 13878  	}
 13879  	if version >= 0 && version <= 2 {
 13880  		var v string
 13881  		if unsafe {
 13882  			if isFlexible {
 13883  				v = b.UnsafeCompactString()
 13884  			} else {
 13885  				v = b.UnsafeString()
 13886  			}
 13887  		} else {
 13888  			if isFlexible {
 13889  				v = b.CompactString()
 13890  			} else {
 13891  				v = b.String()
 13892  			}
 13893  		}
 13894  		s.MemberID = v
 13895  	}
 13896  	if version >= 3 {
 13897  		v := s.Members
 13898  		a := v
 13899  		var l int32
 13900  		if isFlexible {
 13901  			l = b.CompactArrayLen()
 13902  		} else {
 13903  			l = b.ArrayLen()
 13904  		}
 13905  		if !b.Ok() {
 13906  			return b.Complete()
 13907  		}
 13908  		a = a[:0]
 13909  		if l > 0 {
 13910  			a = append(a, make([]LeaveGroupRequestMember, l)...)
 13911  		}
 13912  		for i := int32(0); i < l; i++ {
 13913  			v := &a[i]
 13914  			v.Default()
 13915  			s := v
 13916  			{
 13917  				var v string
 13918  				if unsafe {
 13919  					if isFlexible {
 13920  						v = b.UnsafeCompactString()
 13921  					} else {
 13922  						v = b.UnsafeString()
 13923  					}
 13924  				} else {
 13925  					if isFlexible {
 13926  						v = b.CompactString()
 13927  					} else {
 13928  						v = b.String()
 13929  					}
 13930  				}
 13931  				s.MemberID = v
 13932  			}
 13933  			{
 13934  				var v *string
 13935  				if isFlexible {
 13936  					if unsafe {
 13937  						v = b.UnsafeCompactNullableString()
 13938  					} else {
 13939  						v = b.CompactNullableString()
 13940  					}
 13941  				} else {
 13942  					if unsafe {
 13943  						v = b.UnsafeNullableString()
 13944  					} else {
 13945  						v = b.NullableString()
 13946  					}
 13947  				}
 13948  				s.InstanceID = v
 13949  			}
 13950  			if version >= 5 {
 13951  				var v *string
 13952  				if isFlexible {
 13953  					if unsafe {
 13954  						v = b.UnsafeCompactNullableString()
 13955  					} else {
 13956  						v = b.CompactNullableString()
 13957  					}
 13958  				} else {
 13959  					if unsafe {
 13960  						v = b.UnsafeNullableString()
 13961  					} else {
 13962  						v = b.NullableString()
 13963  					}
 13964  				}
 13965  				s.Reason = v
 13966  			}
 13967  			if isFlexible {
 13968  				s.UnknownTags = internalReadTags(&b)
 13969  			}
 13970  		}
 13971  		v = a
 13972  		s.Members = v
 13973  	}
 13974  	if isFlexible {
 13975  		s.UnknownTags = internalReadTags(&b)
 13976  	}
 13977  	return b.Complete()
 13978  }
 13979  
 13980  // NewPtrLeaveGroupRequest returns a pointer to a default LeaveGroupRequest
 13981  // This is a shortcut for creating a new(struct) and calling Default yourself.
 13982  func NewPtrLeaveGroupRequest() *LeaveGroupRequest {
 13983  	var v LeaveGroupRequest
 13984  	v.Default()
 13985  	return &v
 13986  }
 13987  
 13988  // Default sets any default fields. Calling this allows for future compatibility
 13989  // if new fields are added to LeaveGroupRequest.
 13990  func (v *LeaveGroupRequest) Default() {
 13991  }
 13992  
 13993  // NewLeaveGroupRequest returns a default LeaveGroupRequest
 13994  // This is a shortcut for creating a struct and calling Default yourself.
 13995  func NewLeaveGroupRequest() LeaveGroupRequest {
 13996  	var v LeaveGroupRequest
 13997  	v.Default()
 13998  	return v
 13999  }
 14000  
 14001  type LeaveGroupResponseMember struct {
 14002  	MemberID string
 14003  
 14004  	InstanceID *string
 14005  
 14006  	// An individual member's leave error code.
 14007  	ErrorCode int16
 14008  
 14009  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14010  	UnknownTags Tags // v4+
 14011  }
 14012  
 14013  // Default sets any default fields. Calling this allows for future compatibility
 14014  // if new fields are added to LeaveGroupResponseMember.
 14015  func (v *LeaveGroupResponseMember) Default() {
 14016  }
 14017  
 14018  // NewLeaveGroupResponseMember returns a default LeaveGroupResponseMember
 14019  // This is a shortcut for creating a struct and calling Default yourself.
 14020  func NewLeaveGroupResponseMember() LeaveGroupResponseMember {
 14021  	var v LeaveGroupResponseMember
 14022  	v.Default()
 14023  	return v
 14024  }
 14025  
 14026  // LeaveGroupResponse is returned from a LeaveGroupRequest.
 14027  type LeaveGroupResponse struct {
 14028  	// Version is the version of this message used with a Kafka broker.
 14029  	Version int16
 14030  
 14031  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 14032  	// after this request.
 14033  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 14034  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 14035  	//
 14036  	// This request switched at version 2.
 14037  	ThrottleMillis int32 // v1+
 14038  
 14039  	// ErrorCode is the error for the leave group request.
 14040  	//
 14041  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 14042  	// to the group (no read perms).
 14043  	//
 14044  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 14045  	//
 14046  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available
 14047  	// (due to the requested broker shutting down or it has not completed startup).
 14048  	//
 14049  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is loading.
 14050  	//
 14051  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 14052  	// for the requested group.
 14053  	//
 14054  	// UNKNOWN_MEMBER_ID is returned if the member ID is not a part of the group,
 14055  	// or if the group is empty or dead.
 14056  	ErrorCode int16
 14057  
 14058  	// Members are the list of members and group instance IDs that left the group.
 14059  	Members []LeaveGroupResponseMember // v3+
 14060  
 14061  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14062  	UnknownTags Tags // v4+
 14063  }
 14064  
 14065  func (*LeaveGroupResponse) Key() int16                         { return 13 }
 14066  func (*LeaveGroupResponse) MaxVersion() int16                  { return 5 }
 14067  func (v *LeaveGroupResponse) SetVersion(version int16)         { v.Version = version }
 14068  func (v *LeaveGroupResponse) GetVersion() int16                { return v.Version }
 14069  func (v *LeaveGroupResponse) IsFlexible() bool                 { return v.Version >= 4 }
 14070  func (v *LeaveGroupResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 14071  func (v *LeaveGroupResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 14072  func (v *LeaveGroupResponse) RequestKind() Request             { return &LeaveGroupRequest{Version: v.Version} }
 14073  
 14074  func (v *LeaveGroupResponse) AppendTo(dst []byte) []byte {
 14075  	version := v.Version
 14076  	_ = version
 14077  	isFlexible := version >= 4
 14078  	_ = isFlexible
 14079  	if version >= 1 {
 14080  		v := v.ThrottleMillis
 14081  		dst = kbin.AppendInt32(dst, v)
 14082  	}
 14083  	{
 14084  		v := v.ErrorCode
 14085  		dst = kbin.AppendInt16(dst, v)
 14086  	}
 14087  	if version >= 3 {
 14088  		v := v.Members
 14089  		if isFlexible {
 14090  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 14091  		} else {
 14092  			dst = kbin.AppendArrayLen(dst, len(v))
 14093  		}
 14094  		for i := range v {
 14095  			v := &v[i]
 14096  			{
 14097  				v := v.MemberID
 14098  				if isFlexible {
 14099  					dst = kbin.AppendCompactString(dst, v)
 14100  				} else {
 14101  					dst = kbin.AppendString(dst, v)
 14102  				}
 14103  			}
 14104  			{
 14105  				v := v.InstanceID
 14106  				if isFlexible {
 14107  					dst = kbin.AppendCompactNullableString(dst, v)
 14108  				} else {
 14109  					dst = kbin.AppendNullableString(dst, v)
 14110  				}
 14111  			}
 14112  			{
 14113  				v := v.ErrorCode
 14114  				dst = kbin.AppendInt16(dst, v)
 14115  			}
 14116  			if isFlexible {
 14117  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 14118  				dst = v.UnknownTags.AppendEach(dst)
 14119  			}
 14120  		}
 14121  	}
 14122  	if isFlexible {
 14123  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 14124  		dst = v.UnknownTags.AppendEach(dst)
 14125  	}
 14126  	return dst
 14127  }
 14128  
 14129  func (v *LeaveGroupResponse) ReadFrom(src []byte) error {
 14130  	return v.readFrom(src, false)
 14131  }
 14132  
 14133  func (v *LeaveGroupResponse) UnsafeReadFrom(src []byte) error {
 14134  	return v.readFrom(src, true)
 14135  }
 14136  
 14137  func (v *LeaveGroupResponse) readFrom(src []byte, unsafe bool) error {
 14138  	v.Default()
 14139  	b := kbin.Reader{Src: src}
 14140  	version := v.Version
 14141  	_ = version
 14142  	isFlexible := version >= 4
 14143  	_ = isFlexible
 14144  	s := v
 14145  	if version >= 1 {
 14146  		v := b.Int32()
 14147  		s.ThrottleMillis = v
 14148  	}
 14149  	{
 14150  		v := b.Int16()
 14151  		s.ErrorCode = v
 14152  	}
 14153  	if version >= 3 {
 14154  		v := s.Members
 14155  		a := v
 14156  		var l int32
 14157  		if isFlexible {
 14158  			l = b.CompactArrayLen()
 14159  		} else {
 14160  			l = b.ArrayLen()
 14161  		}
 14162  		if !b.Ok() {
 14163  			return b.Complete()
 14164  		}
 14165  		a = a[:0]
 14166  		if l > 0 {
 14167  			a = append(a, make([]LeaveGroupResponseMember, l)...)
 14168  		}
 14169  		for i := int32(0); i < l; i++ {
 14170  			v := &a[i]
 14171  			v.Default()
 14172  			s := v
 14173  			{
 14174  				var v string
 14175  				if unsafe {
 14176  					if isFlexible {
 14177  						v = b.UnsafeCompactString()
 14178  					} else {
 14179  						v = b.UnsafeString()
 14180  					}
 14181  				} else {
 14182  					if isFlexible {
 14183  						v = b.CompactString()
 14184  					} else {
 14185  						v = b.String()
 14186  					}
 14187  				}
 14188  				s.MemberID = v
 14189  			}
 14190  			{
 14191  				var v *string
 14192  				if isFlexible {
 14193  					if unsafe {
 14194  						v = b.UnsafeCompactNullableString()
 14195  					} else {
 14196  						v = b.CompactNullableString()
 14197  					}
 14198  				} else {
 14199  					if unsafe {
 14200  						v = b.UnsafeNullableString()
 14201  					} else {
 14202  						v = b.NullableString()
 14203  					}
 14204  				}
 14205  				s.InstanceID = v
 14206  			}
 14207  			{
 14208  				v := b.Int16()
 14209  				s.ErrorCode = v
 14210  			}
 14211  			if isFlexible {
 14212  				s.UnknownTags = internalReadTags(&b)
 14213  			}
 14214  		}
 14215  		v = a
 14216  		s.Members = v
 14217  	}
 14218  	if isFlexible {
 14219  		s.UnknownTags = internalReadTags(&b)
 14220  	}
 14221  	return b.Complete()
 14222  }
 14223  
 14224  // NewPtrLeaveGroupResponse returns a pointer to a default LeaveGroupResponse
 14225  // This is a shortcut for creating a new(struct) and calling Default yourself.
 14226  func NewPtrLeaveGroupResponse() *LeaveGroupResponse {
 14227  	var v LeaveGroupResponse
 14228  	v.Default()
 14229  	return &v
 14230  }
 14231  
 14232  // Default sets any default fields. Calling this allows for future compatibility
 14233  // if new fields are added to LeaveGroupResponse.
 14234  func (v *LeaveGroupResponse) Default() {
 14235  }
 14236  
 14237  // NewLeaveGroupResponse returns a default LeaveGroupResponse
 14238  // This is a shortcut for creating a struct and calling Default yourself.
 14239  func NewLeaveGroupResponse() LeaveGroupResponse {
 14240  	var v LeaveGroupResponse
 14241  	v.Default()
 14242  	return v
 14243  }
 14244  
 14245  type SyncGroupRequestGroupAssignment struct {
 14246  	// MemberID is the member this assignment is for.
 14247  	MemberID string
 14248  
 14249  	// MemberAssignment is the assignment for this member. This is typically
 14250  	// of type GroupMemberAssignment.
 14251  	MemberAssignment []byte
 14252  
 14253  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14254  	UnknownTags Tags // v4+
 14255  }
 14256  
 14257  // Default sets any default fields. Calling this allows for future compatibility
 14258  // if new fields are added to SyncGroupRequestGroupAssignment.
 14259  func (v *SyncGroupRequestGroupAssignment) Default() {
 14260  }
 14261  
 14262  // NewSyncGroupRequestGroupAssignment returns a default SyncGroupRequestGroupAssignment
 14263  // This is a shortcut for creating a struct and calling Default yourself.
 14264  func NewSyncGroupRequestGroupAssignment() SyncGroupRequestGroupAssignment {
 14265  	var v SyncGroupRequestGroupAssignment
 14266  	v.Default()
 14267  	return v
 14268  }
 14269  
 14270  // SyncGroupRequest is issued by all group members after they receive a a
 14271  // response for JoinGroup. The group leader is responsible for sending member
 14272  // assignments with the request; all other members do not.
 14273  //
 14274  // Once the leader sends the group assignment, all members will be replied to.
 14275  type SyncGroupRequest struct {
 14276  	// Version is the version of this message used with a Kafka broker.
 14277  	Version int16
 14278  
 14279  	// Group is the group ID this sync group is for.
 14280  	Group string
 14281  
 14282  	// Generation is the group generation this sync is for.
 14283  	Generation int32
 14284  
 14285  	// MemberID is the member ID this member is.
 14286  	MemberID string
 14287  
 14288  	// InstanceID is the instance ID of this member in the group (KIP-345).
 14289  	InstanceID *string // v3+
 14290  
 14291  	// ProtocolType is the "type" of protocol being used for this group.
 14292  	ProtocolType *string // v5+
 14293  
 14294  	// Protocol is the agreed upon protocol name (i.e. "sticky", "range").
 14295  	Protocol *string // v5+
 14296  
 14297  	// GroupAssignment, sent only from the group leader, is the topic partition
 14298  	// assignment it has decided on for all members.
 14299  	GroupAssignment []SyncGroupRequestGroupAssignment
 14300  
 14301  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14302  	UnknownTags Tags // v4+
 14303  }
 14304  
 14305  func (*SyncGroupRequest) Key() int16                   { return 14 }
 14306  func (*SyncGroupRequest) MaxVersion() int16            { return 5 }
 14307  func (v *SyncGroupRequest) SetVersion(version int16)   { v.Version = version }
 14308  func (v *SyncGroupRequest) GetVersion() int16          { return v.Version }
 14309  func (v *SyncGroupRequest) IsFlexible() bool           { return v.Version >= 4 }
 14310  func (v *SyncGroupRequest) IsGroupCoordinatorRequest() {}
 14311  func (v *SyncGroupRequest) ResponseKind() Response {
 14312  	r := &SyncGroupResponse{Version: v.Version}
 14313  	r.Default()
 14314  	return r
 14315  }
 14316  
 14317  // RequestWith is requests v on r and returns the response or an error.
 14318  // For sharded requests, the response may be merged and still return an error.
 14319  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 14320  func (v *SyncGroupRequest) RequestWith(ctx context.Context, r Requestor) (*SyncGroupResponse, error) {
 14321  	kresp, err := r.Request(ctx, v)
 14322  	resp, _ := kresp.(*SyncGroupResponse)
 14323  	return resp, err
 14324  }
 14325  
 14326  func (v *SyncGroupRequest) AppendTo(dst []byte) []byte {
 14327  	version := v.Version
 14328  	_ = version
 14329  	isFlexible := version >= 4
 14330  	_ = isFlexible
 14331  	{
 14332  		v := v.Group
 14333  		if isFlexible {
 14334  			dst = kbin.AppendCompactString(dst, v)
 14335  		} else {
 14336  			dst = kbin.AppendString(dst, v)
 14337  		}
 14338  	}
 14339  	{
 14340  		v := v.Generation
 14341  		dst = kbin.AppendInt32(dst, v)
 14342  	}
 14343  	{
 14344  		v := v.MemberID
 14345  		if isFlexible {
 14346  			dst = kbin.AppendCompactString(dst, v)
 14347  		} else {
 14348  			dst = kbin.AppendString(dst, v)
 14349  		}
 14350  	}
 14351  	if version >= 3 {
 14352  		v := v.InstanceID
 14353  		if isFlexible {
 14354  			dst = kbin.AppendCompactNullableString(dst, v)
 14355  		} else {
 14356  			dst = kbin.AppendNullableString(dst, v)
 14357  		}
 14358  	}
 14359  	if version >= 5 {
 14360  		v := v.ProtocolType
 14361  		if isFlexible {
 14362  			dst = kbin.AppendCompactNullableString(dst, v)
 14363  		} else {
 14364  			dst = kbin.AppendNullableString(dst, v)
 14365  		}
 14366  	}
 14367  	if version >= 5 {
 14368  		v := v.Protocol
 14369  		if isFlexible {
 14370  			dst = kbin.AppendCompactNullableString(dst, v)
 14371  		} else {
 14372  			dst = kbin.AppendNullableString(dst, v)
 14373  		}
 14374  	}
 14375  	{
 14376  		v := v.GroupAssignment
 14377  		if isFlexible {
 14378  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 14379  		} else {
 14380  			dst = kbin.AppendArrayLen(dst, len(v))
 14381  		}
 14382  		for i := range v {
 14383  			v := &v[i]
 14384  			{
 14385  				v := v.MemberID
 14386  				if isFlexible {
 14387  					dst = kbin.AppendCompactString(dst, v)
 14388  				} else {
 14389  					dst = kbin.AppendString(dst, v)
 14390  				}
 14391  			}
 14392  			{
 14393  				v := v.MemberAssignment
 14394  				if isFlexible {
 14395  					dst = kbin.AppendCompactBytes(dst, v)
 14396  				} else {
 14397  					dst = kbin.AppendBytes(dst, v)
 14398  				}
 14399  			}
 14400  			if isFlexible {
 14401  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 14402  				dst = v.UnknownTags.AppendEach(dst)
 14403  			}
 14404  		}
 14405  	}
 14406  	if isFlexible {
 14407  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 14408  		dst = v.UnknownTags.AppendEach(dst)
 14409  	}
 14410  	return dst
 14411  }
 14412  
 14413  func (v *SyncGroupRequest) ReadFrom(src []byte) error {
 14414  	return v.readFrom(src, false)
 14415  }
 14416  
 14417  func (v *SyncGroupRequest) UnsafeReadFrom(src []byte) error {
 14418  	return v.readFrom(src, true)
 14419  }
 14420  
 14421  func (v *SyncGroupRequest) readFrom(src []byte, unsafe bool) error {
 14422  	v.Default()
 14423  	b := kbin.Reader{Src: src}
 14424  	version := v.Version
 14425  	_ = version
 14426  	isFlexible := version >= 4
 14427  	_ = isFlexible
 14428  	s := v
 14429  	{
 14430  		var v string
 14431  		if unsafe {
 14432  			if isFlexible {
 14433  				v = b.UnsafeCompactString()
 14434  			} else {
 14435  				v = b.UnsafeString()
 14436  			}
 14437  		} else {
 14438  			if isFlexible {
 14439  				v = b.CompactString()
 14440  			} else {
 14441  				v = b.String()
 14442  			}
 14443  		}
 14444  		s.Group = v
 14445  	}
 14446  	{
 14447  		v := b.Int32()
 14448  		s.Generation = v
 14449  	}
 14450  	{
 14451  		var v string
 14452  		if unsafe {
 14453  			if isFlexible {
 14454  				v = b.UnsafeCompactString()
 14455  			} else {
 14456  				v = b.UnsafeString()
 14457  			}
 14458  		} else {
 14459  			if isFlexible {
 14460  				v = b.CompactString()
 14461  			} else {
 14462  				v = b.String()
 14463  			}
 14464  		}
 14465  		s.MemberID = v
 14466  	}
 14467  	if version >= 3 {
 14468  		var v *string
 14469  		if isFlexible {
 14470  			if unsafe {
 14471  				v = b.UnsafeCompactNullableString()
 14472  			} else {
 14473  				v = b.CompactNullableString()
 14474  			}
 14475  		} else {
 14476  			if unsafe {
 14477  				v = b.UnsafeNullableString()
 14478  			} else {
 14479  				v = b.NullableString()
 14480  			}
 14481  		}
 14482  		s.InstanceID = v
 14483  	}
 14484  	if version >= 5 {
 14485  		var v *string
 14486  		if isFlexible {
 14487  			if unsafe {
 14488  				v = b.UnsafeCompactNullableString()
 14489  			} else {
 14490  				v = b.CompactNullableString()
 14491  			}
 14492  		} else {
 14493  			if unsafe {
 14494  				v = b.UnsafeNullableString()
 14495  			} else {
 14496  				v = b.NullableString()
 14497  			}
 14498  		}
 14499  		s.ProtocolType = v
 14500  	}
 14501  	if version >= 5 {
 14502  		var v *string
 14503  		if isFlexible {
 14504  			if unsafe {
 14505  				v = b.UnsafeCompactNullableString()
 14506  			} else {
 14507  				v = b.CompactNullableString()
 14508  			}
 14509  		} else {
 14510  			if unsafe {
 14511  				v = b.UnsafeNullableString()
 14512  			} else {
 14513  				v = b.NullableString()
 14514  			}
 14515  		}
 14516  		s.Protocol = v
 14517  	}
 14518  	{
 14519  		v := s.GroupAssignment
 14520  		a := v
 14521  		var l int32
 14522  		if isFlexible {
 14523  			l = b.CompactArrayLen()
 14524  		} else {
 14525  			l = b.ArrayLen()
 14526  		}
 14527  		if !b.Ok() {
 14528  			return b.Complete()
 14529  		}
 14530  		a = a[:0]
 14531  		if l > 0 {
 14532  			a = append(a, make([]SyncGroupRequestGroupAssignment, l)...)
 14533  		}
 14534  		for i := int32(0); i < l; i++ {
 14535  			v := &a[i]
 14536  			v.Default()
 14537  			s := v
 14538  			{
 14539  				var v string
 14540  				if unsafe {
 14541  					if isFlexible {
 14542  						v = b.UnsafeCompactString()
 14543  					} else {
 14544  						v = b.UnsafeString()
 14545  					}
 14546  				} else {
 14547  					if isFlexible {
 14548  						v = b.CompactString()
 14549  					} else {
 14550  						v = b.String()
 14551  					}
 14552  				}
 14553  				s.MemberID = v
 14554  			}
 14555  			{
 14556  				var v []byte
 14557  				if isFlexible {
 14558  					v = b.CompactBytes()
 14559  				} else {
 14560  					v = b.Bytes()
 14561  				}
 14562  				s.MemberAssignment = v
 14563  			}
 14564  			if isFlexible {
 14565  				s.UnknownTags = internalReadTags(&b)
 14566  			}
 14567  		}
 14568  		v = a
 14569  		s.GroupAssignment = v
 14570  	}
 14571  	if isFlexible {
 14572  		s.UnknownTags = internalReadTags(&b)
 14573  	}
 14574  	return b.Complete()
 14575  }
 14576  
 14577  // NewPtrSyncGroupRequest returns a pointer to a default SyncGroupRequest
 14578  // This is a shortcut for creating a new(struct) and calling Default yourself.
 14579  func NewPtrSyncGroupRequest() *SyncGroupRequest {
 14580  	var v SyncGroupRequest
 14581  	v.Default()
 14582  	return &v
 14583  }
 14584  
 14585  // Default sets any default fields. Calling this allows for future compatibility
 14586  // if new fields are added to SyncGroupRequest.
 14587  func (v *SyncGroupRequest) Default() {
 14588  }
 14589  
 14590  // NewSyncGroupRequest returns a default SyncGroupRequest
 14591  // This is a shortcut for creating a struct and calling Default yourself.
 14592  func NewSyncGroupRequest() SyncGroupRequest {
 14593  	var v SyncGroupRequest
 14594  	v.Default()
 14595  	return v
 14596  }
 14597  
 14598  // SyncGroupResponse is returned from a SyncGroupRequest.
 14599  type SyncGroupResponse struct {
 14600  	// Version is the version of this message used with a Kafka broker.
 14601  	Version int16
 14602  
 14603  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 14604  	// after this request.
 14605  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 14606  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 14607  	//
 14608  	// This request switched at version 2.
 14609  	ThrottleMillis int32 // v1+
 14610  
 14611  	// ErrorCode is the error for the sync group request.
 14612  	//
 14613  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 14614  	// to the group (no read perms).
 14615  	//
 14616  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 14617  	//
 14618  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available.
 14619  	//
 14620  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 14621  	// for the requested group.
 14622  	//
 14623  	// UNKNOWN_MEMBER_ID is returned if the member ID is not a part of the group,
 14624  	// or if the group is empty or dead.
 14625  	//
 14626  	// ILLEGAL_GENERATION is returned if the request's generation ID is invalid.
 14627  	//
 14628  	// REBALANCE_IN_PROGRESS is returned if the group switched back to rebalancing.
 14629  	//
 14630  	// UNKNOWN_SERVER_ERROR is returned if the store of the group assignment
 14631  	// resulted in a too large message.
 14632  	ErrorCode int16
 14633  
 14634  	// ProtocolType is the "type" of protocol being used for this group.
 14635  	ProtocolType *string // v5+
 14636  
 14637  	// Protocol is the agreed upon protocol name (i.e. "sticky", "range").
 14638  	Protocol *string // v5+
 14639  
 14640  	// MemberAssignment is the assignment for this member that the leader
 14641  	// determined.
 14642  	MemberAssignment []byte
 14643  
 14644  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14645  	UnknownTags Tags // v4+
 14646  }
 14647  
 14648  func (*SyncGroupResponse) Key() int16                         { return 14 }
 14649  func (*SyncGroupResponse) MaxVersion() int16                  { return 5 }
 14650  func (v *SyncGroupResponse) SetVersion(version int16)         { v.Version = version }
 14651  func (v *SyncGroupResponse) GetVersion() int16                { return v.Version }
 14652  func (v *SyncGroupResponse) IsFlexible() bool                 { return v.Version >= 4 }
 14653  func (v *SyncGroupResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 14654  func (v *SyncGroupResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 14655  func (v *SyncGroupResponse) RequestKind() Request             { return &SyncGroupRequest{Version: v.Version} }
 14656  
 14657  func (v *SyncGroupResponse) AppendTo(dst []byte) []byte {
 14658  	version := v.Version
 14659  	_ = version
 14660  	isFlexible := version >= 4
 14661  	_ = isFlexible
 14662  	if version >= 1 {
 14663  		v := v.ThrottleMillis
 14664  		dst = kbin.AppendInt32(dst, v)
 14665  	}
 14666  	{
 14667  		v := v.ErrorCode
 14668  		dst = kbin.AppendInt16(dst, v)
 14669  	}
 14670  	if version >= 5 {
 14671  		v := v.ProtocolType
 14672  		if isFlexible {
 14673  			dst = kbin.AppendCompactNullableString(dst, v)
 14674  		} else {
 14675  			dst = kbin.AppendNullableString(dst, v)
 14676  		}
 14677  	}
 14678  	if version >= 5 {
 14679  		v := v.Protocol
 14680  		if isFlexible {
 14681  			dst = kbin.AppendCompactNullableString(dst, v)
 14682  		} else {
 14683  			dst = kbin.AppendNullableString(dst, v)
 14684  		}
 14685  	}
 14686  	{
 14687  		v := v.MemberAssignment
 14688  		if isFlexible {
 14689  			dst = kbin.AppendCompactBytes(dst, v)
 14690  		} else {
 14691  			dst = kbin.AppendBytes(dst, v)
 14692  		}
 14693  	}
 14694  	if isFlexible {
 14695  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 14696  		dst = v.UnknownTags.AppendEach(dst)
 14697  	}
 14698  	return dst
 14699  }
 14700  
 14701  func (v *SyncGroupResponse) ReadFrom(src []byte) error {
 14702  	return v.readFrom(src, false)
 14703  }
 14704  
 14705  func (v *SyncGroupResponse) UnsafeReadFrom(src []byte) error {
 14706  	return v.readFrom(src, true)
 14707  }
 14708  
 14709  func (v *SyncGroupResponse) readFrom(src []byte, unsafe bool) error {
 14710  	v.Default()
 14711  	b := kbin.Reader{Src: src}
 14712  	version := v.Version
 14713  	_ = version
 14714  	isFlexible := version >= 4
 14715  	_ = isFlexible
 14716  	s := v
 14717  	if version >= 1 {
 14718  		v := b.Int32()
 14719  		s.ThrottleMillis = v
 14720  	}
 14721  	{
 14722  		v := b.Int16()
 14723  		s.ErrorCode = v
 14724  	}
 14725  	if version >= 5 {
 14726  		var v *string
 14727  		if isFlexible {
 14728  			if unsafe {
 14729  				v = b.UnsafeCompactNullableString()
 14730  			} else {
 14731  				v = b.CompactNullableString()
 14732  			}
 14733  		} else {
 14734  			if unsafe {
 14735  				v = b.UnsafeNullableString()
 14736  			} else {
 14737  				v = b.NullableString()
 14738  			}
 14739  		}
 14740  		s.ProtocolType = v
 14741  	}
 14742  	if version >= 5 {
 14743  		var v *string
 14744  		if isFlexible {
 14745  			if unsafe {
 14746  				v = b.UnsafeCompactNullableString()
 14747  			} else {
 14748  				v = b.CompactNullableString()
 14749  			}
 14750  		} else {
 14751  			if unsafe {
 14752  				v = b.UnsafeNullableString()
 14753  			} else {
 14754  				v = b.NullableString()
 14755  			}
 14756  		}
 14757  		s.Protocol = v
 14758  	}
 14759  	{
 14760  		var v []byte
 14761  		if isFlexible {
 14762  			v = b.CompactBytes()
 14763  		} else {
 14764  			v = b.Bytes()
 14765  		}
 14766  		s.MemberAssignment = v
 14767  	}
 14768  	if isFlexible {
 14769  		s.UnknownTags = internalReadTags(&b)
 14770  	}
 14771  	return b.Complete()
 14772  }
 14773  
 14774  // NewPtrSyncGroupResponse returns a pointer to a default SyncGroupResponse
 14775  // This is a shortcut for creating a new(struct) and calling Default yourself.
 14776  func NewPtrSyncGroupResponse() *SyncGroupResponse {
 14777  	var v SyncGroupResponse
 14778  	v.Default()
 14779  	return &v
 14780  }
 14781  
 14782  // Default sets any default fields. Calling this allows for future compatibility
 14783  // if new fields are added to SyncGroupResponse.
 14784  func (v *SyncGroupResponse) Default() {
 14785  }
 14786  
 14787  // NewSyncGroupResponse returns a default SyncGroupResponse
 14788  // This is a shortcut for creating a struct and calling Default yourself.
 14789  func NewSyncGroupResponse() SyncGroupResponse {
 14790  	var v SyncGroupResponse
 14791  	v.Default()
 14792  	return v
 14793  }
 14794  
 14795  // DescribeGroupsRequest requests metadata for group IDs.
 14796  type DescribeGroupsRequest struct {
 14797  	// Version is the version of this message used with a Kafka broker.
 14798  	Version int16
 14799  
 14800  	// Groups is an array of group IDs to request metadata for.
 14801  	Groups []string
 14802  
 14803  	// IncludeAuthorizedOperations, introduced in Kafka 2.3.0, specifies
 14804  	// whether to include a bitfield of AclOperations this client can perform
 14805  	// on the groups. See KIP-430 for more details.
 14806  	IncludeAuthorizedOperations bool // v3+
 14807  
 14808  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14809  	UnknownTags Tags // v5+
 14810  }
 14811  
 14812  func (*DescribeGroupsRequest) Key() int16                   { return 15 }
 14813  func (*DescribeGroupsRequest) MaxVersion() int16            { return 5 }
 14814  func (v *DescribeGroupsRequest) SetVersion(version int16)   { v.Version = version }
 14815  func (v *DescribeGroupsRequest) GetVersion() int16          { return v.Version }
 14816  func (v *DescribeGroupsRequest) IsFlexible() bool           { return v.Version >= 5 }
 14817  func (v *DescribeGroupsRequest) IsGroupCoordinatorRequest() {}
 14818  func (v *DescribeGroupsRequest) ResponseKind() Response {
 14819  	r := &DescribeGroupsResponse{Version: v.Version}
 14820  	r.Default()
 14821  	return r
 14822  }
 14823  
 14824  // RequestWith is requests v on r and returns the response or an error.
 14825  // For sharded requests, the response may be merged and still return an error.
 14826  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 14827  func (v *DescribeGroupsRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeGroupsResponse, error) {
 14828  	kresp, err := r.Request(ctx, v)
 14829  	resp, _ := kresp.(*DescribeGroupsResponse)
 14830  	return resp, err
 14831  }
 14832  
 14833  func (v *DescribeGroupsRequest) AppendTo(dst []byte) []byte {
 14834  	version := v.Version
 14835  	_ = version
 14836  	isFlexible := version >= 5
 14837  	_ = isFlexible
 14838  	{
 14839  		v := v.Groups
 14840  		if isFlexible {
 14841  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 14842  		} else {
 14843  			dst = kbin.AppendArrayLen(dst, len(v))
 14844  		}
 14845  		for i := range v {
 14846  			v := v[i]
 14847  			if isFlexible {
 14848  				dst = kbin.AppendCompactString(dst, v)
 14849  			} else {
 14850  				dst = kbin.AppendString(dst, v)
 14851  			}
 14852  		}
 14853  	}
 14854  	if version >= 3 {
 14855  		v := v.IncludeAuthorizedOperations
 14856  		dst = kbin.AppendBool(dst, v)
 14857  	}
 14858  	if isFlexible {
 14859  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 14860  		dst = v.UnknownTags.AppendEach(dst)
 14861  	}
 14862  	return dst
 14863  }
 14864  
 14865  func (v *DescribeGroupsRequest) ReadFrom(src []byte) error {
 14866  	return v.readFrom(src, false)
 14867  }
 14868  
 14869  func (v *DescribeGroupsRequest) UnsafeReadFrom(src []byte) error {
 14870  	return v.readFrom(src, true)
 14871  }
 14872  
 14873  func (v *DescribeGroupsRequest) readFrom(src []byte, unsafe bool) error {
 14874  	v.Default()
 14875  	b := kbin.Reader{Src: src}
 14876  	version := v.Version
 14877  	_ = version
 14878  	isFlexible := version >= 5
 14879  	_ = isFlexible
 14880  	s := v
 14881  	{
 14882  		v := s.Groups
 14883  		a := v
 14884  		var l int32
 14885  		if isFlexible {
 14886  			l = b.CompactArrayLen()
 14887  		} else {
 14888  			l = b.ArrayLen()
 14889  		}
 14890  		if !b.Ok() {
 14891  			return b.Complete()
 14892  		}
 14893  		a = a[:0]
 14894  		if l > 0 {
 14895  			a = append(a, make([]string, l)...)
 14896  		}
 14897  		for i := int32(0); i < l; i++ {
 14898  			var v string
 14899  			if unsafe {
 14900  				if isFlexible {
 14901  					v = b.UnsafeCompactString()
 14902  				} else {
 14903  					v = b.UnsafeString()
 14904  				}
 14905  			} else {
 14906  				if isFlexible {
 14907  					v = b.CompactString()
 14908  				} else {
 14909  					v = b.String()
 14910  				}
 14911  			}
 14912  			a[i] = v
 14913  		}
 14914  		v = a
 14915  		s.Groups = v
 14916  	}
 14917  	if version >= 3 {
 14918  		v := b.Bool()
 14919  		s.IncludeAuthorizedOperations = v
 14920  	}
 14921  	if isFlexible {
 14922  		s.UnknownTags = internalReadTags(&b)
 14923  	}
 14924  	return b.Complete()
 14925  }
 14926  
 14927  // NewPtrDescribeGroupsRequest returns a pointer to a default DescribeGroupsRequest
 14928  // This is a shortcut for creating a new(struct) and calling Default yourself.
 14929  func NewPtrDescribeGroupsRequest() *DescribeGroupsRequest {
 14930  	var v DescribeGroupsRequest
 14931  	v.Default()
 14932  	return &v
 14933  }
 14934  
 14935  // Default sets any default fields. Calling this allows for future compatibility
 14936  // if new fields are added to DescribeGroupsRequest.
 14937  func (v *DescribeGroupsRequest) Default() {
 14938  }
 14939  
 14940  // NewDescribeGroupsRequest returns a default DescribeGroupsRequest
 14941  // This is a shortcut for creating a struct and calling Default yourself.
 14942  func NewDescribeGroupsRequest() DescribeGroupsRequest {
 14943  	var v DescribeGroupsRequest
 14944  	v.Default()
 14945  	return v
 14946  }
 14947  
 14948  type DescribeGroupsResponseGroupMember struct {
 14949  	// MemberID is the member ID of a member in this group.
 14950  	MemberID string
 14951  
 14952  	// InstanceID is the instance ID of this member in the group (KIP-345).
 14953  	InstanceID *string // v4+
 14954  
 14955  	// ClientID is the client ID used by this member.
 14956  	ClientID string
 14957  
 14958  	// ClientHost is the host this client is running on.
 14959  	ClientHost string
 14960  
 14961  	// ProtocolMetadata is the metadata this member included when joining
 14962  	// the group. If using normal (Java-like) consumers, this will be of
 14963  	// type GroupMemberMetadata.
 14964  	ProtocolMetadata []byte
 14965  
 14966  	// MemberAssignment is the assignment for this member in the group.
 14967  	// If using normal (Java-like) consumers, this will be of type
 14968  	// GroupMemberAssignment.
 14969  	MemberAssignment []byte
 14970  
 14971  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 14972  	UnknownTags Tags // v5+
 14973  }
 14974  
 14975  // Default sets any default fields. Calling this allows for future compatibility
 14976  // if new fields are added to DescribeGroupsResponseGroupMember.
 14977  func (v *DescribeGroupsResponseGroupMember) Default() {
 14978  }
 14979  
 14980  // NewDescribeGroupsResponseGroupMember returns a default DescribeGroupsResponseGroupMember
 14981  // This is a shortcut for creating a struct and calling Default yourself.
 14982  func NewDescribeGroupsResponseGroupMember() DescribeGroupsResponseGroupMember {
 14983  	var v DescribeGroupsResponseGroupMember
 14984  	v.Default()
 14985  	return v
 14986  }
 14987  
 14988  type DescribeGroupsResponseGroup struct {
 14989  	// ErrorCode is the error code for an individual group in a request.
 14990  	//
 14991  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 14992  	// to describe a group.
 14993  	//
 14994  	// INVALID_GROUP_ID is returned if the requested group ID is invalid.
 14995  	//
 14996  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator for this
 14997  	// group is not yet active.
 14998  	//
 14999  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is loading.
 15000  	//
 15001  	// NOT_COORDINATOR is returned if the requested broker is not the
 15002  	// coordinator for this group.
 15003  	ErrorCode int16
 15004  
 15005  	// Group is the id of this group.
 15006  	Group string
 15007  
 15008  	// State is the state this group is in.
 15009  	State string
 15010  
 15011  	// ProtocolType is the "type" of protocol being used for this group.
 15012  	ProtocolType string
 15013  
 15014  	// Protocol is the agreed upon protocol for all members in this group.
 15015  	Protocol string
 15016  
 15017  	// Members contains members in this group.
 15018  	Members []DescribeGroupsResponseGroupMember
 15019  
 15020  	// AuthorizedOperations is a bitfield containing which operations the
 15021  	// the client is allowed to perform on this group.
 15022  	// This is only returned if requested.
 15023  	//
 15024  	// This field has a default of -2147483648.
 15025  	AuthorizedOperations int32 // v3+
 15026  
 15027  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 15028  	UnknownTags Tags // v5+
 15029  }
 15030  
 15031  // Default sets any default fields. Calling this allows for future compatibility
 15032  // if new fields are added to DescribeGroupsResponseGroup.
 15033  func (v *DescribeGroupsResponseGroup) Default() {
 15034  	v.AuthorizedOperations = -2147483648
 15035  }
 15036  
 15037  // NewDescribeGroupsResponseGroup returns a default DescribeGroupsResponseGroup
 15038  // This is a shortcut for creating a struct and calling Default yourself.
 15039  func NewDescribeGroupsResponseGroup() DescribeGroupsResponseGroup {
 15040  	var v DescribeGroupsResponseGroup
 15041  	v.Default()
 15042  	return v
 15043  }
 15044  
 15045  // DescribeGroupsResponse is returned from a DescribeGroupsRequest.
 15046  type DescribeGroupsResponse struct {
 15047  	// Version is the version of this message used with a Kafka broker.
 15048  	Version int16
 15049  
 15050  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 15051  	// after this request.
 15052  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 15053  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 15054  	//
 15055  	// This request switched at version 2.
 15056  	ThrottleMillis int32 // v1+
 15057  
 15058  	// Groups is an array of group metadata.
 15059  	Groups []DescribeGroupsResponseGroup
 15060  
 15061  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 15062  	UnknownTags Tags // v5+
 15063  }
 15064  
 15065  func (*DescribeGroupsResponse) Key() int16                         { return 15 }
 15066  func (*DescribeGroupsResponse) MaxVersion() int16                  { return 5 }
 15067  func (v *DescribeGroupsResponse) SetVersion(version int16)         { v.Version = version }
 15068  func (v *DescribeGroupsResponse) GetVersion() int16                { return v.Version }
 15069  func (v *DescribeGroupsResponse) IsFlexible() bool                 { return v.Version >= 5 }
 15070  func (v *DescribeGroupsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 15071  func (v *DescribeGroupsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 15072  func (v *DescribeGroupsResponse) RequestKind() Request {
 15073  	return &DescribeGroupsRequest{Version: v.Version}
 15074  }
 15075  
 15076  func (v *DescribeGroupsResponse) AppendTo(dst []byte) []byte {
 15077  	version := v.Version
 15078  	_ = version
 15079  	isFlexible := version >= 5
 15080  	_ = isFlexible
 15081  	if version >= 1 {
 15082  		v := v.ThrottleMillis
 15083  		dst = kbin.AppendInt32(dst, v)
 15084  	}
 15085  	{
 15086  		v := v.Groups
 15087  		if isFlexible {
 15088  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 15089  		} else {
 15090  			dst = kbin.AppendArrayLen(dst, len(v))
 15091  		}
 15092  		for i := range v {
 15093  			v := &v[i]
 15094  			{
 15095  				v := v.ErrorCode
 15096  				dst = kbin.AppendInt16(dst, v)
 15097  			}
 15098  			{
 15099  				v := v.Group
 15100  				if isFlexible {
 15101  					dst = kbin.AppendCompactString(dst, v)
 15102  				} else {
 15103  					dst = kbin.AppendString(dst, v)
 15104  				}
 15105  			}
 15106  			{
 15107  				v := v.State
 15108  				if isFlexible {
 15109  					dst = kbin.AppendCompactString(dst, v)
 15110  				} else {
 15111  					dst = kbin.AppendString(dst, v)
 15112  				}
 15113  			}
 15114  			{
 15115  				v := v.ProtocolType
 15116  				if isFlexible {
 15117  					dst = kbin.AppendCompactString(dst, v)
 15118  				} else {
 15119  					dst = kbin.AppendString(dst, v)
 15120  				}
 15121  			}
 15122  			{
 15123  				v := v.Protocol
 15124  				if isFlexible {
 15125  					dst = kbin.AppendCompactString(dst, v)
 15126  				} else {
 15127  					dst = kbin.AppendString(dst, v)
 15128  				}
 15129  			}
 15130  			{
 15131  				v := v.Members
 15132  				if isFlexible {
 15133  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 15134  				} else {
 15135  					dst = kbin.AppendArrayLen(dst, len(v))
 15136  				}
 15137  				for i := range v {
 15138  					v := &v[i]
 15139  					{
 15140  						v := v.MemberID
 15141  						if isFlexible {
 15142  							dst = kbin.AppendCompactString(dst, v)
 15143  						} else {
 15144  							dst = kbin.AppendString(dst, v)
 15145  						}
 15146  					}
 15147  					if version >= 4 {
 15148  						v := v.InstanceID
 15149  						if isFlexible {
 15150  							dst = kbin.AppendCompactNullableString(dst, v)
 15151  						} else {
 15152  							dst = kbin.AppendNullableString(dst, v)
 15153  						}
 15154  					}
 15155  					{
 15156  						v := v.ClientID
 15157  						if isFlexible {
 15158  							dst = kbin.AppendCompactString(dst, v)
 15159  						} else {
 15160  							dst = kbin.AppendString(dst, v)
 15161  						}
 15162  					}
 15163  					{
 15164  						v := v.ClientHost
 15165  						if isFlexible {
 15166  							dst = kbin.AppendCompactString(dst, v)
 15167  						} else {
 15168  							dst = kbin.AppendString(dst, v)
 15169  						}
 15170  					}
 15171  					{
 15172  						v := v.ProtocolMetadata
 15173  						if isFlexible {
 15174  							dst = kbin.AppendCompactBytes(dst, v)
 15175  						} else {
 15176  							dst = kbin.AppendBytes(dst, v)
 15177  						}
 15178  					}
 15179  					{
 15180  						v := v.MemberAssignment
 15181  						if isFlexible {
 15182  							dst = kbin.AppendCompactBytes(dst, v)
 15183  						} else {
 15184  							dst = kbin.AppendBytes(dst, v)
 15185  						}
 15186  					}
 15187  					if isFlexible {
 15188  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 15189  						dst = v.UnknownTags.AppendEach(dst)
 15190  					}
 15191  				}
 15192  			}
 15193  			if version >= 3 {
 15194  				v := v.AuthorizedOperations
 15195  				dst = kbin.AppendInt32(dst, v)
 15196  			}
 15197  			if isFlexible {
 15198  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 15199  				dst = v.UnknownTags.AppendEach(dst)
 15200  			}
 15201  		}
 15202  	}
 15203  	if isFlexible {
 15204  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 15205  		dst = v.UnknownTags.AppendEach(dst)
 15206  	}
 15207  	return dst
 15208  }
 15209  
 15210  func (v *DescribeGroupsResponse) ReadFrom(src []byte) error {
 15211  	return v.readFrom(src, false)
 15212  }
 15213  
 15214  func (v *DescribeGroupsResponse) UnsafeReadFrom(src []byte) error {
 15215  	return v.readFrom(src, true)
 15216  }
 15217  
 15218  func (v *DescribeGroupsResponse) readFrom(src []byte, unsafe bool) error {
 15219  	v.Default()
 15220  	b := kbin.Reader{Src: src}
 15221  	version := v.Version
 15222  	_ = version
 15223  	isFlexible := version >= 5
 15224  	_ = isFlexible
 15225  	s := v
 15226  	if version >= 1 {
 15227  		v := b.Int32()
 15228  		s.ThrottleMillis = v
 15229  	}
 15230  	{
 15231  		v := s.Groups
 15232  		a := v
 15233  		var l int32
 15234  		if isFlexible {
 15235  			l = b.CompactArrayLen()
 15236  		} else {
 15237  			l = b.ArrayLen()
 15238  		}
 15239  		if !b.Ok() {
 15240  			return b.Complete()
 15241  		}
 15242  		a = a[:0]
 15243  		if l > 0 {
 15244  			a = append(a, make([]DescribeGroupsResponseGroup, l)...)
 15245  		}
 15246  		for i := int32(0); i < l; i++ {
 15247  			v := &a[i]
 15248  			v.Default()
 15249  			s := v
 15250  			{
 15251  				v := b.Int16()
 15252  				s.ErrorCode = v
 15253  			}
 15254  			{
 15255  				var v string
 15256  				if unsafe {
 15257  					if isFlexible {
 15258  						v = b.UnsafeCompactString()
 15259  					} else {
 15260  						v = b.UnsafeString()
 15261  					}
 15262  				} else {
 15263  					if isFlexible {
 15264  						v = b.CompactString()
 15265  					} else {
 15266  						v = b.String()
 15267  					}
 15268  				}
 15269  				s.Group = v
 15270  			}
 15271  			{
 15272  				var v string
 15273  				if unsafe {
 15274  					if isFlexible {
 15275  						v = b.UnsafeCompactString()
 15276  					} else {
 15277  						v = b.UnsafeString()
 15278  					}
 15279  				} else {
 15280  					if isFlexible {
 15281  						v = b.CompactString()
 15282  					} else {
 15283  						v = b.String()
 15284  					}
 15285  				}
 15286  				s.State = v
 15287  			}
 15288  			{
 15289  				var v string
 15290  				if unsafe {
 15291  					if isFlexible {
 15292  						v = b.UnsafeCompactString()
 15293  					} else {
 15294  						v = b.UnsafeString()
 15295  					}
 15296  				} else {
 15297  					if isFlexible {
 15298  						v = b.CompactString()
 15299  					} else {
 15300  						v = b.String()
 15301  					}
 15302  				}
 15303  				s.ProtocolType = v
 15304  			}
 15305  			{
 15306  				var v string
 15307  				if unsafe {
 15308  					if isFlexible {
 15309  						v = b.UnsafeCompactString()
 15310  					} else {
 15311  						v = b.UnsafeString()
 15312  					}
 15313  				} else {
 15314  					if isFlexible {
 15315  						v = b.CompactString()
 15316  					} else {
 15317  						v = b.String()
 15318  					}
 15319  				}
 15320  				s.Protocol = v
 15321  			}
 15322  			{
 15323  				v := s.Members
 15324  				a := v
 15325  				var l int32
 15326  				if isFlexible {
 15327  					l = b.CompactArrayLen()
 15328  				} else {
 15329  					l = b.ArrayLen()
 15330  				}
 15331  				if !b.Ok() {
 15332  					return b.Complete()
 15333  				}
 15334  				a = a[:0]
 15335  				if l > 0 {
 15336  					a = append(a, make([]DescribeGroupsResponseGroupMember, l)...)
 15337  				}
 15338  				for i := int32(0); i < l; i++ {
 15339  					v := &a[i]
 15340  					v.Default()
 15341  					s := v
 15342  					{
 15343  						var v string
 15344  						if unsafe {
 15345  							if isFlexible {
 15346  								v = b.UnsafeCompactString()
 15347  							} else {
 15348  								v = b.UnsafeString()
 15349  							}
 15350  						} else {
 15351  							if isFlexible {
 15352  								v = b.CompactString()
 15353  							} else {
 15354  								v = b.String()
 15355  							}
 15356  						}
 15357  						s.MemberID = v
 15358  					}
 15359  					if version >= 4 {
 15360  						var v *string
 15361  						if isFlexible {
 15362  							if unsafe {
 15363  								v = b.UnsafeCompactNullableString()
 15364  							} else {
 15365  								v = b.CompactNullableString()
 15366  							}
 15367  						} else {
 15368  							if unsafe {
 15369  								v = b.UnsafeNullableString()
 15370  							} else {
 15371  								v = b.NullableString()
 15372  							}
 15373  						}
 15374  						s.InstanceID = v
 15375  					}
 15376  					{
 15377  						var v string
 15378  						if unsafe {
 15379  							if isFlexible {
 15380  								v = b.UnsafeCompactString()
 15381  							} else {
 15382  								v = b.UnsafeString()
 15383  							}
 15384  						} else {
 15385  							if isFlexible {
 15386  								v = b.CompactString()
 15387  							} else {
 15388  								v = b.String()
 15389  							}
 15390  						}
 15391  						s.ClientID = v
 15392  					}
 15393  					{
 15394  						var v string
 15395  						if unsafe {
 15396  							if isFlexible {
 15397  								v = b.UnsafeCompactString()
 15398  							} else {
 15399  								v = b.UnsafeString()
 15400  							}
 15401  						} else {
 15402  							if isFlexible {
 15403  								v = b.CompactString()
 15404  							} else {
 15405  								v = b.String()
 15406  							}
 15407  						}
 15408  						s.ClientHost = v
 15409  					}
 15410  					{
 15411  						var v []byte
 15412  						if isFlexible {
 15413  							v = b.CompactBytes()
 15414  						} else {
 15415  							v = b.Bytes()
 15416  						}
 15417  						s.ProtocolMetadata = v
 15418  					}
 15419  					{
 15420  						var v []byte
 15421  						if isFlexible {
 15422  							v = b.CompactBytes()
 15423  						} else {
 15424  							v = b.Bytes()
 15425  						}
 15426  						s.MemberAssignment = v
 15427  					}
 15428  					if isFlexible {
 15429  						s.UnknownTags = internalReadTags(&b)
 15430  					}
 15431  				}
 15432  				v = a
 15433  				s.Members = v
 15434  			}
 15435  			if version >= 3 {
 15436  				v := b.Int32()
 15437  				s.AuthorizedOperations = v
 15438  			}
 15439  			if isFlexible {
 15440  				s.UnknownTags = internalReadTags(&b)
 15441  			}
 15442  		}
 15443  		v = a
 15444  		s.Groups = v
 15445  	}
 15446  	if isFlexible {
 15447  		s.UnknownTags = internalReadTags(&b)
 15448  	}
 15449  	return b.Complete()
 15450  }
 15451  
 15452  // NewPtrDescribeGroupsResponse returns a pointer to a default DescribeGroupsResponse
 15453  // This is a shortcut for creating a new(struct) and calling Default yourself.
 15454  func NewPtrDescribeGroupsResponse() *DescribeGroupsResponse {
 15455  	var v DescribeGroupsResponse
 15456  	v.Default()
 15457  	return &v
 15458  }
 15459  
 15460  // Default sets any default fields. Calling this allows for future compatibility
 15461  // if new fields are added to DescribeGroupsResponse.
 15462  func (v *DescribeGroupsResponse) Default() {
 15463  }
 15464  
 15465  // NewDescribeGroupsResponse returns a default DescribeGroupsResponse
 15466  // This is a shortcut for creating a struct and calling Default yourself.
 15467  func NewDescribeGroupsResponse() DescribeGroupsResponse {
 15468  	var v DescribeGroupsResponse
 15469  	v.Default()
 15470  	return v
 15471  }
 15472  
 15473  // ListGroupsRequest issues a request to list all groups.
 15474  //
 15475  // To list all groups in a cluster, this must be issued to every broker.
 15476  type ListGroupsRequest struct {
 15477  	// Version is the version of this message used with a Kafka broker.
 15478  	Version int16
 15479  
 15480  	// StatesFilter, proposed in KIP-518 and introduced in Kafka 2.6.0,
 15481  	// allows filtering groups by state, where a state is any of
 15482  	// "Preparing", "PreparingRebalance", "CompletingRebalance", "Stable",
 15483  	// "Dead", or "Empty". If empty, all groups are returned.
 15484  	StatesFilter []string // v4+
 15485  
 15486  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 15487  	UnknownTags Tags // v3+
 15488  }
 15489  
 15490  func (*ListGroupsRequest) Key() int16                 { return 16 }
 15491  func (*ListGroupsRequest) MaxVersion() int16          { return 4 }
 15492  func (v *ListGroupsRequest) SetVersion(version int16) { v.Version = version }
 15493  func (v *ListGroupsRequest) GetVersion() int16        { return v.Version }
 15494  func (v *ListGroupsRequest) IsFlexible() bool         { return v.Version >= 3 }
 15495  func (v *ListGroupsRequest) ResponseKind() Response {
 15496  	r := &ListGroupsResponse{Version: v.Version}
 15497  	r.Default()
 15498  	return r
 15499  }
 15500  
 15501  // RequestWith is requests v on r and returns the response or an error.
 15502  // For sharded requests, the response may be merged and still return an error.
 15503  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 15504  func (v *ListGroupsRequest) RequestWith(ctx context.Context, r Requestor) (*ListGroupsResponse, error) {
 15505  	kresp, err := r.Request(ctx, v)
 15506  	resp, _ := kresp.(*ListGroupsResponse)
 15507  	return resp, err
 15508  }
 15509  
 15510  func (v *ListGroupsRequest) AppendTo(dst []byte) []byte {
 15511  	version := v.Version
 15512  	_ = version
 15513  	isFlexible := version >= 3
 15514  	_ = isFlexible
 15515  	if version >= 4 {
 15516  		v := v.StatesFilter
 15517  		if isFlexible {
 15518  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 15519  		} else {
 15520  			dst = kbin.AppendArrayLen(dst, len(v))
 15521  		}
 15522  		for i := range v {
 15523  			v := v[i]
 15524  			if isFlexible {
 15525  				dst = kbin.AppendCompactString(dst, v)
 15526  			} else {
 15527  				dst = kbin.AppendString(dst, v)
 15528  			}
 15529  		}
 15530  	}
 15531  	if isFlexible {
 15532  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 15533  		dst = v.UnknownTags.AppendEach(dst)
 15534  	}
 15535  	return dst
 15536  }
 15537  
 15538  func (v *ListGroupsRequest) ReadFrom(src []byte) error {
 15539  	return v.readFrom(src, false)
 15540  }
 15541  
 15542  func (v *ListGroupsRequest) UnsafeReadFrom(src []byte) error {
 15543  	return v.readFrom(src, true)
 15544  }
 15545  
 15546  func (v *ListGroupsRequest) readFrom(src []byte, unsafe bool) error {
 15547  	v.Default()
 15548  	b := kbin.Reader{Src: src}
 15549  	version := v.Version
 15550  	_ = version
 15551  	isFlexible := version >= 3
 15552  	_ = isFlexible
 15553  	s := v
 15554  	if version >= 4 {
 15555  		v := s.StatesFilter
 15556  		a := v
 15557  		var l int32
 15558  		if isFlexible {
 15559  			l = b.CompactArrayLen()
 15560  		} else {
 15561  			l = b.ArrayLen()
 15562  		}
 15563  		if !b.Ok() {
 15564  			return b.Complete()
 15565  		}
 15566  		a = a[:0]
 15567  		if l > 0 {
 15568  			a = append(a, make([]string, l)...)
 15569  		}
 15570  		for i := int32(0); i < l; i++ {
 15571  			var v string
 15572  			if unsafe {
 15573  				if isFlexible {
 15574  					v = b.UnsafeCompactString()
 15575  				} else {
 15576  					v = b.UnsafeString()
 15577  				}
 15578  			} else {
 15579  				if isFlexible {
 15580  					v = b.CompactString()
 15581  				} else {
 15582  					v = b.String()
 15583  				}
 15584  			}
 15585  			a[i] = v
 15586  		}
 15587  		v = a
 15588  		s.StatesFilter = v
 15589  	}
 15590  	if isFlexible {
 15591  		s.UnknownTags = internalReadTags(&b)
 15592  	}
 15593  	return b.Complete()
 15594  }
 15595  
 15596  // NewPtrListGroupsRequest returns a pointer to a default ListGroupsRequest
 15597  // This is a shortcut for creating a new(struct) and calling Default yourself.
 15598  func NewPtrListGroupsRequest() *ListGroupsRequest {
 15599  	var v ListGroupsRequest
 15600  	v.Default()
 15601  	return &v
 15602  }
 15603  
 15604  // Default sets any default fields. Calling this allows for future compatibility
 15605  // if new fields are added to ListGroupsRequest.
 15606  func (v *ListGroupsRequest) Default() {
 15607  }
 15608  
 15609  // NewListGroupsRequest returns a default ListGroupsRequest
 15610  // This is a shortcut for creating a struct and calling Default yourself.
 15611  func NewListGroupsRequest() ListGroupsRequest {
 15612  	var v ListGroupsRequest
 15613  	v.Default()
 15614  	return v
 15615  }
 15616  
 15617  type ListGroupsResponseGroup struct {
 15618  	// Group is a Kafka group.
 15619  	Group string
 15620  
 15621  	// ProtocolType is the protocol type in use by the group.
 15622  	ProtocolType string
 15623  
 15624  	// The group state.
 15625  	GroupState string // v4+
 15626  
 15627  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 15628  	UnknownTags Tags // v3+
 15629  }
 15630  
 15631  // Default sets any default fields. Calling this allows for future compatibility
 15632  // if new fields are added to ListGroupsResponseGroup.
 15633  func (v *ListGroupsResponseGroup) Default() {
 15634  }
 15635  
 15636  // NewListGroupsResponseGroup returns a default ListGroupsResponseGroup
 15637  // This is a shortcut for creating a struct and calling Default yourself.
 15638  func NewListGroupsResponseGroup() ListGroupsResponseGroup {
 15639  	var v ListGroupsResponseGroup
 15640  	v.Default()
 15641  	return v
 15642  }
 15643  
 15644  // ListGroupsResponse is returned from a ListGroupsRequest.
 15645  type ListGroupsResponse struct {
 15646  	// Version is the version of this message used with a Kafka broker.
 15647  	Version int16
 15648  
 15649  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 15650  	// after this request.
 15651  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 15652  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 15653  	//
 15654  	// This request switched at version 2.
 15655  	ThrottleMillis int32 // v1+
 15656  
 15657  	// ErrorCode is the error returned for the list groups request.
 15658  	//
 15659  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not yet active.
 15660  	//
 15661  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group manager is loading.
 15662  	ErrorCode int16
 15663  
 15664  	// Groups is the list of groups Kafka knows of.
 15665  	Groups []ListGroupsResponseGroup
 15666  
 15667  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 15668  	UnknownTags Tags // v3+
 15669  }
 15670  
 15671  func (*ListGroupsResponse) Key() int16                         { return 16 }
 15672  func (*ListGroupsResponse) MaxVersion() int16                  { return 4 }
 15673  func (v *ListGroupsResponse) SetVersion(version int16)         { v.Version = version }
 15674  func (v *ListGroupsResponse) GetVersion() int16                { return v.Version }
 15675  func (v *ListGroupsResponse) IsFlexible() bool                 { return v.Version >= 3 }
 15676  func (v *ListGroupsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 15677  func (v *ListGroupsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 15678  func (v *ListGroupsResponse) RequestKind() Request             { return &ListGroupsRequest{Version: v.Version} }
 15679  
 15680  func (v *ListGroupsResponse) AppendTo(dst []byte) []byte {
 15681  	version := v.Version
 15682  	_ = version
 15683  	isFlexible := version >= 3
 15684  	_ = isFlexible
 15685  	if version >= 1 {
 15686  		v := v.ThrottleMillis
 15687  		dst = kbin.AppendInt32(dst, v)
 15688  	}
 15689  	{
 15690  		v := v.ErrorCode
 15691  		dst = kbin.AppendInt16(dst, v)
 15692  	}
 15693  	{
 15694  		v := v.Groups
 15695  		if isFlexible {
 15696  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 15697  		} else {
 15698  			dst = kbin.AppendArrayLen(dst, len(v))
 15699  		}
 15700  		for i := range v {
 15701  			v := &v[i]
 15702  			{
 15703  				v := v.Group
 15704  				if isFlexible {
 15705  					dst = kbin.AppendCompactString(dst, v)
 15706  				} else {
 15707  					dst = kbin.AppendString(dst, v)
 15708  				}
 15709  			}
 15710  			{
 15711  				v := v.ProtocolType
 15712  				if isFlexible {
 15713  					dst = kbin.AppendCompactString(dst, v)
 15714  				} else {
 15715  					dst = kbin.AppendString(dst, v)
 15716  				}
 15717  			}
 15718  			if version >= 4 {
 15719  				v := v.GroupState
 15720  				if isFlexible {
 15721  					dst = kbin.AppendCompactString(dst, v)
 15722  				} else {
 15723  					dst = kbin.AppendString(dst, v)
 15724  				}
 15725  			}
 15726  			if isFlexible {
 15727  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 15728  				dst = v.UnknownTags.AppendEach(dst)
 15729  			}
 15730  		}
 15731  	}
 15732  	if isFlexible {
 15733  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 15734  		dst = v.UnknownTags.AppendEach(dst)
 15735  	}
 15736  	return dst
 15737  }
 15738  
 15739  func (v *ListGroupsResponse) ReadFrom(src []byte) error {
 15740  	return v.readFrom(src, false)
 15741  }
 15742  
 15743  func (v *ListGroupsResponse) UnsafeReadFrom(src []byte) error {
 15744  	return v.readFrom(src, true)
 15745  }
 15746  
 15747  func (v *ListGroupsResponse) readFrom(src []byte, unsafe bool) error {
 15748  	v.Default()
 15749  	b := kbin.Reader{Src: src}
 15750  	version := v.Version
 15751  	_ = version
 15752  	isFlexible := version >= 3
 15753  	_ = isFlexible
 15754  	s := v
 15755  	if version >= 1 {
 15756  		v := b.Int32()
 15757  		s.ThrottleMillis = v
 15758  	}
 15759  	{
 15760  		v := b.Int16()
 15761  		s.ErrorCode = v
 15762  	}
 15763  	{
 15764  		v := s.Groups
 15765  		a := v
 15766  		var l int32
 15767  		if isFlexible {
 15768  			l = b.CompactArrayLen()
 15769  		} else {
 15770  			l = b.ArrayLen()
 15771  		}
 15772  		if !b.Ok() {
 15773  			return b.Complete()
 15774  		}
 15775  		a = a[:0]
 15776  		if l > 0 {
 15777  			a = append(a, make([]ListGroupsResponseGroup, l)...)
 15778  		}
 15779  		for i := int32(0); i < l; i++ {
 15780  			v := &a[i]
 15781  			v.Default()
 15782  			s := v
 15783  			{
 15784  				var v string
 15785  				if unsafe {
 15786  					if isFlexible {
 15787  						v = b.UnsafeCompactString()
 15788  					} else {
 15789  						v = b.UnsafeString()
 15790  					}
 15791  				} else {
 15792  					if isFlexible {
 15793  						v = b.CompactString()
 15794  					} else {
 15795  						v = b.String()
 15796  					}
 15797  				}
 15798  				s.Group = v
 15799  			}
 15800  			{
 15801  				var v string
 15802  				if unsafe {
 15803  					if isFlexible {
 15804  						v = b.UnsafeCompactString()
 15805  					} else {
 15806  						v = b.UnsafeString()
 15807  					}
 15808  				} else {
 15809  					if isFlexible {
 15810  						v = b.CompactString()
 15811  					} else {
 15812  						v = b.String()
 15813  					}
 15814  				}
 15815  				s.ProtocolType = v
 15816  			}
 15817  			if version >= 4 {
 15818  				var v string
 15819  				if unsafe {
 15820  					if isFlexible {
 15821  						v = b.UnsafeCompactString()
 15822  					} else {
 15823  						v = b.UnsafeString()
 15824  					}
 15825  				} else {
 15826  					if isFlexible {
 15827  						v = b.CompactString()
 15828  					} else {
 15829  						v = b.String()
 15830  					}
 15831  				}
 15832  				s.GroupState = v
 15833  			}
 15834  			if isFlexible {
 15835  				s.UnknownTags = internalReadTags(&b)
 15836  			}
 15837  		}
 15838  		v = a
 15839  		s.Groups = v
 15840  	}
 15841  	if isFlexible {
 15842  		s.UnknownTags = internalReadTags(&b)
 15843  	}
 15844  	return b.Complete()
 15845  }
 15846  
 15847  // NewPtrListGroupsResponse returns a pointer to a default ListGroupsResponse
 15848  // This is a shortcut for creating a new(struct) and calling Default yourself.
 15849  func NewPtrListGroupsResponse() *ListGroupsResponse {
 15850  	var v ListGroupsResponse
 15851  	v.Default()
 15852  	return &v
 15853  }
 15854  
 15855  // Default sets any default fields. Calling this allows for future compatibility
 15856  // if new fields are added to ListGroupsResponse.
 15857  func (v *ListGroupsResponse) Default() {
 15858  }
 15859  
 15860  // NewListGroupsResponse returns a default ListGroupsResponse
 15861  // This is a shortcut for creating a struct and calling Default yourself.
 15862  func NewListGroupsResponse() ListGroupsResponse {
 15863  	var v ListGroupsResponse
 15864  	v.Default()
 15865  	return v
 15866  }
 15867  
 15868  // SASLHandshakeRequest begins the sasl authentication flow. Note that Kerberos
 15869  // GSSAPI authentication has its own unique flow.
 15870  type SASLHandshakeRequest struct {
 15871  	// Version is the version of this message used with a Kafka broker.
 15872  	Version int16
 15873  
 15874  	// Mechanism is the mechanism to use for the sasl handshake (e.g., "PLAIN").
 15875  	//
 15876  	// For version 0, if this mechanism is supported, it is expected that the
 15877  	// client immediately authenticates using this mechanism. Note that the
 15878  	// only mechanism exclusive to v0 is PLAIN.
 15879  	//
 15880  	// For version 1, if the mechanism is supported, the next request to issue
 15881  	// is SASLHandshakeRequest.
 15882  	Mechanism string
 15883  }
 15884  
 15885  func (*SASLHandshakeRequest) Key() int16                 { return 17 }
 15886  func (*SASLHandshakeRequest) MaxVersion() int16          { return 1 }
 15887  func (v *SASLHandshakeRequest) SetVersion(version int16) { v.Version = version }
 15888  func (v *SASLHandshakeRequest) GetVersion() int16        { return v.Version }
 15889  func (v *SASLHandshakeRequest) IsFlexible() bool         { return false }
 15890  func (v *SASLHandshakeRequest) ResponseKind() Response {
 15891  	r := &SASLHandshakeResponse{Version: v.Version}
 15892  	r.Default()
 15893  	return r
 15894  }
 15895  
 15896  // RequestWith is requests v on r and returns the response or an error.
 15897  // For sharded requests, the response may be merged and still return an error.
 15898  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 15899  func (v *SASLHandshakeRequest) RequestWith(ctx context.Context, r Requestor) (*SASLHandshakeResponse, error) {
 15900  	kresp, err := r.Request(ctx, v)
 15901  	resp, _ := kresp.(*SASLHandshakeResponse)
 15902  	return resp, err
 15903  }
 15904  
 15905  func (v *SASLHandshakeRequest) AppendTo(dst []byte) []byte {
 15906  	version := v.Version
 15907  	_ = version
 15908  	{
 15909  		v := v.Mechanism
 15910  		dst = kbin.AppendString(dst, v)
 15911  	}
 15912  	return dst
 15913  }
 15914  
 15915  func (v *SASLHandshakeRequest) ReadFrom(src []byte) error {
 15916  	return v.readFrom(src, false)
 15917  }
 15918  
 15919  func (v *SASLHandshakeRequest) UnsafeReadFrom(src []byte) error {
 15920  	return v.readFrom(src, true)
 15921  }
 15922  
 15923  func (v *SASLHandshakeRequest) readFrom(src []byte, unsafe bool) error {
 15924  	v.Default()
 15925  	b := kbin.Reader{Src: src}
 15926  	version := v.Version
 15927  	_ = version
 15928  	s := v
 15929  	{
 15930  		var v string
 15931  		if unsafe {
 15932  			v = b.UnsafeString()
 15933  		} else {
 15934  			v = b.String()
 15935  		}
 15936  		s.Mechanism = v
 15937  	}
 15938  	return b.Complete()
 15939  }
 15940  
 15941  // NewPtrSASLHandshakeRequest returns a pointer to a default SASLHandshakeRequest
 15942  // This is a shortcut for creating a new(struct) and calling Default yourself.
 15943  func NewPtrSASLHandshakeRequest() *SASLHandshakeRequest {
 15944  	var v SASLHandshakeRequest
 15945  	v.Default()
 15946  	return &v
 15947  }
 15948  
 15949  // Default sets any default fields. Calling this allows for future compatibility
 15950  // if new fields are added to SASLHandshakeRequest.
 15951  func (v *SASLHandshakeRequest) Default() {
 15952  }
 15953  
 15954  // NewSASLHandshakeRequest returns a default SASLHandshakeRequest
 15955  // This is a shortcut for creating a struct and calling Default yourself.
 15956  func NewSASLHandshakeRequest() SASLHandshakeRequest {
 15957  	var v SASLHandshakeRequest
 15958  	v.Default()
 15959  	return v
 15960  }
 15961  
 15962  // SASLHandshakeResponse is returned for a SASLHandshakeRequest.
 15963  type SASLHandshakeResponse struct {
 15964  	// Version is the version of this message used with a Kafka broker.
 15965  	Version int16
 15966  
 15967  	// ErrorCode is non-zero for ILLEGAL_SASL_STATE, meaning a sasl handshake
 15968  	// is not expected at this point in the connection, or UNSUPPORTED_SASL_MECHANISM,
 15969  	// meaning the requested mechanism is not supported.
 15970  	ErrorCode int16
 15971  
 15972  	// SupportedMechanisms is the list of mechanisms supported if this request
 15973  	// errored.
 15974  	SupportedMechanisms []string
 15975  }
 15976  
 15977  func (*SASLHandshakeResponse) Key() int16                 { return 17 }
 15978  func (*SASLHandshakeResponse) MaxVersion() int16          { return 1 }
 15979  func (v *SASLHandshakeResponse) SetVersion(version int16) { v.Version = version }
 15980  func (v *SASLHandshakeResponse) GetVersion() int16        { return v.Version }
 15981  func (v *SASLHandshakeResponse) IsFlexible() bool         { return false }
 15982  func (v *SASLHandshakeResponse) RequestKind() Request {
 15983  	return &SASLHandshakeRequest{Version: v.Version}
 15984  }
 15985  
 15986  func (v *SASLHandshakeResponse) AppendTo(dst []byte) []byte {
 15987  	version := v.Version
 15988  	_ = version
 15989  	{
 15990  		v := v.ErrorCode
 15991  		dst = kbin.AppendInt16(dst, v)
 15992  	}
 15993  	{
 15994  		v := v.SupportedMechanisms
 15995  		dst = kbin.AppendArrayLen(dst, len(v))
 15996  		for i := range v {
 15997  			v := v[i]
 15998  			dst = kbin.AppendString(dst, v)
 15999  		}
 16000  	}
 16001  	return dst
 16002  }
 16003  
 16004  func (v *SASLHandshakeResponse) ReadFrom(src []byte) error {
 16005  	return v.readFrom(src, false)
 16006  }
 16007  
 16008  func (v *SASLHandshakeResponse) UnsafeReadFrom(src []byte) error {
 16009  	return v.readFrom(src, true)
 16010  }
 16011  
 16012  func (v *SASLHandshakeResponse) readFrom(src []byte, unsafe bool) error {
 16013  	v.Default()
 16014  	b := kbin.Reader{Src: src}
 16015  	version := v.Version
 16016  	_ = version
 16017  	s := v
 16018  	{
 16019  		v := b.Int16()
 16020  		s.ErrorCode = v
 16021  	}
 16022  	{
 16023  		v := s.SupportedMechanisms
 16024  		a := v
 16025  		var l int32
 16026  		l = b.ArrayLen()
 16027  		if !b.Ok() {
 16028  			return b.Complete()
 16029  		}
 16030  		a = a[:0]
 16031  		if l > 0 {
 16032  			a = append(a, make([]string, l)...)
 16033  		}
 16034  		for i := int32(0); i < l; i++ {
 16035  			var v string
 16036  			if unsafe {
 16037  				v = b.UnsafeString()
 16038  			} else {
 16039  				v = b.String()
 16040  			}
 16041  			a[i] = v
 16042  		}
 16043  		v = a
 16044  		s.SupportedMechanisms = v
 16045  	}
 16046  	return b.Complete()
 16047  }
 16048  
 16049  // NewPtrSASLHandshakeResponse returns a pointer to a default SASLHandshakeResponse
 16050  // This is a shortcut for creating a new(struct) and calling Default yourself.
 16051  func NewPtrSASLHandshakeResponse() *SASLHandshakeResponse {
 16052  	var v SASLHandshakeResponse
 16053  	v.Default()
 16054  	return &v
 16055  }
 16056  
 16057  // Default sets any default fields. Calling this allows for future compatibility
 16058  // if new fields are added to SASLHandshakeResponse.
 16059  func (v *SASLHandshakeResponse) Default() {
 16060  }
 16061  
 16062  // NewSASLHandshakeResponse returns a default SASLHandshakeResponse
 16063  // This is a shortcut for creating a struct and calling Default yourself.
 16064  func NewSASLHandshakeResponse() SASLHandshakeResponse {
 16065  	var v SASLHandshakeResponse
 16066  	v.Default()
 16067  	return v
 16068  }
 16069  
 16070  // ApiVersionsRequest requests what API versions a Kafka broker supports.
 16071  //
 16072  // Note that the client does not know the version a broker supports before
 16073  // sending this request.
 16074  //
 16075  // Before Kafka 2.4.0, if the client used a version larger than the broker
 16076  // understands, the broker would reply with an UNSUPPORTED_VERSION error using
 16077  // the version 0 message format (i.e., 6 bytes long!). The client should retry
 16078  // with a lower version.
 16079  //
 16080  // After Kafka 2.4.0, if the client uses a version larger than the broker
 16081  // understands, the broker replies with UNSUPPORTED_VERSIONS using the version
 16082  // 0 message format but additionally includes the api versions the broker does
 16083  // support.
 16084  type ApiVersionsRequest struct {
 16085  	// Version is the version of this message used with a Kafka broker.
 16086  	Version int16
 16087  
 16088  	// ClientSoftwareName, added for KIP-511 with Kafka 2.4.0, is the name of the
 16089  	// client issuing this request. The broker can use this to enrich its own
 16090  	// debugging information of which version of what clients are connected.
 16091  	//
 16092  	// If using v3, this field is required and must match the following pattern:
 16093  	//
 16094  	//	[a-zA-Z0-9](?:[a-zA-Z0-9\\-.]*[a-zA-Z0-9])?
 16095  	ClientSoftwareName string // v3+
 16096  
 16097  	// ClientSoftwareVersion is the version of the software name in the prior
 16098  	// field. It must match the same regex (thus, this is also required).
 16099  	ClientSoftwareVersion string // v3+
 16100  
 16101  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16102  	UnknownTags Tags // v3+
 16103  }
 16104  
 16105  func (*ApiVersionsRequest) Key() int16                 { return 18 }
 16106  func (*ApiVersionsRequest) MaxVersion() int16          { return 3 }
 16107  func (v *ApiVersionsRequest) SetVersion(version int16) { v.Version = version }
 16108  func (v *ApiVersionsRequest) GetVersion() int16        { return v.Version }
 16109  func (v *ApiVersionsRequest) IsFlexible() bool         { return v.Version >= 3 }
 16110  func (v *ApiVersionsRequest) ResponseKind() Response {
 16111  	r := &ApiVersionsResponse{Version: v.Version}
 16112  	r.Default()
 16113  	return r
 16114  }
 16115  
 16116  // RequestWith is requests v on r and returns the response or an error.
 16117  // For sharded requests, the response may be merged and still return an error.
 16118  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 16119  func (v *ApiVersionsRequest) RequestWith(ctx context.Context, r Requestor) (*ApiVersionsResponse, error) {
 16120  	kresp, err := r.Request(ctx, v)
 16121  	resp, _ := kresp.(*ApiVersionsResponse)
 16122  	return resp, err
 16123  }
 16124  
 16125  func (v *ApiVersionsRequest) AppendTo(dst []byte) []byte {
 16126  	version := v.Version
 16127  	_ = version
 16128  	isFlexible := version >= 3
 16129  	_ = isFlexible
 16130  	if version >= 3 {
 16131  		v := v.ClientSoftwareName
 16132  		if isFlexible {
 16133  			dst = kbin.AppendCompactString(dst, v)
 16134  		} else {
 16135  			dst = kbin.AppendString(dst, v)
 16136  		}
 16137  	}
 16138  	if version >= 3 {
 16139  		v := v.ClientSoftwareVersion
 16140  		if isFlexible {
 16141  			dst = kbin.AppendCompactString(dst, v)
 16142  		} else {
 16143  			dst = kbin.AppendString(dst, v)
 16144  		}
 16145  	}
 16146  	if isFlexible {
 16147  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16148  		dst = v.UnknownTags.AppendEach(dst)
 16149  	}
 16150  	return dst
 16151  }
 16152  
 16153  func (v *ApiVersionsRequest) ReadFrom(src []byte) error {
 16154  	return v.readFrom(src, false)
 16155  }
 16156  
 16157  func (v *ApiVersionsRequest) UnsafeReadFrom(src []byte) error {
 16158  	return v.readFrom(src, true)
 16159  }
 16160  
 16161  func (v *ApiVersionsRequest) readFrom(src []byte, unsafe bool) error {
 16162  	v.Default()
 16163  	b := kbin.Reader{Src: src}
 16164  	version := v.Version
 16165  	_ = version
 16166  	isFlexible := version >= 3
 16167  	_ = isFlexible
 16168  	s := v
 16169  	if version >= 3 {
 16170  		var v string
 16171  		if unsafe {
 16172  			if isFlexible {
 16173  				v = b.UnsafeCompactString()
 16174  			} else {
 16175  				v = b.UnsafeString()
 16176  			}
 16177  		} else {
 16178  			if isFlexible {
 16179  				v = b.CompactString()
 16180  			} else {
 16181  				v = b.String()
 16182  			}
 16183  		}
 16184  		s.ClientSoftwareName = v
 16185  	}
 16186  	if version >= 3 {
 16187  		var v string
 16188  		if unsafe {
 16189  			if isFlexible {
 16190  				v = b.UnsafeCompactString()
 16191  			} else {
 16192  				v = b.UnsafeString()
 16193  			}
 16194  		} else {
 16195  			if isFlexible {
 16196  				v = b.CompactString()
 16197  			} else {
 16198  				v = b.String()
 16199  			}
 16200  		}
 16201  		s.ClientSoftwareVersion = v
 16202  	}
 16203  	if isFlexible {
 16204  		s.UnknownTags = internalReadTags(&b)
 16205  	}
 16206  	return b.Complete()
 16207  }
 16208  
 16209  // NewPtrApiVersionsRequest returns a pointer to a default ApiVersionsRequest
 16210  // This is a shortcut for creating a new(struct) and calling Default yourself.
 16211  func NewPtrApiVersionsRequest() *ApiVersionsRequest {
 16212  	var v ApiVersionsRequest
 16213  	v.Default()
 16214  	return &v
 16215  }
 16216  
 16217  // Default sets any default fields. Calling this allows for future compatibility
 16218  // if new fields are added to ApiVersionsRequest.
 16219  func (v *ApiVersionsRequest) Default() {
 16220  }
 16221  
 16222  // NewApiVersionsRequest returns a default ApiVersionsRequest
 16223  // This is a shortcut for creating a struct and calling Default yourself.
 16224  func NewApiVersionsRequest() ApiVersionsRequest {
 16225  	var v ApiVersionsRequest
 16226  	v.Default()
 16227  	return v
 16228  }
 16229  
 16230  type ApiVersionsResponseApiKey struct {
 16231  	// ApiKey is the key of a message request.
 16232  	ApiKey int16
 16233  
 16234  	// MinVersion is the min version a broker supports for an API key.
 16235  	MinVersion int16
 16236  
 16237  	// MaxVersion is the max version a broker supports for an API key.
 16238  	MaxVersion int16
 16239  
 16240  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16241  	UnknownTags Tags // v3+
 16242  }
 16243  
 16244  // Default sets any default fields. Calling this allows for future compatibility
 16245  // if new fields are added to ApiVersionsResponseApiKey.
 16246  func (v *ApiVersionsResponseApiKey) Default() {
 16247  }
 16248  
 16249  // NewApiVersionsResponseApiKey returns a default ApiVersionsResponseApiKey
 16250  // This is a shortcut for creating a struct and calling Default yourself.
 16251  func NewApiVersionsResponseApiKey() ApiVersionsResponseApiKey {
 16252  	var v ApiVersionsResponseApiKey
 16253  	v.Default()
 16254  	return v
 16255  }
 16256  
 16257  type ApiVersionsResponseSupportedFeature struct {
 16258  	// The name of the feature.
 16259  	Name string
 16260  
 16261  	// The minimum supported version for the feature.
 16262  	MinVersion int16
 16263  
 16264  	// The maximum supported version for the feature.
 16265  	MaxVersion int16
 16266  
 16267  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16268  	UnknownTags Tags // v3+
 16269  }
 16270  
 16271  // Default sets any default fields. Calling this allows for future compatibility
 16272  // if new fields are added to ApiVersionsResponseSupportedFeature.
 16273  func (v *ApiVersionsResponseSupportedFeature) Default() {
 16274  }
 16275  
 16276  // NewApiVersionsResponseSupportedFeature returns a default ApiVersionsResponseSupportedFeature
 16277  // This is a shortcut for creating a struct and calling Default yourself.
 16278  func NewApiVersionsResponseSupportedFeature() ApiVersionsResponseSupportedFeature {
 16279  	var v ApiVersionsResponseSupportedFeature
 16280  	v.Default()
 16281  	return v
 16282  }
 16283  
 16284  type ApiVersionsResponseFinalizedFeature struct {
 16285  	// The name of the feature.
 16286  	Name string
 16287  
 16288  	// The cluster-wide finalized max version level for the feature.
 16289  	MaxVersionLevel int16
 16290  
 16291  	// The cluster-wide finalized min version level for the feature.
 16292  	MinVersionLevel int16
 16293  
 16294  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16295  	UnknownTags Tags // v3+
 16296  }
 16297  
 16298  // Default sets any default fields. Calling this allows for future compatibility
 16299  // if new fields are added to ApiVersionsResponseFinalizedFeature.
 16300  func (v *ApiVersionsResponseFinalizedFeature) Default() {
 16301  }
 16302  
 16303  // NewApiVersionsResponseFinalizedFeature returns a default ApiVersionsResponseFinalizedFeature
 16304  // This is a shortcut for creating a struct and calling Default yourself.
 16305  func NewApiVersionsResponseFinalizedFeature() ApiVersionsResponseFinalizedFeature {
 16306  	var v ApiVersionsResponseFinalizedFeature
 16307  	v.Default()
 16308  	return v
 16309  }
 16310  
 16311  // ApiVersionsResponse is returned from an ApiVersionsRequest.
 16312  type ApiVersionsResponse struct {
 16313  	// Version is the version of this message used with a Kafka broker.
 16314  	Version int16
 16315  
 16316  	// ErrorCode is UNSUPPORTED_VERSION if the request was issued with a higher
 16317  	// version than the broker supports. Before Kafka 2.4.0, if this error is
 16318  	// returned, the rest of this struct will be empty.
 16319  	//
 16320  	// Starting in Kafka 2.4.0 (with version 3), even with an UNSUPPORTED_VERSION
 16321  	// error, the broker still replies with the ApiKeys it supports.
 16322  	ErrorCode int16
 16323  
 16324  	// ApiKeys is an array corresponding to API keys the broker supports
 16325  	// and the range of supported versions for each key.
 16326  	ApiKeys []ApiVersionsResponseApiKey
 16327  
 16328  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 16329  	// after this request.
 16330  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 16331  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 16332  	//
 16333  	// This request switched at version 2.
 16334  	ThrottleMillis int32 // v1+
 16335  
 16336  	// Features supported by the broker (see KIP-584).
 16337  	SupportedFeatures []ApiVersionsResponseSupportedFeature // tag 0
 16338  
 16339  	// The monotonically increasing epoch for the finalized features information,
 16340  	// where -1 indicates an unknown epoch.
 16341  	//
 16342  	// This field has a default of -1.
 16343  	FinalizedFeaturesEpoch int64 // tag 1
 16344  
 16345  	// The list of cluster-wide finalized features (only valid if
 16346  	// FinalizedFeaturesEpoch is >= 0).
 16347  	FinalizedFeatures []ApiVersionsResponseFinalizedFeature // tag 2
 16348  
 16349  	// Set by a KRaft controller if the required configurations for ZK migration
 16350  	// are present
 16351  	ZkMigrationReady bool // tag 3
 16352  
 16353  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16354  	UnknownTags Tags // v3+
 16355  }
 16356  
 16357  func (*ApiVersionsResponse) Key() int16                         { return 18 }
 16358  func (*ApiVersionsResponse) MaxVersion() int16                  { return 3 }
 16359  func (v *ApiVersionsResponse) SetVersion(version int16)         { v.Version = version }
 16360  func (v *ApiVersionsResponse) GetVersion() int16                { return v.Version }
 16361  func (v *ApiVersionsResponse) IsFlexible() bool                 { return v.Version >= 3 }
 16362  func (v *ApiVersionsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 16363  func (v *ApiVersionsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 16364  func (v *ApiVersionsResponse) RequestKind() Request             { return &ApiVersionsRequest{Version: v.Version} }
 16365  
 16366  func (v *ApiVersionsResponse) AppendTo(dst []byte) []byte {
 16367  	version := v.Version
 16368  	_ = version
 16369  	isFlexible := version >= 3
 16370  	_ = isFlexible
 16371  	{
 16372  		v := v.ErrorCode
 16373  		dst = kbin.AppendInt16(dst, v)
 16374  	}
 16375  	{
 16376  		v := v.ApiKeys
 16377  		if isFlexible {
 16378  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 16379  		} else {
 16380  			dst = kbin.AppendArrayLen(dst, len(v))
 16381  		}
 16382  		for i := range v {
 16383  			v := &v[i]
 16384  			{
 16385  				v := v.ApiKey
 16386  				dst = kbin.AppendInt16(dst, v)
 16387  			}
 16388  			{
 16389  				v := v.MinVersion
 16390  				dst = kbin.AppendInt16(dst, v)
 16391  			}
 16392  			{
 16393  				v := v.MaxVersion
 16394  				dst = kbin.AppendInt16(dst, v)
 16395  			}
 16396  			if isFlexible {
 16397  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16398  				dst = v.UnknownTags.AppendEach(dst)
 16399  			}
 16400  		}
 16401  	}
 16402  	if version >= 1 {
 16403  		v := v.ThrottleMillis
 16404  		dst = kbin.AppendInt32(dst, v)
 16405  	}
 16406  	if isFlexible {
 16407  		var toEncode []uint32
 16408  		if len(v.SupportedFeatures) > 0 {
 16409  			toEncode = append(toEncode, 0)
 16410  		}
 16411  		if v.FinalizedFeaturesEpoch != -1 {
 16412  			toEncode = append(toEncode, 1)
 16413  		}
 16414  		if len(v.FinalizedFeatures) > 0 {
 16415  			toEncode = append(toEncode, 2)
 16416  		}
 16417  		if v.ZkMigrationReady != false {
 16418  			toEncode = append(toEncode, 3)
 16419  		}
 16420  		dst = kbin.AppendUvarint(dst, uint32(len(toEncode)+v.UnknownTags.Len()))
 16421  		for _, tag := range toEncode {
 16422  			switch tag {
 16423  			case 0:
 16424  				{
 16425  					v := v.SupportedFeatures
 16426  					dst = kbin.AppendUvarint(dst, 0)
 16427  					sized := false
 16428  					lenAt := len(dst)
 16429  				fSupportedFeatures:
 16430  					if isFlexible {
 16431  						dst = kbin.AppendCompactArrayLen(dst, len(v))
 16432  					} else {
 16433  						dst = kbin.AppendArrayLen(dst, len(v))
 16434  					}
 16435  					for i := range v {
 16436  						v := &v[i]
 16437  						{
 16438  							v := v.Name
 16439  							if isFlexible {
 16440  								dst = kbin.AppendCompactString(dst, v)
 16441  							} else {
 16442  								dst = kbin.AppendString(dst, v)
 16443  							}
 16444  						}
 16445  						{
 16446  							v := v.MinVersion
 16447  							dst = kbin.AppendInt16(dst, v)
 16448  						}
 16449  						{
 16450  							v := v.MaxVersion
 16451  							dst = kbin.AppendInt16(dst, v)
 16452  						}
 16453  						if isFlexible {
 16454  							dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16455  							dst = v.UnknownTags.AppendEach(dst)
 16456  						}
 16457  					}
 16458  					if !sized {
 16459  						dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
 16460  						sized = true
 16461  						goto fSupportedFeatures
 16462  					}
 16463  				}
 16464  			case 1:
 16465  				{
 16466  					v := v.FinalizedFeaturesEpoch
 16467  					dst = kbin.AppendUvarint(dst, 1)
 16468  					dst = kbin.AppendUvarint(dst, 8)
 16469  					dst = kbin.AppendInt64(dst, v)
 16470  				}
 16471  			case 2:
 16472  				{
 16473  					v := v.FinalizedFeatures
 16474  					dst = kbin.AppendUvarint(dst, 2)
 16475  					sized := false
 16476  					lenAt := len(dst)
 16477  				fFinalizedFeatures:
 16478  					if isFlexible {
 16479  						dst = kbin.AppendCompactArrayLen(dst, len(v))
 16480  					} else {
 16481  						dst = kbin.AppendArrayLen(dst, len(v))
 16482  					}
 16483  					for i := range v {
 16484  						v := &v[i]
 16485  						{
 16486  							v := v.Name
 16487  							if isFlexible {
 16488  								dst = kbin.AppendCompactString(dst, v)
 16489  							} else {
 16490  								dst = kbin.AppendString(dst, v)
 16491  							}
 16492  						}
 16493  						{
 16494  							v := v.MaxVersionLevel
 16495  							dst = kbin.AppendInt16(dst, v)
 16496  						}
 16497  						{
 16498  							v := v.MinVersionLevel
 16499  							dst = kbin.AppendInt16(dst, v)
 16500  						}
 16501  						if isFlexible {
 16502  							dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16503  							dst = v.UnknownTags.AppendEach(dst)
 16504  						}
 16505  					}
 16506  					if !sized {
 16507  						dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
 16508  						sized = true
 16509  						goto fFinalizedFeatures
 16510  					}
 16511  				}
 16512  			case 3:
 16513  				{
 16514  					v := v.ZkMigrationReady
 16515  					dst = kbin.AppendUvarint(dst, 3)
 16516  					dst = kbin.AppendUvarint(dst, 1)
 16517  					dst = kbin.AppendBool(dst, v)
 16518  				}
 16519  			}
 16520  		}
 16521  		dst = v.UnknownTags.AppendEach(dst)
 16522  	}
 16523  	return dst
 16524  }
 16525  
 16526  func (v *ApiVersionsResponse) ReadFrom(src []byte) error {
 16527  	return v.readFrom(src, false)
 16528  }
 16529  
 16530  func (v *ApiVersionsResponse) UnsafeReadFrom(src []byte) error {
 16531  	return v.readFrom(src, true)
 16532  }
 16533  
 16534  func (v *ApiVersionsResponse) readFrom(src []byte, unsafe bool) error {
 16535  	v.Default()
 16536  	b := kbin.Reader{Src: src}
 16537  	version := v.Version
 16538  	_ = version
 16539  	isFlexible := version >= 3
 16540  	_ = isFlexible
 16541  	s := v
 16542  	{
 16543  		v := b.Int16()
 16544  		s.ErrorCode = v
 16545  	}
 16546  	{
 16547  		v := s.ApiKeys
 16548  		a := v
 16549  		var l int32
 16550  		if isFlexible {
 16551  			l = b.CompactArrayLen()
 16552  		} else {
 16553  			l = b.ArrayLen()
 16554  		}
 16555  		if !b.Ok() {
 16556  			return b.Complete()
 16557  		}
 16558  		a = a[:0]
 16559  		if l > 0 {
 16560  			a = append(a, make([]ApiVersionsResponseApiKey, l)...)
 16561  		}
 16562  		for i := int32(0); i < l; i++ {
 16563  			v := &a[i]
 16564  			v.Default()
 16565  			s := v
 16566  			{
 16567  				v := b.Int16()
 16568  				s.ApiKey = v
 16569  			}
 16570  			{
 16571  				v := b.Int16()
 16572  				s.MinVersion = v
 16573  			}
 16574  			{
 16575  				v := b.Int16()
 16576  				s.MaxVersion = v
 16577  			}
 16578  			if isFlexible {
 16579  				s.UnknownTags = internalReadTags(&b)
 16580  			}
 16581  		}
 16582  		v = a
 16583  		s.ApiKeys = v
 16584  	}
 16585  	if version >= 1 {
 16586  		v := b.Int32()
 16587  		s.ThrottleMillis = v
 16588  	}
 16589  	if isFlexible {
 16590  		for i := b.Uvarint(); i > 0; i-- {
 16591  			switch key := b.Uvarint(); key {
 16592  			default:
 16593  				s.UnknownTags.Set(key, b.Span(int(b.Uvarint())))
 16594  			case 0:
 16595  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 16596  				v := s.SupportedFeatures
 16597  				a := v
 16598  				var l int32
 16599  				if isFlexible {
 16600  					l = b.CompactArrayLen()
 16601  				} else {
 16602  					l = b.ArrayLen()
 16603  				}
 16604  				if !b.Ok() {
 16605  					return b.Complete()
 16606  				}
 16607  				a = a[:0]
 16608  				if l > 0 {
 16609  					a = append(a, make([]ApiVersionsResponseSupportedFeature, l)...)
 16610  				}
 16611  				for i := int32(0); i < l; i++ {
 16612  					v := &a[i]
 16613  					v.Default()
 16614  					s := v
 16615  					{
 16616  						var v string
 16617  						if unsafe {
 16618  							if isFlexible {
 16619  								v = b.UnsafeCompactString()
 16620  							} else {
 16621  								v = b.UnsafeString()
 16622  							}
 16623  						} else {
 16624  							if isFlexible {
 16625  								v = b.CompactString()
 16626  							} else {
 16627  								v = b.String()
 16628  							}
 16629  						}
 16630  						s.Name = v
 16631  					}
 16632  					{
 16633  						v := b.Int16()
 16634  						s.MinVersion = v
 16635  					}
 16636  					{
 16637  						v := b.Int16()
 16638  						s.MaxVersion = v
 16639  					}
 16640  					if isFlexible {
 16641  						s.UnknownTags = internalReadTags(&b)
 16642  					}
 16643  				}
 16644  				v = a
 16645  				s.SupportedFeatures = v
 16646  				if err := b.Complete(); err != nil {
 16647  					return err
 16648  				}
 16649  			case 1:
 16650  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 16651  				v := b.Int64()
 16652  				s.FinalizedFeaturesEpoch = v
 16653  				if err := b.Complete(); err != nil {
 16654  					return err
 16655  				}
 16656  			case 2:
 16657  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 16658  				v := s.FinalizedFeatures
 16659  				a := v
 16660  				var l int32
 16661  				if isFlexible {
 16662  					l = b.CompactArrayLen()
 16663  				} else {
 16664  					l = b.ArrayLen()
 16665  				}
 16666  				if !b.Ok() {
 16667  					return b.Complete()
 16668  				}
 16669  				a = a[:0]
 16670  				if l > 0 {
 16671  					a = append(a, make([]ApiVersionsResponseFinalizedFeature, l)...)
 16672  				}
 16673  				for i := int32(0); i < l; i++ {
 16674  					v := &a[i]
 16675  					v.Default()
 16676  					s := v
 16677  					{
 16678  						var v string
 16679  						if unsafe {
 16680  							if isFlexible {
 16681  								v = b.UnsafeCompactString()
 16682  							} else {
 16683  								v = b.UnsafeString()
 16684  							}
 16685  						} else {
 16686  							if isFlexible {
 16687  								v = b.CompactString()
 16688  							} else {
 16689  								v = b.String()
 16690  							}
 16691  						}
 16692  						s.Name = v
 16693  					}
 16694  					{
 16695  						v := b.Int16()
 16696  						s.MaxVersionLevel = v
 16697  					}
 16698  					{
 16699  						v := b.Int16()
 16700  						s.MinVersionLevel = v
 16701  					}
 16702  					if isFlexible {
 16703  						s.UnknownTags = internalReadTags(&b)
 16704  					}
 16705  				}
 16706  				v = a
 16707  				s.FinalizedFeatures = v
 16708  				if err := b.Complete(); err != nil {
 16709  					return err
 16710  				}
 16711  			case 3:
 16712  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 16713  				v := b.Bool()
 16714  				s.ZkMigrationReady = v
 16715  				if err := b.Complete(); err != nil {
 16716  					return err
 16717  				}
 16718  			}
 16719  		}
 16720  	}
 16721  	return b.Complete()
 16722  }
 16723  
 16724  // NewPtrApiVersionsResponse returns a pointer to a default ApiVersionsResponse
 16725  // This is a shortcut for creating a new(struct) and calling Default yourself.
 16726  func NewPtrApiVersionsResponse() *ApiVersionsResponse {
 16727  	var v ApiVersionsResponse
 16728  	v.Default()
 16729  	return &v
 16730  }
 16731  
 16732  // Default sets any default fields. Calling this allows for future compatibility
 16733  // if new fields are added to ApiVersionsResponse.
 16734  func (v *ApiVersionsResponse) Default() {
 16735  	v.FinalizedFeaturesEpoch = -1
 16736  }
 16737  
 16738  // NewApiVersionsResponse returns a default ApiVersionsResponse
 16739  // This is a shortcut for creating a struct and calling Default yourself.
 16740  func NewApiVersionsResponse() ApiVersionsResponse {
 16741  	var v ApiVersionsResponse
 16742  	v.Default()
 16743  	return v
 16744  }
 16745  
 16746  type CreateTopicsRequestTopicReplicaAssignment struct {
 16747  	// Partition is a partition to create.
 16748  	Partition int32
 16749  
 16750  	// Replicas are broker IDs the partition must exist on.
 16751  	Replicas []int32
 16752  
 16753  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16754  	UnknownTags Tags // v5+
 16755  }
 16756  
 16757  // Default sets any default fields. Calling this allows for future compatibility
 16758  // if new fields are added to CreateTopicsRequestTopicReplicaAssignment.
 16759  func (v *CreateTopicsRequestTopicReplicaAssignment) Default() {
 16760  }
 16761  
 16762  // NewCreateTopicsRequestTopicReplicaAssignment returns a default CreateTopicsRequestTopicReplicaAssignment
 16763  // This is a shortcut for creating a struct and calling Default yourself.
 16764  func NewCreateTopicsRequestTopicReplicaAssignment() CreateTopicsRequestTopicReplicaAssignment {
 16765  	var v CreateTopicsRequestTopicReplicaAssignment
 16766  	v.Default()
 16767  	return v
 16768  }
 16769  
 16770  type CreateTopicsRequestTopicConfig struct {
 16771  	// Name is a topic level config key (e.g. segment.bytes).
 16772  	Name string
 16773  
 16774  	// Value is a topic level config value (e.g. 1073741824)
 16775  	Value *string
 16776  
 16777  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16778  	UnknownTags Tags // v5+
 16779  }
 16780  
 16781  // Default sets any default fields. Calling this allows for future compatibility
 16782  // if new fields are added to CreateTopicsRequestTopicConfig.
 16783  func (v *CreateTopicsRequestTopicConfig) Default() {
 16784  }
 16785  
 16786  // NewCreateTopicsRequestTopicConfig returns a default CreateTopicsRequestTopicConfig
 16787  // This is a shortcut for creating a struct and calling Default yourself.
 16788  func NewCreateTopicsRequestTopicConfig() CreateTopicsRequestTopicConfig {
 16789  	var v CreateTopicsRequestTopicConfig
 16790  	v.Default()
 16791  	return v
 16792  }
 16793  
 16794  type CreateTopicsRequestTopic struct {
 16795  	// Topic is a topic to create.
 16796  	Topic string
 16797  
 16798  	// NumPartitions is how many partitions to give a topic. This must
 16799  	// be -1 if specifying partitions manually (see ReplicaAssignment)
 16800  	// or, starting v4+, to use the broker default partitions.
 16801  	NumPartitions int32
 16802  
 16803  	// ReplicationFactor is how many replicas every partition must have.
 16804  	// This must be -1 if specifying partitions manually (see ReplicaAssignment)
 16805  	// or, starting v4+, to use the broker default replication factor.
 16806  	ReplicationFactor int16
 16807  
 16808  	// ReplicaAssignment is an array to manually dicate replicas and their
 16809  	// partitions for a topic. If using this, both ReplicationFactor and
 16810  	// NumPartitions must be -1.
 16811  	ReplicaAssignment []CreateTopicsRequestTopicReplicaAssignment
 16812  
 16813  	// Configs is an array of key value config pairs for a topic.
 16814  	// These correspond to Kafka Topic-Level Configs: http://kafka.apache.org/documentation/#topicconfigs.
 16815  	Configs []CreateTopicsRequestTopicConfig
 16816  
 16817  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16818  	UnknownTags Tags // v5+
 16819  }
 16820  
 16821  // Default sets any default fields. Calling this allows for future compatibility
 16822  // if new fields are added to CreateTopicsRequestTopic.
 16823  func (v *CreateTopicsRequestTopic) Default() {
 16824  }
 16825  
 16826  // NewCreateTopicsRequestTopic returns a default CreateTopicsRequestTopic
 16827  // This is a shortcut for creating a struct and calling Default yourself.
 16828  func NewCreateTopicsRequestTopic() CreateTopicsRequestTopic {
 16829  	var v CreateTopicsRequestTopic
 16830  	v.Default()
 16831  	return v
 16832  }
 16833  
 16834  // CreateTopicsRequest creates Kafka topics.
 16835  //
 16836  // Version 4, introduced in Kafka 2.4.0, implies client support for
 16837  // creation defaults. See KIP-464.
 16838  //
 16839  // Version 5, also in 2.4.0, returns topic configs in the response (KIP-525).
 16840  type CreateTopicsRequest struct {
 16841  	// Version is the version of this message used with a Kafka broker.
 16842  	Version int16
 16843  
 16844  	// Topics is an array of topics to attempt to create.
 16845  	Topics []CreateTopicsRequestTopic
 16846  
 16847  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 16848  	// This field has no effect on Kafka's processing of the request; the request
 16849  	// will continue to be processed if the timeout is reached. If the timeout is
 16850  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 16851  	//
 16852  	// This field has a default of 60000.
 16853  	TimeoutMillis int32
 16854  
 16855  	// ValidateOnly is makes this request a dry-run; everything is validated but
 16856  	// no topics are actually created.
 16857  	ValidateOnly bool // v1+
 16858  
 16859  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 16860  	UnknownTags Tags // v5+
 16861  }
 16862  
 16863  func (*CreateTopicsRequest) Key() int16                       { return 19 }
 16864  func (*CreateTopicsRequest) MaxVersion() int16                { return 7 }
 16865  func (v *CreateTopicsRequest) SetVersion(version int16)       { v.Version = version }
 16866  func (v *CreateTopicsRequest) GetVersion() int16              { return v.Version }
 16867  func (v *CreateTopicsRequest) IsFlexible() bool               { return v.Version >= 5 }
 16868  func (v *CreateTopicsRequest) Timeout() int32                 { return v.TimeoutMillis }
 16869  func (v *CreateTopicsRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
 16870  func (v *CreateTopicsRequest) IsAdminRequest()                {}
 16871  func (v *CreateTopicsRequest) ResponseKind() Response {
 16872  	r := &CreateTopicsResponse{Version: v.Version}
 16873  	r.Default()
 16874  	return r
 16875  }
 16876  
 16877  // RequestWith is requests v on r and returns the response or an error.
 16878  // For sharded requests, the response may be merged and still return an error.
 16879  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 16880  func (v *CreateTopicsRequest) RequestWith(ctx context.Context, r Requestor) (*CreateTopicsResponse, error) {
 16881  	kresp, err := r.Request(ctx, v)
 16882  	resp, _ := kresp.(*CreateTopicsResponse)
 16883  	return resp, err
 16884  }
 16885  
 16886  func (v *CreateTopicsRequest) AppendTo(dst []byte) []byte {
 16887  	version := v.Version
 16888  	_ = version
 16889  	isFlexible := version >= 5
 16890  	_ = isFlexible
 16891  	{
 16892  		v := v.Topics
 16893  		if isFlexible {
 16894  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 16895  		} else {
 16896  			dst = kbin.AppendArrayLen(dst, len(v))
 16897  		}
 16898  		for i := range v {
 16899  			v := &v[i]
 16900  			{
 16901  				v := v.Topic
 16902  				if isFlexible {
 16903  					dst = kbin.AppendCompactString(dst, v)
 16904  				} else {
 16905  					dst = kbin.AppendString(dst, v)
 16906  				}
 16907  			}
 16908  			{
 16909  				v := v.NumPartitions
 16910  				dst = kbin.AppendInt32(dst, v)
 16911  			}
 16912  			{
 16913  				v := v.ReplicationFactor
 16914  				dst = kbin.AppendInt16(dst, v)
 16915  			}
 16916  			{
 16917  				v := v.ReplicaAssignment
 16918  				if isFlexible {
 16919  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 16920  				} else {
 16921  					dst = kbin.AppendArrayLen(dst, len(v))
 16922  				}
 16923  				for i := range v {
 16924  					v := &v[i]
 16925  					{
 16926  						v := v.Partition
 16927  						dst = kbin.AppendInt32(dst, v)
 16928  					}
 16929  					{
 16930  						v := v.Replicas
 16931  						if isFlexible {
 16932  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 16933  						} else {
 16934  							dst = kbin.AppendArrayLen(dst, len(v))
 16935  						}
 16936  						for i := range v {
 16937  							v := v[i]
 16938  							dst = kbin.AppendInt32(dst, v)
 16939  						}
 16940  					}
 16941  					if isFlexible {
 16942  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16943  						dst = v.UnknownTags.AppendEach(dst)
 16944  					}
 16945  				}
 16946  			}
 16947  			{
 16948  				v := v.Configs
 16949  				if isFlexible {
 16950  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 16951  				} else {
 16952  					dst = kbin.AppendArrayLen(dst, len(v))
 16953  				}
 16954  				for i := range v {
 16955  					v := &v[i]
 16956  					{
 16957  						v := v.Name
 16958  						if isFlexible {
 16959  							dst = kbin.AppendCompactString(dst, v)
 16960  						} else {
 16961  							dst = kbin.AppendString(dst, v)
 16962  						}
 16963  					}
 16964  					{
 16965  						v := v.Value
 16966  						if isFlexible {
 16967  							dst = kbin.AppendCompactNullableString(dst, v)
 16968  						} else {
 16969  							dst = kbin.AppendNullableString(dst, v)
 16970  						}
 16971  					}
 16972  					if isFlexible {
 16973  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16974  						dst = v.UnknownTags.AppendEach(dst)
 16975  					}
 16976  				}
 16977  			}
 16978  			if isFlexible {
 16979  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16980  				dst = v.UnknownTags.AppendEach(dst)
 16981  			}
 16982  		}
 16983  	}
 16984  	{
 16985  		v := v.TimeoutMillis
 16986  		dst = kbin.AppendInt32(dst, v)
 16987  	}
 16988  	if version >= 1 {
 16989  		v := v.ValidateOnly
 16990  		dst = kbin.AppendBool(dst, v)
 16991  	}
 16992  	if isFlexible {
 16993  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 16994  		dst = v.UnknownTags.AppendEach(dst)
 16995  	}
 16996  	return dst
 16997  }
 16998  
 16999  func (v *CreateTopicsRequest) ReadFrom(src []byte) error {
 17000  	return v.readFrom(src, false)
 17001  }
 17002  
 17003  func (v *CreateTopicsRequest) UnsafeReadFrom(src []byte) error {
 17004  	return v.readFrom(src, true)
 17005  }
 17006  
 17007  func (v *CreateTopicsRequest) readFrom(src []byte, unsafe bool) error {
 17008  	v.Default()
 17009  	b := kbin.Reader{Src: src}
 17010  	version := v.Version
 17011  	_ = version
 17012  	isFlexible := version >= 5
 17013  	_ = isFlexible
 17014  	s := v
 17015  	{
 17016  		v := s.Topics
 17017  		a := v
 17018  		var l int32
 17019  		if isFlexible {
 17020  			l = b.CompactArrayLen()
 17021  		} else {
 17022  			l = b.ArrayLen()
 17023  		}
 17024  		if !b.Ok() {
 17025  			return b.Complete()
 17026  		}
 17027  		a = a[:0]
 17028  		if l > 0 {
 17029  			a = append(a, make([]CreateTopicsRequestTopic, l)...)
 17030  		}
 17031  		for i := int32(0); i < l; i++ {
 17032  			v := &a[i]
 17033  			v.Default()
 17034  			s := v
 17035  			{
 17036  				var v string
 17037  				if unsafe {
 17038  					if isFlexible {
 17039  						v = b.UnsafeCompactString()
 17040  					} else {
 17041  						v = b.UnsafeString()
 17042  					}
 17043  				} else {
 17044  					if isFlexible {
 17045  						v = b.CompactString()
 17046  					} else {
 17047  						v = b.String()
 17048  					}
 17049  				}
 17050  				s.Topic = v
 17051  			}
 17052  			{
 17053  				v := b.Int32()
 17054  				s.NumPartitions = v
 17055  			}
 17056  			{
 17057  				v := b.Int16()
 17058  				s.ReplicationFactor = v
 17059  			}
 17060  			{
 17061  				v := s.ReplicaAssignment
 17062  				a := v
 17063  				var l int32
 17064  				if isFlexible {
 17065  					l = b.CompactArrayLen()
 17066  				} else {
 17067  					l = b.ArrayLen()
 17068  				}
 17069  				if !b.Ok() {
 17070  					return b.Complete()
 17071  				}
 17072  				a = a[:0]
 17073  				if l > 0 {
 17074  					a = append(a, make([]CreateTopicsRequestTopicReplicaAssignment, l)...)
 17075  				}
 17076  				for i := int32(0); i < l; i++ {
 17077  					v := &a[i]
 17078  					v.Default()
 17079  					s := v
 17080  					{
 17081  						v := b.Int32()
 17082  						s.Partition = v
 17083  					}
 17084  					{
 17085  						v := s.Replicas
 17086  						a := v
 17087  						var l int32
 17088  						if isFlexible {
 17089  							l = b.CompactArrayLen()
 17090  						} else {
 17091  							l = b.ArrayLen()
 17092  						}
 17093  						if !b.Ok() {
 17094  							return b.Complete()
 17095  						}
 17096  						a = a[:0]
 17097  						if l > 0 {
 17098  							a = append(a, make([]int32, l)...)
 17099  						}
 17100  						for i := int32(0); i < l; i++ {
 17101  							v := b.Int32()
 17102  							a[i] = v
 17103  						}
 17104  						v = a
 17105  						s.Replicas = v
 17106  					}
 17107  					if isFlexible {
 17108  						s.UnknownTags = internalReadTags(&b)
 17109  					}
 17110  				}
 17111  				v = a
 17112  				s.ReplicaAssignment = v
 17113  			}
 17114  			{
 17115  				v := s.Configs
 17116  				a := v
 17117  				var l int32
 17118  				if isFlexible {
 17119  					l = b.CompactArrayLen()
 17120  				} else {
 17121  					l = b.ArrayLen()
 17122  				}
 17123  				if !b.Ok() {
 17124  					return b.Complete()
 17125  				}
 17126  				a = a[:0]
 17127  				if l > 0 {
 17128  					a = append(a, make([]CreateTopicsRequestTopicConfig, l)...)
 17129  				}
 17130  				for i := int32(0); i < l; i++ {
 17131  					v := &a[i]
 17132  					v.Default()
 17133  					s := v
 17134  					{
 17135  						var v string
 17136  						if unsafe {
 17137  							if isFlexible {
 17138  								v = b.UnsafeCompactString()
 17139  							} else {
 17140  								v = b.UnsafeString()
 17141  							}
 17142  						} else {
 17143  							if isFlexible {
 17144  								v = b.CompactString()
 17145  							} else {
 17146  								v = b.String()
 17147  							}
 17148  						}
 17149  						s.Name = v
 17150  					}
 17151  					{
 17152  						var v *string
 17153  						if isFlexible {
 17154  							if unsafe {
 17155  								v = b.UnsafeCompactNullableString()
 17156  							} else {
 17157  								v = b.CompactNullableString()
 17158  							}
 17159  						} else {
 17160  							if unsafe {
 17161  								v = b.UnsafeNullableString()
 17162  							} else {
 17163  								v = b.NullableString()
 17164  							}
 17165  						}
 17166  						s.Value = v
 17167  					}
 17168  					if isFlexible {
 17169  						s.UnknownTags = internalReadTags(&b)
 17170  					}
 17171  				}
 17172  				v = a
 17173  				s.Configs = v
 17174  			}
 17175  			if isFlexible {
 17176  				s.UnknownTags = internalReadTags(&b)
 17177  			}
 17178  		}
 17179  		v = a
 17180  		s.Topics = v
 17181  	}
 17182  	{
 17183  		v := b.Int32()
 17184  		s.TimeoutMillis = v
 17185  	}
 17186  	if version >= 1 {
 17187  		v := b.Bool()
 17188  		s.ValidateOnly = v
 17189  	}
 17190  	if isFlexible {
 17191  		s.UnknownTags = internalReadTags(&b)
 17192  	}
 17193  	return b.Complete()
 17194  }
 17195  
 17196  // NewPtrCreateTopicsRequest returns a pointer to a default CreateTopicsRequest
 17197  // This is a shortcut for creating a new(struct) and calling Default yourself.
 17198  func NewPtrCreateTopicsRequest() *CreateTopicsRequest {
 17199  	var v CreateTopicsRequest
 17200  	v.Default()
 17201  	return &v
 17202  }
 17203  
 17204  // Default sets any default fields. Calling this allows for future compatibility
 17205  // if new fields are added to CreateTopicsRequest.
 17206  func (v *CreateTopicsRequest) Default() {
 17207  	v.TimeoutMillis = 60000
 17208  }
 17209  
 17210  // NewCreateTopicsRequest returns a default CreateTopicsRequest
 17211  // This is a shortcut for creating a struct and calling Default yourself.
 17212  func NewCreateTopicsRequest() CreateTopicsRequest {
 17213  	var v CreateTopicsRequest
 17214  	v.Default()
 17215  	return v
 17216  }
 17217  
 17218  type CreateTopicsResponseTopicConfig struct {
 17219  	// Name is the configuration name (e.g. segment.bytes).
 17220  	Name string
 17221  
 17222  	// Value is the value for this config key. If the key is sensitive,
 17223  	// the value will be null.
 17224  	Value *string
 17225  
 17226  	// ReadOnly signifies whether this is not a dynamic config option.
 17227  	ReadOnly bool
 17228  
 17229  	// Source is where this config entry is from. See the documentation
 17230  	// on DescribeConfigsRequest's Source for more details.
 17231  	//
 17232  	// This field has a default of -1.
 17233  	Source int8
 17234  
 17235  	// IsSensitive signifies whether this is a sensitive config key, which
 17236  	// is either a password or an unknown type.
 17237  	IsSensitive bool
 17238  
 17239  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 17240  	UnknownTags Tags // v5+
 17241  }
 17242  
 17243  // Default sets any default fields. Calling this allows for future compatibility
 17244  // if new fields are added to CreateTopicsResponseTopicConfig.
 17245  func (v *CreateTopicsResponseTopicConfig) Default() {
 17246  	v.Source = -1
 17247  }
 17248  
 17249  // NewCreateTopicsResponseTopicConfig returns a default CreateTopicsResponseTopicConfig
 17250  // This is a shortcut for creating a struct and calling Default yourself.
 17251  func NewCreateTopicsResponseTopicConfig() CreateTopicsResponseTopicConfig {
 17252  	var v CreateTopicsResponseTopicConfig
 17253  	v.Default()
 17254  	return v
 17255  }
 17256  
 17257  type CreateTopicsResponseTopic struct {
 17258  	// Topic is the topic this response corresponds to.
 17259  	Topic string
 17260  
 17261  	// The unique topic ID.
 17262  	TopicID [16]byte // v7+
 17263  
 17264  	// ErrorCode is the error code for an individual topic creation.
 17265  	//
 17266  	// NOT_CONTROLLER is returned if the request was not issued to a Kafka
 17267  	// controller.
 17268  	//
 17269  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized.
 17270  	//
 17271  	// INVALID_REQUEST is returned if the same topic occurred multiple times
 17272  	// in the request.
 17273  	//
 17274  	// POLICY_VIOLATION is returned if the broker is using a
 17275  	// create.topic.policy.class.name that returns a policy violation.
 17276  	//
 17277  	// INVALID_TOPIC_EXCEPTION if the topic collides with another topic when
 17278  	// both topic's names' periods are replaced with underscores (e.g.
 17279  	// topic.foo and topic_foo collide).
 17280  	//
 17281  	// TOPIC_ALREADY_EXISTS is returned if the topic already exists.
 17282  	//
 17283  	// INVALID_PARTITIONS is returned if the requested number of partitions is
 17284  	// <= 0.
 17285  	//
 17286  	// INVALID_REPLICATION_FACTOR is returned if the requested replication
 17287  	// factor is <= 0.
 17288  	//
 17289  	// INVALID_REPLICA_ASSIGNMENT is returned if not all partitions have the same
 17290  	// number of replicas, or duplica replicas are assigned, or the partitions
 17291  	// are not consecutive starting from 0.
 17292  	//
 17293  	// INVALID_CONFIG is returned if the requested topic config is invalid.
 17294  	// to create a topic.
 17295  	ErrorCode int16
 17296  
 17297  	// ErrorMessage is an informative message if the topic creation failed.
 17298  	ErrorMessage *string // v1+
 17299  
 17300  	// ConfigErrorCode is non-zero if configs are unable to be returned.
 17301  	//
 17302  	// This is the first tagged field, introduced in version 5. As such, it is
 17303  	// only possible to be present in v5+.
 17304  	ConfigErrorCode int16 // tag 0
 17305  
 17306  	// NumPartitions is how many partitions were created for this topic.
 17307  	//
 17308  	// This field has a default of -1.
 17309  	NumPartitions int32 // v5+
 17310  
 17311  	// ReplicationFactor is how many replicas every partition has for this topic.
 17312  	//
 17313  	// This field has a default of -1.
 17314  	ReplicationFactor int16 // v5+
 17315  
 17316  	// Configs contains this topic's configuration.
 17317  	Configs []CreateTopicsResponseTopicConfig // v5+
 17318  
 17319  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 17320  	UnknownTags Tags // v5+
 17321  }
 17322  
 17323  // Default sets any default fields. Calling this allows for future compatibility
 17324  // if new fields are added to CreateTopicsResponseTopic.
 17325  func (v *CreateTopicsResponseTopic) Default() {
 17326  	v.NumPartitions = -1
 17327  	v.ReplicationFactor = -1
 17328  }
 17329  
 17330  // NewCreateTopicsResponseTopic returns a default CreateTopicsResponseTopic
 17331  // This is a shortcut for creating a struct and calling Default yourself.
 17332  func NewCreateTopicsResponseTopic() CreateTopicsResponseTopic {
 17333  	var v CreateTopicsResponseTopic
 17334  	v.Default()
 17335  	return v
 17336  }
 17337  
 17338  // CreateTopicsResponse is returned from a CreateTopicsRequest.
 17339  type CreateTopicsResponse struct {
 17340  	// Version is the version of this message used with a Kafka broker.
 17341  	Version int16
 17342  
 17343  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 17344  	// after this request.
 17345  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 17346  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 17347  	//
 17348  	// This request switched at version 3.
 17349  	ThrottleMillis int32 // v2+
 17350  
 17351  	// Topics contains responses to the requested topic creations.
 17352  	Topics []CreateTopicsResponseTopic
 17353  
 17354  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 17355  	UnknownTags Tags // v5+
 17356  }
 17357  
 17358  func (*CreateTopicsResponse) Key() int16                         { return 19 }
 17359  func (*CreateTopicsResponse) MaxVersion() int16                  { return 7 }
 17360  func (v *CreateTopicsResponse) SetVersion(version int16)         { v.Version = version }
 17361  func (v *CreateTopicsResponse) GetVersion() int16                { return v.Version }
 17362  func (v *CreateTopicsResponse) IsFlexible() bool                 { return v.Version >= 5 }
 17363  func (v *CreateTopicsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 3 }
 17364  func (v *CreateTopicsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 17365  func (v *CreateTopicsResponse) RequestKind() Request             { return &CreateTopicsRequest{Version: v.Version} }
 17366  
 17367  func (v *CreateTopicsResponse) AppendTo(dst []byte) []byte {
 17368  	version := v.Version
 17369  	_ = version
 17370  	isFlexible := version >= 5
 17371  	_ = isFlexible
 17372  	if version >= 2 {
 17373  		v := v.ThrottleMillis
 17374  		dst = kbin.AppendInt32(dst, v)
 17375  	}
 17376  	{
 17377  		v := v.Topics
 17378  		if isFlexible {
 17379  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 17380  		} else {
 17381  			dst = kbin.AppendArrayLen(dst, len(v))
 17382  		}
 17383  		for i := range v {
 17384  			v := &v[i]
 17385  			{
 17386  				v := v.Topic
 17387  				if isFlexible {
 17388  					dst = kbin.AppendCompactString(dst, v)
 17389  				} else {
 17390  					dst = kbin.AppendString(dst, v)
 17391  				}
 17392  			}
 17393  			if version >= 7 {
 17394  				v := v.TopicID
 17395  				dst = kbin.AppendUuid(dst, v)
 17396  			}
 17397  			{
 17398  				v := v.ErrorCode
 17399  				dst = kbin.AppendInt16(dst, v)
 17400  			}
 17401  			if version >= 1 {
 17402  				v := v.ErrorMessage
 17403  				if isFlexible {
 17404  					dst = kbin.AppendCompactNullableString(dst, v)
 17405  				} else {
 17406  					dst = kbin.AppendNullableString(dst, v)
 17407  				}
 17408  			}
 17409  			if version >= 5 {
 17410  				v := v.NumPartitions
 17411  				dst = kbin.AppendInt32(dst, v)
 17412  			}
 17413  			if version >= 5 {
 17414  				v := v.ReplicationFactor
 17415  				dst = kbin.AppendInt16(dst, v)
 17416  			}
 17417  			if version >= 5 {
 17418  				v := v.Configs
 17419  				if isFlexible {
 17420  					dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 17421  				} else {
 17422  					dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 17423  				}
 17424  				for i := range v {
 17425  					v := &v[i]
 17426  					{
 17427  						v := v.Name
 17428  						if isFlexible {
 17429  							dst = kbin.AppendCompactString(dst, v)
 17430  						} else {
 17431  							dst = kbin.AppendString(dst, v)
 17432  						}
 17433  					}
 17434  					{
 17435  						v := v.Value
 17436  						if isFlexible {
 17437  							dst = kbin.AppendCompactNullableString(dst, v)
 17438  						} else {
 17439  							dst = kbin.AppendNullableString(dst, v)
 17440  						}
 17441  					}
 17442  					{
 17443  						v := v.ReadOnly
 17444  						dst = kbin.AppendBool(dst, v)
 17445  					}
 17446  					{
 17447  						v := v.Source
 17448  						dst = kbin.AppendInt8(dst, v)
 17449  					}
 17450  					{
 17451  						v := v.IsSensitive
 17452  						dst = kbin.AppendBool(dst, v)
 17453  					}
 17454  					if isFlexible {
 17455  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 17456  						dst = v.UnknownTags.AppendEach(dst)
 17457  					}
 17458  				}
 17459  			}
 17460  			if isFlexible {
 17461  				var toEncode []uint32
 17462  				if v.ConfigErrorCode != 0 {
 17463  					toEncode = append(toEncode, 0)
 17464  				}
 17465  				dst = kbin.AppendUvarint(dst, uint32(len(toEncode)+v.UnknownTags.Len()))
 17466  				for _, tag := range toEncode {
 17467  					switch tag {
 17468  					case 0:
 17469  						{
 17470  							v := v.ConfigErrorCode
 17471  							dst = kbin.AppendUvarint(dst, 0)
 17472  							dst = kbin.AppendUvarint(dst, 2)
 17473  							dst = kbin.AppendInt16(dst, v)
 17474  						}
 17475  					}
 17476  				}
 17477  				dst = v.UnknownTags.AppendEach(dst)
 17478  			}
 17479  		}
 17480  	}
 17481  	if isFlexible {
 17482  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 17483  		dst = v.UnknownTags.AppendEach(dst)
 17484  	}
 17485  	return dst
 17486  }
 17487  
 17488  func (v *CreateTopicsResponse) ReadFrom(src []byte) error {
 17489  	return v.readFrom(src, false)
 17490  }
 17491  
 17492  func (v *CreateTopicsResponse) UnsafeReadFrom(src []byte) error {
 17493  	return v.readFrom(src, true)
 17494  }
 17495  
 17496  func (v *CreateTopicsResponse) readFrom(src []byte, unsafe bool) error {
 17497  	v.Default()
 17498  	b := kbin.Reader{Src: src}
 17499  	version := v.Version
 17500  	_ = version
 17501  	isFlexible := version >= 5
 17502  	_ = isFlexible
 17503  	s := v
 17504  	if version >= 2 {
 17505  		v := b.Int32()
 17506  		s.ThrottleMillis = v
 17507  	}
 17508  	{
 17509  		v := s.Topics
 17510  		a := v
 17511  		var l int32
 17512  		if isFlexible {
 17513  			l = b.CompactArrayLen()
 17514  		} else {
 17515  			l = b.ArrayLen()
 17516  		}
 17517  		if !b.Ok() {
 17518  			return b.Complete()
 17519  		}
 17520  		a = a[:0]
 17521  		if l > 0 {
 17522  			a = append(a, make([]CreateTopicsResponseTopic, l)...)
 17523  		}
 17524  		for i := int32(0); i < l; i++ {
 17525  			v := &a[i]
 17526  			v.Default()
 17527  			s := v
 17528  			{
 17529  				var v string
 17530  				if unsafe {
 17531  					if isFlexible {
 17532  						v = b.UnsafeCompactString()
 17533  					} else {
 17534  						v = b.UnsafeString()
 17535  					}
 17536  				} else {
 17537  					if isFlexible {
 17538  						v = b.CompactString()
 17539  					} else {
 17540  						v = b.String()
 17541  					}
 17542  				}
 17543  				s.Topic = v
 17544  			}
 17545  			if version >= 7 {
 17546  				v := b.Uuid()
 17547  				s.TopicID = v
 17548  			}
 17549  			{
 17550  				v := b.Int16()
 17551  				s.ErrorCode = v
 17552  			}
 17553  			if version >= 1 {
 17554  				var v *string
 17555  				if isFlexible {
 17556  					if unsafe {
 17557  						v = b.UnsafeCompactNullableString()
 17558  					} else {
 17559  						v = b.CompactNullableString()
 17560  					}
 17561  				} else {
 17562  					if unsafe {
 17563  						v = b.UnsafeNullableString()
 17564  					} else {
 17565  						v = b.NullableString()
 17566  					}
 17567  				}
 17568  				s.ErrorMessage = v
 17569  			}
 17570  			if version >= 5 {
 17571  				v := b.Int32()
 17572  				s.NumPartitions = v
 17573  			}
 17574  			if version >= 5 {
 17575  				v := b.Int16()
 17576  				s.ReplicationFactor = v
 17577  			}
 17578  			if version >= 5 {
 17579  				v := s.Configs
 17580  				a := v
 17581  				var l int32
 17582  				if isFlexible {
 17583  					l = b.CompactArrayLen()
 17584  				} else {
 17585  					l = b.ArrayLen()
 17586  				}
 17587  				if version < 0 || l == 0 {
 17588  					a = []CreateTopicsResponseTopicConfig{}
 17589  				}
 17590  				if !b.Ok() {
 17591  					return b.Complete()
 17592  				}
 17593  				a = a[:0]
 17594  				if l > 0 {
 17595  					a = append(a, make([]CreateTopicsResponseTopicConfig, l)...)
 17596  				}
 17597  				for i := int32(0); i < l; i++ {
 17598  					v := &a[i]
 17599  					v.Default()
 17600  					s := v
 17601  					{
 17602  						var v string
 17603  						if unsafe {
 17604  							if isFlexible {
 17605  								v = b.UnsafeCompactString()
 17606  							} else {
 17607  								v = b.UnsafeString()
 17608  							}
 17609  						} else {
 17610  							if isFlexible {
 17611  								v = b.CompactString()
 17612  							} else {
 17613  								v = b.String()
 17614  							}
 17615  						}
 17616  						s.Name = v
 17617  					}
 17618  					{
 17619  						var v *string
 17620  						if isFlexible {
 17621  							if unsafe {
 17622  								v = b.UnsafeCompactNullableString()
 17623  							} else {
 17624  								v = b.CompactNullableString()
 17625  							}
 17626  						} else {
 17627  							if unsafe {
 17628  								v = b.UnsafeNullableString()
 17629  							} else {
 17630  								v = b.NullableString()
 17631  							}
 17632  						}
 17633  						s.Value = v
 17634  					}
 17635  					{
 17636  						v := b.Bool()
 17637  						s.ReadOnly = v
 17638  					}
 17639  					{
 17640  						v := b.Int8()
 17641  						s.Source = v
 17642  					}
 17643  					{
 17644  						v := b.Bool()
 17645  						s.IsSensitive = v
 17646  					}
 17647  					if isFlexible {
 17648  						s.UnknownTags = internalReadTags(&b)
 17649  					}
 17650  				}
 17651  				v = a
 17652  				s.Configs = v
 17653  			}
 17654  			if isFlexible {
 17655  				for i := b.Uvarint(); i > 0; i-- {
 17656  					switch key := b.Uvarint(); key {
 17657  					default:
 17658  						s.UnknownTags.Set(key, b.Span(int(b.Uvarint())))
 17659  					case 0:
 17660  						b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 17661  						v := b.Int16()
 17662  						s.ConfigErrorCode = v
 17663  						if err := b.Complete(); err != nil {
 17664  							return err
 17665  						}
 17666  					}
 17667  				}
 17668  			}
 17669  		}
 17670  		v = a
 17671  		s.Topics = v
 17672  	}
 17673  	if isFlexible {
 17674  		s.UnknownTags = internalReadTags(&b)
 17675  	}
 17676  	return b.Complete()
 17677  }
 17678  
 17679  // NewPtrCreateTopicsResponse returns a pointer to a default CreateTopicsResponse
 17680  // This is a shortcut for creating a new(struct) and calling Default yourself.
 17681  func NewPtrCreateTopicsResponse() *CreateTopicsResponse {
 17682  	var v CreateTopicsResponse
 17683  	v.Default()
 17684  	return &v
 17685  }
 17686  
 17687  // Default sets any default fields. Calling this allows for future compatibility
 17688  // if new fields are added to CreateTopicsResponse.
 17689  func (v *CreateTopicsResponse) Default() {
 17690  }
 17691  
 17692  // NewCreateTopicsResponse returns a default CreateTopicsResponse
 17693  // This is a shortcut for creating a struct and calling Default yourself.
 17694  func NewCreateTopicsResponse() CreateTopicsResponse {
 17695  	var v CreateTopicsResponse
 17696  	v.Default()
 17697  	return v
 17698  }
 17699  
 17700  type DeleteTopicsRequestTopic struct {
 17701  	Topic *string
 17702  
 17703  	TopicID [16]byte
 17704  
 17705  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 17706  	UnknownTags Tags // v4+
 17707  }
 17708  
 17709  // Default sets any default fields. Calling this allows for future compatibility
 17710  // if new fields are added to DeleteTopicsRequestTopic.
 17711  func (v *DeleteTopicsRequestTopic) Default() {
 17712  }
 17713  
 17714  // NewDeleteTopicsRequestTopic returns a default DeleteTopicsRequestTopic
 17715  // This is a shortcut for creating a struct and calling Default yourself.
 17716  func NewDeleteTopicsRequestTopic() DeleteTopicsRequestTopic {
 17717  	var v DeleteTopicsRequestTopic
 17718  	v.Default()
 17719  	return v
 17720  }
 17721  
 17722  // DeleteTopicsRequest deletes Kafka topics.
 17723  type DeleteTopicsRequest struct {
 17724  	// Version is the version of this message used with a Kafka broker.
 17725  	Version int16
 17726  
 17727  	// Topics is an array of topics to delete.
 17728  	TopicNames []string // v0-v5
 17729  
 17730  	// The name or topic ID of topics to delete.
 17731  	Topics []DeleteTopicsRequestTopic // v6+
 17732  
 17733  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 17734  	// This field has no effect on Kafka's processing of the request; the request
 17735  	// will continue to be processed if the timeout is reached. If the timeout is
 17736  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 17737  	//
 17738  	// This field has a default of 15000.
 17739  	TimeoutMillis int32
 17740  
 17741  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 17742  	UnknownTags Tags // v4+
 17743  }
 17744  
 17745  func (*DeleteTopicsRequest) Key() int16                       { return 20 }
 17746  func (*DeleteTopicsRequest) MaxVersion() int16                { return 6 }
 17747  func (v *DeleteTopicsRequest) SetVersion(version int16)       { v.Version = version }
 17748  func (v *DeleteTopicsRequest) GetVersion() int16              { return v.Version }
 17749  func (v *DeleteTopicsRequest) IsFlexible() bool               { return v.Version >= 4 }
 17750  func (v *DeleteTopicsRequest) Timeout() int32                 { return v.TimeoutMillis }
 17751  func (v *DeleteTopicsRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
 17752  func (v *DeleteTopicsRequest) IsAdminRequest()                {}
 17753  func (v *DeleteTopicsRequest) ResponseKind() Response {
 17754  	r := &DeleteTopicsResponse{Version: v.Version}
 17755  	r.Default()
 17756  	return r
 17757  }
 17758  
 17759  // RequestWith is requests v on r and returns the response or an error.
 17760  // For sharded requests, the response may be merged and still return an error.
 17761  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 17762  func (v *DeleteTopicsRequest) RequestWith(ctx context.Context, r Requestor) (*DeleteTopicsResponse, error) {
 17763  	kresp, err := r.Request(ctx, v)
 17764  	resp, _ := kresp.(*DeleteTopicsResponse)
 17765  	return resp, err
 17766  }
 17767  
 17768  func (v *DeleteTopicsRequest) AppendTo(dst []byte) []byte {
 17769  	version := v.Version
 17770  	_ = version
 17771  	isFlexible := version >= 4
 17772  	_ = isFlexible
 17773  	if version >= 0 && version <= 5 {
 17774  		v := v.TopicNames
 17775  		if isFlexible {
 17776  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 17777  		} else {
 17778  			dst = kbin.AppendArrayLen(dst, len(v))
 17779  		}
 17780  		for i := range v {
 17781  			v := v[i]
 17782  			if isFlexible {
 17783  				dst = kbin.AppendCompactString(dst, v)
 17784  			} else {
 17785  				dst = kbin.AppendString(dst, v)
 17786  			}
 17787  		}
 17788  	}
 17789  	if version >= 6 {
 17790  		v := v.Topics
 17791  		if isFlexible {
 17792  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 17793  		} else {
 17794  			dst = kbin.AppendArrayLen(dst, len(v))
 17795  		}
 17796  		for i := range v {
 17797  			v := &v[i]
 17798  			{
 17799  				v := v.Topic
 17800  				if isFlexible {
 17801  					dst = kbin.AppendCompactNullableString(dst, v)
 17802  				} else {
 17803  					dst = kbin.AppendNullableString(dst, v)
 17804  				}
 17805  			}
 17806  			{
 17807  				v := v.TopicID
 17808  				dst = kbin.AppendUuid(dst, v)
 17809  			}
 17810  			if isFlexible {
 17811  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 17812  				dst = v.UnknownTags.AppendEach(dst)
 17813  			}
 17814  		}
 17815  	}
 17816  	{
 17817  		v := v.TimeoutMillis
 17818  		dst = kbin.AppendInt32(dst, v)
 17819  	}
 17820  	if isFlexible {
 17821  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 17822  		dst = v.UnknownTags.AppendEach(dst)
 17823  	}
 17824  	return dst
 17825  }
 17826  
 17827  func (v *DeleteTopicsRequest) ReadFrom(src []byte) error {
 17828  	return v.readFrom(src, false)
 17829  }
 17830  
 17831  func (v *DeleteTopicsRequest) UnsafeReadFrom(src []byte) error {
 17832  	return v.readFrom(src, true)
 17833  }
 17834  
 17835  func (v *DeleteTopicsRequest) readFrom(src []byte, unsafe bool) error {
 17836  	v.Default()
 17837  	b := kbin.Reader{Src: src}
 17838  	version := v.Version
 17839  	_ = version
 17840  	isFlexible := version >= 4
 17841  	_ = isFlexible
 17842  	s := v
 17843  	if version >= 0 && version <= 5 {
 17844  		v := s.TopicNames
 17845  		a := v
 17846  		var l int32
 17847  		if isFlexible {
 17848  			l = b.CompactArrayLen()
 17849  		} else {
 17850  			l = b.ArrayLen()
 17851  		}
 17852  		if !b.Ok() {
 17853  			return b.Complete()
 17854  		}
 17855  		a = a[:0]
 17856  		if l > 0 {
 17857  			a = append(a, make([]string, l)...)
 17858  		}
 17859  		for i := int32(0); i < l; i++ {
 17860  			var v string
 17861  			if unsafe {
 17862  				if isFlexible {
 17863  					v = b.UnsafeCompactString()
 17864  				} else {
 17865  					v = b.UnsafeString()
 17866  				}
 17867  			} else {
 17868  				if isFlexible {
 17869  					v = b.CompactString()
 17870  				} else {
 17871  					v = b.String()
 17872  				}
 17873  			}
 17874  			a[i] = v
 17875  		}
 17876  		v = a
 17877  		s.TopicNames = v
 17878  	}
 17879  	if version >= 6 {
 17880  		v := s.Topics
 17881  		a := v
 17882  		var l int32
 17883  		if isFlexible {
 17884  			l = b.CompactArrayLen()
 17885  		} else {
 17886  			l = b.ArrayLen()
 17887  		}
 17888  		if !b.Ok() {
 17889  			return b.Complete()
 17890  		}
 17891  		a = a[:0]
 17892  		if l > 0 {
 17893  			a = append(a, make([]DeleteTopicsRequestTopic, l)...)
 17894  		}
 17895  		for i := int32(0); i < l; i++ {
 17896  			v := &a[i]
 17897  			v.Default()
 17898  			s := v
 17899  			{
 17900  				var v *string
 17901  				if isFlexible {
 17902  					if unsafe {
 17903  						v = b.UnsafeCompactNullableString()
 17904  					} else {
 17905  						v = b.CompactNullableString()
 17906  					}
 17907  				} else {
 17908  					if unsafe {
 17909  						v = b.UnsafeNullableString()
 17910  					} else {
 17911  						v = b.NullableString()
 17912  					}
 17913  				}
 17914  				s.Topic = v
 17915  			}
 17916  			{
 17917  				v := b.Uuid()
 17918  				s.TopicID = v
 17919  			}
 17920  			if isFlexible {
 17921  				s.UnknownTags = internalReadTags(&b)
 17922  			}
 17923  		}
 17924  		v = a
 17925  		s.Topics = v
 17926  	}
 17927  	{
 17928  		v := b.Int32()
 17929  		s.TimeoutMillis = v
 17930  	}
 17931  	if isFlexible {
 17932  		s.UnknownTags = internalReadTags(&b)
 17933  	}
 17934  	return b.Complete()
 17935  }
 17936  
 17937  // NewPtrDeleteTopicsRequest returns a pointer to a default DeleteTopicsRequest
 17938  // This is a shortcut for creating a new(struct) and calling Default yourself.
 17939  func NewPtrDeleteTopicsRequest() *DeleteTopicsRequest {
 17940  	var v DeleteTopicsRequest
 17941  	v.Default()
 17942  	return &v
 17943  }
 17944  
 17945  // Default sets any default fields. Calling this allows for future compatibility
 17946  // if new fields are added to DeleteTopicsRequest.
 17947  func (v *DeleteTopicsRequest) Default() {
 17948  	v.TimeoutMillis = 15000
 17949  }
 17950  
 17951  // NewDeleteTopicsRequest returns a default DeleteTopicsRequest
 17952  // This is a shortcut for creating a struct and calling Default yourself.
 17953  func NewDeleteTopicsRequest() DeleteTopicsRequest {
 17954  	var v DeleteTopicsRequest
 17955  	v.Default()
 17956  	return v
 17957  }
 17958  
 17959  type DeleteTopicsResponseTopic struct {
 17960  	// Topic is the topic requested for deletion.
 17961  	Topic *string
 17962  
 17963  	// The topic ID requested for deletion.
 17964  	TopicID [16]byte // v6+
 17965  
 17966  	// ErrorCode is the error code returned for an individual topic in
 17967  	// deletion request.
 17968  	//
 17969  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized
 17970  	// to delete a topic.
 17971  	//
 17972  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 17973  	// the topic.
 17974  	//
 17975  	// NOT_CONTROLLER is returned if the request was not issued to a Kafka
 17976  	// controller.
 17977  	//
 17978  	// TOPIC_DELETION_DISABLED is returned for deletion requests version 3+
 17979  	// and brokers >= 2.1.0. INVALID_REQUEST is issued for request versions
 17980  	// 0-2 against brokers >= 2.1.0. Otherwise, the request hangs until it
 17981  	// times out.
 17982  	//
 17983  	// UNSUPPORTED_VERSION is returned when using topic IDs with a cluster
 17984  	// that is not yet Kafka v2.8+.
 17985  	//
 17986  	// UNKNOWN_TOPIC_ID is returned when using topic IDs to a Kafka cluster
 17987  	// v2.8+ and the topic ID is not found.
 17988  	ErrorCode int16
 17989  
 17990  	// ErrorMessage is a message for an error.
 17991  	ErrorMessage *string // v5+
 17992  
 17993  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 17994  	UnknownTags Tags // v4+
 17995  }
 17996  
 17997  // Default sets any default fields. Calling this allows for future compatibility
 17998  // if new fields are added to DeleteTopicsResponseTopic.
 17999  func (v *DeleteTopicsResponseTopic) Default() {
 18000  }
 18001  
 18002  // NewDeleteTopicsResponseTopic returns a default DeleteTopicsResponseTopic
 18003  // This is a shortcut for creating a struct and calling Default yourself.
 18004  func NewDeleteTopicsResponseTopic() DeleteTopicsResponseTopic {
 18005  	var v DeleteTopicsResponseTopic
 18006  	v.Default()
 18007  	return v
 18008  }
 18009  
 18010  // DeleteTopicsResponse is returned from a DeleteTopicsRequest.
 18011  // Version 3 added the TOPIC_DELETION_DISABLED error proposed in KIP-322
 18012  // and introduced in Kafka 2.1.0. Prior, the request timed out.
 18013  type DeleteTopicsResponse struct {
 18014  	// Version is the version of this message used with a Kafka broker.
 18015  	Version int16
 18016  
 18017  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 18018  	// after this request.
 18019  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 18020  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 18021  	//
 18022  	// This request switched at version 2.
 18023  	ThrottleMillis int32 // v1+
 18024  
 18025  	// Topics contains responses for each topic requested for deletion.
 18026  	Topics []DeleteTopicsResponseTopic
 18027  
 18028  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18029  	UnknownTags Tags // v4+
 18030  }
 18031  
 18032  func (*DeleteTopicsResponse) Key() int16                         { return 20 }
 18033  func (*DeleteTopicsResponse) MaxVersion() int16                  { return 6 }
 18034  func (v *DeleteTopicsResponse) SetVersion(version int16)         { v.Version = version }
 18035  func (v *DeleteTopicsResponse) GetVersion() int16                { return v.Version }
 18036  func (v *DeleteTopicsResponse) IsFlexible() bool                 { return v.Version >= 4 }
 18037  func (v *DeleteTopicsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 2 }
 18038  func (v *DeleteTopicsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 18039  func (v *DeleteTopicsResponse) RequestKind() Request             { return &DeleteTopicsRequest{Version: v.Version} }
 18040  
 18041  func (v *DeleteTopicsResponse) AppendTo(dst []byte) []byte {
 18042  	version := v.Version
 18043  	_ = version
 18044  	isFlexible := version >= 4
 18045  	_ = isFlexible
 18046  	if version >= 1 {
 18047  		v := v.ThrottleMillis
 18048  		dst = kbin.AppendInt32(dst, v)
 18049  	}
 18050  	{
 18051  		v := v.Topics
 18052  		if isFlexible {
 18053  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 18054  		} else {
 18055  			dst = kbin.AppendArrayLen(dst, len(v))
 18056  		}
 18057  		for i := range v {
 18058  			v := &v[i]
 18059  			{
 18060  				v := v.Topic
 18061  				if version < 6 {
 18062  					var vv string
 18063  					if v != nil {
 18064  						vv = *v
 18065  					}
 18066  					{
 18067  						v := vv
 18068  						if isFlexible {
 18069  							dst = kbin.AppendCompactString(dst, v)
 18070  						} else {
 18071  							dst = kbin.AppendString(dst, v)
 18072  						}
 18073  					}
 18074  				} else {
 18075  					if isFlexible {
 18076  						dst = kbin.AppendCompactNullableString(dst, v)
 18077  					} else {
 18078  						dst = kbin.AppendNullableString(dst, v)
 18079  					}
 18080  				}
 18081  			}
 18082  			if version >= 6 {
 18083  				v := v.TopicID
 18084  				dst = kbin.AppendUuid(dst, v)
 18085  			}
 18086  			{
 18087  				v := v.ErrorCode
 18088  				dst = kbin.AppendInt16(dst, v)
 18089  			}
 18090  			if version >= 5 {
 18091  				v := v.ErrorMessage
 18092  				if isFlexible {
 18093  					dst = kbin.AppendCompactNullableString(dst, v)
 18094  				} else {
 18095  					dst = kbin.AppendNullableString(dst, v)
 18096  				}
 18097  			}
 18098  			if isFlexible {
 18099  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18100  				dst = v.UnknownTags.AppendEach(dst)
 18101  			}
 18102  		}
 18103  	}
 18104  	if isFlexible {
 18105  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18106  		dst = v.UnknownTags.AppendEach(dst)
 18107  	}
 18108  	return dst
 18109  }
 18110  
 18111  func (v *DeleteTopicsResponse) ReadFrom(src []byte) error {
 18112  	return v.readFrom(src, false)
 18113  }
 18114  
 18115  func (v *DeleteTopicsResponse) UnsafeReadFrom(src []byte) error {
 18116  	return v.readFrom(src, true)
 18117  }
 18118  
 18119  func (v *DeleteTopicsResponse) readFrom(src []byte, unsafe bool) error {
 18120  	v.Default()
 18121  	b := kbin.Reader{Src: src}
 18122  	version := v.Version
 18123  	_ = version
 18124  	isFlexible := version >= 4
 18125  	_ = isFlexible
 18126  	s := v
 18127  	if version >= 1 {
 18128  		v := b.Int32()
 18129  		s.ThrottleMillis = v
 18130  	}
 18131  	{
 18132  		v := s.Topics
 18133  		a := v
 18134  		var l int32
 18135  		if isFlexible {
 18136  			l = b.CompactArrayLen()
 18137  		} else {
 18138  			l = b.ArrayLen()
 18139  		}
 18140  		if !b.Ok() {
 18141  			return b.Complete()
 18142  		}
 18143  		a = a[:0]
 18144  		if l > 0 {
 18145  			a = append(a, make([]DeleteTopicsResponseTopic, l)...)
 18146  		}
 18147  		for i := int32(0); i < l; i++ {
 18148  			v := &a[i]
 18149  			v.Default()
 18150  			s := v
 18151  			{
 18152  				var v *string
 18153  				if version < 6 {
 18154  					var vv string
 18155  					if isFlexible {
 18156  						if unsafe {
 18157  							vv = b.UnsafeCompactString()
 18158  						} else {
 18159  							vv = b.CompactString()
 18160  						}
 18161  					} else {
 18162  						if unsafe {
 18163  							vv = b.UnsafeString()
 18164  						} else {
 18165  							vv = b.String()
 18166  						}
 18167  					}
 18168  					v = &vv
 18169  				} else {
 18170  					if isFlexible {
 18171  						if unsafe {
 18172  							v = b.UnsafeCompactNullableString()
 18173  						} else {
 18174  							v = b.CompactNullableString()
 18175  						}
 18176  					} else {
 18177  						if unsafe {
 18178  							v = b.UnsafeNullableString()
 18179  						} else {
 18180  							v = b.NullableString()
 18181  						}
 18182  					}
 18183  				}
 18184  				s.Topic = v
 18185  			}
 18186  			if version >= 6 {
 18187  				v := b.Uuid()
 18188  				s.TopicID = v
 18189  			}
 18190  			{
 18191  				v := b.Int16()
 18192  				s.ErrorCode = v
 18193  			}
 18194  			if version >= 5 {
 18195  				var v *string
 18196  				if isFlexible {
 18197  					if unsafe {
 18198  						v = b.UnsafeCompactNullableString()
 18199  					} else {
 18200  						v = b.CompactNullableString()
 18201  					}
 18202  				} else {
 18203  					if unsafe {
 18204  						v = b.UnsafeNullableString()
 18205  					} else {
 18206  						v = b.NullableString()
 18207  					}
 18208  				}
 18209  				s.ErrorMessage = v
 18210  			}
 18211  			if isFlexible {
 18212  				s.UnknownTags = internalReadTags(&b)
 18213  			}
 18214  		}
 18215  		v = a
 18216  		s.Topics = v
 18217  	}
 18218  	if isFlexible {
 18219  		s.UnknownTags = internalReadTags(&b)
 18220  	}
 18221  	return b.Complete()
 18222  }
 18223  
 18224  // NewPtrDeleteTopicsResponse returns a pointer to a default DeleteTopicsResponse
 18225  // This is a shortcut for creating a new(struct) and calling Default yourself.
 18226  func NewPtrDeleteTopicsResponse() *DeleteTopicsResponse {
 18227  	var v DeleteTopicsResponse
 18228  	v.Default()
 18229  	return &v
 18230  }
 18231  
 18232  // Default sets any default fields. Calling this allows for future compatibility
 18233  // if new fields are added to DeleteTopicsResponse.
 18234  func (v *DeleteTopicsResponse) Default() {
 18235  }
 18236  
 18237  // NewDeleteTopicsResponse returns a default DeleteTopicsResponse
 18238  // This is a shortcut for creating a struct and calling Default yourself.
 18239  func NewDeleteTopicsResponse() DeleteTopicsResponse {
 18240  	var v DeleteTopicsResponse
 18241  	v.Default()
 18242  	return v
 18243  }
 18244  
 18245  type DeleteRecordsRequestTopicPartition struct {
 18246  	// Partition is a partition to delete records from.
 18247  	Partition int32
 18248  
 18249  	// Offset is the offset to set the partition's low watermark (start
 18250  	// offset) to. After a successful response, all records before this
 18251  	// offset are considered deleted and are no longer readable.
 18252  	//
 18253  	// To delete all records, use -1, which is mapped to the partition's
 18254  	// current high watermark.
 18255  	Offset int64
 18256  
 18257  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18258  	UnknownTags Tags // v2+
 18259  }
 18260  
 18261  // Default sets any default fields. Calling this allows for future compatibility
 18262  // if new fields are added to DeleteRecordsRequestTopicPartition.
 18263  func (v *DeleteRecordsRequestTopicPartition) Default() {
 18264  }
 18265  
 18266  // NewDeleteRecordsRequestTopicPartition returns a default DeleteRecordsRequestTopicPartition
 18267  // This is a shortcut for creating a struct and calling Default yourself.
 18268  func NewDeleteRecordsRequestTopicPartition() DeleteRecordsRequestTopicPartition {
 18269  	var v DeleteRecordsRequestTopicPartition
 18270  	v.Default()
 18271  	return v
 18272  }
 18273  
 18274  type DeleteRecordsRequestTopic struct {
 18275  	// Topic is a topic to delete records from.
 18276  	Topic string
 18277  
 18278  	// Partitions contains partitions to delete records from.
 18279  	Partitions []DeleteRecordsRequestTopicPartition
 18280  
 18281  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18282  	UnknownTags Tags // v2+
 18283  }
 18284  
 18285  // Default sets any default fields. Calling this allows for future compatibility
 18286  // if new fields are added to DeleteRecordsRequestTopic.
 18287  func (v *DeleteRecordsRequestTopic) Default() {
 18288  }
 18289  
 18290  // NewDeleteRecordsRequestTopic returns a default DeleteRecordsRequestTopic
 18291  // This is a shortcut for creating a struct and calling Default yourself.
 18292  func NewDeleteRecordsRequestTopic() DeleteRecordsRequestTopic {
 18293  	var v DeleteRecordsRequestTopic
 18294  	v.Default()
 18295  	return v
 18296  }
 18297  
 18298  // DeleteRecordsRequest is an admin request to delete records from Kafka.
 18299  // This was added for KIP-107.
 18300  //
 18301  // To delete records, Kafka sets the LogStartOffset for partitions to
 18302  // the requested offset. All segments whose max partition is before the
 18303  // requested offset are deleted, and any records within the segment before
 18304  // the requested offset can no longer be read.
 18305  //
 18306  // This request must be issued to the correct brokers that own the partitions
 18307  // you intend to delete records for.
 18308  type DeleteRecordsRequest struct {
 18309  	// Version is the version of this message used with a Kafka broker.
 18310  	Version int16
 18311  
 18312  	// Topics contains topics for which to delete records from.
 18313  	Topics []DeleteRecordsRequestTopic
 18314  
 18315  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 18316  	// This field has no effect on Kafka's processing of the request; the request
 18317  	// will continue to be processed if the timeout is reached. If the timeout is
 18318  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 18319  	//
 18320  	// This field has a default of 15000.
 18321  	TimeoutMillis int32
 18322  
 18323  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18324  	UnknownTags Tags // v2+
 18325  }
 18326  
 18327  func (*DeleteRecordsRequest) Key() int16                       { return 21 }
 18328  func (*DeleteRecordsRequest) MaxVersion() int16                { return 2 }
 18329  func (v *DeleteRecordsRequest) SetVersion(version int16)       { v.Version = version }
 18330  func (v *DeleteRecordsRequest) GetVersion() int16              { return v.Version }
 18331  func (v *DeleteRecordsRequest) IsFlexible() bool               { return v.Version >= 2 }
 18332  func (v *DeleteRecordsRequest) Timeout() int32                 { return v.TimeoutMillis }
 18333  func (v *DeleteRecordsRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
 18334  func (v *DeleteRecordsRequest) ResponseKind() Response {
 18335  	r := &DeleteRecordsResponse{Version: v.Version}
 18336  	r.Default()
 18337  	return r
 18338  }
 18339  
 18340  // RequestWith is requests v on r and returns the response or an error.
 18341  // For sharded requests, the response may be merged and still return an error.
 18342  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 18343  func (v *DeleteRecordsRequest) RequestWith(ctx context.Context, r Requestor) (*DeleteRecordsResponse, error) {
 18344  	kresp, err := r.Request(ctx, v)
 18345  	resp, _ := kresp.(*DeleteRecordsResponse)
 18346  	return resp, err
 18347  }
 18348  
 18349  func (v *DeleteRecordsRequest) AppendTo(dst []byte) []byte {
 18350  	version := v.Version
 18351  	_ = version
 18352  	isFlexible := version >= 2
 18353  	_ = isFlexible
 18354  	{
 18355  		v := v.Topics
 18356  		if isFlexible {
 18357  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 18358  		} else {
 18359  			dst = kbin.AppendArrayLen(dst, len(v))
 18360  		}
 18361  		for i := range v {
 18362  			v := &v[i]
 18363  			{
 18364  				v := v.Topic
 18365  				if isFlexible {
 18366  					dst = kbin.AppendCompactString(dst, v)
 18367  				} else {
 18368  					dst = kbin.AppendString(dst, v)
 18369  				}
 18370  			}
 18371  			{
 18372  				v := v.Partitions
 18373  				if isFlexible {
 18374  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 18375  				} else {
 18376  					dst = kbin.AppendArrayLen(dst, len(v))
 18377  				}
 18378  				for i := range v {
 18379  					v := &v[i]
 18380  					{
 18381  						v := v.Partition
 18382  						dst = kbin.AppendInt32(dst, v)
 18383  					}
 18384  					{
 18385  						v := v.Offset
 18386  						dst = kbin.AppendInt64(dst, v)
 18387  					}
 18388  					if isFlexible {
 18389  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18390  						dst = v.UnknownTags.AppendEach(dst)
 18391  					}
 18392  				}
 18393  			}
 18394  			if isFlexible {
 18395  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18396  				dst = v.UnknownTags.AppendEach(dst)
 18397  			}
 18398  		}
 18399  	}
 18400  	{
 18401  		v := v.TimeoutMillis
 18402  		dst = kbin.AppendInt32(dst, v)
 18403  	}
 18404  	if isFlexible {
 18405  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18406  		dst = v.UnknownTags.AppendEach(dst)
 18407  	}
 18408  	return dst
 18409  }
 18410  
 18411  func (v *DeleteRecordsRequest) ReadFrom(src []byte) error {
 18412  	return v.readFrom(src, false)
 18413  }
 18414  
 18415  func (v *DeleteRecordsRequest) UnsafeReadFrom(src []byte) error {
 18416  	return v.readFrom(src, true)
 18417  }
 18418  
 18419  func (v *DeleteRecordsRequest) readFrom(src []byte, unsafe bool) error {
 18420  	v.Default()
 18421  	b := kbin.Reader{Src: src}
 18422  	version := v.Version
 18423  	_ = version
 18424  	isFlexible := version >= 2
 18425  	_ = isFlexible
 18426  	s := v
 18427  	{
 18428  		v := s.Topics
 18429  		a := v
 18430  		var l int32
 18431  		if isFlexible {
 18432  			l = b.CompactArrayLen()
 18433  		} else {
 18434  			l = b.ArrayLen()
 18435  		}
 18436  		if !b.Ok() {
 18437  			return b.Complete()
 18438  		}
 18439  		a = a[:0]
 18440  		if l > 0 {
 18441  			a = append(a, make([]DeleteRecordsRequestTopic, l)...)
 18442  		}
 18443  		for i := int32(0); i < l; i++ {
 18444  			v := &a[i]
 18445  			v.Default()
 18446  			s := v
 18447  			{
 18448  				var v string
 18449  				if unsafe {
 18450  					if isFlexible {
 18451  						v = b.UnsafeCompactString()
 18452  					} else {
 18453  						v = b.UnsafeString()
 18454  					}
 18455  				} else {
 18456  					if isFlexible {
 18457  						v = b.CompactString()
 18458  					} else {
 18459  						v = b.String()
 18460  					}
 18461  				}
 18462  				s.Topic = v
 18463  			}
 18464  			{
 18465  				v := s.Partitions
 18466  				a := v
 18467  				var l int32
 18468  				if isFlexible {
 18469  					l = b.CompactArrayLen()
 18470  				} else {
 18471  					l = b.ArrayLen()
 18472  				}
 18473  				if !b.Ok() {
 18474  					return b.Complete()
 18475  				}
 18476  				a = a[:0]
 18477  				if l > 0 {
 18478  					a = append(a, make([]DeleteRecordsRequestTopicPartition, l)...)
 18479  				}
 18480  				for i := int32(0); i < l; i++ {
 18481  					v := &a[i]
 18482  					v.Default()
 18483  					s := v
 18484  					{
 18485  						v := b.Int32()
 18486  						s.Partition = v
 18487  					}
 18488  					{
 18489  						v := b.Int64()
 18490  						s.Offset = v
 18491  					}
 18492  					if isFlexible {
 18493  						s.UnknownTags = internalReadTags(&b)
 18494  					}
 18495  				}
 18496  				v = a
 18497  				s.Partitions = v
 18498  			}
 18499  			if isFlexible {
 18500  				s.UnknownTags = internalReadTags(&b)
 18501  			}
 18502  		}
 18503  		v = a
 18504  		s.Topics = v
 18505  	}
 18506  	{
 18507  		v := b.Int32()
 18508  		s.TimeoutMillis = v
 18509  	}
 18510  	if isFlexible {
 18511  		s.UnknownTags = internalReadTags(&b)
 18512  	}
 18513  	return b.Complete()
 18514  }
 18515  
 18516  // NewPtrDeleteRecordsRequest returns a pointer to a default DeleteRecordsRequest
 18517  // This is a shortcut for creating a new(struct) and calling Default yourself.
 18518  func NewPtrDeleteRecordsRequest() *DeleteRecordsRequest {
 18519  	var v DeleteRecordsRequest
 18520  	v.Default()
 18521  	return &v
 18522  }
 18523  
 18524  // Default sets any default fields. Calling this allows for future compatibility
 18525  // if new fields are added to DeleteRecordsRequest.
 18526  func (v *DeleteRecordsRequest) Default() {
 18527  	v.TimeoutMillis = 15000
 18528  }
 18529  
 18530  // NewDeleteRecordsRequest returns a default DeleteRecordsRequest
 18531  // This is a shortcut for creating a struct and calling Default yourself.
 18532  func NewDeleteRecordsRequest() DeleteRecordsRequest {
 18533  	var v DeleteRecordsRequest
 18534  	v.Default()
 18535  	return v
 18536  }
 18537  
 18538  type DeleteRecordsResponseTopicPartition struct {
 18539  	// Partition is the partition this response corresponds to.
 18540  	Partition int32
 18541  
 18542  	// LowWatermark is the new earliest offset for this partition.
 18543  	LowWatermark int64
 18544  
 18545  	// ErrorCode is the error code returned for a given partition in
 18546  	// the delete request.
 18547  	//
 18548  	// TOPIC_AUTHORIZATION_FAILED is returned for all partitions if the
 18549  	// client is not authorized to delete records.
 18550  	//
 18551  	// UNKNOWN_TOPIC_OR_PARTITION is returned for all partitions that
 18552  	// the requested broker does not know of.
 18553  	//
 18554  	// NOT_LEADER_FOR_PARTITION is returned for partitions that the
 18555  	// requested broker is not a leader of.
 18556  	//
 18557  	// OFFSET_OUT_OF_RANGE is returned if the requested offset is
 18558  	// negative or higher than the current high watermark.
 18559  	//
 18560  	// POLICY_VIOLATION is returned if records cannot be deleted due to
 18561  	// broker configuration.
 18562  	//
 18563  	// KAFKA_STORAGE_EXCEPTION is returned if the partition is in an
 18564  	// offline log directory.
 18565  	ErrorCode int16
 18566  
 18567  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18568  	UnknownTags Tags // v2+
 18569  }
 18570  
 18571  // Default sets any default fields. Calling this allows for future compatibility
 18572  // if new fields are added to DeleteRecordsResponseTopicPartition.
 18573  func (v *DeleteRecordsResponseTopicPartition) Default() {
 18574  }
 18575  
 18576  // NewDeleteRecordsResponseTopicPartition returns a default DeleteRecordsResponseTopicPartition
 18577  // This is a shortcut for creating a struct and calling Default yourself.
 18578  func NewDeleteRecordsResponseTopicPartition() DeleteRecordsResponseTopicPartition {
 18579  	var v DeleteRecordsResponseTopicPartition
 18580  	v.Default()
 18581  	return v
 18582  }
 18583  
 18584  type DeleteRecordsResponseTopic struct {
 18585  	// Topic is the topic this response corresponds to.
 18586  	Topic string
 18587  
 18588  	// Partitions contains responses for each partition in a requested topic
 18589  	// in the delete records request.
 18590  	Partitions []DeleteRecordsResponseTopicPartition
 18591  
 18592  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18593  	UnknownTags Tags // v2+
 18594  }
 18595  
 18596  // Default sets any default fields. Calling this allows for future compatibility
 18597  // if new fields are added to DeleteRecordsResponseTopic.
 18598  func (v *DeleteRecordsResponseTopic) Default() {
 18599  }
 18600  
 18601  // NewDeleteRecordsResponseTopic returns a default DeleteRecordsResponseTopic
 18602  // This is a shortcut for creating a struct and calling Default yourself.
 18603  func NewDeleteRecordsResponseTopic() DeleteRecordsResponseTopic {
 18604  	var v DeleteRecordsResponseTopic
 18605  	v.Default()
 18606  	return v
 18607  }
 18608  
 18609  // DeleteRecordsResponse is returned from a DeleteRecordsRequest.
 18610  type DeleteRecordsResponse struct {
 18611  	// Version is the version of this message used with a Kafka broker.
 18612  	Version int16
 18613  
 18614  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 18615  	// after this request.
 18616  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 18617  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 18618  	//
 18619  	// This request switched at version 1.
 18620  	ThrottleMillis int32
 18621  
 18622  	// Topics contains responses for each topic in the delete records request.
 18623  	Topics []DeleteRecordsResponseTopic
 18624  
 18625  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18626  	UnknownTags Tags // v2+
 18627  }
 18628  
 18629  func (*DeleteRecordsResponse) Key() int16                         { return 21 }
 18630  func (*DeleteRecordsResponse) MaxVersion() int16                  { return 2 }
 18631  func (v *DeleteRecordsResponse) SetVersion(version int16)         { v.Version = version }
 18632  func (v *DeleteRecordsResponse) GetVersion() int16                { return v.Version }
 18633  func (v *DeleteRecordsResponse) IsFlexible() bool                 { return v.Version >= 2 }
 18634  func (v *DeleteRecordsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 18635  func (v *DeleteRecordsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 18636  func (v *DeleteRecordsResponse) RequestKind() Request {
 18637  	return &DeleteRecordsRequest{Version: v.Version}
 18638  }
 18639  
 18640  func (v *DeleteRecordsResponse) AppendTo(dst []byte) []byte {
 18641  	version := v.Version
 18642  	_ = version
 18643  	isFlexible := version >= 2
 18644  	_ = isFlexible
 18645  	{
 18646  		v := v.ThrottleMillis
 18647  		dst = kbin.AppendInt32(dst, v)
 18648  	}
 18649  	{
 18650  		v := v.Topics
 18651  		if isFlexible {
 18652  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 18653  		} else {
 18654  			dst = kbin.AppendArrayLen(dst, len(v))
 18655  		}
 18656  		for i := range v {
 18657  			v := &v[i]
 18658  			{
 18659  				v := v.Topic
 18660  				if isFlexible {
 18661  					dst = kbin.AppendCompactString(dst, v)
 18662  				} else {
 18663  					dst = kbin.AppendString(dst, v)
 18664  				}
 18665  			}
 18666  			{
 18667  				v := v.Partitions
 18668  				if isFlexible {
 18669  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 18670  				} else {
 18671  					dst = kbin.AppendArrayLen(dst, len(v))
 18672  				}
 18673  				for i := range v {
 18674  					v := &v[i]
 18675  					{
 18676  						v := v.Partition
 18677  						dst = kbin.AppendInt32(dst, v)
 18678  					}
 18679  					{
 18680  						v := v.LowWatermark
 18681  						dst = kbin.AppendInt64(dst, v)
 18682  					}
 18683  					{
 18684  						v := v.ErrorCode
 18685  						dst = kbin.AppendInt16(dst, v)
 18686  					}
 18687  					if isFlexible {
 18688  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18689  						dst = v.UnknownTags.AppendEach(dst)
 18690  					}
 18691  				}
 18692  			}
 18693  			if isFlexible {
 18694  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18695  				dst = v.UnknownTags.AppendEach(dst)
 18696  			}
 18697  		}
 18698  	}
 18699  	if isFlexible {
 18700  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18701  		dst = v.UnknownTags.AppendEach(dst)
 18702  	}
 18703  	return dst
 18704  }
 18705  
 18706  func (v *DeleteRecordsResponse) ReadFrom(src []byte) error {
 18707  	return v.readFrom(src, false)
 18708  }
 18709  
 18710  func (v *DeleteRecordsResponse) UnsafeReadFrom(src []byte) error {
 18711  	return v.readFrom(src, true)
 18712  }
 18713  
 18714  func (v *DeleteRecordsResponse) readFrom(src []byte, unsafe bool) error {
 18715  	v.Default()
 18716  	b := kbin.Reader{Src: src}
 18717  	version := v.Version
 18718  	_ = version
 18719  	isFlexible := version >= 2
 18720  	_ = isFlexible
 18721  	s := v
 18722  	{
 18723  		v := b.Int32()
 18724  		s.ThrottleMillis = v
 18725  	}
 18726  	{
 18727  		v := s.Topics
 18728  		a := v
 18729  		var l int32
 18730  		if isFlexible {
 18731  			l = b.CompactArrayLen()
 18732  		} else {
 18733  			l = b.ArrayLen()
 18734  		}
 18735  		if !b.Ok() {
 18736  			return b.Complete()
 18737  		}
 18738  		a = a[:0]
 18739  		if l > 0 {
 18740  			a = append(a, make([]DeleteRecordsResponseTopic, l)...)
 18741  		}
 18742  		for i := int32(0); i < l; i++ {
 18743  			v := &a[i]
 18744  			v.Default()
 18745  			s := v
 18746  			{
 18747  				var v string
 18748  				if unsafe {
 18749  					if isFlexible {
 18750  						v = b.UnsafeCompactString()
 18751  					} else {
 18752  						v = b.UnsafeString()
 18753  					}
 18754  				} else {
 18755  					if isFlexible {
 18756  						v = b.CompactString()
 18757  					} else {
 18758  						v = b.String()
 18759  					}
 18760  				}
 18761  				s.Topic = v
 18762  			}
 18763  			{
 18764  				v := s.Partitions
 18765  				a := v
 18766  				var l int32
 18767  				if isFlexible {
 18768  					l = b.CompactArrayLen()
 18769  				} else {
 18770  					l = b.ArrayLen()
 18771  				}
 18772  				if !b.Ok() {
 18773  					return b.Complete()
 18774  				}
 18775  				a = a[:0]
 18776  				if l > 0 {
 18777  					a = append(a, make([]DeleteRecordsResponseTopicPartition, l)...)
 18778  				}
 18779  				for i := int32(0); i < l; i++ {
 18780  					v := &a[i]
 18781  					v.Default()
 18782  					s := v
 18783  					{
 18784  						v := b.Int32()
 18785  						s.Partition = v
 18786  					}
 18787  					{
 18788  						v := b.Int64()
 18789  						s.LowWatermark = v
 18790  					}
 18791  					{
 18792  						v := b.Int16()
 18793  						s.ErrorCode = v
 18794  					}
 18795  					if isFlexible {
 18796  						s.UnknownTags = internalReadTags(&b)
 18797  					}
 18798  				}
 18799  				v = a
 18800  				s.Partitions = v
 18801  			}
 18802  			if isFlexible {
 18803  				s.UnknownTags = internalReadTags(&b)
 18804  			}
 18805  		}
 18806  		v = a
 18807  		s.Topics = v
 18808  	}
 18809  	if isFlexible {
 18810  		s.UnknownTags = internalReadTags(&b)
 18811  	}
 18812  	return b.Complete()
 18813  }
 18814  
 18815  // NewPtrDeleteRecordsResponse returns a pointer to a default DeleteRecordsResponse
 18816  // This is a shortcut for creating a new(struct) and calling Default yourself.
 18817  func NewPtrDeleteRecordsResponse() *DeleteRecordsResponse {
 18818  	var v DeleteRecordsResponse
 18819  	v.Default()
 18820  	return &v
 18821  }
 18822  
 18823  // Default sets any default fields. Calling this allows for future compatibility
 18824  // if new fields are added to DeleteRecordsResponse.
 18825  func (v *DeleteRecordsResponse) Default() {
 18826  }
 18827  
 18828  // NewDeleteRecordsResponse returns a default DeleteRecordsResponse
 18829  // This is a shortcut for creating a struct and calling Default yourself.
 18830  func NewDeleteRecordsResponse() DeleteRecordsResponse {
 18831  	var v DeleteRecordsResponse
 18832  	v.Default()
 18833  	return v
 18834  }
 18835  
 18836  // InitProducerIDRequest initializes a producer ID for idempotent transactions,
 18837  // and if using transactions, a producer epoch. This is the first request
 18838  // necessary to begin idempotent producing or transactions.
 18839  //
 18840  // Note that you do not need to go to a txn coordinator if you are initializing
 18841  // a producer id without a transactional id.
 18842  type InitProducerIDRequest struct {
 18843  	// Version is the version of this message used with a Kafka broker.
 18844  	Version int16
 18845  
 18846  	// TransactionalID is the ID to use for transactions if using transactions.
 18847  	TransactionalID *string
 18848  
 18849  	// TransactionTimeoutMillis is how long a transaction is allowed before
 18850  	// EndTxn is required.
 18851  	//
 18852  	// Note that this timeout only begins on the first AddPartitionsToTxn
 18853  	// request.
 18854  	TransactionTimeoutMillis int32
 18855  
 18856  	// ProducerID, added for KIP-360, is the current producer ID. This allows
 18857  	// the client to potentially recover on UNKNOWN_PRODUCER_ID errors.
 18858  	//
 18859  	// This field has a default of -1.
 18860  	ProducerID int64 // v3+
 18861  
 18862  	// The producer's current epoch. This will be checked against the producer
 18863  	// epoch on the broker, and the request will return an error if they do not
 18864  	// match. Also added for KIP-360.
 18865  	//
 18866  	// This field has a default of -1.
 18867  	ProducerEpoch int16 // v3+
 18868  
 18869  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 18870  	UnknownTags Tags // v2+
 18871  }
 18872  
 18873  func (*InitProducerIDRequest) Key() int16                 { return 22 }
 18874  func (*InitProducerIDRequest) MaxVersion() int16          { return 4 }
 18875  func (v *InitProducerIDRequest) SetVersion(version int16) { v.Version = version }
 18876  func (v *InitProducerIDRequest) GetVersion() int16        { return v.Version }
 18877  func (v *InitProducerIDRequest) IsFlexible() bool         { return v.Version >= 2 }
 18878  func (v *InitProducerIDRequest) IsTxnCoordinatorRequest() {}
 18879  func (v *InitProducerIDRequest) ResponseKind() Response {
 18880  	r := &InitProducerIDResponse{Version: v.Version}
 18881  	r.Default()
 18882  	return r
 18883  }
 18884  
 18885  // RequestWith is requests v on r and returns the response or an error.
 18886  // For sharded requests, the response may be merged and still return an error.
 18887  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 18888  func (v *InitProducerIDRequest) RequestWith(ctx context.Context, r Requestor) (*InitProducerIDResponse, error) {
 18889  	kresp, err := r.Request(ctx, v)
 18890  	resp, _ := kresp.(*InitProducerIDResponse)
 18891  	return resp, err
 18892  }
 18893  
 18894  func (v *InitProducerIDRequest) AppendTo(dst []byte) []byte {
 18895  	version := v.Version
 18896  	_ = version
 18897  	isFlexible := version >= 2
 18898  	_ = isFlexible
 18899  	{
 18900  		v := v.TransactionalID
 18901  		if isFlexible {
 18902  			dst = kbin.AppendCompactNullableString(dst, v)
 18903  		} else {
 18904  			dst = kbin.AppendNullableString(dst, v)
 18905  		}
 18906  	}
 18907  	{
 18908  		v := v.TransactionTimeoutMillis
 18909  		dst = kbin.AppendInt32(dst, v)
 18910  	}
 18911  	if version >= 3 {
 18912  		v := v.ProducerID
 18913  		dst = kbin.AppendInt64(dst, v)
 18914  	}
 18915  	if version >= 3 {
 18916  		v := v.ProducerEpoch
 18917  		dst = kbin.AppendInt16(dst, v)
 18918  	}
 18919  	if isFlexible {
 18920  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 18921  		dst = v.UnknownTags.AppendEach(dst)
 18922  	}
 18923  	return dst
 18924  }
 18925  
 18926  func (v *InitProducerIDRequest) ReadFrom(src []byte) error {
 18927  	return v.readFrom(src, false)
 18928  }
 18929  
 18930  func (v *InitProducerIDRequest) UnsafeReadFrom(src []byte) error {
 18931  	return v.readFrom(src, true)
 18932  }
 18933  
 18934  func (v *InitProducerIDRequest) readFrom(src []byte, unsafe bool) error {
 18935  	v.Default()
 18936  	b := kbin.Reader{Src: src}
 18937  	version := v.Version
 18938  	_ = version
 18939  	isFlexible := version >= 2
 18940  	_ = isFlexible
 18941  	s := v
 18942  	{
 18943  		var v *string
 18944  		if isFlexible {
 18945  			if unsafe {
 18946  				v = b.UnsafeCompactNullableString()
 18947  			} else {
 18948  				v = b.CompactNullableString()
 18949  			}
 18950  		} else {
 18951  			if unsafe {
 18952  				v = b.UnsafeNullableString()
 18953  			} else {
 18954  				v = b.NullableString()
 18955  			}
 18956  		}
 18957  		s.TransactionalID = v
 18958  	}
 18959  	{
 18960  		v := b.Int32()
 18961  		s.TransactionTimeoutMillis = v
 18962  	}
 18963  	if version >= 3 {
 18964  		v := b.Int64()
 18965  		s.ProducerID = v
 18966  	}
 18967  	if version >= 3 {
 18968  		v := b.Int16()
 18969  		s.ProducerEpoch = v
 18970  	}
 18971  	if isFlexible {
 18972  		s.UnknownTags = internalReadTags(&b)
 18973  	}
 18974  	return b.Complete()
 18975  }
 18976  
 18977  // NewPtrInitProducerIDRequest returns a pointer to a default InitProducerIDRequest
 18978  // This is a shortcut for creating a new(struct) and calling Default yourself.
 18979  func NewPtrInitProducerIDRequest() *InitProducerIDRequest {
 18980  	var v InitProducerIDRequest
 18981  	v.Default()
 18982  	return &v
 18983  }
 18984  
 18985  // Default sets any default fields. Calling this allows for future compatibility
 18986  // if new fields are added to InitProducerIDRequest.
 18987  func (v *InitProducerIDRequest) Default() {
 18988  	v.ProducerID = -1
 18989  	v.ProducerEpoch = -1
 18990  }
 18991  
 18992  // NewInitProducerIDRequest returns a default InitProducerIDRequest
 18993  // This is a shortcut for creating a struct and calling Default yourself.
 18994  func NewInitProducerIDRequest() InitProducerIDRequest {
 18995  	var v InitProducerIDRequest
 18996  	v.Default()
 18997  	return v
 18998  }
 18999  
 19000  // InitProducerIDResponse is returned for an InitProducerIDRequest.
 19001  type InitProducerIDResponse struct {
 19002  	// Version is the version of this message used with a Kafka broker.
 19003  	Version int16
 19004  
 19005  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 19006  	// after this request.
 19007  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 19008  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 19009  	//
 19010  	// This request switched at version 1.
 19011  	ThrottleMillis int32
 19012  
 19013  	// CLUSTER_AUTHORIZATION_FAILED is returned when not using transactions if
 19014  	// the client is not authorized for idempotent_write on cluster.
 19015  	//
 19016  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned when using transactions
 19017  	// if the client is not authorized to write on transactional_id.
 19018  	//
 19019  	// INVALID_REQUEST is returned if using transactions and the transactional id
 19020  	// is an empty, non-null string
 19021  	//
 19022  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the coordinator for this
 19023  	// transactional ID is still loading.
 19024  	//
 19025  	// NOT_COORDINATOR is returned if the broker is not the coordinator for
 19026  	// this transactional ID.
 19027  	//
 19028  	// INVALID_TRANSACTION_TIMEOUT is returned if using transactions and the timeout
 19029  	// is equal to over over transaction.max.timeout.ms or under 0.
 19030  	//
 19031  	// CONCURRENT_TRANSACTIONS is returned if there is an ongoing transaction
 19032  	// that is completing at the time this init is called.
 19033  	ErrorCode int16
 19034  
 19035  	// ProducerID is the next producer ID that Kafka generated. This ID is used
 19036  	// to ensure repeated produce requests do not result in duplicate records.
 19037  	//
 19038  	// This field has a default of -1.
 19039  	ProducerID int64
 19040  
 19041  	// ProducerEpoch is the producer epoch to use for transactions.
 19042  	ProducerEpoch int16
 19043  
 19044  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19045  	UnknownTags Tags // v2+
 19046  }
 19047  
 19048  func (*InitProducerIDResponse) Key() int16                         { return 22 }
 19049  func (*InitProducerIDResponse) MaxVersion() int16                  { return 4 }
 19050  func (v *InitProducerIDResponse) SetVersion(version int16)         { v.Version = version }
 19051  func (v *InitProducerIDResponse) GetVersion() int16                { return v.Version }
 19052  func (v *InitProducerIDResponse) IsFlexible() bool                 { return v.Version >= 2 }
 19053  func (v *InitProducerIDResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 19054  func (v *InitProducerIDResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 19055  func (v *InitProducerIDResponse) RequestKind() Request {
 19056  	return &InitProducerIDRequest{Version: v.Version}
 19057  }
 19058  
 19059  func (v *InitProducerIDResponse) AppendTo(dst []byte) []byte {
 19060  	version := v.Version
 19061  	_ = version
 19062  	isFlexible := version >= 2
 19063  	_ = isFlexible
 19064  	{
 19065  		v := v.ThrottleMillis
 19066  		dst = kbin.AppendInt32(dst, v)
 19067  	}
 19068  	{
 19069  		v := v.ErrorCode
 19070  		dst = kbin.AppendInt16(dst, v)
 19071  	}
 19072  	{
 19073  		v := v.ProducerID
 19074  		dst = kbin.AppendInt64(dst, v)
 19075  	}
 19076  	{
 19077  		v := v.ProducerEpoch
 19078  		dst = kbin.AppendInt16(dst, v)
 19079  	}
 19080  	if isFlexible {
 19081  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19082  		dst = v.UnknownTags.AppendEach(dst)
 19083  	}
 19084  	return dst
 19085  }
 19086  
 19087  func (v *InitProducerIDResponse) ReadFrom(src []byte) error {
 19088  	return v.readFrom(src, false)
 19089  }
 19090  
 19091  func (v *InitProducerIDResponse) UnsafeReadFrom(src []byte) error {
 19092  	return v.readFrom(src, true)
 19093  }
 19094  
 19095  func (v *InitProducerIDResponse) readFrom(src []byte, unsafe bool) error {
 19096  	v.Default()
 19097  	b := kbin.Reader{Src: src}
 19098  	version := v.Version
 19099  	_ = version
 19100  	isFlexible := version >= 2
 19101  	_ = isFlexible
 19102  	s := v
 19103  	{
 19104  		v := b.Int32()
 19105  		s.ThrottleMillis = v
 19106  	}
 19107  	{
 19108  		v := b.Int16()
 19109  		s.ErrorCode = v
 19110  	}
 19111  	{
 19112  		v := b.Int64()
 19113  		s.ProducerID = v
 19114  	}
 19115  	{
 19116  		v := b.Int16()
 19117  		s.ProducerEpoch = v
 19118  	}
 19119  	if isFlexible {
 19120  		s.UnknownTags = internalReadTags(&b)
 19121  	}
 19122  	return b.Complete()
 19123  }
 19124  
 19125  // NewPtrInitProducerIDResponse returns a pointer to a default InitProducerIDResponse
 19126  // This is a shortcut for creating a new(struct) and calling Default yourself.
 19127  func NewPtrInitProducerIDResponse() *InitProducerIDResponse {
 19128  	var v InitProducerIDResponse
 19129  	v.Default()
 19130  	return &v
 19131  }
 19132  
 19133  // Default sets any default fields. Calling this allows for future compatibility
 19134  // if new fields are added to InitProducerIDResponse.
 19135  func (v *InitProducerIDResponse) Default() {
 19136  	v.ProducerID = -1
 19137  }
 19138  
 19139  // NewInitProducerIDResponse returns a default InitProducerIDResponse
 19140  // This is a shortcut for creating a struct and calling Default yourself.
 19141  func NewInitProducerIDResponse() InitProducerIDResponse {
 19142  	var v InitProducerIDResponse
 19143  	v.Default()
 19144  	return v
 19145  }
 19146  
 19147  type OffsetForLeaderEpochRequestTopicPartition struct {
 19148  	// Partition is the number of a partition.
 19149  	Partition int32
 19150  
 19151  	// CurrentLeaderEpoch, proposed in KIP-320 and introduced in Kafka 2.1.0,
 19152  	// allows brokers to check if the client is fenced (has an out of date
 19153  	// leader) or if the client is ahead of the broker.
 19154  	//
 19155  	// The initial leader epoch can be determined from a MetadataResponse.
 19156  	//
 19157  	// This field has a default of -1.
 19158  	CurrentLeaderEpoch int32 // v2+
 19159  
 19160  	// LeaderEpoch is the epoch to fetch the end offset for.
 19161  	LeaderEpoch int32
 19162  
 19163  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19164  	UnknownTags Tags // v4+
 19165  }
 19166  
 19167  // Default sets any default fields. Calling this allows for future compatibility
 19168  // if new fields are added to OffsetForLeaderEpochRequestTopicPartition.
 19169  func (v *OffsetForLeaderEpochRequestTopicPartition) Default() {
 19170  	v.CurrentLeaderEpoch = -1
 19171  }
 19172  
 19173  // NewOffsetForLeaderEpochRequestTopicPartition returns a default OffsetForLeaderEpochRequestTopicPartition
 19174  // This is a shortcut for creating a struct and calling Default yourself.
 19175  func NewOffsetForLeaderEpochRequestTopicPartition() OffsetForLeaderEpochRequestTopicPartition {
 19176  	var v OffsetForLeaderEpochRequestTopicPartition
 19177  	v.Default()
 19178  	return v
 19179  }
 19180  
 19181  type OffsetForLeaderEpochRequestTopic struct {
 19182  	// Topic is the name of a topic.
 19183  	Topic string
 19184  
 19185  	// Partitions are partitions within a topic to fetch leader epoch offsets for.
 19186  	Partitions []OffsetForLeaderEpochRequestTopicPartition
 19187  
 19188  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19189  	UnknownTags Tags // v4+
 19190  }
 19191  
 19192  // Default sets any default fields. Calling this allows for future compatibility
 19193  // if new fields are added to OffsetForLeaderEpochRequestTopic.
 19194  func (v *OffsetForLeaderEpochRequestTopic) Default() {
 19195  }
 19196  
 19197  // NewOffsetForLeaderEpochRequestTopic returns a default OffsetForLeaderEpochRequestTopic
 19198  // This is a shortcut for creating a struct and calling Default yourself.
 19199  func NewOffsetForLeaderEpochRequestTopic() OffsetForLeaderEpochRequestTopic {
 19200  	var v OffsetForLeaderEpochRequestTopic
 19201  	v.Default()
 19202  	return v
 19203  }
 19204  
 19205  // OffsetForLeaderEpochRequest requests log end offsets for partitions.
 19206  //
 19207  // Version 2, proposed in KIP-320 and introduced in Kafka 2.1.0, can be used by
 19208  // consumers to perform more accurate offset resetting in the case of data loss.
 19209  //
 19210  // In support of version 2, this requires DESCRIBE on TOPIC.
 19211  type OffsetForLeaderEpochRequest struct {
 19212  	// Version is the version of this message used with a Kafka broker.
 19213  	Version int16
 19214  
 19215  	// ReplicaID, added in support of KIP-392, is the broker ID of the follower,
 19216  	// or -1 if this request is from a consumer.
 19217  	//
 19218  	// This field has a default of -2.
 19219  	ReplicaID int32 // v3+
 19220  
 19221  	// Topics are topics to fetch leader epoch offsets for.
 19222  	Topics []OffsetForLeaderEpochRequestTopic
 19223  
 19224  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19225  	UnknownTags Tags // v4+
 19226  }
 19227  
 19228  func (*OffsetForLeaderEpochRequest) Key() int16                 { return 23 }
 19229  func (*OffsetForLeaderEpochRequest) MaxVersion() int16          { return 4 }
 19230  func (v *OffsetForLeaderEpochRequest) SetVersion(version int16) { v.Version = version }
 19231  func (v *OffsetForLeaderEpochRequest) GetVersion() int16        { return v.Version }
 19232  func (v *OffsetForLeaderEpochRequest) IsFlexible() bool         { return v.Version >= 4 }
 19233  func (v *OffsetForLeaderEpochRequest) ResponseKind() Response {
 19234  	r := &OffsetForLeaderEpochResponse{Version: v.Version}
 19235  	r.Default()
 19236  	return r
 19237  }
 19238  
 19239  // RequestWith is requests v on r and returns the response or an error.
 19240  // For sharded requests, the response may be merged and still return an error.
 19241  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 19242  func (v *OffsetForLeaderEpochRequest) RequestWith(ctx context.Context, r Requestor) (*OffsetForLeaderEpochResponse, error) {
 19243  	kresp, err := r.Request(ctx, v)
 19244  	resp, _ := kresp.(*OffsetForLeaderEpochResponse)
 19245  	return resp, err
 19246  }
 19247  
 19248  func (v *OffsetForLeaderEpochRequest) AppendTo(dst []byte) []byte {
 19249  	version := v.Version
 19250  	_ = version
 19251  	isFlexible := version >= 4
 19252  	_ = isFlexible
 19253  	if version >= 3 {
 19254  		v := v.ReplicaID
 19255  		dst = kbin.AppendInt32(dst, v)
 19256  	}
 19257  	{
 19258  		v := v.Topics
 19259  		if isFlexible {
 19260  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 19261  		} else {
 19262  			dst = kbin.AppendArrayLen(dst, len(v))
 19263  		}
 19264  		for i := range v {
 19265  			v := &v[i]
 19266  			{
 19267  				v := v.Topic
 19268  				if isFlexible {
 19269  					dst = kbin.AppendCompactString(dst, v)
 19270  				} else {
 19271  					dst = kbin.AppendString(dst, v)
 19272  				}
 19273  			}
 19274  			{
 19275  				v := v.Partitions
 19276  				if isFlexible {
 19277  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 19278  				} else {
 19279  					dst = kbin.AppendArrayLen(dst, len(v))
 19280  				}
 19281  				for i := range v {
 19282  					v := &v[i]
 19283  					{
 19284  						v := v.Partition
 19285  						dst = kbin.AppendInt32(dst, v)
 19286  					}
 19287  					if version >= 2 {
 19288  						v := v.CurrentLeaderEpoch
 19289  						dst = kbin.AppendInt32(dst, v)
 19290  					}
 19291  					{
 19292  						v := v.LeaderEpoch
 19293  						dst = kbin.AppendInt32(dst, v)
 19294  					}
 19295  					if isFlexible {
 19296  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19297  						dst = v.UnknownTags.AppendEach(dst)
 19298  					}
 19299  				}
 19300  			}
 19301  			if isFlexible {
 19302  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19303  				dst = v.UnknownTags.AppendEach(dst)
 19304  			}
 19305  		}
 19306  	}
 19307  	if isFlexible {
 19308  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19309  		dst = v.UnknownTags.AppendEach(dst)
 19310  	}
 19311  	return dst
 19312  }
 19313  
 19314  func (v *OffsetForLeaderEpochRequest) ReadFrom(src []byte) error {
 19315  	return v.readFrom(src, false)
 19316  }
 19317  
 19318  func (v *OffsetForLeaderEpochRequest) UnsafeReadFrom(src []byte) error {
 19319  	return v.readFrom(src, true)
 19320  }
 19321  
 19322  func (v *OffsetForLeaderEpochRequest) readFrom(src []byte, unsafe bool) error {
 19323  	v.Default()
 19324  	b := kbin.Reader{Src: src}
 19325  	version := v.Version
 19326  	_ = version
 19327  	isFlexible := version >= 4
 19328  	_ = isFlexible
 19329  	s := v
 19330  	if version >= 3 {
 19331  		v := b.Int32()
 19332  		s.ReplicaID = v
 19333  	}
 19334  	{
 19335  		v := s.Topics
 19336  		a := v
 19337  		var l int32
 19338  		if isFlexible {
 19339  			l = b.CompactArrayLen()
 19340  		} else {
 19341  			l = b.ArrayLen()
 19342  		}
 19343  		if !b.Ok() {
 19344  			return b.Complete()
 19345  		}
 19346  		a = a[:0]
 19347  		if l > 0 {
 19348  			a = append(a, make([]OffsetForLeaderEpochRequestTopic, l)...)
 19349  		}
 19350  		for i := int32(0); i < l; i++ {
 19351  			v := &a[i]
 19352  			v.Default()
 19353  			s := v
 19354  			{
 19355  				var v string
 19356  				if unsafe {
 19357  					if isFlexible {
 19358  						v = b.UnsafeCompactString()
 19359  					} else {
 19360  						v = b.UnsafeString()
 19361  					}
 19362  				} else {
 19363  					if isFlexible {
 19364  						v = b.CompactString()
 19365  					} else {
 19366  						v = b.String()
 19367  					}
 19368  				}
 19369  				s.Topic = v
 19370  			}
 19371  			{
 19372  				v := s.Partitions
 19373  				a := v
 19374  				var l int32
 19375  				if isFlexible {
 19376  					l = b.CompactArrayLen()
 19377  				} else {
 19378  					l = b.ArrayLen()
 19379  				}
 19380  				if !b.Ok() {
 19381  					return b.Complete()
 19382  				}
 19383  				a = a[:0]
 19384  				if l > 0 {
 19385  					a = append(a, make([]OffsetForLeaderEpochRequestTopicPartition, l)...)
 19386  				}
 19387  				for i := int32(0); i < l; i++ {
 19388  					v := &a[i]
 19389  					v.Default()
 19390  					s := v
 19391  					{
 19392  						v := b.Int32()
 19393  						s.Partition = v
 19394  					}
 19395  					if version >= 2 {
 19396  						v := b.Int32()
 19397  						s.CurrentLeaderEpoch = v
 19398  					}
 19399  					{
 19400  						v := b.Int32()
 19401  						s.LeaderEpoch = v
 19402  					}
 19403  					if isFlexible {
 19404  						s.UnknownTags = internalReadTags(&b)
 19405  					}
 19406  				}
 19407  				v = a
 19408  				s.Partitions = v
 19409  			}
 19410  			if isFlexible {
 19411  				s.UnknownTags = internalReadTags(&b)
 19412  			}
 19413  		}
 19414  		v = a
 19415  		s.Topics = v
 19416  	}
 19417  	if isFlexible {
 19418  		s.UnknownTags = internalReadTags(&b)
 19419  	}
 19420  	return b.Complete()
 19421  }
 19422  
 19423  // NewPtrOffsetForLeaderEpochRequest returns a pointer to a default OffsetForLeaderEpochRequest
 19424  // This is a shortcut for creating a new(struct) and calling Default yourself.
 19425  func NewPtrOffsetForLeaderEpochRequest() *OffsetForLeaderEpochRequest {
 19426  	var v OffsetForLeaderEpochRequest
 19427  	v.Default()
 19428  	return &v
 19429  }
 19430  
 19431  // Default sets any default fields. Calling this allows for future compatibility
 19432  // if new fields are added to OffsetForLeaderEpochRequest.
 19433  func (v *OffsetForLeaderEpochRequest) Default() {
 19434  	v.ReplicaID = -2
 19435  }
 19436  
 19437  // NewOffsetForLeaderEpochRequest returns a default OffsetForLeaderEpochRequest
 19438  // This is a shortcut for creating a struct and calling Default yourself.
 19439  func NewOffsetForLeaderEpochRequest() OffsetForLeaderEpochRequest {
 19440  	var v OffsetForLeaderEpochRequest
 19441  	v.Default()
 19442  	return v
 19443  }
 19444  
 19445  type OffsetForLeaderEpochResponseTopicPartition struct {
 19446  	// ErrorCode is the error code returned on request failure.
 19447  	//
 19448  	// TOPIC_AUTHORIZATION_FAILED is returned if the client does not have
 19449  	// the necessary permissions to issue this request.
 19450  	//
 19451  	// KAFKA_STORAGE_ERROR is returned if the partition is offline.
 19452  	//
 19453  	// NOT_LEADER_FOR_PARTITION is returned if the broker knows of the partition
 19454  	// but does not own it.
 19455  	//
 19456  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of the
 19457  	// partition.
 19458  	//
 19459  	// FENCED_LEADER_EPOCH is returned if the client is using a current leader epoch
 19460  	// older than the actual leader epoch.
 19461  	//
 19462  	// UNKNOWN_LEADER_EPOCH if returned if the client is using a current leader epoch
 19463  	// that the actual leader does not know of. This could occur when the client
 19464  	// has newer metadata than the broker when the broker just became the leader for
 19465  	// a replica.
 19466  	ErrorCode int16
 19467  
 19468  	// Partition is the partition this response is for.
 19469  	Partition int32
 19470  
 19471  	// LeaderEpoch is similar to the requested leader epoch, but pairs with the
 19472  	// next field. If the requested leader epoch is unknown, this is -1. If the
 19473  	// requested epoch had no records produced during the requested epoch, this
 19474  	// is the first prior epoch that had records.
 19475  	//
 19476  	// This field has a default of -1.
 19477  	LeaderEpoch int32 // v1+
 19478  
 19479  	// EndOffset is either (1) just past the last recorded offset in the
 19480  	// current partition if the broker leader has the same epoch as the
 19481  	// leader epoch in the request, or (2) the beginning offset of the next
 19482  	// epoch if the leader is past the requested epoch. The second scenario
 19483  	// can be seen as equivalent to the first: the beginning offset of the
 19484  	// next epoch is just past the final offset of the prior epoch.
 19485  	//
 19486  	// (2) allows consumers to detect data loss: if the consumer consumed
 19487  	// past the end offset that is returned, then the consumer should reset
 19488  	// to the returned offset and the consumer knows everything past the end
 19489  	// offset was lost.
 19490  	//
 19491  	// With the prior field, consumers know that at this offset, the broker
 19492  	// either has no more records (consumer is caught up), or the broker
 19493  	// transitioned to a new epoch.
 19494  	//
 19495  	// This field has a default of -1.
 19496  	EndOffset int64
 19497  
 19498  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19499  	UnknownTags Tags // v4+
 19500  }
 19501  
 19502  // Default sets any default fields. Calling this allows for future compatibility
 19503  // if new fields are added to OffsetForLeaderEpochResponseTopicPartition.
 19504  func (v *OffsetForLeaderEpochResponseTopicPartition) Default() {
 19505  	v.LeaderEpoch = -1
 19506  	v.EndOffset = -1
 19507  }
 19508  
 19509  // NewOffsetForLeaderEpochResponseTopicPartition returns a default OffsetForLeaderEpochResponseTopicPartition
 19510  // This is a shortcut for creating a struct and calling Default yourself.
 19511  func NewOffsetForLeaderEpochResponseTopicPartition() OffsetForLeaderEpochResponseTopicPartition {
 19512  	var v OffsetForLeaderEpochResponseTopicPartition
 19513  	v.Default()
 19514  	return v
 19515  }
 19516  
 19517  type OffsetForLeaderEpochResponseTopic struct {
 19518  	// Topic is the topic this response corresponds to.
 19519  	Topic string
 19520  
 19521  	// Partitions are responses to partitions in a topic in the request.
 19522  	Partitions []OffsetForLeaderEpochResponseTopicPartition
 19523  
 19524  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19525  	UnknownTags Tags // v4+
 19526  }
 19527  
 19528  // Default sets any default fields. Calling this allows for future compatibility
 19529  // if new fields are added to OffsetForLeaderEpochResponseTopic.
 19530  func (v *OffsetForLeaderEpochResponseTopic) Default() {
 19531  }
 19532  
 19533  // NewOffsetForLeaderEpochResponseTopic returns a default OffsetForLeaderEpochResponseTopic
 19534  // This is a shortcut for creating a struct and calling Default yourself.
 19535  func NewOffsetForLeaderEpochResponseTopic() OffsetForLeaderEpochResponseTopic {
 19536  	var v OffsetForLeaderEpochResponseTopic
 19537  	v.Default()
 19538  	return v
 19539  }
 19540  
 19541  // OffsetForLeaderEpochResponse is returned from an OffsetForLeaderEpochRequest.
 19542  type OffsetForLeaderEpochResponse struct {
 19543  	// Version is the version of this message used with a Kafka broker.
 19544  	Version int16
 19545  
 19546  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 19547  	// after responding to this request.
 19548  	ThrottleMillis int32 // v2+
 19549  
 19550  	// Topics are responses to topics in the request.
 19551  	Topics []OffsetForLeaderEpochResponseTopic
 19552  
 19553  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19554  	UnknownTags Tags // v4+
 19555  }
 19556  
 19557  func (*OffsetForLeaderEpochResponse) Key() int16                 { return 23 }
 19558  func (*OffsetForLeaderEpochResponse) MaxVersion() int16          { return 4 }
 19559  func (v *OffsetForLeaderEpochResponse) SetVersion(version int16) { v.Version = version }
 19560  func (v *OffsetForLeaderEpochResponse) GetVersion() int16        { return v.Version }
 19561  func (v *OffsetForLeaderEpochResponse) IsFlexible() bool         { return v.Version >= 4 }
 19562  func (v *OffsetForLeaderEpochResponse) Throttle() (int32, bool) {
 19563  	return v.ThrottleMillis, v.Version >= 0
 19564  }
 19565  
 19566  func (v *OffsetForLeaderEpochResponse) SetThrottle(throttleMillis int32) {
 19567  	v.ThrottleMillis = throttleMillis
 19568  }
 19569  
 19570  func (v *OffsetForLeaderEpochResponse) RequestKind() Request {
 19571  	return &OffsetForLeaderEpochRequest{Version: v.Version}
 19572  }
 19573  
 19574  func (v *OffsetForLeaderEpochResponse) AppendTo(dst []byte) []byte {
 19575  	version := v.Version
 19576  	_ = version
 19577  	isFlexible := version >= 4
 19578  	_ = isFlexible
 19579  	if version >= 2 {
 19580  		v := v.ThrottleMillis
 19581  		dst = kbin.AppendInt32(dst, v)
 19582  	}
 19583  	{
 19584  		v := v.Topics
 19585  		if isFlexible {
 19586  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 19587  		} else {
 19588  			dst = kbin.AppendArrayLen(dst, len(v))
 19589  		}
 19590  		for i := range v {
 19591  			v := &v[i]
 19592  			{
 19593  				v := v.Topic
 19594  				if isFlexible {
 19595  					dst = kbin.AppendCompactString(dst, v)
 19596  				} else {
 19597  					dst = kbin.AppendString(dst, v)
 19598  				}
 19599  			}
 19600  			{
 19601  				v := v.Partitions
 19602  				if isFlexible {
 19603  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 19604  				} else {
 19605  					dst = kbin.AppendArrayLen(dst, len(v))
 19606  				}
 19607  				for i := range v {
 19608  					v := &v[i]
 19609  					{
 19610  						v := v.ErrorCode
 19611  						dst = kbin.AppendInt16(dst, v)
 19612  					}
 19613  					{
 19614  						v := v.Partition
 19615  						dst = kbin.AppendInt32(dst, v)
 19616  					}
 19617  					if version >= 1 {
 19618  						v := v.LeaderEpoch
 19619  						dst = kbin.AppendInt32(dst, v)
 19620  					}
 19621  					{
 19622  						v := v.EndOffset
 19623  						dst = kbin.AppendInt64(dst, v)
 19624  					}
 19625  					if isFlexible {
 19626  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19627  						dst = v.UnknownTags.AppendEach(dst)
 19628  					}
 19629  				}
 19630  			}
 19631  			if isFlexible {
 19632  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19633  				dst = v.UnknownTags.AppendEach(dst)
 19634  			}
 19635  		}
 19636  	}
 19637  	if isFlexible {
 19638  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19639  		dst = v.UnknownTags.AppendEach(dst)
 19640  	}
 19641  	return dst
 19642  }
 19643  
 19644  func (v *OffsetForLeaderEpochResponse) ReadFrom(src []byte) error {
 19645  	return v.readFrom(src, false)
 19646  }
 19647  
 19648  func (v *OffsetForLeaderEpochResponse) UnsafeReadFrom(src []byte) error {
 19649  	return v.readFrom(src, true)
 19650  }
 19651  
 19652  func (v *OffsetForLeaderEpochResponse) readFrom(src []byte, unsafe bool) error {
 19653  	v.Default()
 19654  	b := kbin.Reader{Src: src}
 19655  	version := v.Version
 19656  	_ = version
 19657  	isFlexible := version >= 4
 19658  	_ = isFlexible
 19659  	s := v
 19660  	if version >= 2 {
 19661  		v := b.Int32()
 19662  		s.ThrottleMillis = v
 19663  	}
 19664  	{
 19665  		v := s.Topics
 19666  		a := v
 19667  		var l int32
 19668  		if isFlexible {
 19669  			l = b.CompactArrayLen()
 19670  		} else {
 19671  			l = b.ArrayLen()
 19672  		}
 19673  		if !b.Ok() {
 19674  			return b.Complete()
 19675  		}
 19676  		a = a[:0]
 19677  		if l > 0 {
 19678  			a = append(a, make([]OffsetForLeaderEpochResponseTopic, l)...)
 19679  		}
 19680  		for i := int32(0); i < l; i++ {
 19681  			v := &a[i]
 19682  			v.Default()
 19683  			s := v
 19684  			{
 19685  				var v string
 19686  				if unsafe {
 19687  					if isFlexible {
 19688  						v = b.UnsafeCompactString()
 19689  					} else {
 19690  						v = b.UnsafeString()
 19691  					}
 19692  				} else {
 19693  					if isFlexible {
 19694  						v = b.CompactString()
 19695  					} else {
 19696  						v = b.String()
 19697  					}
 19698  				}
 19699  				s.Topic = v
 19700  			}
 19701  			{
 19702  				v := s.Partitions
 19703  				a := v
 19704  				var l int32
 19705  				if isFlexible {
 19706  					l = b.CompactArrayLen()
 19707  				} else {
 19708  					l = b.ArrayLen()
 19709  				}
 19710  				if !b.Ok() {
 19711  					return b.Complete()
 19712  				}
 19713  				a = a[:0]
 19714  				if l > 0 {
 19715  					a = append(a, make([]OffsetForLeaderEpochResponseTopicPartition, l)...)
 19716  				}
 19717  				for i := int32(0); i < l; i++ {
 19718  					v := &a[i]
 19719  					v.Default()
 19720  					s := v
 19721  					{
 19722  						v := b.Int16()
 19723  						s.ErrorCode = v
 19724  					}
 19725  					{
 19726  						v := b.Int32()
 19727  						s.Partition = v
 19728  					}
 19729  					if version >= 1 {
 19730  						v := b.Int32()
 19731  						s.LeaderEpoch = v
 19732  					}
 19733  					{
 19734  						v := b.Int64()
 19735  						s.EndOffset = v
 19736  					}
 19737  					if isFlexible {
 19738  						s.UnknownTags = internalReadTags(&b)
 19739  					}
 19740  				}
 19741  				v = a
 19742  				s.Partitions = v
 19743  			}
 19744  			if isFlexible {
 19745  				s.UnknownTags = internalReadTags(&b)
 19746  			}
 19747  		}
 19748  		v = a
 19749  		s.Topics = v
 19750  	}
 19751  	if isFlexible {
 19752  		s.UnknownTags = internalReadTags(&b)
 19753  	}
 19754  	return b.Complete()
 19755  }
 19756  
 19757  // NewPtrOffsetForLeaderEpochResponse returns a pointer to a default OffsetForLeaderEpochResponse
 19758  // This is a shortcut for creating a new(struct) and calling Default yourself.
 19759  func NewPtrOffsetForLeaderEpochResponse() *OffsetForLeaderEpochResponse {
 19760  	var v OffsetForLeaderEpochResponse
 19761  	v.Default()
 19762  	return &v
 19763  }
 19764  
 19765  // Default sets any default fields. Calling this allows for future compatibility
 19766  // if new fields are added to OffsetForLeaderEpochResponse.
 19767  func (v *OffsetForLeaderEpochResponse) Default() {
 19768  }
 19769  
 19770  // NewOffsetForLeaderEpochResponse returns a default OffsetForLeaderEpochResponse
 19771  // This is a shortcut for creating a struct and calling Default yourself.
 19772  func NewOffsetForLeaderEpochResponse() OffsetForLeaderEpochResponse {
 19773  	var v OffsetForLeaderEpochResponse
 19774  	v.Default()
 19775  	return v
 19776  }
 19777  
 19778  type AddPartitionsToTxnRequestTopic struct {
 19779  	// Topic is a topic name.
 19780  	Topic string
 19781  
 19782  	// Partitions are partitions within a topic to add as part of the producer
 19783  	// side of a transaction.
 19784  	Partitions []int32
 19785  
 19786  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19787  	UnknownTags Tags // v3+
 19788  }
 19789  
 19790  // Default sets any default fields. Calling this allows for future compatibility
 19791  // if new fields are added to AddPartitionsToTxnRequestTopic.
 19792  func (v *AddPartitionsToTxnRequestTopic) Default() {
 19793  }
 19794  
 19795  // NewAddPartitionsToTxnRequestTopic returns a default AddPartitionsToTxnRequestTopic
 19796  // This is a shortcut for creating a struct and calling Default yourself.
 19797  func NewAddPartitionsToTxnRequestTopic() AddPartitionsToTxnRequestTopic {
 19798  	var v AddPartitionsToTxnRequestTopic
 19799  	v.Default()
 19800  	return v
 19801  }
 19802  
 19803  type AddPartitionsToTxnRequestTransactionTopic struct {
 19804  	Topic string
 19805  
 19806  	Partitions []int32
 19807  
 19808  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19809  	UnknownTags Tags // v3+
 19810  }
 19811  
 19812  // Default sets any default fields. Calling this allows for future compatibility
 19813  // if new fields are added to AddPartitionsToTxnRequestTransactionTopic.
 19814  func (v *AddPartitionsToTxnRequestTransactionTopic) Default() {
 19815  }
 19816  
 19817  // NewAddPartitionsToTxnRequestTransactionTopic returns a default AddPartitionsToTxnRequestTransactionTopic
 19818  // This is a shortcut for creating a struct and calling Default yourself.
 19819  func NewAddPartitionsToTxnRequestTransactionTopic() AddPartitionsToTxnRequestTransactionTopic {
 19820  	var v AddPartitionsToTxnRequestTransactionTopic
 19821  	v.Default()
 19822  	return v
 19823  }
 19824  
 19825  type AddPartitionsToTxnRequestTransaction struct {
 19826  	TransactionalID string
 19827  
 19828  	ProducerID int64
 19829  
 19830  	ProducerEpoch int16
 19831  
 19832  	// VerifyOnly signifies if we want to check if the partition is in the
 19833  	// transaction rather than add it.
 19834  	VerifyOnly bool
 19835  
 19836  	Topics []AddPartitionsToTxnRequestTransactionTopic
 19837  
 19838  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19839  	UnknownTags Tags // v3+
 19840  }
 19841  
 19842  // Default sets any default fields. Calling this allows for future compatibility
 19843  // if new fields are added to AddPartitionsToTxnRequestTransaction.
 19844  func (v *AddPartitionsToTxnRequestTransaction) Default() {
 19845  }
 19846  
 19847  // NewAddPartitionsToTxnRequestTransaction returns a default AddPartitionsToTxnRequestTransaction
 19848  // This is a shortcut for creating a struct and calling Default yourself.
 19849  func NewAddPartitionsToTxnRequestTransaction() AddPartitionsToTxnRequestTransaction {
 19850  	var v AddPartitionsToTxnRequestTransaction
 19851  	v.Default()
 19852  	return v
 19853  }
 19854  
 19855  // AddPartitionsToTxnRequest begins the producer side of a transaction for all
 19856  // partitions in the request. Before producing any records to a partition in
 19857  // the transaction, that partition must have been added to the transaction with
 19858  // this request.
 19859  //
 19860  // Versions 3 and below are exclusively used by clients and versions 4 and
 19861  // above are used by brokers.
 19862  //
 19863  // Version 4 adds VerifyOnly field to check if partitions are already in
 19864  // transaction and adds support to batch multiple transactions.
 19865  type AddPartitionsToTxnRequest struct {
 19866  	// Version is the version of this message used with a Kafka broker.
 19867  	Version int16
 19868  
 19869  	// TransactionalID is the transactional ID to use for this request.
 19870  	TransactionalID string // v0-v3
 19871  
 19872  	// ProducerID is the producer ID of the client for this transactional ID
 19873  	// as received from InitProducerID.
 19874  	ProducerID int64 // v0-v3
 19875  
 19876  	// ProducerEpoch is the producer epoch of the client for this transactional ID
 19877  	// as received from InitProducerID.
 19878  	ProducerEpoch int16 // v0-v3
 19879  
 19880  	// Topics are topics to add as part of the producer side of a transaction.
 19881  	Topics []AddPartitionsToTxnRequestTopic // v0-v3
 19882  
 19883  	// The list of transactions to add partitions to, for v4+, for brokers only.
 19884  	// The fields in this are batch broker requests that duplicate the above fields
 19885  	// and thus are undocumented (except VerifyOnly, which is new).
 19886  	Transactions []AddPartitionsToTxnRequestTransaction // v4+
 19887  
 19888  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 19889  	UnknownTags Tags // v3+
 19890  }
 19891  
 19892  func (*AddPartitionsToTxnRequest) Key() int16                 { return 24 }
 19893  func (*AddPartitionsToTxnRequest) MaxVersion() int16          { return 4 }
 19894  func (v *AddPartitionsToTxnRequest) SetVersion(version int16) { v.Version = version }
 19895  func (v *AddPartitionsToTxnRequest) GetVersion() int16        { return v.Version }
 19896  func (v *AddPartitionsToTxnRequest) IsFlexible() bool         { return v.Version >= 3 }
 19897  func (v *AddPartitionsToTxnRequest) IsTxnCoordinatorRequest() {}
 19898  func (v *AddPartitionsToTxnRequest) ResponseKind() Response {
 19899  	r := &AddPartitionsToTxnResponse{Version: v.Version}
 19900  	r.Default()
 19901  	return r
 19902  }
 19903  
 19904  // RequestWith is requests v on r and returns the response or an error.
 19905  // For sharded requests, the response may be merged and still return an error.
 19906  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 19907  func (v *AddPartitionsToTxnRequest) RequestWith(ctx context.Context, r Requestor) (*AddPartitionsToTxnResponse, error) {
 19908  	kresp, err := r.Request(ctx, v)
 19909  	resp, _ := kresp.(*AddPartitionsToTxnResponse)
 19910  	return resp, err
 19911  }
 19912  
 19913  func (v *AddPartitionsToTxnRequest) AppendTo(dst []byte) []byte {
 19914  	version := v.Version
 19915  	_ = version
 19916  	isFlexible := version >= 3
 19917  	_ = isFlexible
 19918  	if version >= 0 && version <= 3 {
 19919  		v := v.TransactionalID
 19920  		if isFlexible {
 19921  			dst = kbin.AppendCompactString(dst, v)
 19922  		} else {
 19923  			dst = kbin.AppendString(dst, v)
 19924  		}
 19925  	}
 19926  	if version >= 0 && version <= 3 {
 19927  		v := v.ProducerID
 19928  		dst = kbin.AppendInt64(dst, v)
 19929  	}
 19930  	if version >= 0 && version <= 3 {
 19931  		v := v.ProducerEpoch
 19932  		dst = kbin.AppendInt16(dst, v)
 19933  	}
 19934  	if version >= 0 && version <= 3 {
 19935  		v := v.Topics
 19936  		if isFlexible {
 19937  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 19938  		} else {
 19939  			dst = kbin.AppendArrayLen(dst, len(v))
 19940  		}
 19941  		for i := range v {
 19942  			v := &v[i]
 19943  			{
 19944  				v := v.Topic
 19945  				if isFlexible {
 19946  					dst = kbin.AppendCompactString(dst, v)
 19947  				} else {
 19948  					dst = kbin.AppendString(dst, v)
 19949  				}
 19950  			}
 19951  			{
 19952  				v := v.Partitions
 19953  				if isFlexible {
 19954  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 19955  				} else {
 19956  					dst = kbin.AppendArrayLen(dst, len(v))
 19957  				}
 19958  				for i := range v {
 19959  					v := v[i]
 19960  					dst = kbin.AppendInt32(dst, v)
 19961  				}
 19962  			}
 19963  			if isFlexible {
 19964  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 19965  				dst = v.UnknownTags.AppendEach(dst)
 19966  			}
 19967  		}
 19968  	}
 19969  	if version >= 4 {
 19970  		v := v.Transactions
 19971  		if isFlexible {
 19972  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 19973  		} else {
 19974  			dst = kbin.AppendArrayLen(dst, len(v))
 19975  		}
 19976  		for i := range v {
 19977  			v := &v[i]
 19978  			{
 19979  				v := v.TransactionalID
 19980  				if isFlexible {
 19981  					dst = kbin.AppendCompactString(dst, v)
 19982  				} else {
 19983  					dst = kbin.AppendString(dst, v)
 19984  				}
 19985  			}
 19986  			{
 19987  				v := v.ProducerID
 19988  				dst = kbin.AppendInt64(dst, v)
 19989  			}
 19990  			{
 19991  				v := v.ProducerEpoch
 19992  				dst = kbin.AppendInt16(dst, v)
 19993  			}
 19994  			{
 19995  				v := v.VerifyOnly
 19996  				dst = kbin.AppendBool(dst, v)
 19997  			}
 19998  			{
 19999  				v := v.Topics
 20000  				if isFlexible {
 20001  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 20002  				} else {
 20003  					dst = kbin.AppendArrayLen(dst, len(v))
 20004  				}
 20005  				for i := range v {
 20006  					v := &v[i]
 20007  					{
 20008  						v := v.Topic
 20009  						if isFlexible {
 20010  							dst = kbin.AppendCompactString(dst, v)
 20011  						} else {
 20012  							dst = kbin.AppendString(dst, v)
 20013  						}
 20014  					}
 20015  					{
 20016  						v := v.Partitions
 20017  						if isFlexible {
 20018  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 20019  						} else {
 20020  							dst = kbin.AppendArrayLen(dst, len(v))
 20021  						}
 20022  						for i := range v {
 20023  							v := v[i]
 20024  							dst = kbin.AppendInt32(dst, v)
 20025  						}
 20026  					}
 20027  					if isFlexible {
 20028  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20029  						dst = v.UnknownTags.AppendEach(dst)
 20030  					}
 20031  				}
 20032  			}
 20033  			if isFlexible {
 20034  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20035  				dst = v.UnknownTags.AppendEach(dst)
 20036  			}
 20037  		}
 20038  	}
 20039  	if isFlexible {
 20040  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20041  		dst = v.UnknownTags.AppendEach(dst)
 20042  	}
 20043  	return dst
 20044  }
 20045  
 20046  func (v *AddPartitionsToTxnRequest) ReadFrom(src []byte) error {
 20047  	return v.readFrom(src, false)
 20048  }
 20049  
 20050  func (v *AddPartitionsToTxnRequest) UnsafeReadFrom(src []byte) error {
 20051  	return v.readFrom(src, true)
 20052  }
 20053  
 20054  func (v *AddPartitionsToTxnRequest) readFrom(src []byte, unsafe bool) error {
 20055  	v.Default()
 20056  	b := kbin.Reader{Src: src}
 20057  	version := v.Version
 20058  	_ = version
 20059  	isFlexible := version >= 3
 20060  	_ = isFlexible
 20061  	s := v
 20062  	if version >= 0 && version <= 3 {
 20063  		var v string
 20064  		if unsafe {
 20065  			if isFlexible {
 20066  				v = b.UnsafeCompactString()
 20067  			} else {
 20068  				v = b.UnsafeString()
 20069  			}
 20070  		} else {
 20071  			if isFlexible {
 20072  				v = b.CompactString()
 20073  			} else {
 20074  				v = b.String()
 20075  			}
 20076  		}
 20077  		s.TransactionalID = v
 20078  	}
 20079  	if version >= 0 && version <= 3 {
 20080  		v := b.Int64()
 20081  		s.ProducerID = v
 20082  	}
 20083  	if version >= 0 && version <= 3 {
 20084  		v := b.Int16()
 20085  		s.ProducerEpoch = v
 20086  	}
 20087  	if version >= 0 && version <= 3 {
 20088  		v := s.Topics
 20089  		a := v
 20090  		var l int32
 20091  		if isFlexible {
 20092  			l = b.CompactArrayLen()
 20093  		} else {
 20094  			l = b.ArrayLen()
 20095  		}
 20096  		if !b.Ok() {
 20097  			return b.Complete()
 20098  		}
 20099  		a = a[:0]
 20100  		if l > 0 {
 20101  			a = append(a, make([]AddPartitionsToTxnRequestTopic, l)...)
 20102  		}
 20103  		for i := int32(0); i < l; i++ {
 20104  			v := &a[i]
 20105  			v.Default()
 20106  			s := v
 20107  			{
 20108  				var v string
 20109  				if unsafe {
 20110  					if isFlexible {
 20111  						v = b.UnsafeCompactString()
 20112  					} else {
 20113  						v = b.UnsafeString()
 20114  					}
 20115  				} else {
 20116  					if isFlexible {
 20117  						v = b.CompactString()
 20118  					} else {
 20119  						v = b.String()
 20120  					}
 20121  				}
 20122  				s.Topic = v
 20123  			}
 20124  			{
 20125  				v := s.Partitions
 20126  				a := v
 20127  				var l int32
 20128  				if isFlexible {
 20129  					l = b.CompactArrayLen()
 20130  				} else {
 20131  					l = b.ArrayLen()
 20132  				}
 20133  				if !b.Ok() {
 20134  					return b.Complete()
 20135  				}
 20136  				a = a[:0]
 20137  				if l > 0 {
 20138  					a = append(a, make([]int32, l)...)
 20139  				}
 20140  				for i := int32(0); i < l; i++ {
 20141  					v := b.Int32()
 20142  					a[i] = v
 20143  				}
 20144  				v = a
 20145  				s.Partitions = v
 20146  			}
 20147  			if isFlexible {
 20148  				s.UnknownTags = internalReadTags(&b)
 20149  			}
 20150  		}
 20151  		v = a
 20152  		s.Topics = v
 20153  	}
 20154  	if version >= 4 {
 20155  		v := s.Transactions
 20156  		a := v
 20157  		var l int32
 20158  		if isFlexible {
 20159  			l = b.CompactArrayLen()
 20160  		} else {
 20161  			l = b.ArrayLen()
 20162  		}
 20163  		if !b.Ok() {
 20164  			return b.Complete()
 20165  		}
 20166  		a = a[:0]
 20167  		if l > 0 {
 20168  			a = append(a, make([]AddPartitionsToTxnRequestTransaction, l)...)
 20169  		}
 20170  		for i := int32(0); i < l; i++ {
 20171  			v := &a[i]
 20172  			v.Default()
 20173  			s := v
 20174  			{
 20175  				var v string
 20176  				if unsafe {
 20177  					if isFlexible {
 20178  						v = b.UnsafeCompactString()
 20179  					} else {
 20180  						v = b.UnsafeString()
 20181  					}
 20182  				} else {
 20183  					if isFlexible {
 20184  						v = b.CompactString()
 20185  					} else {
 20186  						v = b.String()
 20187  					}
 20188  				}
 20189  				s.TransactionalID = v
 20190  			}
 20191  			{
 20192  				v := b.Int64()
 20193  				s.ProducerID = v
 20194  			}
 20195  			{
 20196  				v := b.Int16()
 20197  				s.ProducerEpoch = v
 20198  			}
 20199  			{
 20200  				v := b.Bool()
 20201  				s.VerifyOnly = v
 20202  			}
 20203  			{
 20204  				v := s.Topics
 20205  				a := v
 20206  				var l int32
 20207  				if isFlexible {
 20208  					l = b.CompactArrayLen()
 20209  				} else {
 20210  					l = b.ArrayLen()
 20211  				}
 20212  				if !b.Ok() {
 20213  					return b.Complete()
 20214  				}
 20215  				a = a[:0]
 20216  				if l > 0 {
 20217  					a = append(a, make([]AddPartitionsToTxnRequestTransactionTopic, l)...)
 20218  				}
 20219  				for i := int32(0); i < l; i++ {
 20220  					v := &a[i]
 20221  					v.Default()
 20222  					s := v
 20223  					{
 20224  						var v string
 20225  						if unsafe {
 20226  							if isFlexible {
 20227  								v = b.UnsafeCompactString()
 20228  							} else {
 20229  								v = b.UnsafeString()
 20230  							}
 20231  						} else {
 20232  							if isFlexible {
 20233  								v = b.CompactString()
 20234  							} else {
 20235  								v = b.String()
 20236  							}
 20237  						}
 20238  						s.Topic = v
 20239  					}
 20240  					{
 20241  						v := s.Partitions
 20242  						a := v
 20243  						var l int32
 20244  						if isFlexible {
 20245  							l = b.CompactArrayLen()
 20246  						} else {
 20247  							l = b.ArrayLen()
 20248  						}
 20249  						if !b.Ok() {
 20250  							return b.Complete()
 20251  						}
 20252  						a = a[:0]
 20253  						if l > 0 {
 20254  							a = append(a, make([]int32, l)...)
 20255  						}
 20256  						for i := int32(0); i < l; i++ {
 20257  							v := b.Int32()
 20258  							a[i] = v
 20259  						}
 20260  						v = a
 20261  						s.Partitions = v
 20262  					}
 20263  					if isFlexible {
 20264  						s.UnknownTags = internalReadTags(&b)
 20265  					}
 20266  				}
 20267  				v = a
 20268  				s.Topics = v
 20269  			}
 20270  			if isFlexible {
 20271  				s.UnknownTags = internalReadTags(&b)
 20272  			}
 20273  		}
 20274  		v = a
 20275  		s.Transactions = v
 20276  	}
 20277  	if isFlexible {
 20278  		s.UnknownTags = internalReadTags(&b)
 20279  	}
 20280  	return b.Complete()
 20281  }
 20282  
 20283  // NewPtrAddPartitionsToTxnRequest returns a pointer to a default AddPartitionsToTxnRequest
 20284  // This is a shortcut for creating a new(struct) and calling Default yourself.
 20285  func NewPtrAddPartitionsToTxnRequest() *AddPartitionsToTxnRequest {
 20286  	var v AddPartitionsToTxnRequest
 20287  	v.Default()
 20288  	return &v
 20289  }
 20290  
 20291  // Default sets any default fields. Calling this allows for future compatibility
 20292  // if new fields are added to AddPartitionsToTxnRequest.
 20293  func (v *AddPartitionsToTxnRequest) Default() {
 20294  }
 20295  
 20296  // NewAddPartitionsToTxnRequest returns a default AddPartitionsToTxnRequest
 20297  // This is a shortcut for creating a struct and calling Default yourself.
 20298  func NewAddPartitionsToTxnRequest() AddPartitionsToTxnRequest {
 20299  	var v AddPartitionsToTxnRequest
 20300  	v.Default()
 20301  	return v
 20302  }
 20303  
 20304  type AddPartitionsToTxnResponseTransactionTopicPartition struct {
 20305  	Partition int32
 20306  
 20307  	ErrorCode int16
 20308  
 20309  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20310  	UnknownTags Tags // v3+
 20311  }
 20312  
 20313  // Default sets any default fields. Calling this allows for future compatibility
 20314  // if new fields are added to AddPartitionsToTxnResponseTransactionTopicPartition.
 20315  func (v *AddPartitionsToTxnResponseTransactionTopicPartition) Default() {
 20316  }
 20317  
 20318  // NewAddPartitionsToTxnResponseTransactionTopicPartition returns a default AddPartitionsToTxnResponseTransactionTopicPartition
 20319  // This is a shortcut for creating a struct and calling Default yourself.
 20320  func NewAddPartitionsToTxnResponseTransactionTopicPartition() AddPartitionsToTxnResponseTransactionTopicPartition {
 20321  	var v AddPartitionsToTxnResponseTransactionTopicPartition
 20322  	v.Default()
 20323  	return v
 20324  }
 20325  
 20326  type AddPartitionsToTxnResponseTransactionTopic struct {
 20327  	Topic string
 20328  
 20329  	Partitions []AddPartitionsToTxnResponseTransactionTopicPartition
 20330  
 20331  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20332  	UnknownTags Tags // v3+
 20333  }
 20334  
 20335  // Default sets any default fields. Calling this allows for future compatibility
 20336  // if new fields are added to AddPartitionsToTxnResponseTransactionTopic.
 20337  func (v *AddPartitionsToTxnResponseTransactionTopic) Default() {
 20338  }
 20339  
 20340  // NewAddPartitionsToTxnResponseTransactionTopic returns a default AddPartitionsToTxnResponseTransactionTopic
 20341  // This is a shortcut for creating a struct and calling Default yourself.
 20342  func NewAddPartitionsToTxnResponseTransactionTopic() AddPartitionsToTxnResponseTransactionTopic {
 20343  	var v AddPartitionsToTxnResponseTransactionTopic
 20344  	v.Default()
 20345  	return v
 20346  }
 20347  
 20348  type AddPartitionsToTxnResponseTransaction struct {
 20349  	// The transactional id corresponding to the transaction.
 20350  	TransactionalID string
 20351  
 20352  	Topics []AddPartitionsToTxnResponseTransactionTopic
 20353  
 20354  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20355  	UnknownTags Tags // v3+
 20356  }
 20357  
 20358  // Default sets any default fields. Calling this allows for future compatibility
 20359  // if new fields are added to AddPartitionsToTxnResponseTransaction.
 20360  func (v *AddPartitionsToTxnResponseTransaction) Default() {
 20361  }
 20362  
 20363  // NewAddPartitionsToTxnResponseTransaction returns a default AddPartitionsToTxnResponseTransaction
 20364  // This is a shortcut for creating a struct and calling Default yourself.
 20365  func NewAddPartitionsToTxnResponseTransaction() AddPartitionsToTxnResponseTransaction {
 20366  	var v AddPartitionsToTxnResponseTransaction
 20367  	v.Default()
 20368  	return v
 20369  }
 20370  
 20371  type AddPartitionsToTxnResponseTopicPartition struct {
 20372  	// Partition is a partition being responded to.
 20373  	Partition int32
 20374  
 20375  	// ErrorCode is any error for this topic/partition commit.
 20376  	//
 20377  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned if the client is
 20378  	// not authorized for write with transactional IDs with the requested
 20379  	// transactional ID.
 20380  	//
 20381  	// TOPIC_AUTHORIZATION_FAILED is returned for all topics that the client
 20382  	// is not authorized to write to.
 20383  	//
 20384  	// UNKNOWN_TOPIC_OR_PARTITION is returned for all topics or partitions
 20385  	// that the broker does not know of.
 20386  	//
 20387  	// OPERATION_NOT_ATTEMPTED is returned if any of the above errors occur
 20388  	// for all partitions that did not have the above errors.
 20389  	//
 20390  	// INVALID_REQUEST is returned if the transactional ID is invalid.
 20391  	//
 20392  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the coordinator for this
 20393  	// transactional ID is still loading.
 20394  	//
 20395  	// NOT_COORDINATOR is returned if the broker is not the coordinator for
 20396  	// this transactional ID.
 20397  	//
 20398  	// INVALID_PRODUCER_ID_MAPPING is returned if the produce request used
 20399  	// a producer ID that is not tied to the transactional ID (i.e., mismatch
 20400  	// from what was returned from InitProducerID).
 20401  	//
 20402  	// INVALID_PRODUCER_EPOCH is returned if the requested epoch does not match
 20403  	// the broker epoch for this transactional ID.
 20404  	//
 20405  	// CONCURRENT_TRANSACTIONS is returned if there is an ongoing transaction for
 20406  	// this transactional ID, if the producer ID and epoch matches the broker's.
 20407  	ErrorCode int16
 20408  
 20409  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20410  	UnknownTags Tags // v3+
 20411  }
 20412  
 20413  // Default sets any default fields. Calling this allows for future compatibility
 20414  // if new fields are added to AddPartitionsToTxnResponseTopicPartition.
 20415  func (v *AddPartitionsToTxnResponseTopicPartition) Default() {
 20416  }
 20417  
 20418  // NewAddPartitionsToTxnResponseTopicPartition returns a default AddPartitionsToTxnResponseTopicPartition
 20419  // This is a shortcut for creating a struct and calling Default yourself.
 20420  func NewAddPartitionsToTxnResponseTopicPartition() AddPartitionsToTxnResponseTopicPartition {
 20421  	var v AddPartitionsToTxnResponseTopicPartition
 20422  	v.Default()
 20423  	return v
 20424  }
 20425  
 20426  type AddPartitionsToTxnResponseTopic struct {
 20427  	// Topic is a topic being responded to.
 20428  	Topic string
 20429  
 20430  	// Partitions are responses to partitions in the request.
 20431  	Partitions []AddPartitionsToTxnResponseTopicPartition
 20432  
 20433  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20434  	UnknownTags Tags // v3+
 20435  }
 20436  
 20437  // Default sets any default fields. Calling this allows for future compatibility
 20438  // if new fields are added to AddPartitionsToTxnResponseTopic.
 20439  func (v *AddPartitionsToTxnResponseTopic) Default() {
 20440  }
 20441  
 20442  // NewAddPartitionsToTxnResponseTopic returns a default AddPartitionsToTxnResponseTopic
 20443  // This is a shortcut for creating a struct and calling Default yourself.
 20444  func NewAddPartitionsToTxnResponseTopic() AddPartitionsToTxnResponseTopic {
 20445  	var v AddPartitionsToTxnResponseTopic
 20446  	v.Default()
 20447  	return v
 20448  }
 20449  
 20450  // AddPartitionsToTxnResponse is a response to an AddPartitionsToTxnRequest.
 20451  type AddPartitionsToTxnResponse struct {
 20452  	// Version is the version of this message used with a Kafka broker.
 20453  	Version int16
 20454  
 20455  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 20456  	// after this request.
 20457  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 20458  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 20459  	//
 20460  	// This request switched at version 1.
 20461  	ThrottleMillis int32
 20462  
 20463  	// The response top level error code.
 20464  	ErrorCode int16 // v4+
 20465  
 20466  	// Results categorized by transactional ID, v4+ only, for brokers only.
 20467  	// The fields duplicate v3 and below fields (except TransactionalID) and
 20468  	// are left undocumented.
 20469  	Transactions []AddPartitionsToTxnResponseTransaction // v4+
 20470  
 20471  	// Topics are responses to topics in the request.
 20472  	Topics []AddPartitionsToTxnResponseTopic // v0-v3
 20473  
 20474  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20475  	UnknownTags Tags // v3+
 20476  }
 20477  
 20478  func (*AddPartitionsToTxnResponse) Key() int16                 { return 24 }
 20479  func (*AddPartitionsToTxnResponse) MaxVersion() int16          { return 4 }
 20480  func (v *AddPartitionsToTxnResponse) SetVersion(version int16) { v.Version = version }
 20481  func (v *AddPartitionsToTxnResponse) GetVersion() int16        { return v.Version }
 20482  func (v *AddPartitionsToTxnResponse) IsFlexible() bool         { return v.Version >= 3 }
 20483  func (v *AddPartitionsToTxnResponse) Throttle() (int32, bool) {
 20484  	return v.ThrottleMillis, v.Version >= 1
 20485  }
 20486  
 20487  func (v *AddPartitionsToTxnResponse) SetThrottle(throttleMillis int32) {
 20488  	v.ThrottleMillis = throttleMillis
 20489  }
 20490  
 20491  func (v *AddPartitionsToTxnResponse) RequestKind() Request {
 20492  	return &AddPartitionsToTxnRequest{Version: v.Version}
 20493  }
 20494  
 20495  func (v *AddPartitionsToTxnResponse) AppendTo(dst []byte) []byte {
 20496  	version := v.Version
 20497  	_ = version
 20498  	isFlexible := version >= 3
 20499  	_ = isFlexible
 20500  	{
 20501  		v := v.ThrottleMillis
 20502  		dst = kbin.AppendInt32(dst, v)
 20503  	}
 20504  	if version >= 4 {
 20505  		v := v.ErrorCode
 20506  		dst = kbin.AppendInt16(dst, v)
 20507  	}
 20508  	if version >= 4 {
 20509  		v := v.Transactions
 20510  		if isFlexible {
 20511  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 20512  		} else {
 20513  			dst = kbin.AppendArrayLen(dst, len(v))
 20514  		}
 20515  		for i := range v {
 20516  			v := &v[i]
 20517  			{
 20518  				v := v.TransactionalID
 20519  				if isFlexible {
 20520  					dst = kbin.AppendCompactString(dst, v)
 20521  				} else {
 20522  					dst = kbin.AppendString(dst, v)
 20523  				}
 20524  			}
 20525  			{
 20526  				v := v.Topics
 20527  				if isFlexible {
 20528  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 20529  				} else {
 20530  					dst = kbin.AppendArrayLen(dst, len(v))
 20531  				}
 20532  				for i := range v {
 20533  					v := &v[i]
 20534  					{
 20535  						v := v.Topic
 20536  						if isFlexible {
 20537  							dst = kbin.AppendCompactString(dst, v)
 20538  						} else {
 20539  							dst = kbin.AppendString(dst, v)
 20540  						}
 20541  					}
 20542  					{
 20543  						v := v.Partitions
 20544  						if isFlexible {
 20545  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 20546  						} else {
 20547  							dst = kbin.AppendArrayLen(dst, len(v))
 20548  						}
 20549  						for i := range v {
 20550  							v := &v[i]
 20551  							{
 20552  								v := v.Partition
 20553  								dst = kbin.AppendInt32(dst, v)
 20554  							}
 20555  							{
 20556  								v := v.ErrorCode
 20557  								dst = kbin.AppendInt16(dst, v)
 20558  							}
 20559  							if isFlexible {
 20560  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20561  								dst = v.UnknownTags.AppendEach(dst)
 20562  							}
 20563  						}
 20564  					}
 20565  					if isFlexible {
 20566  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20567  						dst = v.UnknownTags.AppendEach(dst)
 20568  					}
 20569  				}
 20570  			}
 20571  			if isFlexible {
 20572  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20573  				dst = v.UnknownTags.AppendEach(dst)
 20574  			}
 20575  		}
 20576  	}
 20577  	if version >= 0 && version <= 3 {
 20578  		v := v.Topics
 20579  		if isFlexible {
 20580  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 20581  		} else {
 20582  			dst = kbin.AppendArrayLen(dst, len(v))
 20583  		}
 20584  		for i := range v {
 20585  			v := &v[i]
 20586  			{
 20587  				v := v.Topic
 20588  				if isFlexible {
 20589  					dst = kbin.AppendCompactString(dst, v)
 20590  				} else {
 20591  					dst = kbin.AppendString(dst, v)
 20592  				}
 20593  			}
 20594  			{
 20595  				v := v.Partitions
 20596  				if isFlexible {
 20597  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 20598  				} else {
 20599  					dst = kbin.AppendArrayLen(dst, len(v))
 20600  				}
 20601  				for i := range v {
 20602  					v := &v[i]
 20603  					{
 20604  						v := v.Partition
 20605  						dst = kbin.AppendInt32(dst, v)
 20606  					}
 20607  					{
 20608  						v := v.ErrorCode
 20609  						dst = kbin.AppendInt16(dst, v)
 20610  					}
 20611  					if isFlexible {
 20612  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20613  						dst = v.UnknownTags.AppendEach(dst)
 20614  					}
 20615  				}
 20616  			}
 20617  			if isFlexible {
 20618  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20619  				dst = v.UnknownTags.AppendEach(dst)
 20620  			}
 20621  		}
 20622  	}
 20623  	if isFlexible {
 20624  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20625  		dst = v.UnknownTags.AppendEach(dst)
 20626  	}
 20627  	return dst
 20628  }
 20629  
 20630  func (v *AddPartitionsToTxnResponse) ReadFrom(src []byte) error {
 20631  	return v.readFrom(src, false)
 20632  }
 20633  
 20634  func (v *AddPartitionsToTxnResponse) UnsafeReadFrom(src []byte) error {
 20635  	return v.readFrom(src, true)
 20636  }
 20637  
 20638  func (v *AddPartitionsToTxnResponse) readFrom(src []byte, unsafe bool) error {
 20639  	v.Default()
 20640  	b := kbin.Reader{Src: src}
 20641  	version := v.Version
 20642  	_ = version
 20643  	isFlexible := version >= 3
 20644  	_ = isFlexible
 20645  	s := v
 20646  	{
 20647  		v := b.Int32()
 20648  		s.ThrottleMillis = v
 20649  	}
 20650  	if version >= 4 {
 20651  		v := b.Int16()
 20652  		s.ErrorCode = v
 20653  	}
 20654  	if version >= 4 {
 20655  		v := s.Transactions
 20656  		a := v
 20657  		var l int32
 20658  		if isFlexible {
 20659  			l = b.CompactArrayLen()
 20660  		} else {
 20661  			l = b.ArrayLen()
 20662  		}
 20663  		if !b.Ok() {
 20664  			return b.Complete()
 20665  		}
 20666  		a = a[:0]
 20667  		if l > 0 {
 20668  			a = append(a, make([]AddPartitionsToTxnResponseTransaction, l)...)
 20669  		}
 20670  		for i := int32(0); i < l; i++ {
 20671  			v := &a[i]
 20672  			v.Default()
 20673  			s := v
 20674  			{
 20675  				var v string
 20676  				if unsafe {
 20677  					if isFlexible {
 20678  						v = b.UnsafeCompactString()
 20679  					} else {
 20680  						v = b.UnsafeString()
 20681  					}
 20682  				} else {
 20683  					if isFlexible {
 20684  						v = b.CompactString()
 20685  					} else {
 20686  						v = b.String()
 20687  					}
 20688  				}
 20689  				s.TransactionalID = v
 20690  			}
 20691  			{
 20692  				v := s.Topics
 20693  				a := v
 20694  				var l int32
 20695  				if isFlexible {
 20696  					l = b.CompactArrayLen()
 20697  				} else {
 20698  					l = b.ArrayLen()
 20699  				}
 20700  				if !b.Ok() {
 20701  					return b.Complete()
 20702  				}
 20703  				a = a[:0]
 20704  				if l > 0 {
 20705  					a = append(a, make([]AddPartitionsToTxnResponseTransactionTopic, l)...)
 20706  				}
 20707  				for i := int32(0); i < l; i++ {
 20708  					v := &a[i]
 20709  					v.Default()
 20710  					s := v
 20711  					{
 20712  						var v string
 20713  						if unsafe {
 20714  							if isFlexible {
 20715  								v = b.UnsafeCompactString()
 20716  							} else {
 20717  								v = b.UnsafeString()
 20718  							}
 20719  						} else {
 20720  							if isFlexible {
 20721  								v = b.CompactString()
 20722  							} else {
 20723  								v = b.String()
 20724  							}
 20725  						}
 20726  						s.Topic = v
 20727  					}
 20728  					{
 20729  						v := s.Partitions
 20730  						a := v
 20731  						var l int32
 20732  						if isFlexible {
 20733  							l = b.CompactArrayLen()
 20734  						} else {
 20735  							l = b.ArrayLen()
 20736  						}
 20737  						if !b.Ok() {
 20738  							return b.Complete()
 20739  						}
 20740  						a = a[:0]
 20741  						if l > 0 {
 20742  							a = append(a, make([]AddPartitionsToTxnResponseTransactionTopicPartition, l)...)
 20743  						}
 20744  						for i := int32(0); i < l; i++ {
 20745  							v := &a[i]
 20746  							v.Default()
 20747  							s := v
 20748  							{
 20749  								v := b.Int32()
 20750  								s.Partition = v
 20751  							}
 20752  							{
 20753  								v := b.Int16()
 20754  								s.ErrorCode = v
 20755  							}
 20756  							if isFlexible {
 20757  								s.UnknownTags = internalReadTags(&b)
 20758  							}
 20759  						}
 20760  						v = a
 20761  						s.Partitions = v
 20762  					}
 20763  					if isFlexible {
 20764  						s.UnknownTags = internalReadTags(&b)
 20765  					}
 20766  				}
 20767  				v = a
 20768  				s.Topics = v
 20769  			}
 20770  			if isFlexible {
 20771  				s.UnknownTags = internalReadTags(&b)
 20772  			}
 20773  		}
 20774  		v = a
 20775  		s.Transactions = v
 20776  	}
 20777  	if version >= 0 && version <= 3 {
 20778  		v := s.Topics
 20779  		a := v
 20780  		var l int32
 20781  		if isFlexible {
 20782  			l = b.CompactArrayLen()
 20783  		} else {
 20784  			l = b.ArrayLen()
 20785  		}
 20786  		if !b.Ok() {
 20787  			return b.Complete()
 20788  		}
 20789  		a = a[:0]
 20790  		if l > 0 {
 20791  			a = append(a, make([]AddPartitionsToTxnResponseTopic, l)...)
 20792  		}
 20793  		for i := int32(0); i < l; i++ {
 20794  			v := &a[i]
 20795  			v.Default()
 20796  			s := v
 20797  			{
 20798  				var v string
 20799  				if unsafe {
 20800  					if isFlexible {
 20801  						v = b.UnsafeCompactString()
 20802  					} else {
 20803  						v = b.UnsafeString()
 20804  					}
 20805  				} else {
 20806  					if isFlexible {
 20807  						v = b.CompactString()
 20808  					} else {
 20809  						v = b.String()
 20810  					}
 20811  				}
 20812  				s.Topic = v
 20813  			}
 20814  			{
 20815  				v := s.Partitions
 20816  				a := v
 20817  				var l int32
 20818  				if isFlexible {
 20819  					l = b.CompactArrayLen()
 20820  				} else {
 20821  					l = b.ArrayLen()
 20822  				}
 20823  				if !b.Ok() {
 20824  					return b.Complete()
 20825  				}
 20826  				a = a[:0]
 20827  				if l > 0 {
 20828  					a = append(a, make([]AddPartitionsToTxnResponseTopicPartition, l)...)
 20829  				}
 20830  				for i := int32(0); i < l; i++ {
 20831  					v := &a[i]
 20832  					v.Default()
 20833  					s := v
 20834  					{
 20835  						v := b.Int32()
 20836  						s.Partition = v
 20837  					}
 20838  					{
 20839  						v := b.Int16()
 20840  						s.ErrorCode = v
 20841  					}
 20842  					if isFlexible {
 20843  						s.UnknownTags = internalReadTags(&b)
 20844  					}
 20845  				}
 20846  				v = a
 20847  				s.Partitions = v
 20848  			}
 20849  			if isFlexible {
 20850  				s.UnknownTags = internalReadTags(&b)
 20851  			}
 20852  		}
 20853  		v = a
 20854  		s.Topics = v
 20855  	}
 20856  	if isFlexible {
 20857  		s.UnknownTags = internalReadTags(&b)
 20858  	}
 20859  	return b.Complete()
 20860  }
 20861  
 20862  // NewPtrAddPartitionsToTxnResponse returns a pointer to a default AddPartitionsToTxnResponse
 20863  // This is a shortcut for creating a new(struct) and calling Default yourself.
 20864  func NewPtrAddPartitionsToTxnResponse() *AddPartitionsToTxnResponse {
 20865  	var v AddPartitionsToTxnResponse
 20866  	v.Default()
 20867  	return &v
 20868  }
 20869  
 20870  // Default sets any default fields. Calling this allows for future compatibility
 20871  // if new fields are added to AddPartitionsToTxnResponse.
 20872  func (v *AddPartitionsToTxnResponse) Default() {
 20873  }
 20874  
 20875  // NewAddPartitionsToTxnResponse returns a default AddPartitionsToTxnResponse
 20876  // This is a shortcut for creating a struct and calling Default yourself.
 20877  func NewAddPartitionsToTxnResponse() AddPartitionsToTxnResponse {
 20878  	var v AddPartitionsToTxnResponse
 20879  	v.Default()
 20880  	return v
 20881  }
 20882  
 20883  // AddOffsetsToTxnRequest is a request that ties produced records to what group
 20884  // is being consumed for the transaction.
 20885  //
 20886  // This request must be called before TxnOffsetCommitRequest.
 20887  //
 20888  // Internally, this request simply adds the __consumer_offsets topic as a
 20889  // partition for this transaction with AddPartitionsToTxn for the partition
 20890  // in that topic that contains the group.
 20891  type AddOffsetsToTxnRequest struct {
 20892  	// Version is the version of this message used with a Kafka broker.
 20893  	Version int16
 20894  
 20895  	// TransactionalID is the transactional ID to use for this request.
 20896  	TransactionalID string
 20897  
 20898  	// ProducerID is the producer ID of the client for this transactional ID
 20899  	// as received from InitProducerID.
 20900  	ProducerID int64
 20901  
 20902  	// ProducerEpoch is the producer epoch of the client for this transactional ID
 20903  	// as received from InitProducerID.
 20904  	ProducerEpoch int16
 20905  
 20906  	// Group is the group to tie this transaction to.
 20907  	Group string
 20908  
 20909  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 20910  	UnknownTags Tags // v3+
 20911  }
 20912  
 20913  func (*AddOffsetsToTxnRequest) Key() int16                 { return 25 }
 20914  func (*AddOffsetsToTxnRequest) MaxVersion() int16          { return 3 }
 20915  func (v *AddOffsetsToTxnRequest) SetVersion(version int16) { v.Version = version }
 20916  func (v *AddOffsetsToTxnRequest) GetVersion() int16        { return v.Version }
 20917  func (v *AddOffsetsToTxnRequest) IsFlexible() bool         { return v.Version >= 3 }
 20918  func (v *AddOffsetsToTxnRequest) IsTxnCoordinatorRequest() {}
 20919  func (v *AddOffsetsToTxnRequest) ResponseKind() Response {
 20920  	r := &AddOffsetsToTxnResponse{Version: v.Version}
 20921  	r.Default()
 20922  	return r
 20923  }
 20924  
 20925  // RequestWith is requests v on r and returns the response or an error.
 20926  // For sharded requests, the response may be merged and still return an error.
 20927  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 20928  func (v *AddOffsetsToTxnRequest) RequestWith(ctx context.Context, r Requestor) (*AddOffsetsToTxnResponse, error) {
 20929  	kresp, err := r.Request(ctx, v)
 20930  	resp, _ := kresp.(*AddOffsetsToTxnResponse)
 20931  	return resp, err
 20932  }
 20933  
 20934  func (v *AddOffsetsToTxnRequest) AppendTo(dst []byte) []byte {
 20935  	version := v.Version
 20936  	_ = version
 20937  	isFlexible := version >= 3
 20938  	_ = isFlexible
 20939  	{
 20940  		v := v.TransactionalID
 20941  		if isFlexible {
 20942  			dst = kbin.AppendCompactString(dst, v)
 20943  		} else {
 20944  			dst = kbin.AppendString(dst, v)
 20945  		}
 20946  	}
 20947  	{
 20948  		v := v.ProducerID
 20949  		dst = kbin.AppendInt64(dst, v)
 20950  	}
 20951  	{
 20952  		v := v.ProducerEpoch
 20953  		dst = kbin.AppendInt16(dst, v)
 20954  	}
 20955  	{
 20956  		v := v.Group
 20957  		if isFlexible {
 20958  			dst = kbin.AppendCompactString(dst, v)
 20959  		} else {
 20960  			dst = kbin.AppendString(dst, v)
 20961  		}
 20962  	}
 20963  	if isFlexible {
 20964  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 20965  		dst = v.UnknownTags.AppendEach(dst)
 20966  	}
 20967  	return dst
 20968  }
 20969  
 20970  func (v *AddOffsetsToTxnRequest) ReadFrom(src []byte) error {
 20971  	return v.readFrom(src, false)
 20972  }
 20973  
 20974  func (v *AddOffsetsToTxnRequest) UnsafeReadFrom(src []byte) error {
 20975  	return v.readFrom(src, true)
 20976  }
 20977  
 20978  func (v *AddOffsetsToTxnRequest) readFrom(src []byte, unsafe bool) error {
 20979  	v.Default()
 20980  	b := kbin.Reader{Src: src}
 20981  	version := v.Version
 20982  	_ = version
 20983  	isFlexible := version >= 3
 20984  	_ = isFlexible
 20985  	s := v
 20986  	{
 20987  		var v string
 20988  		if unsafe {
 20989  			if isFlexible {
 20990  				v = b.UnsafeCompactString()
 20991  			} else {
 20992  				v = b.UnsafeString()
 20993  			}
 20994  		} else {
 20995  			if isFlexible {
 20996  				v = b.CompactString()
 20997  			} else {
 20998  				v = b.String()
 20999  			}
 21000  		}
 21001  		s.TransactionalID = v
 21002  	}
 21003  	{
 21004  		v := b.Int64()
 21005  		s.ProducerID = v
 21006  	}
 21007  	{
 21008  		v := b.Int16()
 21009  		s.ProducerEpoch = v
 21010  	}
 21011  	{
 21012  		var v string
 21013  		if unsafe {
 21014  			if isFlexible {
 21015  				v = b.UnsafeCompactString()
 21016  			} else {
 21017  				v = b.UnsafeString()
 21018  			}
 21019  		} else {
 21020  			if isFlexible {
 21021  				v = b.CompactString()
 21022  			} else {
 21023  				v = b.String()
 21024  			}
 21025  		}
 21026  		s.Group = v
 21027  	}
 21028  	if isFlexible {
 21029  		s.UnknownTags = internalReadTags(&b)
 21030  	}
 21031  	return b.Complete()
 21032  }
 21033  
 21034  // NewPtrAddOffsetsToTxnRequest returns a pointer to a default AddOffsetsToTxnRequest
 21035  // This is a shortcut for creating a new(struct) and calling Default yourself.
 21036  func NewPtrAddOffsetsToTxnRequest() *AddOffsetsToTxnRequest {
 21037  	var v AddOffsetsToTxnRequest
 21038  	v.Default()
 21039  	return &v
 21040  }
 21041  
 21042  // Default sets any default fields. Calling this allows for future compatibility
 21043  // if new fields are added to AddOffsetsToTxnRequest.
 21044  func (v *AddOffsetsToTxnRequest) Default() {
 21045  }
 21046  
 21047  // NewAddOffsetsToTxnRequest returns a default AddOffsetsToTxnRequest
 21048  // This is a shortcut for creating a struct and calling Default yourself.
 21049  func NewAddOffsetsToTxnRequest() AddOffsetsToTxnRequest {
 21050  	var v AddOffsetsToTxnRequest
 21051  	v.Default()
 21052  	return v
 21053  }
 21054  
 21055  // AddOffsetsToTxnResponse is a response to an AddOffsetsToTxnRequest.
 21056  type AddOffsetsToTxnResponse struct {
 21057  	// Version is the version of this message used with a Kafka broker.
 21058  	Version int16
 21059  
 21060  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 21061  	// after this request.
 21062  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 21063  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 21064  	//
 21065  	// This request switched at version 1.
 21066  	ThrottleMillis int32
 21067  
 21068  	// ErrorCode is any error for this topic/partition commit.
 21069  	//
 21070  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned if the client is
 21071  	// not authorized for write with transactional IDs with the requested
 21072  	// transactional ID.
 21073  	//
 21074  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 21075  	// to read group with the requested group id.
 21076  	//
 21077  	// This also can return any error that AddPartitionsToTxn returns.
 21078  	ErrorCode int16
 21079  
 21080  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21081  	UnknownTags Tags // v3+
 21082  }
 21083  
 21084  func (*AddOffsetsToTxnResponse) Key() int16                 { return 25 }
 21085  func (*AddOffsetsToTxnResponse) MaxVersion() int16          { return 3 }
 21086  func (v *AddOffsetsToTxnResponse) SetVersion(version int16) { v.Version = version }
 21087  func (v *AddOffsetsToTxnResponse) GetVersion() int16        { return v.Version }
 21088  func (v *AddOffsetsToTxnResponse) IsFlexible() bool         { return v.Version >= 3 }
 21089  func (v *AddOffsetsToTxnResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 1 }
 21090  func (v *AddOffsetsToTxnResponse) SetThrottle(throttleMillis int32) {
 21091  	v.ThrottleMillis = throttleMillis
 21092  }
 21093  
 21094  func (v *AddOffsetsToTxnResponse) RequestKind() Request {
 21095  	return &AddOffsetsToTxnRequest{Version: v.Version}
 21096  }
 21097  
 21098  func (v *AddOffsetsToTxnResponse) AppendTo(dst []byte) []byte {
 21099  	version := v.Version
 21100  	_ = version
 21101  	isFlexible := version >= 3
 21102  	_ = isFlexible
 21103  	{
 21104  		v := v.ThrottleMillis
 21105  		dst = kbin.AppendInt32(dst, v)
 21106  	}
 21107  	{
 21108  		v := v.ErrorCode
 21109  		dst = kbin.AppendInt16(dst, v)
 21110  	}
 21111  	if isFlexible {
 21112  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21113  		dst = v.UnknownTags.AppendEach(dst)
 21114  	}
 21115  	return dst
 21116  }
 21117  
 21118  func (v *AddOffsetsToTxnResponse) ReadFrom(src []byte) error {
 21119  	return v.readFrom(src, false)
 21120  }
 21121  
 21122  func (v *AddOffsetsToTxnResponse) UnsafeReadFrom(src []byte) error {
 21123  	return v.readFrom(src, true)
 21124  }
 21125  
 21126  func (v *AddOffsetsToTxnResponse) readFrom(src []byte, unsafe bool) error {
 21127  	v.Default()
 21128  	b := kbin.Reader{Src: src}
 21129  	version := v.Version
 21130  	_ = version
 21131  	isFlexible := version >= 3
 21132  	_ = isFlexible
 21133  	s := v
 21134  	{
 21135  		v := b.Int32()
 21136  		s.ThrottleMillis = v
 21137  	}
 21138  	{
 21139  		v := b.Int16()
 21140  		s.ErrorCode = v
 21141  	}
 21142  	if isFlexible {
 21143  		s.UnknownTags = internalReadTags(&b)
 21144  	}
 21145  	return b.Complete()
 21146  }
 21147  
 21148  // NewPtrAddOffsetsToTxnResponse returns a pointer to a default AddOffsetsToTxnResponse
 21149  // This is a shortcut for creating a new(struct) and calling Default yourself.
 21150  func NewPtrAddOffsetsToTxnResponse() *AddOffsetsToTxnResponse {
 21151  	var v AddOffsetsToTxnResponse
 21152  	v.Default()
 21153  	return &v
 21154  }
 21155  
 21156  // Default sets any default fields. Calling this allows for future compatibility
 21157  // if new fields are added to AddOffsetsToTxnResponse.
 21158  func (v *AddOffsetsToTxnResponse) Default() {
 21159  }
 21160  
 21161  // NewAddOffsetsToTxnResponse returns a default AddOffsetsToTxnResponse
 21162  // This is a shortcut for creating a struct and calling Default yourself.
 21163  func NewAddOffsetsToTxnResponse() AddOffsetsToTxnResponse {
 21164  	var v AddOffsetsToTxnResponse
 21165  	v.Default()
 21166  	return v
 21167  }
 21168  
 21169  // EndTxnRequest ends a transaction. This should be called after
 21170  // TxnOffsetCommitRequest.
 21171  type EndTxnRequest struct {
 21172  	// Version is the version of this message used with a Kafka broker.
 21173  	Version int16
 21174  
 21175  	// TransactionalID is the transactional ID to use for this request.
 21176  	TransactionalID string
 21177  
 21178  	// ProducerID is the producer ID of the client for this transactional ID
 21179  	// as received from InitProducerID.
 21180  	ProducerID int64
 21181  
 21182  	// ProducerEpoch is the producer epoch of the client for this transactional ID
 21183  	// as received from InitProducerID.
 21184  	ProducerEpoch int16
 21185  
 21186  	// Commit is whether to commit this transaction: true for yes, false for abort.
 21187  	Commit bool
 21188  
 21189  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21190  	UnknownTags Tags // v3+
 21191  }
 21192  
 21193  func (*EndTxnRequest) Key() int16                 { return 26 }
 21194  func (*EndTxnRequest) MaxVersion() int16          { return 3 }
 21195  func (v *EndTxnRequest) SetVersion(version int16) { v.Version = version }
 21196  func (v *EndTxnRequest) GetVersion() int16        { return v.Version }
 21197  func (v *EndTxnRequest) IsFlexible() bool         { return v.Version >= 3 }
 21198  func (v *EndTxnRequest) IsTxnCoordinatorRequest() {}
 21199  func (v *EndTxnRequest) ResponseKind() Response {
 21200  	r := &EndTxnResponse{Version: v.Version}
 21201  	r.Default()
 21202  	return r
 21203  }
 21204  
 21205  // RequestWith is requests v on r and returns the response or an error.
 21206  // For sharded requests, the response may be merged and still return an error.
 21207  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 21208  func (v *EndTxnRequest) RequestWith(ctx context.Context, r Requestor) (*EndTxnResponse, error) {
 21209  	kresp, err := r.Request(ctx, v)
 21210  	resp, _ := kresp.(*EndTxnResponse)
 21211  	return resp, err
 21212  }
 21213  
 21214  func (v *EndTxnRequest) AppendTo(dst []byte) []byte {
 21215  	version := v.Version
 21216  	_ = version
 21217  	isFlexible := version >= 3
 21218  	_ = isFlexible
 21219  	{
 21220  		v := v.TransactionalID
 21221  		if isFlexible {
 21222  			dst = kbin.AppendCompactString(dst, v)
 21223  		} else {
 21224  			dst = kbin.AppendString(dst, v)
 21225  		}
 21226  	}
 21227  	{
 21228  		v := v.ProducerID
 21229  		dst = kbin.AppendInt64(dst, v)
 21230  	}
 21231  	{
 21232  		v := v.ProducerEpoch
 21233  		dst = kbin.AppendInt16(dst, v)
 21234  	}
 21235  	{
 21236  		v := v.Commit
 21237  		dst = kbin.AppendBool(dst, v)
 21238  	}
 21239  	if isFlexible {
 21240  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21241  		dst = v.UnknownTags.AppendEach(dst)
 21242  	}
 21243  	return dst
 21244  }
 21245  
 21246  func (v *EndTxnRequest) ReadFrom(src []byte) error {
 21247  	return v.readFrom(src, false)
 21248  }
 21249  
 21250  func (v *EndTxnRequest) UnsafeReadFrom(src []byte) error {
 21251  	return v.readFrom(src, true)
 21252  }
 21253  
 21254  func (v *EndTxnRequest) readFrom(src []byte, unsafe bool) error {
 21255  	v.Default()
 21256  	b := kbin.Reader{Src: src}
 21257  	version := v.Version
 21258  	_ = version
 21259  	isFlexible := version >= 3
 21260  	_ = isFlexible
 21261  	s := v
 21262  	{
 21263  		var v string
 21264  		if unsafe {
 21265  			if isFlexible {
 21266  				v = b.UnsafeCompactString()
 21267  			} else {
 21268  				v = b.UnsafeString()
 21269  			}
 21270  		} else {
 21271  			if isFlexible {
 21272  				v = b.CompactString()
 21273  			} else {
 21274  				v = b.String()
 21275  			}
 21276  		}
 21277  		s.TransactionalID = v
 21278  	}
 21279  	{
 21280  		v := b.Int64()
 21281  		s.ProducerID = v
 21282  	}
 21283  	{
 21284  		v := b.Int16()
 21285  		s.ProducerEpoch = v
 21286  	}
 21287  	{
 21288  		v := b.Bool()
 21289  		s.Commit = v
 21290  	}
 21291  	if isFlexible {
 21292  		s.UnknownTags = internalReadTags(&b)
 21293  	}
 21294  	return b.Complete()
 21295  }
 21296  
 21297  // NewPtrEndTxnRequest returns a pointer to a default EndTxnRequest
 21298  // This is a shortcut for creating a new(struct) and calling Default yourself.
 21299  func NewPtrEndTxnRequest() *EndTxnRequest {
 21300  	var v EndTxnRequest
 21301  	v.Default()
 21302  	return &v
 21303  }
 21304  
 21305  // Default sets any default fields. Calling this allows for future compatibility
 21306  // if new fields are added to EndTxnRequest.
 21307  func (v *EndTxnRequest) Default() {
 21308  }
 21309  
 21310  // NewEndTxnRequest returns a default EndTxnRequest
 21311  // This is a shortcut for creating a struct and calling Default yourself.
 21312  func NewEndTxnRequest() EndTxnRequest {
 21313  	var v EndTxnRequest
 21314  	v.Default()
 21315  	return v
 21316  }
 21317  
 21318  // EndTxnResponse is a response for an EndTxnRequest.
 21319  type EndTxnResponse struct {
 21320  	// Version is the version of this message used with a Kafka broker.
 21321  	Version int16
 21322  
 21323  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 21324  	// after this request.
 21325  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 21326  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 21327  	//
 21328  	// This request switched at version 1.
 21329  	ThrottleMillis int32
 21330  
 21331  	// ErrorCode is any error for this topic/partition commit.
 21332  	//
 21333  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned if the client is
 21334  	// not authorized for write with transactional IDs with the requested
 21335  	// transactional ID.
 21336  	//
 21337  	// INVALID_REQUEST is returned if the transactional ID is invalid.
 21338  	//
 21339  	// INVALID_PRODUCER_ID_MAPPING is returned if the produce request used
 21340  	// a producer ID that is not tied to the transactional ID (i.e., mismatch
 21341  	// from what was returned from InitProducerID).
 21342  	//
 21343  	// INVALID_PRODUCER_EPOCH is returned if the requested epoch does not match
 21344  	// the broker epoch for this transactional ID.
 21345  	//
 21346  	// CONCURRENT_TRANSACTIONS is returned if there is an ongoing transaction for
 21347  	// this transactional ID, if the producer ID and epoch matches the broker's.
 21348  	//
 21349  	// INVALID_TXN_STATE is returned if this request is attempted at the wrong
 21350  	// time (given the order of how transaction requests should go).
 21351  	ErrorCode int16
 21352  
 21353  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21354  	UnknownTags Tags // v3+
 21355  }
 21356  
 21357  func (*EndTxnResponse) Key() int16                         { return 26 }
 21358  func (*EndTxnResponse) MaxVersion() int16                  { return 3 }
 21359  func (v *EndTxnResponse) SetVersion(version int16)         { v.Version = version }
 21360  func (v *EndTxnResponse) GetVersion() int16                { return v.Version }
 21361  func (v *EndTxnResponse) IsFlexible() bool                 { return v.Version >= 3 }
 21362  func (v *EndTxnResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 21363  func (v *EndTxnResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 21364  func (v *EndTxnResponse) RequestKind() Request             { return &EndTxnRequest{Version: v.Version} }
 21365  
 21366  func (v *EndTxnResponse) AppendTo(dst []byte) []byte {
 21367  	version := v.Version
 21368  	_ = version
 21369  	isFlexible := version >= 3
 21370  	_ = isFlexible
 21371  	{
 21372  		v := v.ThrottleMillis
 21373  		dst = kbin.AppendInt32(dst, v)
 21374  	}
 21375  	{
 21376  		v := v.ErrorCode
 21377  		dst = kbin.AppendInt16(dst, v)
 21378  	}
 21379  	if isFlexible {
 21380  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21381  		dst = v.UnknownTags.AppendEach(dst)
 21382  	}
 21383  	return dst
 21384  }
 21385  
 21386  func (v *EndTxnResponse) ReadFrom(src []byte) error {
 21387  	return v.readFrom(src, false)
 21388  }
 21389  
 21390  func (v *EndTxnResponse) UnsafeReadFrom(src []byte) error {
 21391  	return v.readFrom(src, true)
 21392  }
 21393  
 21394  func (v *EndTxnResponse) readFrom(src []byte, unsafe bool) error {
 21395  	v.Default()
 21396  	b := kbin.Reader{Src: src}
 21397  	version := v.Version
 21398  	_ = version
 21399  	isFlexible := version >= 3
 21400  	_ = isFlexible
 21401  	s := v
 21402  	{
 21403  		v := b.Int32()
 21404  		s.ThrottleMillis = v
 21405  	}
 21406  	{
 21407  		v := b.Int16()
 21408  		s.ErrorCode = v
 21409  	}
 21410  	if isFlexible {
 21411  		s.UnknownTags = internalReadTags(&b)
 21412  	}
 21413  	return b.Complete()
 21414  }
 21415  
 21416  // NewPtrEndTxnResponse returns a pointer to a default EndTxnResponse
 21417  // This is a shortcut for creating a new(struct) and calling Default yourself.
 21418  func NewPtrEndTxnResponse() *EndTxnResponse {
 21419  	var v EndTxnResponse
 21420  	v.Default()
 21421  	return &v
 21422  }
 21423  
 21424  // Default sets any default fields. Calling this allows for future compatibility
 21425  // if new fields are added to EndTxnResponse.
 21426  func (v *EndTxnResponse) Default() {
 21427  }
 21428  
 21429  // NewEndTxnResponse returns a default EndTxnResponse
 21430  // This is a shortcut for creating a struct and calling Default yourself.
 21431  func NewEndTxnResponse() EndTxnResponse {
 21432  	var v EndTxnResponse
 21433  	v.Default()
 21434  	return v
 21435  }
 21436  
 21437  type WriteTxnMarkersRequestMarkerTopic struct {
 21438  	// Topic is the name of the topic to write markers for.
 21439  	Topic string
 21440  
 21441  	// Partitions contains partitions to write markers for.
 21442  	Partitions []int32
 21443  
 21444  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21445  	UnknownTags Tags // v1+
 21446  }
 21447  
 21448  // Default sets any default fields. Calling this allows for future compatibility
 21449  // if new fields are added to WriteTxnMarkersRequestMarkerTopic.
 21450  func (v *WriteTxnMarkersRequestMarkerTopic) Default() {
 21451  }
 21452  
 21453  // NewWriteTxnMarkersRequestMarkerTopic returns a default WriteTxnMarkersRequestMarkerTopic
 21454  // This is a shortcut for creating a struct and calling Default yourself.
 21455  func NewWriteTxnMarkersRequestMarkerTopic() WriteTxnMarkersRequestMarkerTopic {
 21456  	var v WriteTxnMarkersRequestMarkerTopic
 21457  	v.Default()
 21458  	return v
 21459  }
 21460  
 21461  type WriteTxnMarkersRequestMarker struct {
 21462  	// ProducerID is the current producer ID to use when writing a marker.
 21463  	ProducerID int64
 21464  
 21465  	// ProducerEpoch is the current producer epoch to use when writing a
 21466  	// marker.
 21467  	ProducerEpoch int16
 21468  
 21469  	// Committed is true if this marker is for a committed transaction,
 21470  	// otherwise false if this is for an aborted transaction.
 21471  	Committed bool
 21472  
 21473  	// Topics contains the topics we are writing markers for.
 21474  	Topics []WriteTxnMarkersRequestMarkerTopic
 21475  
 21476  	// CoordinatorEpoch is the current epoch of the transaction coordinator we
 21477  	// are writing a marker to. This is used to detect fenced writers.
 21478  	CoordinatorEpoch int32
 21479  
 21480  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21481  	UnknownTags Tags // v1+
 21482  }
 21483  
 21484  // Default sets any default fields. Calling this allows for future compatibility
 21485  // if new fields are added to WriteTxnMarkersRequestMarker.
 21486  func (v *WriteTxnMarkersRequestMarker) Default() {
 21487  }
 21488  
 21489  // NewWriteTxnMarkersRequestMarker returns a default WriteTxnMarkersRequestMarker
 21490  // This is a shortcut for creating a struct and calling Default yourself.
 21491  func NewWriteTxnMarkersRequestMarker() WriteTxnMarkersRequestMarker {
 21492  	var v WriteTxnMarkersRequestMarker
 21493  	v.Default()
 21494  	return v
 21495  }
 21496  
 21497  // WriteTxnMarkersRequest is a broker-to-broker request that Kafka uses to
 21498  // finish transactions.
 21499  type WriteTxnMarkersRequest struct {
 21500  	// Version is the version of this message used with a Kafka broker.
 21501  	Version int16
 21502  
 21503  	// Markers contains transactional markers to be written.
 21504  	Markers []WriteTxnMarkersRequestMarker
 21505  
 21506  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21507  	UnknownTags Tags // v1+
 21508  }
 21509  
 21510  func (*WriteTxnMarkersRequest) Key() int16                 { return 27 }
 21511  func (*WriteTxnMarkersRequest) MaxVersion() int16          { return 1 }
 21512  func (v *WriteTxnMarkersRequest) SetVersion(version int16) { v.Version = version }
 21513  func (v *WriteTxnMarkersRequest) GetVersion() int16        { return v.Version }
 21514  func (v *WriteTxnMarkersRequest) IsFlexible() bool         { return v.Version >= 1 }
 21515  func (v *WriteTxnMarkersRequest) ResponseKind() Response {
 21516  	r := &WriteTxnMarkersResponse{Version: v.Version}
 21517  	r.Default()
 21518  	return r
 21519  }
 21520  
 21521  // RequestWith is requests v on r and returns the response or an error.
 21522  // For sharded requests, the response may be merged and still return an error.
 21523  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 21524  func (v *WriteTxnMarkersRequest) RequestWith(ctx context.Context, r Requestor) (*WriteTxnMarkersResponse, error) {
 21525  	kresp, err := r.Request(ctx, v)
 21526  	resp, _ := kresp.(*WriteTxnMarkersResponse)
 21527  	return resp, err
 21528  }
 21529  
 21530  func (v *WriteTxnMarkersRequest) AppendTo(dst []byte) []byte {
 21531  	version := v.Version
 21532  	_ = version
 21533  	isFlexible := version >= 1
 21534  	_ = isFlexible
 21535  	{
 21536  		v := v.Markers
 21537  		if isFlexible {
 21538  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 21539  		} else {
 21540  			dst = kbin.AppendArrayLen(dst, len(v))
 21541  		}
 21542  		for i := range v {
 21543  			v := &v[i]
 21544  			{
 21545  				v := v.ProducerID
 21546  				dst = kbin.AppendInt64(dst, v)
 21547  			}
 21548  			{
 21549  				v := v.ProducerEpoch
 21550  				dst = kbin.AppendInt16(dst, v)
 21551  			}
 21552  			{
 21553  				v := v.Committed
 21554  				dst = kbin.AppendBool(dst, v)
 21555  			}
 21556  			{
 21557  				v := v.Topics
 21558  				if isFlexible {
 21559  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 21560  				} else {
 21561  					dst = kbin.AppendArrayLen(dst, len(v))
 21562  				}
 21563  				for i := range v {
 21564  					v := &v[i]
 21565  					{
 21566  						v := v.Topic
 21567  						if isFlexible {
 21568  							dst = kbin.AppendCompactString(dst, v)
 21569  						} else {
 21570  							dst = kbin.AppendString(dst, v)
 21571  						}
 21572  					}
 21573  					{
 21574  						v := v.Partitions
 21575  						if isFlexible {
 21576  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 21577  						} else {
 21578  							dst = kbin.AppendArrayLen(dst, len(v))
 21579  						}
 21580  						for i := range v {
 21581  							v := v[i]
 21582  							dst = kbin.AppendInt32(dst, v)
 21583  						}
 21584  					}
 21585  					if isFlexible {
 21586  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21587  						dst = v.UnknownTags.AppendEach(dst)
 21588  					}
 21589  				}
 21590  			}
 21591  			{
 21592  				v := v.CoordinatorEpoch
 21593  				dst = kbin.AppendInt32(dst, v)
 21594  			}
 21595  			if isFlexible {
 21596  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21597  				dst = v.UnknownTags.AppendEach(dst)
 21598  			}
 21599  		}
 21600  	}
 21601  	if isFlexible {
 21602  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21603  		dst = v.UnknownTags.AppendEach(dst)
 21604  	}
 21605  	return dst
 21606  }
 21607  
 21608  func (v *WriteTxnMarkersRequest) ReadFrom(src []byte) error {
 21609  	return v.readFrom(src, false)
 21610  }
 21611  
 21612  func (v *WriteTxnMarkersRequest) UnsafeReadFrom(src []byte) error {
 21613  	return v.readFrom(src, true)
 21614  }
 21615  
 21616  func (v *WriteTxnMarkersRequest) readFrom(src []byte, unsafe bool) error {
 21617  	v.Default()
 21618  	b := kbin.Reader{Src: src}
 21619  	version := v.Version
 21620  	_ = version
 21621  	isFlexible := version >= 1
 21622  	_ = isFlexible
 21623  	s := v
 21624  	{
 21625  		v := s.Markers
 21626  		a := v
 21627  		var l int32
 21628  		if isFlexible {
 21629  			l = b.CompactArrayLen()
 21630  		} else {
 21631  			l = b.ArrayLen()
 21632  		}
 21633  		if !b.Ok() {
 21634  			return b.Complete()
 21635  		}
 21636  		a = a[:0]
 21637  		if l > 0 {
 21638  			a = append(a, make([]WriteTxnMarkersRequestMarker, l)...)
 21639  		}
 21640  		for i := int32(0); i < l; i++ {
 21641  			v := &a[i]
 21642  			v.Default()
 21643  			s := v
 21644  			{
 21645  				v := b.Int64()
 21646  				s.ProducerID = v
 21647  			}
 21648  			{
 21649  				v := b.Int16()
 21650  				s.ProducerEpoch = v
 21651  			}
 21652  			{
 21653  				v := b.Bool()
 21654  				s.Committed = v
 21655  			}
 21656  			{
 21657  				v := s.Topics
 21658  				a := v
 21659  				var l int32
 21660  				if isFlexible {
 21661  					l = b.CompactArrayLen()
 21662  				} else {
 21663  					l = b.ArrayLen()
 21664  				}
 21665  				if !b.Ok() {
 21666  					return b.Complete()
 21667  				}
 21668  				a = a[:0]
 21669  				if l > 0 {
 21670  					a = append(a, make([]WriteTxnMarkersRequestMarkerTopic, l)...)
 21671  				}
 21672  				for i := int32(0); i < l; i++ {
 21673  					v := &a[i]
 21674  					v.Default()
 21675  					s := v
 21676  					{
 21677  						var v string
 21678  						if unsafe {
 21679  							if isFlexible {
 21680  								v = b.UnsafeCompactString()
 21681  							} else {
 21682  								v = b.UnsafeString()
 21683  							}
 21684  						} else {
 21685  							if isFlexible {
 21686  								v = b.CompactString()
 21687  							} else {
 21688  								v = b.String()
 21689  							}
 21690  						}
 21691  						s.Topic = v
 21692  					}
 21693  					{
 21694  						v := s.Partitions
 21695  						a := v
 21696  						var l int32
 21697  						if isFlexible {
 21698  							l = b.CompactArrayLen()
 21699  						} else {
 21700  							l = b.ArrayLen()
 21701  						}
 21702  						if !b.Ok() {
 21703  							return b.Complete()
 21704  						}
 21705  						a = a[:0]
 21706  						if l > 0 {
 21707  							a = append(a, make([]int32, l)...)
 21708  						}
 21709  						for i := int32(0); i < l; i++ {
 21710  							v := b.Int32()
 21711  							a[i] = v
 21712  						}
 21713  						v = a
 21714  						s.Partitions = v
 21715  					}
 21716  					if isFlexible {
 21717  						s.UnknownTags = internalReadTags(&b)
 21718  					}
 21719  				}
 21720  				v = a
 21721  				s.Topics = v
 21722  			}
 21723  			{
 21724  				v := b.Int32()
 21725  				s.CoordinatorEpoch = v
 21726  			}
 21727  			if isFlexible {
 21728  				s.UnknownTags = internalReadTags(&b)
 21729  			}
 21730  		}
 21731  		v = a
 21732  		s.Markers = v
 21733  	}
 21734  	if isFlexible {
 21735  		s.UnknownTags = internalReadTags(&b)
 21736  	}
 21737  	return b.Complete()
 21738  }
 21739  
 21740  // NewPtrWriteTxnMarkersRequest returns a pointer to a default WriteTxnMarkersRequest
 21741  // This is a shortcut for creating a new(struct) and calling Default yourself.
 21742  func NewPtrWriteTxnMarkersRequest() *WriteTxnMarkersRequest {
 21743  	var v WriteTxnMarkersRequest
 21744  	v.Default()
 21745  	return &v
 21746  }
 21747  
 21748  // Default sets any default fields. Calling this allows for future compatibility
 21749  // if new fields are added to WriteTxnMarkersRequest.
 21750  func (v *WriteTxnMarkersRequest) Default() {
 21751  }
 21752  
 21753  // NewWriteTxnMarkersRequest returns a default WriteTxnMarkersRequest
 21754  // This is a shortcut for creating a struct and calling Default yourself.
 21755  func NewWriteTxnMarkersRequest() WriteTxnMarkersRequest {
 21756  	var v WriteTxnMarkersRequest
 21757  	v.Default()
 21758  	return v
 21759  }
 21760  
 21761  type WriteTxnMarkersResponseMarkerTopicPartition struct {
 21762  	// Partition is the partition this result is for.
 21763  	Partition int32
 21764  
 21765  	// ErrorCode is non-nil if writing the transansactional marker for this
 21766  	// partition errored.
 21767  	//
 21768  	// CLUSTER_AUTHORIZATION_FAILED is returned if the user does not have
 21769  	// CLUSTER_ACTION on CLUSTER.
 21770  	//
 21771  	// NOT_LEADER_OR_FOLLOWER is returned if the broker receiving this
 21772  	// request is not the leader of the partition.
 21773  	//
 21774  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the topic or partition is
 21775  	// not known to exist.
 21776  	//
 21777  	// INVALID_PRODUCER_EPOCH is returned if the cluster epoch is provided
 21778  	// and the provided epoch does not match.
 21779  	ErrorCode int16
 21780  
 21781  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21782  	UnknownTags Tags // v1+
 21783  }
 21784  
 21785  // Default sets any default fields. Calling this allows for future compatibility
 21786  // if new fields are added to WriteTxnMarkersResponseMarkerTopicPartition.
 21787  func (v *WriteTxnMarkersResponseMarkerTopicPartition) Default() {
 21788  }
 21789  
 21790  // NewWriteTxnMarkersResponseMarkerTopicPartition returns a default WriteTxnMarkersResponseMarkerTopicPartition
 21791  // This is a shortcut for creating a struct and calling Default yourself.
 21792  func NewWriteTxnMarkersResponseMarkerTopicPartition() WriteTxnMarkersResponseMarkerTopicPartition {
 21793  	var v WriteTxnMarkersResponseMarkerTopicPartition
 21794  	v.Default()
 21795  	return v
 21796  }
 21797  
 21798  type WriteTxnMarkersResponseMarkerTopic struct {
 21799  	// Topic is the topic these results are for.
 21800  	Topic string
 21801  
 21802  	// Partitions contains per-partition results for the write markers
 21803  	// request.
 21804  	Partitions []WriteTxnMarkersResponseMarkerTopicPartition
 21805  
 21806  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21807  	UnknownTags Tags // v1+
 21808  }
 21809  
 21810  // Default sets any default fields. Calling this allows for future compatibility
 21811  // if new fields are added to WriteTxnMarkersResponseMarkerTopic.
 21812  func (v *WriteTxnMarkersResponseMarkerTopic) Default() {
 21813  }
 21814  
 21815  // NewWriteTxnMarkersResponseMarkerTopic returns a default WriteTxnMarkersResponseMarkerTopic
 21816  // This is a shortcut for creating a struct and calling Default yourself.
 21817  func NewWriteTxnMarkersResponseMarkerTopic() WriteTxnMarkersResponseMarkerTopic {
 21818  	var v WriteTxnMarkersResponseMarkerTopic
 21819  	v.Default()
 21820  	return v
 21821  }
 21822  
 21823  type WriteTxnMarkersResponseMarker struct {
 21824  	// ProducerID is the producer ID these results are for (from the input
 21825  	// request).
 21826  	ProducerID int64
 21827  
 21828  	// Topics contains the results for the write markers request.
 21829  	Topics []WriteTxnMarkersResponseMarkerTopic
 21830  
 21831  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21832  	UnknownTags Tags // v1+
 21833  }
 21834  
 21835  // Default sets any default fields. Calling this allows for future compatibility
 21836  // if new fields are added to WriteTxnMarkersResponseMarker.
 21837  func (v *WriteTxnMarkersResponseMarker) Default() {
 21838  }
 21839  
 21840  // NewWriteTxnMarkersResponseMarker returns a default WriteTxnMarkersResponseMarker
 21841  // This is a shortcut for creating a struct and calling Default yourself.
 21842  func NewWriteTxnMarkersResponseMarker() WriteTxnMarkersResponseMarker {
 21843  	var v WriteTxnMarkersResponseMarker
 21844  	v.Default()
 21845  	return v
 21846  }
 21847  
 21848  // WriteTxnMarkersResponse is a response to a WriteTxnMarkersRequest.
 21849  type WriteTxnMarkersResponse struct {
 21850  	// Version is the version of this message used with a Kafka broker.
 21851  	Version int16
 21852  
 21853  	// Markers contains results for writing transactional markers.
 21854  	Markers []WriteTxnMarkersResponseMarker
 21855  
 21856  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 21857  	UnknownTags Tags // v1+
 21858  }
 21859  
 21860  func (*WriteTxnMarkersResponse) Key() int16                 { return 27 }
 21861  func (*WriteTxnMarkersResponse) MaxVersion() int16          { return 1 }
 21862  func (v *WriteTxnMarkersResponse) SetVersion(version int16) { v.Version = version }
 21863  func (v *WriteTxnMarkersResponse) GetVersion() int16        { return v.Version }
 21864  func (v *WriteTxnMarkersResponse) IsFlexible() bool         { return v.Version >= 1 }
 21865  func (v *WriteTxnMarkersResponse) RequestKind() Request {
 21866  	return &WriteTxnMarkersRequest{Version: v.Version}
 21867  }
 21868  
 21869  func (v *WriteTxnMarkersResponse) AppendTo(dst []byte) []byte {
 21870  	version := v.Version
 21871  	_ = version
 21872  	isFlexible := version >= 1
 21873  	_ = isFlexible
 21874  	{
 21875  		v := v.Markers
 21876  		if isFlexible {
 21877  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 21878  		} else {
 21879  			dst = kbin.AppendArrayLen(dst, len(v))
 21880  		}
 21881  		for i := range v {
 21882  			v := &v[i]
 21883  			{
 21884  				v := v.ProducerID
 21885  				dst = kbin.AppendInt64(dst, v)
 21886  			}
 21887  			{
 21888  				v := v.Topics
 21889  				if isFlexible {
 21890  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 21891  				} else {
 21892  					dst = kbin.AppendArrayLen(dst, len(v))
 21893  				}
 21894  				for i := range v {
 21895  					v := &v[i]
 21896  					{
 21897  						v := v.Topic
 21898  						if isFlexible {
 21899  							dst = kbin.AppendCompactString(dst, v)
 21900  						} else {
 21901  							dst = kbin.AppendString(dst, v)
 21902  						}
 21903  					}
 21904  					{
 21905  						v := v.Partitions
 21906  						if isFlexible {
 21907  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 21908  						} else {
 21909  							dst = kbin.AppendArrayLen(dst, len(v))
 21910  						}
 21911  						for i := range v {
 21912  							v := &v[i]
 21913  							{
 21914  								v := v.Partition
 21915  								dst = kbin.AppendInt32(dst, v)
 21916  							}
 21917  							{
 21918  								v := v.ErrorCode
 21919  								dst = kbin.AppendInt16(dst, v)
 21920  							}
 21921  							if isFlexible {
 21922  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21923  								dst = v.UnknownTags.AppendEach(dst)
 21924  							}
 21925  						}
 21926  					}
 21927  					if isFlexible {
 21928  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21929  						dst = v.UnknownTags.AppendEach(dst)
 21930  					}
 21931  				}
 21932  			}
 21933  			if isFlexible {
 21934  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21935  				dst = v.UnknownTags.AppendEach(dst)
 21936  			}
 21937  		}
 21938  	}
 21939  	if isFlexible {
 21940  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 21941  		dst = v.UnknownTags.AppendEach(dst)
 21942  	}
 21943  	return dst
 21944  }
 21945  
 21946  func (v *WriteTxnMarkersResponse) ReadFrom(src []byte) error {
 21947  	return v.readFrom(src, false)
 21948  }
 21949  
 21950  func (v *WriteTxnMarkersResponse) UnsafeReadFrom(src []byte) error {
 21951  	return v.readFrom(src, true)
 21952  }
 21953  
 21954  func (v *WriteTxnMarkersResponse) readFrom(src []byte, unsafe bool) error {
 21955  	v.Default()
 21956  	b := kbin.Reader{Src: src}
 21957  	version := v.Version
 21958  	_ = version
 21959  	isFlexible := version >= 1
 21960  	_ = isFlexible
 21961  	s := v
 21962  	{
 21963  		v := s.Markers
 21964  		a := v
 21965  		var l int32
 21966  		if isFlexible {
 21967  			l = b.CompactArrayLen()
 21968  		} else {
 21969  			l = b.ArrayLen()
 21970  		}
 21971  		if !b.Ok() {
 21972  			return b.Complete()
 21973  		}
 21974  		a = a[:0]
 21975  		if l > 0 {
 21976  			a = append(a, make([]WriteTxnMarkersResponseMarker, l)...)
 21977  		}
 21978  		for i := int32(0); i < l; i++ {
 21979  			v := &a[i]
 21980  			v.Default()
 21981  			s := v
 21982  			{
 21983  				v := b.Int64()
 21984  				s.ProducerID = v
 21985  			}
 21986  			{
 21987  				v := s.Topics
 21988  				a := v
 21989  				var l int32
 21990  				if isFlexible {
 21991  					l = b.CompactArrayLen()
 21992  				} else {
 21993  					l = b.ArrayLen()
 21994  				}
 21995  				if !b.Ok() {
 21996  					return b.Complete()
 21997  				}
 21998  				a = a[:0]
 21999  				if l > 0 {
 22000  					a = append(a, make([]WriteTxnMarkersResponseMarkerTopic, l)...)
 22001  				}
 22002  				for i := int32(0); i < l; i++ {
 22003  					v := &a[i]
 22004  					v.Default()
 22005  					s := v
 22006  					{
 22007  						var v string
 22008  						if unsafe {
 22009  							if isFlexible {
 22010  								v = b.UnsafeCompactString()
 22011  							} else {
 22012  								v = b.UnsafeString()
 22013  							}
 22014  						} else {
 22015  							if isFlexible {
 22016  								v = b.CompactString()
 22017  							} else {
 22018  								v = b.String()
 22019  							}
 22020  						}
 22021  						s.Topic = v
 22022  					}
 22023  					{
 22024  						v := s.Partitions
 22025  						a := v
 22026  						var l int32
 22027  						if isFlexible {
 22028  							l = b.CompactArrayLen()
 22029  						} else {
 22030  							l = b.ArrayLen()
 22031  						}
 22032  						if !b.Ok() {
 22033  							return b.Complete()
 22034  						}
 22035  						a = a[:0]
 22036  						if l > 0 {
 22037  							a = append(a, make([]WriteTxnMarkersResponseMarkerTopicPartition, l)...)
 22038  						}
 22039  						for i := int32(0); i < l; i++ {
 22040  							v := &a[i]
 22041  							v.Default()
 22042  							s := v
 22043  							{
 22044  								v := b.Int32()
 22045  								s.Partition = v
 22046  							}
 22047  							{
 22048  								v := b.Int16()
 22049  								s.ErrorCode = v
 22050  							}
 22051  							if isFlexible {
 22052  								s.UnknownTags = internalReadTags(&b)
 22053  							}
 22054  						}
 22055  						v = a
 22056  						s.Partitions = v
 22057  					}
 22058  					if isFlexible {
 22059  						s.UnknownTags = internalReadTags(&b)
 22060  					}
 22061  				}
 22062  				v = a
 22063  				s.Topics = v
 22064  			}
 22065  			if isFlexible {
 22066  				s.UnknownTags = internalReadTags(&b)
 22067  			}
 22068  		}
 22069  		v = a
 22070  		s.Markers = v
 22071  	}
 22072  	if isFlexible {
 22073  		s.UnknownTags = internalReadTags(&b)
 22074  	}
 22075  	return b.Complete()
 22076  }
 22077  
 22078  // NewPtrWriteTxnMarkersResponse returns a pointer to a default WriteTxnMarkersResponse
 22079  // This is a shortcut for creating a new(struct) and calling Default yourself.
 22080  func NewPtrWriteTxnMarkersResponse() *WriteTxnMarkersResponse {
 22081  	var v WriteTxnMarkersResponse
 22082  	v.Default()
 22083  	return &v
 22084  }
 22085  
 22086  // Default sets any default fields. Calling this allows for future compatibility
 22087  // if new fields are added to WriteTxnMarkersResponse.
 22088  func (v *WriteTxnMarkersResponse) Default() {
 22089  }
 22090  
 22091  // NewWriteTxnMarkersResponse returns a default WriteTxnMarkersResponse
 22092  // This is a shortcut for creating a struct and calling Default yourself.
 22093  func NewWriteTxnMarkersResponse() WriteTxnMarkersResponse {
 22094  	var v WriteTxnMarkersResponse
 22095  	v.Default()
 22096  	return v
 22097  }
 22098  
 22099  type TxnOffsetCommitRequestTopicPartition struct {
 22100  	// Partition is a partition to add for a pending commit.
 22101  	Partition int32
 22102  
 22103  	// Offset is the offset within partition to commit once EndTxnRequest is
 22104  	// called (with commit; abort obviously aborts).
 22105  	Offset int64
 22106  
 22107  	// LeaderEpoch, proposed in KIP-320 and introduced in Kafka 2.1.0,
 22108  	// allows brokers to check if the client is fenced (has an out of date
 22109  	// leader) or is using an unknown leader.
 22110  	//
 22111  	// The initial leader epoch can be determined from a MetadataResponse.
 22112  	// To skip log truncation checking, use -1.
 22113  	//
 22114  	// This field has a default of -1.
 22115  	LeaderEpoch int32 // v2+
 22116  
 22117  	// Metadata is optional metadata the client wants to include with this
 22118  	// commit.
 22119  	Metadata *string
 22120  
 22121  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22122  	UnknownTags Tags // v3+
 22123  }
 22124  
 22125  // Default sets any default fields. Calling this allows for future compatibility
 22126  // if new fields are added to TxnOffsetCommitRequestTopicPartition.
 22127  func (v *TxnOffsetCommitRequestTopicPartition) Default() {
 22128  	v.LeaderEpoch = -1
 22129  }
 22130  
 22131  // NewTxnOffsetCommitRequestTopicPartition returns a default TxnOffsetCommitRequestTopicPartition
 22132  // This is a shortcut for creating a struct and calling Default yourself.
 22133  func NewTxnOffsetCommitRequestTopicPartition() TxnOffsetCommitRequestTopicPartition {
 22134  	var v TxnOffsetCommitRequestTopicPartition
 22135  	v.Default()
 22136  	return v
 22137  }
 22138  
 22139  type TxnOffsetCommitRequestTopic struct {
 22140  	// Topic is a topic to add for a pending commit.
 22141  	Topic string
 22142  
 22143  	// Partitions are partitions to add for pending commits.
 22144  	Partitions []TxnOffsetCommitRequestTopicPartition
 22145  
 22146  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22147  	UnknownTags Tags // v3+
 22148  }
 22149  
 22150  // Default sets any default fields. Calling this allows for future compatibility
 22151  // if new fields are added to TxnOffsetCommitRequestTopic.
 22152  func (v *TxnOffsetCommitRequestTopic) Default() {
 22153  }
 22154  
 22155  // NewTxnOffsetCommitRequestTopic returns a default TxnOffsetCommitRequestTopic
 22156  // This is a shortcut for creating a struct and calling Default yourself.
 22157  func NewTxnOffsetCommitRequestTopic() TxnOffsetCommitRequestTopic {
 22158  	var v TxnOffsetCommitRequestTopic
 22159  	v.Default()
 22160  	return v
 22161  }
 22162  
 22163  // TxnOffsetCommitRequest sends offsets that are a part of this transaction
 22164  // to be committed once the transaction itself finishes. This effectively
 22165  // replaces OffsetCommitRequest for when using transactions.
 22166  type TxnOffsetCommitRequest struct {
 22167  	// Version is the version of this message used with a Kafka broker.
 22168  	Version int16
 22169  
 22170  	// TransactionalID is the transactional ID to use for this request.
 22171  	TransactionalID string
 22172  
 22173  	// Group is the group consumed in this transaction and to be used for
 22174  	// committing.
 22175  	Group string
 22176  
 22177  	// ProducerID is the producer ID of the client for this transactional ID
 22178  	// as received from InitProducerID.
 22179  	ProducerID int64
 22180  
 22181  	// ProducerEpoch is the producer epoch of the client for this transactional ID
 22182  	// as received from InitProducerID.
 22183  	ProducerEpoch int16
 22184  
 22185  	// Generation is the group generation this transactional offset commit request is for.
 22186  	//
 22187  	// This field has a default of -1.
 22188  	Generation int32 // v3+
 22189  
 22190  	// MemberID is the member ID this member is for.
 22191  	MemberID string // v3+
 22192  
 22193  	// InstanceID is the instance ID of this member in the group (KIP-345, KIP-447).
 22194  	InstanceID *string // v3+
 22195  
 22196  	// Topics are topics to add for pending commits.
 22197  	Topics []TxnOffsetCommitRequestTopic
 22198  
 22199  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22200  	UnknownTags Tags // v3+
 22201  }
 22202  
 22203  func (*TxnOffsetCommitRequest) Key() int16                   { return 28 }
 22204  func (*TxnOffsetCommitRequest) MaxVersion() int16            { return 3 }
 22205  func (v *TxnOffsetCommitRequest) SetVersion(version int16)   { v.Version = version }
 22206  func (v *TxnOffsetCommitRequest) GetVersion() int16          { return v.Version }
 22207  func (v *TxnOffsetCommitRequest) IsFlexible() bool           { return v.Version >= 3 }
 22208  func (v *TxnOffsetCommitRequest) IsGroupCoordinatorRequest() {}
 22209  func (v *TxnOffsetCommitRequest) ResponseKind() Response {
 22210  	r := &TxnOffsetCommitResponse{Version: v.Version}
 22211  	r.Default()
 22212  	return r
 22213  }
 22214  
 22215  // RequestWith is requests v on r and returns the response or an error.
 22216  // For sharded requests, the response may be merged and still return an error.
 22217  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 22218  func (v *TxnOffsetCommitRequest) RequestWith(ctx context.Context, r Requestor) (*TxnOffsetCommitResponse, error) {
 22219  	kresp, err := r.Request(ctx, v)
 22220  	resp, _ := kresp.(*TxnOffsetCommitResponse)
 22221  	return resp, err
 22222  }
 22223  
 22224  func (v *TxnOffsetCommitRequest) AppendTo(dst []byte) []byte {
 22225  	version := v.Version
 22226  	_ = version
 22227  	isFlexible := version >= 3
 22228  	_ = isFlexible
 22229  	{
 22230  		v := v.TransactionalID
 22231  		if isFlexible {
 22232  			dst = kbin.AppendCompactString(dst, v)
 22233  		} else {
 22234  			dst = kbin.AppendString(dst, v)
 22235  		}
 22236  	}
 22237  	{
 22238  		v := v.Group
 22239  		if isFlexible {
 22240  			dst = kbin.AppendCompactString(dst, v)
 22241  		} else {
 22242  			dst = kbin.AppendString(dst, v)
 22243  		}
 22244  	}
 22245  	{
 22246  		v := v.ProducerID
 22247  		dst = kbin.AppendInt64(dst, v)
 22248  	}
 22249  	{
 22250  		v := v.ProducerEpoch
 22251  		dst = kbin.AppendInt16(dst, v)
 22252  	}
 22253  	if version >= 3 {
 22254  		v := v.Generation
 22255  		dst = kbin.AppendInt32(dst, v)
 22256  	}
 22257  	if version >= 3 {
 22258  		v := v.MemberID
 22259  		if isFlexible {
 22260  			dst = kbin.AppendCompactString(dst, v)
 22261  		} else {
 22262  			dst = kbin.AppendString(dst, v)
 22263  		}
 22264  	}
 22265  	if version >= 3 {
 22266  		v := v.InstanceID
 22267  		if isFlexible {
 22268  			dst = kbin.AppendCompactNullableString(dst, v)
 22269  		} else {
 22270  			dst = kbin.AppendNullableString(dst, v)
 22271  		}
 22272  	}
 22273  	{
 22274  		v := v.Topics
 22275  		if isFlexible {
 22276  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 22277  		} else {
 22278  			dst = kbin.AppendArrayLen(dst, len(v))
 22279  		}
 22280  		for i := range v {
 22281  			v := &v[i]
 22282  			{
 22283  				v := v.Topic
 22284  				if isFlexible {
 22285  					dst = kbin.AppendCompactString(dst, v)
 22286  				} else {
 22287  					dst = kbin.AppendString(dst, v)
 22288  				}
 22289  			}
 22290  			{
 22291  				v := v.Partitions
 22292  				if isFlexible {
 22293  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 22294  				} else {
 22295  					dst = kbin.AppendArrayLen(dst, len(v))
 22296  				}
 22297  				for i := range v {
 22298  					v := &v[i]
 22299  					{
 22300  						v := v.Partition
 22301  						dst = kbin.AppendInt32(dst, v)
 22302  					}
 22303  					{
 22304  						v := v.Offset
 22305  						dst = kbin.AppendInt64(dst, v)
 22306  					}
 22307  					if version >= 2 {
 22308  						v := v.LeaderEpoch
 22309  						dst = kbin.AppendInt32(dst, v)
 22310  					}
 22311  					{
 22312  						v := v.Metadata
 22313  						if isFlexible {
 22314  							dst = kbin.AppendCompactNullableString(dst, v)
 22315  						} else {
 22316  							dst = kbin.AppendNullableString(dst, v)
 22317  						}
 22318  					}
 22319  					if isFlexible {
 22320  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22321  						dst = v.UnknownTags.AppendEach(dst)
 22322  					}
 22323  				}
 22324  			}
 22325  			if isFlexible {
 22326  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22327  				dst = v.UnknownTags.AppendEach(dst)
 22328  			}
 22329  		}
 22330  	}
 22331  	if isFlexible {
 22332  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22333  		dst = v.UnknownTags.AppendEach(dst)
 22334  	}
 22335  	return dst
 22336  }
 22337  
 22338  func (v *TxnOffsetCommitRequest) ReadFrom(src []byte) error {
 22339  	return v.readFrom(src, false)
 22340  }
 22341  
 22342  func (v *TxnOffsetCommitRequest) UnsafeReadFrom(src []byte) error {
 22343  	return v.readFrom(src, true)
 22344  }
 22345  
 22346  func (v *TxnOffsetCommitRequest) readFrom(src []byte, unsafe bool) error {
 22347  	v.Default()
 22348  	b := kbin.Reader{Src: src}
 22349  	version := v.Version
 22350  	_ = version
 22351  	isFlexible := version >= 3
 22352  	_ = isFlexible
 22353  	s := v
 22354  	{
 22355  		var v string
 22356  		if unsafe {
 22357  			if isFlexible {
 22358  				v = b.UnsafeCompactString()
 22359  			} else {
 22360  				v = b.UnsafeString()
 22361  			}
 22362  		} else {
 22363  			if isFlexible {
 22364  				v = b.CompactString()
 22365  			} else {
 22366  				v = b.String()
 22367  			}
 22368  		}
 22369  		s.TransactionalID = v
 22370  	}
 22371  	{
 22372  		var v string
 22373  		if unsafe {
 22374  			if isFlexible {
 22375  				v = b.UnsafeCompactString()
 22376  			} else {
 22377  				v = b.UnsafeString()
 22378  			}
 22379  		} else {
 22380  			if isFlexible {
 22381  				v = b.CompactString()
 22382  			} else {
 22383  				v = b.String()
 22384  			}
 22385  		}
 22386  		s.Group = v
 22387  	}
 22388  	{
 22389  		v := b.Int64()
 22390  		s.ProducerID = v
 22391  	}
 22392  	{
 22393  		v := b.Int16()
 22394  		s.ProducerEpoch = v
 22395  	}
 22396  	if version >= 3 {
 22397  		v := b.Int32()
 22398  		s.Generation = v
 22399  	}
 22400  	if version >= 3 {
 22401  		var v string
 22402  		if unsafe {
 22403  			if isFlexible {
 22404  				v = b.UnsafeCompactString()
 22405  			} else {
 22406  				v = b.UnsafeString()
 22407  			}
 22408  		} else {
 22409  			if isFlexible {
 22410  				v = b.CompactString()
 22411  			} else {
 22412  				v = b.String()
 22413  			}
 22414  		}
 22415  		s.MemberID = v
 22416  	}
 22417  	if version >= 3 {
 22418  		var v *string
 22419  		if isFlexible {
 22420  			if unsafe {
 22421  				v = b.UnsafeCompactNullableString()
 22422  			} else {
 22423  				v = b.CompactNullableString()
 22424  			}
 22425  		} else {
 22426  			if unsafe {
 22427  				v = b.UnsafeNullableString()
 22428  			} else {
 22429  				v = b.NullableString()
 22430  			}
 22431  		}
 22432  		s.InstanceID = v
 22433  	}
 22434  	{
 22435  		v := s.Topics
 22436  		a := v
 22437  		var l int32
 22438  		if isFlexible {
 22439  			l = b.CompactArrayLen()
 22440  		} else {
 22441  			l = b.ArrayLen()
 22442  		}
 22443  		if !b.Ok() {
 22444  			return b.Complete()
 22445  		}
 22446  		a = a[:0]
 22447  		if l > 0 {
 22448  			a = append(a, make([]TxnOffsetCommitRequestTopic, l)...)
 22449  		}
 22450  		for i := int32(0); i < l; i++ {
 22451  			v := &a[i]
 22452  			v.Default()
 22453  			s := v
 22454  			{
 22455  				var v string
 22456  				if unsafe {
 22457  					if isFlexible {
 22458  						v = b.UnsafeCompactString()
 22459  					} else {
 22460  						v = b.UnsafeString()
 22461  					}
 22462  				} else {
 22463  					if isFlexible {
 22464  						v = b.CompactString()
 22465  					} else {
 22466  						v = b.String()
 22467  					}
 22468  				}
 22469  				s.Topic = v
 22470  			}
 22471  			{
 22472  				v := s.Partitions
 22473  				a := v
 22474  				var l int32
 22475  				if isFlexible {
 22476  					l = b.CompactArrayLen()
 22477  				} else {
 22478  					l = b.ArrayLen()
 22479  				}
 22480  				if !b.Ok() {
 22481  					return b.Complete()
 22482  				}
 22483  				a = a[:0]
 22484  				if l > 0 {
 22485  					a = append(a, make([]TxnOffsetCommitRequestTopicPartition, l)...)
 22486  				}
 22487  				for i := int32(0); i < l; i++ {
 22488  					v := &a[i]
 22489  					v.Default()
 22490  					s := v
 22491  					{
 22492  						v := b.Int32()
 22493  						s.Partition = v
 22494  					}
 22495  					{
 22496  						v := b.Int64()
 22497  						s.Offset = v
 22498  					}
 22499  					if version >= 2 {
 22500  						v := b.Int32()
 22501  						s.LeaderEpoch = v
 22502  					}
 22503  					{
 22504  						var v *string
 22505  						if isFlexible {
 22506  							if unsafe {
 22507  								v = b.UnsafeCompactNullableString()
 22508  							} else {
 22509  								v = b.CompactNullableString()
 22510  							}
 22511  						} else {
 22512  							if unsafe {
 22513  								v = b.UnsafeNullableString()
 22514  							} else {
 22515  								v = b.NullableString()
 22516  							}
 22517  						}
 22518  						s.Metadata = v
 22519  					}
 22520  					if isFlexible {
 22521  						s.UnknownTags = internalReadTags(&b)
 22522  					}
 22523  				}
 22524  				v = a
 22525  				s.Partitions = v
 22526  			}
 22527  			if isFlexible {
 22528  				s.UnknownTags = internalReadTags(&b)
 22529  			}
 22530  		}
 22531  		v = a
 22532  		s.Topics = v
 22533  	}
 22534  	if isFlexible {
 22535  		s.UnknownTags = internalReadTags(&b)
 22536  	}
 22537  	return b.Complete()
 22538  }
 22539  
 22540  // NewPtrTxnOffsetCommitRequest returns a pointer to a default TxnOffsetCommitRequest
 22541  // This is a shortcut for creating a new(struct) and calling Default yourself.
 22542  func NewPtrTxnOffsetCommitRequest() *TxnOffsetCommitRequest {
 22543  	var v TxnOffsetCommitRequest
 22544  	v.Default()
 22545  	return &v
 22546  }
 22547  
 22548  // Default sets any default fields. Calling this allows for future compatibility
 22549  // if new fields are added to TxnOffsetCommitRequest.
 22550  func (v *TxnOffsetCommitRequest) Default() {
 22551  	v.Generation = -1
 22552  }
 22553  
 22554  // NewTxnOffsetCommitRequest returns a default TxnOffsetCommitRequest
 22555  // This is a shortcut for creating a struct and calling Default yourself.
 22556  func NewTxnOffsetCommitRequest() TxnOffsetCommitRequest {
 22557  	var v TxnOffsetCommitRequest
 22558  	v.Default()
 22559  	return v
 22560  }
 22561  
 22562  type TxnOffsetCommitResponseTopicPartition struct {
 22563  	// Partition is the partition this response is for.
 22564  	Partition int32
 22565  
 22566  	// ErrorCode is any error for this topic/partition commit.
 22567  	//
 22568  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned if the client is
 22569  	// not authorized for write with transactional IDs with the requested
 22570  	// transactional ID.
 22571  	//
 22572  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 22573  	// to read group with the requested group id.
 22574  	//
 22575  	// TOPIC_AUTHORIZATION_FAILED is returned for all topics that the client
 22576  	// is not authorized to read.
 22577  	//
 22578  	// UNKNOWN_TOPIC_OR_PARTITION is returned for all topics or partitions
 22579  	// that the broker does not know of.
 22580  	//
 22581  	// INVALID_GROUP_ID is returned if the requested group does not exist.
 22582  	//
 22583  	// COORDINATOR_NOT_AVAILABLE is returned if the broker is not yet fully
 22584  	// started or is shutting down, or if the group was just deleted or is
 22585  	// migrating to another broker.
 22586  	//
 22587  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is still loading.
 22588  	//
 22589  	// NOT_COORDINATOR is returned if the broker is not the coordinator for
 22590  	// the group.
 22591  	//
 22592  	// FENCED_INSTANCE_ID is returned if the member is fenced (another newer
 22593  	// transactional member is using the same instance ID).
 22594  	//
 22595  	// UNKNOWN_MEMBER_ID is returned if the consumer group does not know of
 22596  	// this member.
 22597  	//
 22598  	// ILLEGAL_GENERATION is returned if the consumer group's generation is
 22599  	// different than the requested generation.
 22600  	//
 22601  	// OFFSET_METADATA_TOO_LARGE is returned if the commit metadata is too
 22602  	// large.
 22603  	//
 22604  	// REBALANCE_IN_PROGRESS is returned if the group is completing a rebalance.
 22605  	ErrorCode int16
 22606  
 22607  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22608  	UnknownTags Tags // v3+
 22609  }
 22610  
 22611  // Default sets any default fields. Calling this allows for future compatibility
 22612  // if new fields are added to TxnOffsetCommitResponseTopicPartition.
 22613  func (v *TxnOffsetCommitResponseTopicPartition) Default() {
 22614  }
 22615  
 22616  // NewTxnOffsetCommitResponseTopicPartition returns a default TxnOffsetCommitResponseTopicPartition
 22617  // This is a shortcut for creating a struct and calling Default yourself.
 22618  func NewTxnOffsetCommitResponseTopicPartition() TxnOffsetCommitResponseTopicPartition {
 22619  	var v TxnOffsetCommitResponseTopicPartition
 22620  	v.Default()
 22621  	return v
 22622  }
 22623  
 22624  type TxnOffsetCommitResponseTopic struct {
 22625  	// Topic is the topic this response is for.
 22626  	Topic string
 22627  
 22628  	// Partitions contains responses to the partitions in this topic.
 22629  	Partitions []TxnOffsetCommitResponseTopicPartition
 22630  
 22631  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22632  	UnknownTags Tags // v3+
 22633  }
 22634  
 22635  // Default sets any default fields. Calling this allows for future compatibility
 22636  // if new fields are added to TxnOffsetCommitResponseTopic.
 22637  func (v *TxnOffsetCommitResponseTopic) Default() {
 22638  }
 22639  
 22640  // NewTxnOffsetCommitResponseTopic returns a default TxnOffsetCommitResponseTopic
 22641  // This is a shortcut for creating a struct and calling Default yourself.
 22642  func NewTxnOffsetCommitResponseTopic() TxnOffsetCommitResponseTopic {
 22643  	var v TxnOffsetCommitResponseTopic
 22644  	v.Default()
 22645  	return v
 22646  }
 22647  
 22648  // TxnOffsetCommitResponse is a response to a TxnOffsetCommitRequest.
 22649  type TxnOffsetCommitResponse struct {
 22650  	// Version is the version of this message used with a Kafka broker.
 22651  	Version int16
 22652  
 22653  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 22654  	// after this request.
 22655  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 22656  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 22657  	//
 22658  	// This request switched at version 1.
 22659  	ThrottleMillis int32
 22660  
 22661  	// Topics contains responses to the topics in the request.
 22662  	Topics []TxnOffsetCommitResponseTopic
 22663  
 22664  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22665  	UnknownTags Tags // v3+
 22666  }
 22667  
 22668  func (*TxnOffsetCommitResponse) Key() int16                 { return 28 }
 22669  func (*TxnOffsetCommitResponse) MaxVersion() int16          { return 3 }
 22670  func (v *TxnOffsetCommitResponse) SetVersion(version int16) { v.Version = version }
 22671  func (v *TxnOffsetCommitResponse) GetVersion() int16        { return v.Version }
 22672  func (v *TxnOffsetCommitResponse) IsFlexible() bool         { return v.Version >= 3 }
 22673  func (v *TxnOffsetCommitResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 1 }
 22674  func (v *TxnOffsetCommitResponse) SetThrottle(throttleMillis int32) {
 22675  	v.ThrottleMillis = throttleMillis
 22676  }
 22677  
 22678  func (v *TxnOffsetCommitResponse) RequestKind() Request {
 22679  	return &TxnOffsetCommitRequest{Version: v.Version}
 22680  }
 22681  
 22682  func (v *TxnOffsetCommitResponse) AppendTo(dst []byte) []byte {
 22683  	version := v.Version
 22684  	_ = version
 22685  	isFlexible := version >= 3
 22686  	_ = isFlexible
 22687  	{
 22688  		v := v.ThrottleMillis
 22689  		dst = kbin.AppendInt32(dst, v)
 22690  	}
 22691  	{
 22692  		v := v.Topics
 22693  		if isFlexible {
 22694  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 22695  		} else {
 22696  			dst = kbin.AppendArrayLen(dst, len(v))
 22697  		}
 22698  		for i := range v {
 22699  			v := &v[i]
 22700  			{
 22701  				v := v.Topic
 22702  				if isFlexible {
 22703  					dst = kbin.AppendCompactString(dst, v)
 22704  				} else {
 22705  					dst = kbin.AppendString(dst, v)
 22706  				}
 22707  			}
 22708  			{
 22709  				v := v.Partitions
 22710  				if isFlexible {
 22711  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 22712  				} else {
 22713  					dst = kbin.AppendArrayLen(dst, len(v))
 22714  				}
 22715  				for i := range v {
 22716  					v := &v[i]
 22717  					{
 22718  						v := v.Partition
 22719  						dst = kbin.AppendInt32(dst, v)
 22720  					}
 22721  					{
 22722  						v := v.ErrorCode
 22723  						dst = kbin.AppendInt16(dst, v)
 22724  					}
 22725  					if isFlexible {
 22726  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22727  						dst = v.UnknownTags.AppendEach(dst)
 22728  					}
 22729  				}
 22730  			}
 22731  			if isFlexible {
 22732  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22733  				dst = v.UnknownTags.AppendEach(dst)
 22734  			}
 22735  		}
 22736  	}
 22737  	if isFlexible {
 22738  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22739  		dst = v.UnknownTags.AppendEach(dst)
 22740  	}
 22741  	return dst
 22742  }
 22743  
 22744  func (v *TxnOffsetCommitResponse) ReadFrom(src []byte) error {
 22745  	return v.readFrom(src, false)
 22746  }
 22747  
 22748  func (v *TxnOffsetCommitResponse) UnsafeReadFrom(src []byte) error {
 22749  	return v.readFrom(src, true)
 22750  }
 22751  
 22752  func (v *TxnOffsetCommitResponse) readFrom(src []byte, unsafe bool) error {
 22753  	v.Default()
 22754  	b := kbin.Reader{Src: src}
 22755  	version := v.Version
 22756  	_ = version
 22757  	isFlexible := version >= 3
 22758  	_ = isFlexible
 22759  	s := v
 22760  	{
 22761  		v := b.Int32()
 22762  		s.ThrottleMillis = v
 22763  	}
 22764  	{
 22765  		v := s.Topics
 22766  		a := v
 22767  		var l int32
 22768  		if isFlexible {
 22769  			l = b.CompactArrayLen()
 22770  		} else {
 22771  			l = b.ArrayLen()
 22772  		}
 22773  		if !b.Ok() {
 22774  			return b.Complete()
 22775  		}
 22776  		a = a[:0]
 22777  		if l > 0 {
 22778  			a = append(a, make([]TxnOffsetCommitResponseTopic, l)...)
 22779  		}
 22780  		for i := int32(0); i < l; i++ {
 22781  			v := &a[i]
 22782  			v.Default()
 22783  			s := v
 22784  			{
 22785  				var v string
 22786  				if unsafe {
 22787  					if isFlexible {
 22788  						v = b.UnsafeCompactString()
 22789  					} else {
 22790  						v = b.UnsafeString()
 22791  					}
 22792  				} else {
 22793  					if isFlexible {
 22794  						v = b.CompactString()
 22795  					} else {
 22796  						v = b.String()
 22797  					}
 22798  				}
 22799  				s.Topic = v
 22800  			}
 22801  			{
 22802  				v := s.Partitions
 22803  				a := v
 22804  				var l int32
 22805  				if isFlexible {
 22806  					l = b.CompactArrayLen()
 22807  				} else {
 22808  					l = b.ArrayLen()
 22809  				}
 22810  				if !b.Ok() {
 22811  					return b.Complete()
 22812  				}
 22813  				a = a[:0]
 22814  				if l > 0 {
 22815  					a = append(a, make([]TxnOffsetCommitResponseTopicPartition, l)...)
 22816  				}
 22817  				for i := int32(0); i < l; i++ {
 22818  					v := &a[i]
 22819  					v.Default()
 22820  					s := v
 22821  					{
 22822  						v := b.Int32()
 22823  						s.Partition = v
 22824  					}
 22825  					{
 22826  						v := b.Int16()
 22827  						s.ErrorCode = v
 22828  					}
 22829  					if isFlexible {
 22830  						s.UnknownTags = internalReadTags(&b)
 22831  					}
 22832  				}
 22833  				v = a
 22834  				s.Partitions = v
 22835  			}
 22836  			if isFlexible {
 22837  				s.UnknownTags = internalReadTags(&b)
 22838  			}
 22839  		}
 22840  		v = a
 22841  		s.Topics = v
 22842  	}
 22843  	if isFlexible {
 22844  		s.UnknownTags = internalReadTags(&b)
 22845  	}
 22846  	return b.Complete()
 22847  }
 22848  
 22849  // NewPtrTxnOffsetCommitResponse returns a pointer to a default TxnOffsetCommitResponse
 22850  // This is a shortcut for creating a new(struct) and calling Default yourself.
 22851  func NewPtrTxnOffsetCommitResponse() *TxnOffsetCommitResponse {
 22852  	var v TxnOffsetCommitResponse
 22853  	v.Default()
 22854  	return &v
 22855  }
 22856  
 22857  // Default sets any default fields. Calling this allows for future compatibility
 22858  // if new fields are added to TxnOffsetCommitResponse.
 22859  func (v *TxnOffsetCommitResponse) Default() {
 22860  }
 22861  
 22862  // NewTxnOffsetCommitResponse returns a default TxnOffsetCommitResponse
 22863  // This is a shortcut for creating a struct and calling Default yourself.
 22864  func NewTxnOffsetCommitResponse() TxnOffsetCommitResponse {
 22865  	var v TxnOffsetCommitResponse
 22866  	v.Default()
 22867  	return v
 22868  }
 22869  
 22870  // DescribeACLsRequest describes ACLs. Describing ACLs works on a filter basis:
 22871  // anything that matches the filter is described. Note that there are two
 22872  // "types" of filters in this request: the resource filter and the entry
 22873  // filter, with entries corresponding to users. The first three fields form the
 22874  // resource filter, the last four the entry filter.
 22875  type DescribeACLsRequest struct {
 22876  	// Version is the version of this message used with a Kafka broker.
 22877  	Version int16
 22878  
 22879  	// ResourceType is the type of resource to describe.
 22880  	ResourceType ACLResourceType
 22881  
 22882  	// ResourceName is the name to filter out. For the CLUSTER resource type,
 22883  	// this must be "kafka-cluster".
 22884  	ResourceName *string
 22885  
 22886  	// ResourcePatternType is how ResourceName is understood.
 22887  	//
 22888  	// This field has a default of 3.
 22889  	ResourcePatternType ACLResourcePatternType // v1+
 22890  
 22891  	// Principal is the user to filter for. In Kafka with the simple authorizor,
 22892  	// all principals begin with "User:". Pluggable authorizors are allowed, but
 22893  	// Kafka still expects principals to lead with a principal type ("User") and
 22894  	// have a colon separating the principal name ("bob" in "User:bob").
 22895  	Principal *string
 22896  
 22897  	// Host is a host to filter for.
 22898  	Host *string
 22899  
 22900  	// Operation is an operation to filter for.
 22901  	//
 22902  	// Note that READ, WRITE, DELETE, and ALTER imply DESCRIBE, and ALTER_CONFIGS
 22903  	// implies DESCRIBE_CONFIGS.
 22904  	Operation ACLOperation
 22905  
 22906  	// PermissionType is the permission type to filter for. UNKNOWN is 0.
 22907  	PermissionType ACLPermissionType
 22908  
 22909  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 22910  	UnknownTags Tags // v2+
 22911  }
 22912  
 22913  func (*DescribeACLsRequest) Key() int16                 { return 29 }
 22914  func (*DescribeACLsRequest) MaxVersion() int16          { return 3 }
 22915  func (v *DescribeACLsRequest) SetVersion(version int16) { v.Version = version }
 22916  func (v *DescribeACLsRequest) GetVersion() int16        { return v.Version }
 22917  func (v *DescribeACLsRequest) IsFlexible() bool         { return v.Version >= 2 }
 22918  func (v *DescribeACLsRequest) ResponseKind() Response {
 22919  	r := &DescribeACLsResponse{Version: v.Version}
 22920  	r.Default()
 22921  	return r
 22922  }
 22923  
 22924  // RequestWith is requests v on r and returns the response or an error.
 22925  // For sharded requests, the response may be merged and still return an error.
 22926  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 22927  func (v *DescribeACLsRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeACLsResponse, error) {
 22928  	kresp, err := r.Request(ctx, v)
 22929  	resp, _ := kresp.(*DescribeACLsResponse)
 22930  	return resp, err
 22931  }
 22932  
 22933  func (v *DescribeACLsRequest) AppendTo(dst []byte) []byte {
 22934  	version := v.Version
 22935  	_ = version
 22936  	isFlexible := version >= 2
 22937  	_ = isFlexible
 22938  	{
 22939  		v := v.ResourceType
 22940  		{
 22941  			v := int8(v)
 22942  			dst = kbin.AppendInt8(dst, v)
 22943  		}
 22944  	}
 22945  	{
 22946  		v := v.ResourceName
 22947  		if isFlexible {
 22948  			dst = kbin.AppendCompactNullableString(dst, v)
 22949  		} else {
 22950  			dst = kbin.AppendNullableString(dst, v)
 22951  		}
 22952  	}
 22953  	if version >= 1 {
 22954  		v := v.ResourcePatternType
 22955  		{
 22956  			v := int8(v)
 22957  			dst = kbin.AppendInt8(dst, v)
 22958  		}
 22959  	}
 22960  	{
 22961  		v := v.Principal
 22962  		if isFlexible {
 22963  			dst = kbin.AppendCompactNullableString(dst, v)
 22964  		} else {
 22965  			dst = kbin.AppendNullableString(dst, v)
 22966  		}
 22967  	}
 22968  	{
 22969  		v := v.Host
 22970  		if isFlexible {
 22971  			dst = kbin.AppendCompactNullableString(dst, v)
 22972  		} else {
 22973  			dst = kbin.AppendNullableString(dst, v)
 22974  		}
 22975  	}
 22976  	{
 22977  		v := v.Operation
 22978  		{
 22979  			v := int8(v)
 22980  			dst = kbin.AppendInt8(dst, v)
 22981  		}
 22982  	}
 22983  	{
 22984  		v := v.PermissionType
 22985  		{
 22986  			v := int8(v)
 22987  			dst = kbin.AppendInt8(dst, v)
 22988  		}
 22989  	}
 22990  	if isFlexible {
 22991  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 22992  		dst = v.UnknownTags.AppendEach(dst)
 22993  	}
 22994  	return dst
 22995  }
 22996  
 22997  func (v *DescribeACLsRequest) ReadFrom(src []byte) error {
 22998  	return v.readFrom(src, false)
 22999  }
 23000  
 23001  func (v *DescribeACLsRequest) UnsafeReadFrom(src []byte) error {
 23002  	return v.readFrom(src, true)
 23003  }
 23004  
 23005  func (v *DescribeACLsRequest) readFrom(src []byte, unsafe bool) error {
 23006  	v.Default()
 23007  	b := kbin.Reader{Src: src}
 23008  	version := v.Version
 23009  	_ = version
 23010  	isFlexible := version >= 2
 23011  	_ = isFlexible
 23012  	s := v
 23013  	{
 23014  		var t ACLResourceType
 23015  		{
 23016  			v := b.Int8()
 23017  			t = ACLResourceType(v)
 23018  		}
 23019  		v := t
 23020  		s.ResourceType = v
 23021  	}
 23022  	{
 23023  		var v *string
 23024  		if isFlexible {
 23025  			if unsafe {
 23026  				v = b.UnsafeCompactNullableString()
 23027  			} else {
 23028  				v = b.CompactNullableString()
 23029  			}
 23030  		} else {
 23031  			if unsafe {
 23032  				v = b.UnsafeNullableString()
 23033  			} else {
 23034  				v = b.NullableString()
 23035  			}
 23036  		}
 23037  		s.ResourceName = v
 23038  	}
 23039  	if version >= 1 {
 23040  		var t ACLResourcePatternType
 23041  		{
 23042  			v := b.Int8()
 23043  			t = ACLResourcePatternType(v)
 23044  		}
 23045  		v := t
 23046  		s.ResourcePatternType = v
 23047  	}
 23048  	{
 23049  		var v *string
 23050  		if isFlexible {
 23051  			if unsafe {
 23052  				v = b.UnsafeCompactNullableString()
 23053  			} else {
 23054  				v = b.CompactNullableString()
 23055  			}
 23056  		} else {
 23057  			if unsafe {
 23058  				v = b.UnsafeNullableString()
 23059  			} else {
 23060  				v = b.NullableString()
 23061  			}
 23062  		}
 23063  		s.Principal = v
 23064  	}
 23065  	{
 23066  		var v *string
 23067  		if isFlexible {
 23068  			if unsafe {
 23069  				v = b.UnsafeCompactNullableString()
 23070  			} else {
 23071  				v = b.CompactNullableString()
 23072  			}
 23073  		} else {
 23074  			if unsafe {
 23075  				v = b.UnsafeNullableString()
 23076  			} else {
 23077  				v = b.NullableString()
 23078  			}
 23079  		}
 23080  		s.Host = v
 23081  	}
 23082  	{
 23083  		var t ACLOperation
 23084  		{
 23085  			v := b.Int8()
 23086  			t = ACLOperation(v)
 23087  		}
 23088  		v := t
 23089  		s.Operation = v
 23090  	}
 23091  	{
 23092  		var t ACLPermissionType
 23093  		{
 23094  			v := b.Int8()
 23095  			t = ACLPermissionType(v)
 23096  		}
 23097  		v := t
 23098  		s.PermissionType = v
 23099  	}
 23100  	if isFlexible {
 23101  		s.UnknownTags = internalReadTags(&b)
 23102  	}
 23103  	return b.Complete()
 23104  }
 23105  
 23106  // NewPtrDescribeACLsRequest returns a pointer to a default DescribeACLsRequest
 23107  // This is a shortcut for creating a new(struct) and calling Default yourself.
 23108  func NewPtrDescribeACLsRequest() *DescribeACLsRequest {
 23109  	var v DescribeACLsRequest
 23110  	v.Default()
 23111  	return &v
 23112  }
 23113  
 23114  // Default sets any default fields. Calling this allows for future compatibility
 23115  // if new fields are added to DescribeACLsRequest.
 23116  func (v *DescribeACLsRequest) Default() {
 23117  	v.ResourcePatternType = 3
 23118  }
 23119  
 23120  // NewDescribeACLsRequest returns a default DescribeACLsRequest
 23121  // This is a shortcut for creating a struct and calling Default yourself.
 23122  func NewDescribeACLsRequest() DescribeACLsRequest {
 23123  	var v DescribeACLsRequest
 23124  	v.Default()
 23125  	return v
 23126  }
 23127  
 23128  type DescribeACLsResponseResourceACL struct {
 23129  	// Principal is who this ACL applies to.
 23130  	Principal string
 23131  
 23132  	// Host is on which host this ACL applies.
 23133  	Host string
 23134  
 23135  	// Operation is the operation being described.
 23136  	Operation ACLOperation
 23137  
 23138  	// PermissionType is the permission being described.
 23139  	PermissionType ACLPermissionType
 23140  
 23141  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23142  	UnknownTags Tags // v2+
 23143  }
 23144  
 23145  // Default sets any default fields. Calling this allows for future compatibility
 23146  // if new fields are added to DescribeACLsResponseResourceACL.
 23147  func (v *DescribeACLsResponseResourceACL) Default() {
 23148  }
 23149  
 23150  // NewDescribeACLsResponseResourceACL returns a default DescribeACLsResponseResourceACL
 23151  // This is a shortcut for creating a struct and calling Default yourself.
 23152  func NewDescribeACLsResponseResourceACL() DescribeACLsResponseResourceACL {
 23153  	var v DescribeACLsResponseResourceACL
 23154  	v.Default()
 23155  	return v
 23156  }
 23157  
 23158  type DescribeACLsResponseResource struct {
 23159  	// ResourceType is the resource type being described.
 23160  	ResourceType ACLResourceType
 23161  
 23162  	// ResourceName is the resource name being described.
 23163  	ResourceName string
 23164  
 23165  	// ResourcePatternType is the pattern type being described.
 23166  	//
 23167  	// This field has a default of 3.
 23168  	ResourcePatternType ACLResourcePatternType // v1+
 23169  
 23170  	// ACLs contains users / entries being described.
 23171  	ACLs []DescribeACLsResponseResourceACL
 23172  
 23173  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23174  	UnknownTags Tags // v2+
 23175  }
 23176  
 23177  // Default sets any default fields. Calling this allows for future compatibility
 23178  // if new fields are added to DescribeACLsResponseResource.
 23179  func (v *DescribeACLsResponseResource) Default() {
 23180  	v.ResourcePatternType = 3
 23181  }
 23182  
 23183  // NewDescribeACLsResponseResource returns a default DescribeACLsResponseResource
 23184  // This is a shortcut for creating a struct and calling Default yourself.
 23185  func NewDescribeACLsResponseResource() DescribeACLsResponseResource {
 23186  	var v DescribeACLsResponseResource
 23187  	v.Default()
 23188  	return v
 23189  }
 23190  
 23191  // DescribeACLsResponse is a response to a describe acls request.
 23192  type DescribeACLsResponse struct {
 23193  	// Version is the version of this message used with a Kafka broker.
 23194  	Version int16
 23195  
 23196  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 23197  	// after this request.
 23198  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 23199  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 23200  	//
 23201  	// This request switched at version 1.
 23202  	ThrottleMillis int32
 23203  
 23204  	// ErrorCode is the error code returned on request failure.
 23205  	//
 23206  	// SECURITY_DISABLED is returned if there is no authorizer configured on the
 23207  	// broker.
 23208  	//
 23209  	// There can be other authorization failures.
 23210  	ErrorCode int16
 23211  
 23212  	// ErrorMessage is a message for an error.
 23213  	ErrorMessage *string
 23214  
 23215  	// Resources are the describe resources.
 23216  	Resources []DescribeACLsResponseResource
 23217  
 23218  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23219  	UnknownTags Tags // v2+
 23220  }
 23221  
 23222  func (*DescribeACLsResponse) Key() int16                         { return 29 }
 23223  func (*DescribeACLsResponse) MaxVersion() int16                  { return 3 }
 23224  func (v *DescribeACLsResponse) SetVersion(version int16)         { v.Version = version }
 23225  func (v *DescribeACLsResponse) GetVersion() int16                { return v.Version }
 23226  func (v *DescribeACLsResponse) IsFlexible() bool                 { return v.Version >= 2 }
 23227  func (v *DescribeACLsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 23228  func (v *DescribeACLsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 23229  func (v *DescribeACLsResponse) RequestKind() Request             { return &DescribeACLsRequest{Version: v.Version} }
 23230  
 23231  func (v *DescribeACLsResponse) AppendTo(dst []byte) []byte {
 23232  	version := v.Version
 23233  	_ = version
 23234  	isFlexible := version >= 2
 23235  	_ = isFlexible
 23236  	{
 23237  		v := v.ThrottleMillis
 23238  		dst = kbin.AppendInt32(dst, v)
 23239  	}
 23240  	{
 23241  		v := v.ErrorCode
 23242  		dst = kbin.AppendInt16(dst, v)
 23243  	}
 23244  	{
 23245  		v := v.ErrorMessage
 23246  		if isFlexible {
 23247  			dst = kbin.AppendCompactNullableString(dst, v)
 23248  		} else {
 23249  			dst = kbin.AppendNullableString(dst, v)
 23250  		}
 23251  	}
 23252  	{
 23253  		v := v.Resources
 23254  		if isFlexible {
 23255  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 23256  		} else {
 23257  			dst = kbin.AppendArrayLen(dst, len(v))
 23258  		}
 23259  		for i := range v {
 23260  			v := &v[i]
 23261  			{
 23262  				v := v.ResourceType
 23263  				{
 23264  					v := int8(v)
 23265  					dst = kbin.AppendInt8(dst, v)
 23266  				}
 23267  			}
 23268  			{
 23269  				v := v.ResourceName
 23270  				if isFlexible {
 23271  					dst = kbin.AppendCompactString(dst, v)
 23272  				} else {
 23273  					dst = kbin.AppendString(dst, v)
 23274  				}
 23275  			}
 23276  			if version >= 1 {
 23277  				v := v.ResourcePatternType
 23278  				{
 23279  					v := int8(v)
 23280  					dst = kbin.AppendInt8(dst, v)
 23281  				}
 23282  			}
 23283  			{
 23284  				v := v.ACLs
 23285  				if isFlexible {
 23286  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 23287  				} else {
 23288  					dst = kbin.AppendArrayLen(dst, len(v))
 23289  				}
 23290  				for i := range v {
 23291  					v := &v[i]
 23292  					{
 23293  						v := v.Principal
 23294  						if isFlexible {
 23295  							dst = kbin.AppendCompactString(dst, v)
 23296  						} else {
 23297  							dst = kbin.AppendString(dst, v)
 23298  						}
 23299  					}
 23300  					{
 23301  						v := v.Host
 23302  						if isFlexible {
 23303  							dst = kbin.AppendCompactString(dst, v)
 23304  						} else {
 23305  							dst = kbin.AppendString(dst, v)
 23306  						}
 23307  					}
 23308  					{
 23309  						v := v.Operation
 23310  						{
 23311  							v := int8(v)
 23312  							dst = kbin.AppendInt8(dst, v)
 23313  						}
 23314  					}
 23315  					{
 23316  						v := v.PermissionType
 23317  						{
 23318  							v := int8(v)
 23319  							dst = kbin.AppendInt8(dst, v)
 23320  						}
 23321  					}
 23322  					if isFlexible {
 23323  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23324  						dst = v.UnknownTags.AppendEach(dst)
 23325  					}
 23326  				}
 23327  			}
 23328  			if isFlexible {
 23329  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23330  				dst = v.UnknownTags.AppendEach(dst)
 23331  			}
 23332  		}
 23333  	}
 23334  	if isFlexible {
 23335  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23336  		dst = v.UnknownTags.AppendEach(dst)
 23337  	}
 23338  	return dst
 23339  }
 23340  
 23341  func (v *DescribeACLsResponse) ReadFrom(src []byte) error {
 23342  	return v.readFrom(src, false)
 23343  }
 23344  
 23345  func (v *DescribeACLsResponse) UnsafeReadFrom(src []byte) error {
 23346  	return v.readFrom(src, true)
 23347  }
 23348  
 23349  func (v *DescribeACLsResponse) readFrom(src []byte, unsafe bool) error {
 23350  	v.Default()
 23351  	b := kbin.Reader{Src: src}
 23352  	version := v.Version
 23353  	_ = version
 23354  	isFlexible := version >= 2
 23355  	_ = isFlexible
 23356  	s := v
 23357  	{
 23358  		v := b.Int32()
 23359  		s.ThrottleMillis = v
 23360  	}
 23361  	{
 23362  		v := b.Int16()
 23363  		s.ErrorCode = v
 23364  	}
 23365  	{
 23366  		var v *string
 23367  		if isFlexible {
 23368  			if unsafe {
 23369  				v = b.UnsafeCompactNullableString()
 23370  			} else {
 23371  				v = b.CompactNullableString()
 23372  			}
 23373  		} else {
 23374  			if unsafe {
 23375  				v = b.UnsafeNullableString()
 23376  			} else {
 23377  				v = b.NullableString()
 23378  			}
 23379  		}
 23380  		s.ErrorMessage = v
 23381  	}
 23382  	{
 23383  		v := s.Resources
 23384  		a := v
 23385  		var l int32
 23386  		if isFlexible {
 23387  			l = b.CompactArrayLen()
 23388  		} else {
 23389  			l = b.ArrayLen()
 23390  		}
 23391  		if !b.Ok() {
 23392  			return b.Complete()
 23393  		}
 23394  		a = a[:0]
 23395  		if l > 0 {
 23396  			a = append(a, make([]DescribeACLsResponseResource, l)...)
 23397  		}
 23398  		for i := int32(0); i < l; i++ {
 23399  			v := &a[i]
 23400  			v.Default()
 23401  			s := v
 23402  			{
 23403  				var t ACLResourceType
 23404  				{
 23405  					v := b.Int8()
 23406  					t = ACLResourceType(v)
 23407  				}
 23408  				v := t
 23409  				s.ResourceType = v
 23410  			}
 23411  			{
 23412  				var v string
 23413  				if unsafe {
 23414  					if isFlexible {
 23415  						v = b.UnsafeCompactString()
 23416  					} else {
 23417  						v = b.UnsafeString()
 23418  					}
 23419  				} else {
 23420  					if isFlexible {
 23421  						v = b.CompactString()
 23422  					} else {
 23423  						v = b.String()
 23424  					}
 23425  				}
 23426  				s.ResourceName = v
 23427  			}
 23428  			if version >= 1 {
 23429  				var t ACLResourcePatternType
 23430  				{
 23431  					v := b.Int8()
 23432  					t = ACLResourcePatternType(v)
 23433  				}
 23434  				v := t
 23435  				s.ResourcePatternType = v
 23436  			}
 23437  			{
 23438  				v := s.ACLs
 23439  				a := v
 23440  				var l int32
 23441  				if isFlexible {
 23442  					l = b.CompactArrayLen()
 23443  				} else {
 23444  					l = b.ArrayLen()
 23445  				}
 23446  				if !b.Ok() {
 23447  					return b.Complete()
 23448  				}
 23449  				a = a[:0]
 23450  				if l > 0 {
 23451  					a = append(a, make([]DescribeACLsResponseResourceACL, l)...)
 23452  				}
 23453  				for i := int32(0); i < l; i++ {
 23454  					v := &a[i]
 23455  					v.Default()
 23456  					s := v
 23457  					{
 23458  						var v string
 23459  						if unsafe {
 23460  							if isFlexible {
 23461  								v = b.UnsafeCompactString()
 23462  							} else {
 23463  								v = b.UnsafeString()
 23464  							}
 23465  						} else {
 23466  							if isFlexible {
 23467  								v = b.CompactString()
 23468  							} else {
 23469  								v = b.String()
 23470  							}
 23471  						}
 23472  						s.Principal = v
 23473  					}
 23474  					{
 23475  						var v string
 23476  						if unsafe {
 23477  							if isFlexible {
 23478  								v = b.UnsafeCompactString()
 23479  							} else {
 23480  								v = b.UnsafeString()
 23481  							}
 23482  						} else {
 23483  							if isFlexible {
 23484  								v = b.CompactString()
 23485  							} else {
 23486  								v = b.String()
 23487  							}
 23488  						}
 23489  						s.Host = v
 23490  					}
 23491  					{
 23492  						var t ACLOperation
 23493  						{
 23494  							v := b.Int8()
 23495  							t = ACLOperation(v)
 23496  						}
 23497  						v := t
 23498  						s.Operation = v
 23499  					}
 23500  					{
 23501  						var t ACLPermissionType
 23502  						{
 23503  							v := b.Int8()
 23504  							t = ACLPermissionType(v)
 23505  						}
 23506  						v := t
 23507  						s.PermissionType = v
 23508  					}
 23509  					if isFlexible {
 23510  						s.UnknownTags = internalReadTags(&b)
 23511  					}
 23512  				}
 23513  				v = a
 23514  				s.ACLs = v
 23515  			}
 23516  			if isFlexible {
 23517  				s.UnknownTags = internalReadTags(&b)
 23518  			}
 23519  		}
 23520  		v = a
 23521  		s.Resources = v
 23522  	}
 23523  	if isFlexible {
 23524  		s.UnknownTags = internalReadTags(&b)
 23525  	}
 23526  	return b.Complete()
 23527  }
 23528  
 23529  // NewPtrDescribeACLsResponse returns a pointer to a default DescribeACLsResponse
 23530  // This is a shortcut for creating a new(struct) and calling Default yourself.
 23531  func NewPtrDescribeACLsResponse() *DescribeACLsResponse {
 23532  	var v DescribeACLsResponse
 23533  	v.Default()
 23534  	return &v
 23535  }
 23536  
 23537  // Default sets any default fields. Calling this allows for future compatibility
 23538  // if new fields are added to DescribeACLsResponse.
 23539  func (v *DescribeACLsResponse) Default() {
 23540  }
 23541  
 23542  // NewDescribeACLsResponse returns a default DescribeACLsResponse
 23543  // This is a shortcut for creating a struct and calling Default yourself.
 23544  func NewDescribeACLsResponse() DescribeACLsResponse {
 23545  	var v DescribeACLsResponse
 23546  	v.Default()
 23547  	return v
 23548  }
 23549  
 23550  type CreateACLsRequestCreation struct {
 23551  	// ResourceType is the type of resource this acl entry will be on.
 23552  	// It is invalid to use UNKNOWN or ANY.
 23553  	ResourceType ACLResourceType
 23554  
 23555  	// ResourceName is the name of the resource this acl entry will be on.
 23556  	// For CLUSTER, this must be "kafka-cluster".
 23557  	ResourceName string
 23558  
 23559  	// ResourcePatternType is the pattern type to use for the resource name.
 23560  	// This cannot be UNKNOWN or MATCH (i.e. this must be LITERAL or PREFIXED).
 23561  	// The default for pre-Kafka 2.0.0 is effectively LITERAL.
 23562  	//
 23563  	// This field has a default of 3.
 23564  	ResourcePatternType ACLResourcePatternType // v1+
 23565  
 23566  	// Principal is the user to apply this acl for. With the Kafka simple
 23567  	// authorizer, this must begin with "User:".
 23568  	Principal string
 23569  
 23570  	// Host is the host address to use for this acl. Each host to allow
 23571  	// the principal access from must be specified as a new creation. KIP-252
 23572  	// might solve this someday. The special wildcard host "*" allows all hosts.
 23573  	Host string
 23574  
 23575  	// Operation is the operation this acl is for. This must not be UNKNOWN or
 23576  	// ANY.
 23577  	Operation ACLOperation
 23578  
 23579  	// PermissionType is the permission of this acl. This must be either ALLOW
 23580  	// or DENY.
 23581  	PermissionType ACLPermissionType
 23582  
 23583  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23584  	UnknownTags Tags // v2+
 23585  }
 23586  
 23587  // Default sets any default fields. Calling this allows for future compatibility
 23588  // if new fields are added to CreateACLsRequestCreation.
 23589  func (v *CreateACLsRequestCreation) Default() {
 23590  	v.ResourcePatternType = 3
 23591  }
 23592  
 23593  // NewCreateACLsRequestCreation returns a default CreateACLsRequestCreation
 23594  // This is a shortcut for creating a struct and calling Default yourself.
 23595  func NewCreateACLsRequestCreation() CreateACLsRequestCreation {
 23596  	var v CreateACLsRequestCreation
 23597  	v.Default()
 23598  	return v
 23599  }
 23600  
 23601  // CreateACLsRequest creates acls. Creating acls can be done as a batch; each
 23602  // "creation" will be an acl entry.
 23603  //
 23604  // See the DescribeACLsRequest documentation for more descriptions of what
 23605  // valid values for the fields in this request are.
 23606  type CreateACLsRequest struct {
 23607  	// Version is the version of this message used with a Kafka broker.
 23608  	Version int16
 23609  
 23610  	Creations []CreateACLsRequestCreation
 23611  
 23612  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23613  	UnknownTags Tags // v2+
 23614  }
 23615  
 23616  func (*CreateACLsRequest) Key() int16                 { return 30 }
 23617  func (*CreateACLsRequest) MaxVersion() int16          { return 3 }
 23618  func (v *CreateACLsRequest) SetVersion(version int16) { v.Version = version }
 23619  func (v *CreateACLsRequest) GetVersion() int16        { return v.Version }
 23620  func (v *CreateACLsRequest) IsFlexible() bool         { return v.Version >= 2 }
 23621  func (v *CreateACLsRequest) ResponseKind() Response {
 23622  	r := &CreateACLsResponse{Version: v.Version}
 23623  	r.Default()
 23624  	return r
 23625  }
 23626  
 23627  // RequestWith is requests v on r and returns the response or an error.
 23628  // For sharded requests, the response may be merged and still return an error.
 23629  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 23630  func (v *CreateACLsRequest) RequestWith(ctx context.Context, r Requestor) (*CreateACLsResponse, error) {
 23631  	kresp, err := r.Request(ctx, v)
 23632  	resp, _ := kresp.(*CreateACLsResponse)
 23633  	return resp, err
 23634  }
 23635  
 23636  func (v *CreateACLsRequest) AppendTo(dst []byte) []byte {
 23637  	version := v.Version
 23638  	_ = version
 23639  	isFlexible := version >= 2
 23640  	_ = isFlexible
 23641  	{
 23642  		v := v.Creations
 23643  		if isFlexible {
 23644  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 23645  		} else {
 23646  			dst = kbin.AppendArrayLen(dst, len(v))
 23647  		}
 23648  		for i := range v {
 23649  			v := &v[i]
 23650  			{
 23651  				v := v.ResourceType
 23652  				{
 23653  					v := int8(v)
 23654  					dst = kbin.AppendInt8(dst, v)
 23655  				}
 23656  			}
 23657  			{
 23658  				v := v.ResourceName
 23659  				if isFlexible {
 23660  					dst = kbin.AppendCompactString(dst, v)
 23661  				} else {
 23662  					dst = kbin.AppendString(dst, v)
 23663  				}
 23664  			}
 23665  			if version >= 1 {
 23666  				v := v.ResourcePatternType
 23667  				{
 23668  					v := int8(v)
 23669  					dst = kbin.AppendInt8(dst, v)
 23670  				}
 23671  			}
 23672  			{
 23673  				v := v.Principal
 23674  				if isFlexible {
 23675  					dst = kbin.AppendCompactString(dst, v)
 23676  				} else {
 23677  					dst = kbin.AppendString(dst, v)
 23678  				}
 23679  			}
 23680  			{
 23681  				v := v.Host
 23682  				if isFlexible {
 23683  					dst = kbin.AppendCompactString(dst, v)
 23684  				} else {
 23685  					dst = kbin.AppendString(dst, v)
 23686  				}
 23687  			}
 23688  			{
 23689  				v := v.Operation
 23690  				{
 23691  					v := int8(v)
 23692  					dst = kbin.AppendInt8(dst, v)
 23693  				}
 23694  			}
 23695  			{
 23696  				v := v.PermissionType
 23697  				{
 23698  					v := int8(v)
 23699  					dst = kbin.AppendInt8(dst, v)
 23700  				}
 23701  			}
 23702  			if isFlexible {
 23703  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23704  				dst = v.UnknownTags.AppendEach(dst)
 23705  			}
 23706  		}
 23707  	}
 23708  	if isFlexible {
 23709  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23710  		dst = v.UnknownTags.AppendEach(dst)
 23711  	}
 23712  	return dst
 23713  }
 23714  
 23715  func (v *CreateACLsRequest) ReadFrom(src []byte) error {
 23716  	return v.readFrom(src, false)
 23717  }
 23718  
 23719  func (v *CreateACLsRequest) UnsafeReadFrom(src []byte) error {
 23720  	return v.readFrom(src, true)
 23721  }
 23722  
 23723  func (v *CreateACLsRequest) readFrom(src []byte, unsafe bool) error {
 23724  	v.Default()
 23725  	b := kbin.Reader{Src: src}
 23726  	version := v.Version
 23727  	_ = version
 23728  	isFlexible := version >= 2
 23729  	_ = isFlexible
 23730  	s := v
 23731  	{
 23732  		v := s.Creations
 23733  		a := v
 23734  		var l int32
 23735  		if isFlexible {
 23736  			l = b.CompactArrayLen()
 23737  		} else {
 23738  			l = b.ArrayLen()
 23739  		}
 23740  		if !b.Ok() {
 23741  			return b.Complete()
 23742  		}
 23743  		a = a[:0]
 23744  		if l > 0 {
 23745  			a = append(a, make([]CreateACLsRequestCreation, l)...)
 23746  		}
 23747  		for i := int32(0); i < l; i++ {
 23748  			v := &a[i]
 23749  			v.Default()
 23750  			s := v
 23751  			{
 23752  				var t ACLResourceType
 23753  				{
 23754  					v := b.Int8()
 23755  					t = ACLResourceType(v)
 23756  				}
 23757  				v := t
 23758  				s.ResourceType = v
 23759  			}
 23760  			{
 23761  				var v string
 23762  				if unsafe {
 23763  					if isFlexible {
 23764  						v = b.UnsafeCompactString()
 23765  					} else {
 23766  						v = b.UnsafeString()
 23767  					}
 23768  				} else {
 23769  					if isFlexible {
 23770  						v = b.CompactString()
 23771  					} else {
 23772  						v = b.String()
 23773  					}
 23774  				}
 23775  				s.ResourceName = v
 23776  			}
 23777  			if version >= 1 {
 23778  				var t ACLResourcePatternType
 23779  				{
 23780  					v := b.Int8()
 23781  					t = ACLResourcePatternType(v)
 23782  				}
 23783  				v := t
 23784  				s.ResourcePatternType = v
 23785  			}
 23786  			{
 23787  				var v string
 23788  				if unsafe {
 23789  					if isFlexible {
 23790  						v = b.UnsafeCompactString()
 23791  					} else {
 23792  						v = b.UnsafeString()
 23793  					}
 23794  				} else {
 23795  					if isFlexible {
 23796  						v = b.CompactString()
 23797  					} else {
 23798  						v = b.String()
 23799  					}
 23800  				}
 23801  				s.Principal = v
 23802  			}
 23803  			{
 23804  				var v string
 23805  				if unsafe {
 23806  					if isFlexible {
 23807  						v = b.UnsafeCompactString()
 23808  					} else {
 23809  						v = b.UnsafeString()
 23810  					}
 23811  				} else {
 23812  					if isFlexible {
 23813  						v = b.CompactString()
 23814  					} else {
 23815  						v = b.String()
 23816  					}
 23817  				}
 23818  				s.Host = v
 23819  			}
 23820  			{
 23821  				var t ACLOperation
 23822  				{
 23823  					v := b.Int8()
 23824  					t = ACLOperation(v)
 23825  				}
 23826  				v := t
 23827  				s.Operation = v
 23828  			}
 23829  			{
 23830  				var t ACLPermissionType
 23831  				{
 23832  					v := b.Int8()
 23833  					t = ACLPermissionType(v)
 23834  				}
 23835  				v := t
 23836  				s.PermissionType = v
 23837  			}
 23838  			if isFlexible {
 23839  				s.UnknownTags = internalReadTags(&b)
 23840  			}
 23841  		}
 23842  		v = a
 23843  		s.Creations = v
 23844  	}
 23845  	if isFlexible {
 23846  		s.UnknownTags = internalReadTags(&b)
 23847  	}
 23848  	return b.Complete()
 23849  }
 23850  
 23851  // NewPtrCreateACLsRequest returns a pointer to a default CreateACLsRequest
 23852  // This is a shortcut for creating a new(struct) and calling Default yourself.
 23853  func NewPtrCreateACLsRequest() *CreateACLsRequest {
 23854  	var v CreateACLsRequest
 23855  	v.Default()
 23856  	return &v
 23857  }
 23858  
 23859  // Default sets any default fields. Calling this allows for future compatibility
 23860  // if new fields are added to CreateACLsRequest.
 23861  func (v *CreateACLsRequest) Default() {
 23862  }
 23863  
 23864  // NewCreateACLsRequest returns a default CreateACLsRequest
 23865  // This is a shortcut for creating a struct and calling Default yourself.
 23866  func NewCreateACLsRequest() CreateACLsRequest {
 23867  	var v CreateACLsRequest
 23868  	v.Default()
 23869  	return v
 23870  }
 23871  
 23872  type CreateACLsResponseResult struct {
 23873  	// ErrorCode is an error for this particular creation (index wise).
 23874  	ErrorCode int16
 23875  
 23876  	// ErrorMessage is a message for this error.
 23877  	ErrorMessage *string
 23878  
 23879  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23880  	UnknownTags Tags // v2+
 23881  }
 23882  
 23883  // Default sets any default fields. Calling this allows for future compatibility
 23884  // if new fields are added to CreateACLsResponseResult.
 23885  func (v *CreateACLsResponseResult) Default() {
 23886  }
 23887  
 23888  // NewCreateACLsResponseResult returns a default CreateACLsResponseResult
 23889  // This is a shortcut for creating a struct and calling Default yourself.
 23890  func NewCreateACLsResponseResult() CreateACLsResponseResult {
 23891  	var v CreateACLsResponseResult
 23892  	v.Default()
 23893  	return v
 23894  }
 23895  
 23896  // CreateACLsResponse is a response for a CreateACLsRequest.
 23897  type CreateACLsResponse struct {
 23898  	// Version is the version of this message used with a Kafka broker.
 23899  	Version int16
 23900  
 23901  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 23902  	// after this request.
 23903  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 23904  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 23905  	//
 23906  	// This request switched at version 1.
 23907  	ThrottleMillis int32
 23908  
 23909  	// Results contains responses to each creation request.
 23910  	Results []CreateACLsResponseResult
 23911  
 23912  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 23913  	UnknownTags Tags // v2+
 23914  }
 23915  
 23916  func (*CreateACLsResponse) Key() int16                         { return 30 }
 23917  func (*CreateACLsResponse) MaxVersion() int16                  { return 3 }
 23918  func (v *CreateACLsResponse) SetVersion(version int16)         { v.Version = version }
 23919  func (v *CreateACLsResponse) GetVersion() int16                { return v.Version }
 23920  func (v *CreateACLsResponse) IsFlexible() bool                 { return v.Version >= 2 }
 23921  func (v *CreateACLsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 23922  func (v *CreateACLsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 23923  func (v *CreateACLsResponse) RequestKind() Request             { return &CreateACLsRequest{Version: v.Version} }
 23924  
 23925  func (v *CreateACLsResponse) AppendTo(dst []byte) []byte {
 23926  	version := v.Version
 23927  	_ = version
 23928  	isFlexible := version >= 2
 23929  	_ = isFlexible
 23930  	{
 23931  		v := v.ThrottleMillis
 23932  		dst = kbin.AppendInt32(dst, v)
 23933  	}
 23934  	{
 23935  		v := v.Results
 23936  		if isFlexible {
 23937  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 23938  		} else {
 23939  			dst = kbin.AppendArrayLen(dst, len(v))
 23940  		}
 23941  		for i := range v {
 23942  			v := &v[i]
 23943  			{
 23944  				v := v.ErrorCode
 23945  				dst = kbin.AppendInt16(dst, v)
 23946  			}
 23947  			{
 23948  				v := v.ErrorMessage
 23949  				if isFlexible {
 23950  					dst = kbin.AppendCompactNullableString(dst, v)
 23951  				} else {
 23952  					dst = kbin.AppendNullableString(dst, v)
 23953  				}
 23954  			}
 23955  			if isFlexible {
 23956  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23957  				dst = v.UnknownTags.AppendEach(dst)
 23958  			}
 23959  		}
 23960  	}
 23961  	if isFlexible {
 23962  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 23963  		dst = v.UnknownTags.AppendEach(dst)
 23964  	}
 23965  	return dst
 23966  }
 23967  
 23968  func (v *CreateACLsResponse) ReadFrom(src []byte) error {
 23969  	return v.readFrom(src, false)
 23970  }
 23971  
 23972  func (v *CreateACLsResponse) UnsafeReadFrom(src []byte) error {
 23973  	return v.readFrom(src, true)
 23974  }
 23975  
 23976  func (v *CreateACLsResponse) readFrom(src []byte, unsafe bool) error {
 23977  	v.Default()
 23978  	b := kbin.Reader{Src: src}
 23979  	version := v.Version
 23980  	_ = version
 23981  	isFlexible := version >= 2
 23982  	_ = isFlexible
 23983  	s := v
 23984  	{
 23985  		v := b.Int32()
 23986  		s.ThrottleMillis = v
 23987  	}
 23988  	{
 23989  		v := s.Results
 23990  		a := v
 23991  		var l int32
 23992  		if isFlexible {
 23993  			l = b.CompactArrayLen()
 23994  		} else {
 23995  			l = b.ArrayLen()
 23996  		}
 23997  		if !b.Ok() {
 23998  			return b.Complete()
 23999  		}
 24000  		a = a[:0]
 24001  		if l > 0 {
 24002  			a = append(a, make([]CreateACLsResponseResult, l)...)
 24003  		}
 24004  		for i := int32(0); i < l; i++ {
 24005  			v := &a[i]
 24006  			v.Default()
 24007  			s := v
 24008  			{
 24009  				v := b.Int16()
 24010  				s.ErrorCode = v
 24011  			}
 24012  			{
 24013  				var v *string
 24014  				if isFlexible {
 24015  					if unsafe {
 24016  						v = b.UnsafeCompactNullableString()
 24017  					} else {
 24018  						v = b.CompactNullableString()
 24019  					}
 24020  				} else {
 24021  					if unsafe {
 24022  						v = b.UnsafeNullableString()
 24023  					} else {
 24024  						v = b.NullableString()
 24025  					}
 24026  				}
 24027  				s.ErrorMessage = v
 24028  			}
 24029  			if isFlexible {
 24030  				s.UnknownTags = internalReadTags(&b)
 24031  			}
 24032  		}
 24033  		v = a
 24034  		s.Results = v
 24035  	}
 24036  	if isFlexible {
 24037  		s.UnknownTags = internalReadTags(&b)
 24038  	}
 24039  	return b.Complete()
 24040  }
 24041  
 24042  // NewPtrCreateACLsResponse returns a pointer to a default CreateACLsResponse
 24043  // This is a shortcut for creating a new(struct) and calling Default yourself.
 24044  func NewPtrCreateACLsResponse() *CreateACLsResponse {
 24045  	var v CreateACLsResponse
 24046  	v.Default()
 24047  	return &v
 24048  }
 24049  
 24050  // Default sets any default fields. Calling this allows for future compatibility
 24051  // if new fields are added to CreateACLsResponse.
 24052  func (v *CreateACLsResponse) Default() {
 24053  }
 24054  
 24055  // NewCreateACLsResponse returns a default CreateACLsResponse
 24056  // This is a shortcut for creating a struct and calling Default yourself.
 24057  func NewCreateACLsResponse() CreateACLsResponse {
 24058  	var v CreateACLsResponse
 24059  	v.Default()
 24060  	return v
 24061  }
 24062  
 24063  type DeleteACLsRequestFilter struct {
 24064  	ResourceType ACLResourceType
 24065  
 24066  	ResourceName *string
 24067  
 24068  	// This field has a default of 3.
 24069  	ResourcePatternType ACLResourcePatternType // v1+
 24070  
 24071  	Principal *string
 24072  
 24073  	Host *string
 24074  
 24075  	Operation ACLOperation
 24076  
 24077  	PermissionType ACLPermissionType
 24078  
 24079  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24080  	UnknownTags Tags // v2+
 24081  }
 24082  
 24083  // Default sets any default fields. Calling this allows for future compatibility
 24084  // if new fields are added to DeleteACLsRequestFilter.
 24085  func (v *DeleteACLsRequestFilter) Default() {
 24086  	v.ResourcePatternType = 3
 24087  }
 24088  
 24089  // NewDeleteACLsRequestFilter returns a default DeleteACLsRequestFilter
 24090  // This is a shortcut for creating a struct and calling Default yourself.
 24091  func NewDeleteACLsRequestFilter() DeleteACLsRequestFilter {
 24092  	var v DeleteACLsRequestFilter
 24093  	v.Default()
 24094  	return v
 24095  }
 24096  
 24097  // DeleteACLsRequest deletes acls. This request works on filters the same way
 24098  // that DescribeACLsRequest does. See DescribeACLsRequest for documentation of
 24099  // the fields.
 24100  type DeleteACLsRequest struct {
 24101  	// Version is the version of this message used with a Kafka broker.
 24102  	Version int16
 24103  
 24104  	// Filters are filters for acls to delete.
 24105  	Filters []DeleteACLsRequestFilter
 24106  
 24107  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24108  	UnknownTags Tags // v2+
 24109  }
 24110  
 24111  func (*DeleteACLsRequest) Key() int16                 { return 31 }
 24112  func (*DeleteACLsRequest) MaxVersion() int16          { return 3 }
 24113  func (v *DeleteACLsRequest) SetVersion(version int16) { v.Version = version }
 24114  func (v *DeleteACLsRequest) GetVersion() int16        { return v.Version }
 24115  func (v *DeleteACLsRequest) IsFlexible() bool         { return v.Version >= 2 }
 24116  func (v *DeleteACLsRequest) ResponseKind() Response {
 24117  	r := &DeleteACLsResponse{Version: v.Version}
 24118  	r.Default()
 24119  	return r
 24120  }
 24121  
 24122  // RequestWith is requests v on r and returns the response or an error.
 24123  // For sharded requests, the response may be merged and still return an error.
 24124  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 24125  func (v *DeleteACLsRequest) RequestWith(ctx context.Context, r Requestor) (*DeleteACLsResponse, error) {
 24126  	kresp, err := r.Request(ctx, v)
 24127  	resp, _ := kresp.(*DeleteACLsResponse)
 24128  	return resp, err
 24129  }
 24130  
 24131  func (v *DeleteACLsRequest) AppendTo(dst []byte) []byte {
 24132  	version := v.Version
 24133  	_ = version
 24134  	isFlexible := version >= 2
 24135  	_ = isFlexible
 24136  	{
 24137  		v := v.Filters
 24138  		if isFlexible {
 24139  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 24140  		} else {
 24141  			dst = kbin.AppendArrayLen(dst, len(v))
 24142  		}
 24143  		for i := range v {
 24144  			v := &v[i]
 24145  			{
 24146  				v := v.ResourceType
 24147  				{
 24148  					v := int8(v)
 24149  					dst = kbin.AppendInt8(dst, v)
 24150  				}
 24151  			}
 24152  			{
 24153  				v := v.ResourceName
 24154  				if isFlexible {
 24155  					dst = kbin.AppendCompactNullableString(dst, v)
 24156  				} else {
 24157  					dst = kbin.AppendNullableString(dst, v)
 24158  				}
 24159  			}
 24160  			if version >= 1 {
 24161  				v := v.ResourcePatternType
 24162  				{
 24163  					v := int8(v)
 24164  					dst = kbin.AppendInt8(dst, v)
 24165  				}
 24166  			}
 24167  			{
 24168  				v := v.Principal
 24169  				if isFlexible {
 24170  					dst = kbin.AppendCompactNullableString(dst, v)
 24171  				} else {
 24172  					dst = kbin.AppendNullableString(dst, v)
 24173  				}
 24174  			}
 24175  			{
 24176  				v := v.Host
 24177  				if isFlexible {
 24178  					dst = kbin.AppendCompactNullableString(dst, v)
 24179  				} else {
 24180  					dst = kbin.AppendNullableString(dst, v)
 24181  				}
 24182  			}
 24183  			{
 24184  				v := v.Operation
 24185  				{
 24186  					v := int8(v)
 24187  					dst = kbin.AppendInt8(dst, v)
 24188  				}
 24189  			}
 24190  			{
 24191  				v := v.PermissionType
 24192  				{
 24193  					v := int8(v)
 24194  					dst = kbin.AppendInt8(dst, v)
 24195  				}
 24196  			}
 24197  			if isFlexible {
 24198  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24199  				dst = v.UnknownTags.AppendEach(dst)
 24200  			}
 24201  		}
 24202  	}
 24203  	if isFlexible {
 24204  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24205  		dst = v.UnknownTags.AppendEach(dst)
 24206  	}
 24207  	return dst
 24208  }
 24209  
 24210  func (v *DeleteACLsRequest) ReadFrom(src []byte) error {
 24211  	return v.readFrom(src, false)
 24212  }
 24213  
 24214  func (v *DeleteACLsRequest) UnsafeReadFrom(src []byte) error {
 24215  	return v.readFrom(src, true)
 24216  }
 24217  
 24218  func (v *DeleteACLsRequest) readFrom(src []byte, unsafe bool) error {
 24219  	v.Default()
 24220  	b := kbin.Reader{Src: src}
 24221  	version := v.Version
 24222  	_ = version
 24223  	isFlexible := version >= 2
 24224  	_ = isFlexible
 24225  	s := v
 24226  	{
 24227  		v := s.Filters
 24228  		a := v
 24229  		var l int32
 24230  		if isFlexible {
 24231  			l = b.CompactArrayLen()
 24232  		} else {
 24233  			l = b.ArrayLen()
 24234  		}
 24235  		if !b.Ok() {
 24236  			return b.Complete()
 24237  		}
 24238  		a = a[:0]
 24239  		if l > 0 {
 24240  			a = append(a, make([]DeleteACLsRequestFilter, l)...)
 24241  		}
 24242  		for i := int32(0); i < l; i++ {
 24243  			v := &a[i]
 24244  			v.Default()
 24245  			s := v
 24246  			{
 24247  				var t ACLResourceType
 24248  				{
 24249  					v := b.Int8()
 24250  					t = ACLResourceType(v)
 24251  				}
 24252  				v := t
 24253  				s.ResourceType = v
 24254  			}
 24255  			{
 24256  				var v *string
 24257  				if isFlexible {
 24258  					if unsafe {
 24259  						v = b.UnsafeCompactNullableString()
 24260  					} else {
 24261  						v = b.CompactNullableString()
 24262  					}
 24263  				} else {
 24264  					if unsafe {
 24265  						v = b.UnsafeNullableString()
 24266  					} else {
 24267  						v = b.NullableString()
 24268  					}
 24269  				}
 24270  				s.ResourceName = v
 24271  			}
 24272  			if version >= 1 {
 24273  				var t ACLResourcePatternType
 24274  				{
 24275  					v := b.Int8()
 24276  					t = ACLResourcePatternType(v)
 24277  				}
 24278  				v := t
 24279  				s.ResourcePatternType = v
 24280  			}
 24281  			{
 24282  				var v *string
 24283  				if isFlexible {
 24284  					if unsafe {
 24285  						v = b.UnsafeCompactNullableString()
 24286  					} else {
 24287  						v = b.CompactNullableString()
 24288  					}
 24289  				} else {
 24290  					if unsafe {
 24291  						v = b.UnsafeNullableString()
 24292  					} else {
 24293  						v = b.NullableString()
 24294  					}
 24295  				}
 24296  				s.Principal = v
 24297  			}
 24298  			{
 24299  				var v *string
 24300  				if isFlexible {
 24301  					if unsafe {
 24302  						v = b.UnsafeCompactNullableString()
 24303  					} else {
 24304  						v = b.CompactNullableString()
 24305  					}
 24306  				} else {
 24307  					if unsafe {
 24308  						v = b.UnsafeNullableString()
 24309  					} else {
 24310  						v = b.NullableString()
 24311  					}
 24312  				}
 24313  				s.Host = v
 24314  			}
 24315  			{
 24316  				var t ACLOperation
 24317  				{
 24318  					v := b.Int8()
 24319  					t = ACLOperation(v)
 24320  				}
 24321  				v := t
 24322  				s.Operation = v
 24323  			}
 24324  			{
 24325  				var t ACLPermissionType
 24326  				{
 24327  					v := b.Int8()
 24328  					t = ACLPermissionType(v)
 24329  				}
 24330  				v := t
 24331  				s.PermissionType = v
 24332  			}
 24333  			if isFlexible {
 24334  				s.UnknownTags = internalReadTags(&b)
 24335  			}
 24336  		}
 24337  		v = a
 24338  		s.Filters = v
 24339  	}
 24340  	if isFlexible {
 24341  		s.UnknownTags = internalReadTags(&b)
 24342  	}
 24343  	return b.Complete()
 24344  }
 24345  
 24346  // NewPtrDeleteACLsRequest returns a pointer to a default DeleteACLsRequest
 24347  // This is a shortcut for creating a new(struct) and calling Default yourself.
 24348  func NewPtrDeleteACLsRequest() *DeleteACLsRequest {
 24349  	var v DeleteACLsRequest
 24350  	v.Default()
 24351  	return &v
 24352  }
 24353  
 24354  // Default sets any default fields. Calling this allows for future compatibility
 24355  // if new fields are added to DeleteACLsRequest.
 24356  func (v *DeleteACLsRequest) Default() {
 24357  }
 24358  
 24359  // NewDeleteACLsRequest returns a default DeleteACLsRequest
 24360  // This is a shortcut for creating a struct and calling Default yourself.
 24361  func NewDeleteACLsRequest() DeleteACLsRequest {
 24362  	var v DeleteACLsRequest
 24363  	v.Default()
 24364  	return v
 24365  }
 24366  
 24367  type DeleteACLsResponseResultMatchingACL struct {
 24368  	// ErrorCode contains an error for this individual acl for this filter.
 24369  	ErrorCode int16
 24370  
 24371  	// ErrorMessage is a message for this error.
 24372  	ErrorMessage *string
 24373  
 24374  	ResourceType ACLResourceType
 24375  
 24376  	ResourceName string
 24377  
 24378  	// This field has a default of 3.
 24379  	ResourcePatternType ACLResourcePatternType // v1+
 24380  
 24381  	Principal string
 24382  
 24383  	Host string
 24384  
 24385  	Operation ACLOperation
 24386  
 24387  	PermissionType ACLPermissionType
 24388  
 24389  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24390  	UnknownTags Tags // v2+
 24391  }
 24392  
 24393  // Default sets any default fields. Calling this allows for future compatibility
 24394  // if new fields are added to DeleteACLsResponseResultMatchingACL.
 24395  func (v *DeleteACLsResponseResultMatchingACL) Default() {
 24396  	v.ResourcePatternType = 3
 24397  }
 24398  
 24399  // NewDeleteACLsResponseResultMatchingACL returns a default DeleteACLsResponseResultMatchingACL
 24400  // This is a shortcut for creating a struct and calling Default yourself.
 24401  func NewDeleteACLsResponseResultMatchingACL() DeleteACLsResponseResultMatchingACL {
 24402  	var v DeleteACLsResponseResultMatchingACL
 24403  	v.Default()
 24404  	return v
 24405  }
 24406  
 24407  type DeleteACLsResponseResult struct {
 24408  	// ErrorCode is the overall error code for this individual filter.
 24409  	ErrorCode int16
 24410  
 24411  	// ErrorMessage is a message for this error.
 24412  	ErrorMessage *string
 24413  
 24414  	// MatchingACLs contains all acls that were matched for this filter.
 24415  	MatchingACLs []DeleteACLsResponseResultMatchingACL
 24416  
 24417  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24418  	UnknownTags Tags // v2+
 24419  }
 24420  
 24421  // Default sets any default fields. Calling this allows for future compatibility
 24422  // if new fields are added to DeleteACLsResponseResult.
 24423  func (v *DeleteACLsResponseResult) Default() {
 24424  }
 24425  
 24426  // NewDeleteACLsResponseResult returns a default DeleteACLsResponseResult
 24427  // This is a shortcut for creating a struct and calling Default yourself.
 24428  func NewDeleteACLsResponseResult() DeleteACLsResponseResult {
 24429  	var v DeleteACLsResponseResult
 24430  	v.Default()
 24431  	return v
 24432  }
 24433  
 24434  // DeleteACLsResponse is a response for a DeleteACLsRequest.
 24435  type DeleteACLsResponse struct {
 24436  	// Version is the version of this message used with a Kafka broker.
 24437  	Version int16
 24438  
 24439  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 24440  	// after this request.
 24441  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 24442  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 24443  	//
 24444  	// This request switched at version 1.
 24445  	ThrottleMillis int32
 24446  
 24447  	// Results contains a response to each requested filter.
 24448  	Results []DeleteACLsResponseResult
 24449  
 24450  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24451  	UnknownTags Tags // v2+
 24452  }
 24453  
 24454  func (*DeleteACLsResponse) Key() int16                         { return 31 }
 24455  func (*DeleteACLsResponse) MaxVersion() int16                  { return 3 }
 24456  func (v *DeleteACLsResponse) SetVersion(version int16)         { v.Version = version }
 24457  func (v *DeleteACLsResponse) GetVersion() int16                { return v.Version }
 24458  func (v *DeleteACLsResponse) IsFlexible() bool                 { return v.Version >= 2 }
 24459  func (v *DeleteACLsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 24460  func (v *DeleteACLsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 24461  func (v *DeleteACLsResponse) RequestKind() Request             { return &DeleteACLsRequest{Version: v.Version} }
 24462  
 24463  func (v *DeleteACLsResponse) AppendTo(dst []byte) []byte {
 24464  	version := v.Version
 24465  	_ = version
 24466  	isFlexible := version >= 2
 24467  	_ = isFlexible
 24468  	{
 24469  		v := v.ThrottleMillis
 24470  		dst = kbin.AppendInt32(dst, v)
 24471  	}
 24472  	{
 24473  		v := v.Results
 24474  		if isFlexible {
 24475  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 24476  		} else {
 24477  			dst = kbin.AppendArrayLen(dst, len(v))
 24478  		}
 24479  		for i := range v {
 24480  			v := &v[i]
 24481  			{
 24482  				v := v.ErrorCode
 24483  				dst = kbin.AppendInt16(dst, v)
 24484  			}
 24485  			{
 24486  				v := v.ErrorMessage
 24487  				if isFlexible {
 24488  					dst = kbin.AppendCompactNullableString(dst, v)
 24489  				} else {
 24490  					dst = kbin.AppendNullableString(dst, v)
 24491  				}
 24492  			}
 24493  			{
 24494  				v := v.MatchingACLs
 24495  				if isFlexible {
 24496  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 24497  				} else {
 24498  					dst = kbin.AppendArrayLen(dst, len(v))
 24499  				}
 24500  				for i := range v {
 24501  					v := &v[i]
 24502  					{
 24503  						v := v.ErrorCode
 24504  						dst = kbin.AppendInt16(dst, v)
 24505  					}
 24506  					{
 24507  						v := v.ErrorMessage
 24508  						if isFlexible {
 24509  							dst = kbin.AppendCompactNullableString(dst, v)
 24510  						} else {
 24511  							dst = kbin.AppendNullableString(dst, v)
 24512  						}
 24513  					}
 24514  					{
 24515  						v := v.ResourceType
 24516  						{
 24517  							v := int8(v)
 24518  							dst = kbin.AppendInt8(dst, v)
 24519  						}
 24520  					}
 24521  					{
 24522  						v := v.ResourceName
 24523  						if isFlexible {
 24524  							dst = kbin.AppendCompactString(dst, v)
 24525  						} else {
 24526  							dst = kbin.AppendString(dst, v)
 24527  						}
 24528  					}
 24529  					if version >= 1 {
 24530  						v := v.ResourcePatternType
 24531  						{
 24532  							v := int8(v)
 24533  							dst = kbin.AppendInt8(dst, v)
 24534  						}
 24535  					}
 24536  					{
 24537  						v := v.Principal
 24538  						if isFlexible {
 24539  							dst = kbin.AppendCompactString(dst, v)
 24540  						} else {
 24541  							dst = kbin.AppendString(dst, v)
 24542  						}
 24543  					}
 24544  					{
 24545  						v := v.Host
 24546  						if isFlexible {
 24547  							dst = kbin.AppendCompactString(dst, v)
 24548  						} else {
 24549  							dst = kbin.AppendString(dst, v)
 24550  						}
 24551  					}
 24552  					{
 24553  						v := v.Operation
 24554  						{
 24555  							v := int8(v)
 24556  							dst = kbin.AppendInt8(dst, v)
 24557  						}
 24558  					}
 24559  					{
 24560  						v := v.PermissionType
 24561  						{
 24562  							v := int8(v)
 24563  							dst = kbin.AppendInt8(dst, v)
 24564  						}
 24565  					}
 24566  					if isFlexible {
 24567  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24568  						dst = v.UnknownTags.AppendEach(dst)
 24569  					}
 24570  				}
 24571  			}
 24572  			if isFlexible {
 24573  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24574  				dst = v.UnknownTags.AppendEach(dst)
 24575  			}
 24576  		}
 24577  	}
 24578  	if isFlexible {
 24579  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24580  		dst = v.UnknownTags.AppendEach(dst)
 24581  	}
 24582  	return dst
 24583  }
 24584  
 24585  func (v *DeleteACLsResponse) ReadFrom(src []byte) error {
 24586  	return v.readFrom(src, false)
 24587  }
 24588  
 24589  func (v *DeleteACLsResponse) UnsafeReadFrom(src []byte) error {
 24590  	return v.readFrom(src, true)
 24591  }
 24592  
 24593  func (v *DeleteACLsResponse) readFrom(src []byte, unsafe bool) error {
 24594  	v.Default()
 24595  	b := kbin.Reader{Src: src}
 24596  	version := v.Version
 24597  	_ = version
 24598  	isFlexible := version >= 2
 24599  	_ = isFlexible
 24600  	s := v
 24601  	{
 24602  		v := b.Int32()
 24603  		s.ThrottleMillis = v
 24604  	}
 24605  	{
 24606  		v := s.Results
 24607  		a := v
 24608  		var l int32
 24609  		if isFlexible {
 24610  			l = b.CompactArrayLen()
 24611  		} else {
 24612  			l = b.ArrayLen()
 24613  		}
 24614  		if !b.Ok() {
 24615  			return b.Complete()
 24616  		}
 24617  		a = a[:0]
 24618  		if l > 0 {
 24619  			a = append(a, make([]DeleteACLsResponseResult, l)...)
 24620  		}
 24621  		for i := int32(0); i < l; i++ {
 24622  			v := &a[i]
 24623  			v.Default()
 24624  			s := v
 24625  			{
 24626  				v := b.Int16()
 24627  				s.ErrorCode = v
 24628  			}
 24629  			{
 24630  				var v *string
 24631  				if isFlexible {
 24632  					if unsafe {
 24633  						v = b.UnsafeCompactNullableString()
 24634  					} else {
 24635  						v = b.CompactNullableString()
 24636  					}
 24637  				} else {
 24638  					if unsafe {
 24639  						v = b.UnsafeNullableString()
 24640  					} else {
 24641  						v = b.NullableString()
 24642  					}
 24643  				}
 24644  				s.ErrorMessage = v
 24645  			}
 24646  			{
 24647  				v := s.MatchingACLs
 24648  				a := v
 24649  				var l int32
 24650  				if isFlexible {
 24651  					l = b.CompactArrayLen()
 24652  				} else {
 24653  					l = b.ArrayLen()
 24654  				}
 24655  				if !b.Ok() {
 24656  					return b.Complete()
 24657  				}
 24658  				a = a[:0]
 24659  				if l > 0 {
 24660  					a = append(a, make([]DeleteACLsResponseResultMatchingACL, l)...)
 24661  				}
 24662  				for i := int32(0); i < l; i++ {
 24663  					v := &a[i]
 24664  					v.Default()
 24665  					s := v
 24666  					{
 24667  						v := b.Int16()
 24668  						s.ErrorCode = v
 24669  					}
 24670  					{
 24671  						var v *string
 24672  						if isFlexible {
 24673  							if unsafe {
 24674  								v = b.UnsafeCompactNullableString()
 24675  							} else {
 24676  								v = b.CompactNullableString()
 24677  							}
 24678  						} else {
 24679  							if unsafe {
 24680  								v = b.UnsafeNullableString()
 24681  							} else {
 24682  								v = b.NullableString()
 24683  							}
 24684  						}
 24685  						s.ErrorMessage = v
 24686  					}
 24687  					{
 24688  						var t ACLResourceType
 24689  						{
 24690  							v := b.Int8()
 24691  							t = ACLResourceType(v)
 24692  						}
 24693  						v := t
 24694  						s.ResourceType = v
 24695  					}
 24696  					{
 24697  						var v string
 24698  						if unsafe {
 24699  							if isFlexible {
 24700  								v = b.UnsafeCompactString()
 24701  							} else {
 24702  								v = b.UnsafeString()
 24703  							}
 24704  						} else {
 24705  							if isFlexible {
 24706  								v = b.CompactString()
 24707  							} else {
 24708  								v = b.String()
 24709  							}
 24710  						}
 24711  						s.ResourceName = v
 24712  					}
 24713  					if version >= 1 {
 24714  						var t ACLResourcePatternType
 24715  						{
 24716  							v := b.Int8()
 24717  							t = ACLResourcePatternType(v)
 24718  						}
 24719  						v := t
 24720  						s.ResourcePatternType = v
 24721  					}
 24722  					{
 24723  						var v string
 24724  						if unsafe {
 24725  							if isFlexible {
 24726  								v = b.UnsafeCompactString()
 24727  							} else {
 24728  								v = b.UnsafeString()
 24729  							}
 24730  						} else {
 24731  							if isFlexible {
 24732  								v = b.CompactString()
 24733  							} else {
 24734  								v = b.String()
 24735  							}
 24736  						}
 24737  						s.Principal = v
 24738  					}
 24739  					{
 24740  						var v string
 24741  						if unsafe {
 24742  							if isFlexible {
 24743  								v = b.UnsafeCompactString()
 24744  							} else {
 24745  								v = b.UnsafeString()
 24746  							}
 24747  						} else {
 24748  							if isFlexible {
 24749  								v = b.CompactString()
 24750  							} else {
 24751  								v = b.String()
 24752  							}
 24753  						}
 24754  						s.Host = v
 24755  					}
 24756  					{
 24757  						var t ACLOperation
 24758  						{
 24759  							v := b.Int8()
 24760  							t = ACLOperation(v)
 24761  						}
 24762  						v := t
 24763  						s.Operation = v
 24764  					}
 24765  					{
 24766  						var t ACLPermissionType
 24767  						{
 24768  							v := b.Int8()
 24769  							t = ACLPermissionType(v)
 24770  						}
 24771  						v := t
 24772  						s.PermissionType = v
 24773  					}
 24774  					if isFlexible {
 24775  						s.UnknownTags = internalReadTags(&b)
 24776  					}
 24777  				}
 24778  				v = a
 24779  				s.MatchingACLs = v
 24780  			}
 24781  			if isFlexible {
 24782  				s.UnknownTags = internalReadTags(&b)
 24783  			}
 24784  		}
 24785  		v = a
 24786  		s.Results = v
 24787  	}
 24788  	if isFlexible {
 24789  		s.UnknownTags = internalReadTags(&b)
 24790  	}
 24791  	return b.Complete()
 24792  }
 24793  
 24794  // NewPtrDeleteACLsResponse returns a pointer to a default DeleteACLsResponse
 24795  // This is a shortcut for creating a new(struct) and calling Default yourself.
 24796  func NewPtrDeleteACLsResponse() *DeleteACLsResponse {
 24797  	var v DeleteACLsResponse
 24798  	v.Default()
 24799  	return &v
 24800  }
 24801  
 24802  // Default sets any default fields. Calling this allows for future compatibility
 24803  // if new fields are added to DeleteACLsResponse.
 24804  func (v *DeleteACLsResponse) Default() {
 24805  }
 24806  
 24807  // NewDeleteACLsResponse returns a default DeleteACLsResponse
 24808  // This is a shortcut for creating a struct and calling Default yourself.
 24809  func NewDeleteACLsResponse() DeleteACLsResponse {
 24810  	var v DeleteACLsResponse
 24811  	v.Default()
 24812  	return v
 24813  }
 24814  
 24815  type DescribeConfigsRequestResource struct {
 24816  	// ResourceType is an enum corresponding to the type of config to describe.
 24817  	ResourceType ConfigResourceType
 24818  
 24819  	// ResourceName is the name of config to describe.
 24820  	//
 24821  	// If the requested type is a topic, this corresponds to a topic name.
 24822  	//
 24823  	// If the requested type if a broker, this should either be empty or be
 24824  	// the ID of the broker this request is issued to. If it is empty, this
 24825  	// returns all broker configs, but only the dynamic configuration values.
 24826  	// If a specific ID, this returns all broker config values.
 24827  	ResourceName string
 24828  
 24829  	// ConfigNames is a list of config entries to return. Null requests all.
 24830  	ConfigNames []string
 24831  
 24832  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24833  	UnknownTags Tags // v4+
 24834  }
 24835  
 24836  // Default sets any default fields. Calling this allows for future compatibility
 24837  // if new fields are added to DescribeConfigsRequestResource.
 24838  func (v *DescribeConfigsRequestResource) Default() {
 24839  }
 24840  
 24841  // NewDescribeConfigsRequestResource returns a default DescribeConfigsRequestResource
 24842  // This is a shortcut for creating a struct and calling Default yourself.
 24843  func NewDescribeConfigsRequestResource() DescribeConfigsRequestResource {
 24844  	var v DescribeConfigsRequestResource
 24845  	v.Default()
 24846  	return v
 24847  }
 24848  
 24849  // DescribeConfigsRequest issues a request to describe configs that Kafka
 24850  // currently has. These are the key/value pairs that one uses to configure
 24851  // brokers and topics.
 24852  type DescribeConfigsRequest struct {
 24853  	// Version is the version of this message used with a Kafka broker.
 24854  	Version int16
 24855  
 24856  	// Resources is a list of resources to describe.
 24857  	Resources []DescribeConfigsRequestResource
 24858  
 24859  	// IncludeSynonyms signifies whether to return config entry synonyms for
 24860  	// all config entries.
 24861  	IncludeSynonyms bool // v1+
 24862  
 24863  	// IncludeDocumentation signifies whether to return documentation for
 24864  	// config entries.
 24865  	IncludeDocumentation bool // v3+
 24866  
 24867  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 24868  	UnknownTags Tags // v4+
 24869  }
 24870  
 24871  func (*DescribeConfigsRequest) Key() int16                 { return 32 }
 24872  func (*DescribeConfigsRequest) MaxVersion() int16          { return 4 }
 24873  func (v *DescribeConfigsRequest) SetVersion(version int16) { v.Version = version }
 24874  func (v *DescribeConfigsRequest) GetVersion() int16        { return v.Version }
 24875  func (v *DescribeConfigsRequest) IsFlexible() bool         { return v.Version >= 4 }
 24876  func (v *DescribeConfigsRequest) ResponseKind() Response {
 24877  	r := &DescribeConfigsResponse{Version: v.Version}
 24878  	r.Default()
 24879  	return r
 24880  }
 24881  
 24882  // RequestWith is requests v on r and returns the response or an error.
 24883  // For sharded requests, the response may be merged and still return an error.
 24884  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 24885  func (v *DescribeConfigsRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeConfigsResponse, error) {
 24886  	kresp, err := r.Request(ctx, v)
 24887  	resp, _ := kresp.(*DescribeConfigsResponse)
 24888  	return resp, err
 24889  }
 24890  
 24891  func (v *DescribeConfigsRequest) AppendTo(dst []byte) []byte {
 24892  	version := v.Version
 24893  	_ = version
 24894  	isFlexible := version >= 4
 24895  	_ = isFlexible
 24896  	{
 24897  		v := v.Resources
 24898  		if isFlexible {
 24899  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 24900  		} else {
 24901  			dst = kbin.AppendArrayLen(dst, len(v))
 24902  		}
 24903  		for i := range v {
 24904  			v := &v[i]
 24905  			{
 24906  				v := v.ResourceType
 24907  				{
 24908  					v := int8(v)
 24909  					dst = kbin.AppendInt8(dst, v)
 24910  				}
 24911  			}
 24912  			{
 24913  				v := v.ResourceName
 24914  				if isFlexible {
 24915  					dst = kbin.AppendCompactString(dst, v)
 24916  				} else {
 24917  					dst = kbin.AppendString(dst, v)
 24918  				}
 24919  			}
 24920  			{
 24921  				v := v.ConfigNames
 24922  				if isFlexible {
 24923  					dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 24924  				} else {
 24925  					dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 24926  				}
 24927  				for i := range v {
 24928  					v := v[i]
 24929  					if isFlexible {
 24930  						dst = kbin.AppendCompactString(dst, v)
 24931  					} else {
 24932  						dst = kbin.AppendString(dst, v)
 24933  					}
 24934  				}
 24935  			}
 24936  			if isFlexible {
 24937  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24938  				dst = v.UnknownTags.AppendEach(dst)
 24939  			}
 24940  		}
 24941  	}
 24942  	if version >= 1 {
 24943  		v := v.IncludeSynonyms
 24944  		dst = kbin.AppendBool(dst, v)
 24945  	}
 24946  	if version >= 3 {
 24947  		v := v.IncludeDocumentation
 24948  		dst = kbin.AppendBool(dst, v)
 24949  	}
 24950  	if isFlexible {
 24951  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 24952  		dst = v.UnknownTags.AppendEach(dst)
 24953  	}
 24954  	return dst
 24955  }
 24956  
 24957  func (v *DescribeConfigsRequest) ReadFrom(src []byte) error {
 24958  	return v.readFrom(src, false)
 24959  }
 24960  
 24961  func (v *DescribeConfigsRequest) UnsafeReadFrom(src []byte) error {
 24962  	return v.readFrom(src, true)
 24963  }
 24964  
 24965  func (v *DescribeConfigsRequest) readFrom(src []byte, unsafe bool) error {
 24966  	v.Default()
 24967  	b := kbin.Reader{Src: src}
 24968  	version := v.Version
 24969  	_ = version
 24970  	isFlexible := version >= 4
 24971  	_ = isFlexible
 24972  	s := v
 24973  	{
 24974  		v := s.Resources
 24975  		a := v
 24976  		var l int32
 24977  		if isFlexible {
 24978  			l = b.CompactArrayLen()
 24979  		} else {
 24980  			l = b.ArrayLen()
 24981  		}
 24982  		if !b.Ok() {
 24983  			return b.Complete()
 24984  		}
 24985  		a = a[:0]
 24986  		if l > 0 {
 24987  			a = append(a, make([]DescribeConfigsRequestResource, l)...)
 24988  		}
 24989  		for i := int32(0); i < l; i++ {
 24990  			v := &a[i]
 24991  			v.Default()
 24992  			s := v
 24993  			{
 24994  				var t ConfigResourceType
 24995  				{
 24996  					v := b.Int8()
 24997  					t = ConfigResourceType(v)
 24998  				}
 24999  				v := t
 25000  				s.ResourceType = v
 25001  			}
 25002  			{
 25003  				var v string
 25004  				if unsafe {
 25005  					if isFlexible {
 25006  						v = b.UnsafeCompactString()
 25007  					} else {
 25008  						v = b.UnsafeString()
 25009  					}
 25010  				} else {
 25011  					if isFlexible {
 25012  						v = b.CompactString()
 25013  					} else {
 25014  						v = b.String()
 25015  					}
 25016  				}
 25017  				s.ResourceName = v
 25018  			}
 25019  			{
 25020  				v := s.ConfigNames
 25021  				a := v
 25022  				var l int32
 25023  				if isFlexible {
 25024  					l = b.CompactArrayLen()
 25025  				} else {
 25026  					l = b.ArrayLen()
 25027  				}
 25028  				if version < 0 || l == 0 {
 25029  					a = []string{}
 25030  				}
 25031  				if !b.Ok() {
 25032  					return b.Complete()
 25033  				}
 25034  				a = a[:0]
 25035  				if l > 0 {
 25036  					a = append(a, make([]string, l)...)
 25037  				}
 25038  				for i := int32(0); i < l; i++ {
 25039  					var v string
 25040  					if unsafe {
 25041  						if isFlexible {
 25042  							v = b.UnsafeCompactString()
 25043  						} else {
 25044  							v = b.UnsafeString()
 25045  						}
 25046  					} else {
 25047  						if isFlexible {
 25048  							v = b.CompactString()
 25049  						} else {
 25050  							v = b.String()
 25051  						}
 25052  					}
 25053  					a[i] = v
 25054  				}
 25055  				v = a
 25056  				s.ConfigNames = v
 25057  			}
 25058  			if isFlexible {
 25059  				s.UnknownTags = internalReadTags(&b)
 25060  			}
 25061  		}
 25062  		v = a
 25063  		s.Resources = v
 25064  	}
 25065  	if version >= 1 {
 25066  		v := b.Bool()
 25067  		s.IncludeSynonyms = v
 25068  	}
 25069  	if version >= 3 {
 25070  		v := b.Bool()
 25071  		s.IncludeDocumentation = v
 25072  	}
 25073  	if isFlexible {
 25074  		s.UnknownTags = internalReadTags(&b)
 25075  	}
 25076  	return b.Complete()
 25077  }
 25078  
 25079  // NewPtrDescribeConfigsRequest returns a pointer to a default DescribeConfigsRequest
 25080  // This is a shortcut for creating a new(struct) and calling Default yourself.
 25081  func NewPtrDescribeConfigsRequest() *DescribeConfigsRequest {
 25082  	var v DescribeConfigsRequest
 25083  	v.Default()
 25084  	return &v
 25085  }
 25086  
 25087  // Default sets any default fields. Calling this allows for future compatibility
 25088  // if new fields are added to DescribeConfigsRequest.
 25089  func (v *DescribeConfigsRequest) Default() {
 25090  }
 25091  
 25092  // NewDescribeConfigsRequest returns a default DescribeConfigsRequest
 25093  // This is a shortcut for creating a struct and calling Default yourself.
 25094  func NewDescribeConfigsRequest() DescribeConfigsRequest {
 25095  	var v DescribeConfigsRequest
 25096  	v.Default()
 25097  	return v
 25098  }
 25099  
 25100  type DescribeConfigsResponseResourceConfigConfigSynonym struct {
 25101  	Name string
 25102  
 25103  	Value *string
 25104  
 25105  	Source ConfigSource
 25106  
 25107  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25108  	UnknownTags Tags // v4+
 25109  }
 25110  
 25111  // Default sets any default fields. Calling this allows for future compatibility
 25112  // if new fields are added to DescribeConfigsResponseResourceConfigConfigSynonym.
 25113  func (v *DescribeConfigsResponseResourceConfigConfigSynonym) Default() {
 25114  }
 25115  
 25116  // NewDescribeConfigsResponseResourceConfigConfigSynonym returns a default DescribeConfigsResponseResourceConfigConfigSynonym
 25117  // This is a shortcut for creating a struct and calling Default yourself.
 25118  func NewDescribeConfigsResponseResourceConfigConfigSynonym() DescribeConfigsResponseResourceConfigConfigSynonym {
 25119  	var v DescribeConfigsResponseResourceConfigConfigSynonym
 25120  	v.Default()
 25121  	return v
 25122  }
 25123  
 25124  type DescribeConfigsResponseResourceConfig struct {
 25125  	// Name is a key this entry corresponds to (e.g. segment.bytes).
 25126  	Name string
 25127  
 25128  	// Value is the value for this config key. If the key is sensitive,
 25129  	// the value will be null.
 25130  	Value *string
 25131  
 25132  	// ReadOnly signifies whether this is not a dynamic config option.
 25133  	//
 25134  	// Note that this field is not always correct, and you may need to check
 25135  	// whether the Source is any dynamic enum. See franz-go#91 for more details.
 25136  	ReadOnly bool
 25137  
 25138  	// IsDefault is whether this is a default config option. This has been
 25139  	// replaced in favor of Source.
 25140  	IsDefault bool
 25141  
 25142  	// Source is where this config entry is from.
 25143  	//
 25144  	// This field has a default of -1.
 25145  	Source ConfigSource // v1+
 25146  
 25147  	// IsSensitive signifies whether this is a sensitive config key, which
 25148  	// is either a password or an unknown type.
 25149  	IsSensitive bool
 25150  
 25151  	// ConfigSynonyms contains fallback key/value pairs for this config
 25152  	// entry, in order of preference. That is, if a config entry is both
 25153  	// dynamically configured and has a default, the top level return will be
 25154  	// the dynamic configuration, while its "synonym" will be the default.
 25155  	ConfigSynonyms []DescribeConfigsResponseResourceConfigConfigSynonym // v1+
 25156  
 25157  	// ConfigType specifies the configuration data type.
 25158  	ConfigType ConfigType // v3+
 25159  
 25160  	// Documentation is optional documentation for the config entry.
 25161  	Documentation *string // v3+
 25162  
 25163  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25164  	UnknownTags Tags // v4+
 25165  }
 25166  
 25167  // Default sets any default fields. Calling this allows for future compatibility
 25168  // if new fields are added to DescribeConfigsResponseResourceConfig.
 25169  func (v *DescribeConfigsResponseResourceConfig) Default() {
 25170  	v.Source = -1
 25171  }
 25172  
 25173  // NewDescribeConfigsResponseResourceConfig returns a default DescribeConfigsResponseResourceConfig
 25174  // This is a shortcut for creating a struct and calling Default yourself.
 25175  func NewDescribeConfigsResponseResourceConfig() DescribeConfigsResponseResourceConfig {
 25176  	var v DescribeConfigsResponseResourceConfig
 25177  	v.Default()
 25178  	return v
 25179  }
 25180  
 25181  type DescribeConfigsResponseResource struct {
 25182  	// ErrorCode is the error code returned for describing configs.
 25183  	//
 25184  	// INVALID_REQUEST is returned if asking to descibe an invalid resource
 25185  	// type.
 25186  	//
 25187  	// CLUSTER_AUTHORIZATION_FAILED is returned if asking to describe broker
 25188  	// configs but the client is not authorized to do so.
 25189  	//
 25190  	// TOPIC_AUTHORIZATION_FAILED is returned if asking to describe topic
 25191  	// configs but the client is not authorized to do so.
 25192  	//
 25193  	// INVALID_TOPIC_EXCEPTION is returned if the requested topic was invalid.
 25194  	//
 25195  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 25196  	// the requested topic.
 25197  	ErrorCode int16
 25198  
 25199  	// ErrorMessage is an informative message if the describe config failed.
 25200  	ErrorMessage *string
 25201  
 25202  	// ResourceType is the enum corresponding to the type of described config.
 25203  	ResourceType ConfigResourceType
 25204  
 25205  	// ResourceName is the name corresponding to the describe config request.
 25206  	ResourceName string
 25207  
 25208  	// Configs contains information about key/value config pairs for
 25209  	// the requested resource.
 25210  	Configs []DescribeConfigsResponseResourceConfig
 25211  
 25212  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25213  	UnknownTags Tags // v4+
 25214  }
 25215  
 25216  // Default sets any default fields. Calling this allows for future compatibility
 25217  // if new fields are added to DescribeConfigsResponseResource.
 25218  func (v *DescribeConfigsResponseResource) Default() {
 25219  }
 25220  
 25221  // NewDescribeConfigsResponseResource returns a default DescribeConfigsResponseResource
 25222  // This is a shortcut for creating a struct and calling Default yourself.
 25223  func NewDescribeConfigsResponseResource() DescribeConfigsResponseResource {
 25224  	var v DescribeConfigsResponseResource
 25225  	v.Default()
 25226  	return v
 25227  }
 25228  
 25229  // DescribeConfigsResponse is returned from a DescribeConfigsRequest.
 25230  type DescribeConfigsResponse struct {
 25231  	// Version is the version of this message used with a Kafka broker.
 25232  	Version int16
 25233  
 25234  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 25235  	// after this request.
 25236  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 25237  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 25238  	//
 25239  	// This request switched at version 2.
 25240  	ThrottleMillis int32
 25241  
 25242  	// Resources are responses for each resource in the describe config request.
 25243  	Resources []DescribeConfigsResponseResource
 25244  
 25245  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25246  	UnknownTags Tags // v4+
 25247  }
 25248  
 25249  func (*DescribeConfigsResponse) Key() int16                 { return 32 }
 25250  func (*DescribeConfigsResponse) MaxVersion() int16          { return 4 }
 25251  func (v *DescribeConfigsResponse) SetVersion(version int16) { v.Version = version }
 25252  func (v *DescribeConfigsResponse) GetVersion() int16        { return v.Version }
 25253  func (v *DescribeConfigsResponse) IsFlexible() bool         { return v.Version >= 4 }
 25254  func (v *DescribeConfigsResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 2 }
 25255  func (v *DescribeConfigsResponse) SetThrottle(throttleMillis int32) {
 25256  	v.ThrottleMillis = throttleMillis
 25257  }
 25258  
 25259  func (v *DescribeConfigsResponse) RequestKind() Request {
 25260  	return &DescribeConfigsRequest{Version: v.Version}
 25261  }
 25262  
 25263  func (v *DescribeConfigsResponse) AppendTo(dst []byte) []byte {
 25264  	version := v.Version
 25265  	_ = version
 25266  	isFlexible := version >= 4
 25267  	_ = isFlexible
 25268  	{
 25269  		v := v.ThrottleMillis
 25270  		dst = kbin.AppendInt32(dst, v)
 25271  	}
 25272  	{
 25273  		v := v.Resources
 25274  		if isFlexible {
 25275  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 25276  		} else {
 25277  			dst = kbin.AppendArrayLen(dst, len(v))
 25278  		}
 25279  		for i := range v {
 25280  			v := &v[i]
 25281  			{
 25282  				v := v.ErrorCode
 25283  				dst = kbin.AppendInt16(dst, v)
 25284  			}
 25285  			{
 25286  				v := v.ErrorMessage
 25287  				if isFlexible {
 25288  					dst = kbin.AppendCompactNullableString(dst, v)
 25289  				} else {
 25290  					dst = kbin.AppendNullableString(dst, v)
 25291  				}
 25292  			}
 25293  			{
 25294  				v := v.ResourceType
 25295  				{
 25296  					v := int8(v)
 25297  					dst = kbin.AppendInt8(dst, v)
 25298  				}
 25299  			}
 25300  			{
 25301  				v := v.ResourceName
 25302  				if isFlexible {
 25303  					dst = kbin.AppendCompactString(dst, v)
 25304  				} else {
 25305  					dst = kbin.AppendString(dst, v)
 25306  				}
 25307  			}
 25308  			{
 25309  				v := v.Configs
 25310  				if isFlexible {
 25311  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 25312  				} else {
 25313  					dst = kbin.AppendArrayLen(dst, len(v))
 25314  				}
 25315  				for i := range v {
 25316  					v := &v[i]
 25317  					{
 25318  						v := v.Name
 25319  						if isFlexible {
 25320  							dst = kbin.AppendCompactString(dst, v)
 25321  						} else {
 25322  							dst = kbin.AppendString(dst, v)
 25323  						}
 25324  					}
 25325  					{
 25326  						v := v.Value
 25327  						if isFlexible {
 25328  							dst = kbin.AppendCompactNullableString(dst, v)
 25329  						} else {
 25330  							dst = kbin.AppendNullableString(dst, v)
 25331  						}
 25332  					}
 25333  					{
 25334  						v := v.ReadOnly
 25335  						dst = kbin.AppendBool(dst, v)
 25336  					}
 25337  					if version >= 0 && version <= 0 {
 25338  						v := v.IsDefault
 25339  						dst = kbin.AppendBool(dst, v)
 25340  					}
 25341  					if version >= 1 {
 25342  						v := v.Source
 25343  						{
 25344  							v := int8(v)
 25345  							dst = kbin.AppendInt8(dst, v)
 25346  						}
 25347  					}
 25348  					{
 25349  						v := v.IsSensitive
 25350  						dst = kbin.AppendBool(dst, v)
 25351  					}
 25352  					if version >= 1 {
 25353  						v := v.ConfigSynonyms
 25354  						if isFlexible {
 25355  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 25356  						} else {
 25357  							dst = kbin.AppendArrayLen(dst, len(v))
 25358  						}
 25359  						for i := range v {
 25360  							v := &v[i]
 25361  							{
 25362  								v := v.Name
 25363  								if isFlexible {
 25364  									dst = kbin.AppendCompactString(dst, v)
 25365  								} else {
 25366  									dst = kbin.AppendString(dst, v)
 25367  								}
 25368  							}
 25369  							{
 25370  								v := v.Value
 25371  								if isFlexible {
 25372  									dst = kbin.AppendCompactNullableString(dst, v)
 25373  								} else {
 25374  									dst = kbin.AppendNullableString(dst, v)
 25375  								}
 25376  							}
 25377  							{
 25378  								v := v.Source
 25379  								{
 25380  									v := int8(v)
 25381  									dst = kbin.AppendInt8(dst, v)
 25382  								}
 25383  							}
 25384  							if isFlexible {
 25385  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25386  								dst = v.UnknownTags.AppendEach(dst)
 25387  							}
 25388  						}
 25389  					}
 25390  					if version >= 3 {
 25391  						v := v.ConfigType
 25392  						{
 25393  							v := int8(v)
 25394  							dst = kbin.AppendInt8(dst, v)
 25395  						}
 25396  					}
 25397  					if version >= 3 {
 25398  						v := v.Documentation
 25399  						if isFlexible {
 25400  							dst = kbin.AppendCompactNullableString(dst, v)
 25401  						} else {
 25402  							dst = kbin.AppendNullableString(dst, v)
 25403  						}
 25404  					}
 25405  					if isFlexible {
 25406  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25407  						dst = v.UnknownTags.AppendEach(dst)
 25408  					}
 25409  				}
 25410  			}
 25411  			if isFlexible {
 25412  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25413  				dst = v.UnknownTags.AppendEach(dst)
 25414  			}
 25415  		}
 25416  	}
 25417  	if isFlexible {
 25418  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25419  		dst = v.UnknownTags.AppendEach(dst)
 25420  	}
 25421  	return dst
 25422  }
 25423  
 25424  func (v *DescribeConfigsResponse) ReadFrom(src []byte) error {
 25425  	return v.readFrom(src, false)
 25426  }
 25427  
 25428  func (v *DescribeConfigsResponse) UnsafeReadFrom(src []byte) error {
 25429  	return v.readFrom(src, true)
 25430  }
 25431  
 25432  func (v *DescribeConfigsResponse) readFrom(src []byte, unsafe bool) error {
 25433  	v.Default()
 25434  	b := kbin.Reader{Src: src}
 25435  	version := v.Version
 25436  	_ = version
 25437  	isFlexible := version >= 4
 25438  	_ = isFlexible
 25439  	s := v
 25440  	{
 25441  		v := b.Int32()
 25442  		s.ThrottleMillis = v
 25443  	}
 25444  	{
 25445  		v := s.Resources
 25446  		a := v
 25447  		var l int32
 25448  		if isFlexible {
 25449  			l = b.CompactArrayLen()
 25450  		} else {
 25451  			l = b.ArrayLen()
 25452  		}
 25453  		if !b.Ok() {
 25454  			return b.Complete()
 25455  		}
 25456  		a = a[:0]
 25457  		if l > 0 {
 25458  			a = append(a, make([]DescribeConfigsResponseResource, l)...)
 25459  		}
 25460  		for i := int32(0); i < l; i++ {
 25461  			v := &a[i]
 25462  			v.Default()
 25463  			s := v
 25464  			{
 25465  				v := b.Int16()
 25466  				s.ErrorCode = v
 25467  			}
 25468  			{
 25469  				var v *string
 25470  				if isFlexible {
 25471  					if unsafe {
 25472  						v = b.UnsafeCompactNullableString()
 25473  					} else {
 25474  						v = b.CompactNullableString()
 25475  					}
 25476  				} else {
 25477  					if unsafe {
 25478  						v = b.UnsafeNullableString()
 25479  					} else {
 25480  						v = b.NullableString()
 25481  					}
 25482  				}
 25483  				s.ErrorMessage = v
 25484  			}
 25485  			{
 25486  				var t ConfigResourceType
 25487  				{
 25488  					v := b.Int8()
 25489  					t = ConfigResourceType(v)
 25490  				}
 25491  				v := t
 25492  				s.ResourceType = v
 25493  			}
 25494  			{
 25495  				var v string
 25496  				if unsafe {
 25497  					if isFlexible {
 25498  						v = b.UnsafeCompactString()
 25499  					} else {
 25500  						v = b.UnsafeString()
 25501  					}
 25502  				} else {
 25503  					if isFlexible {
 25504  						v = b.CompactString()
 25505  					} else {
 25506  						v = b.String()
 25507  					}
 25508  				}
 25509  				s.ResourceName = v
 25510  			}
 25511  			{
 25512  				v := s.Configs
 25513  				a := v
 25514  				var l int32
 25515  				if isFlexible {
 25516  					l = b.CompactArrayLen()
 25517  				} else {
 25518  					l = b.ArrayLen()
 25519  				}
 25520  				if !b.Ok() {
 25521  					return b.Complete()
 25522  				}
 25523  				a = a[:0]
 25524  				if l > 0 {
 25525  					a = append(a, make([]DescribeConfigsResponseResourceConfig, l)...)
 25526  				}
 25527  				for i := int32(0); i < l; i++ {
 25528  					v := &a[i]
 25529  					v.Default()
 25530  					s := v
 25531  					{
 25532  						var v string
 25533  						if unsafe {
 25534  							if isFlexible {
 25535  								v = b.UnsafeCompactString()
 25536  							} else {
 25537  								v = b.UnsafeString()
 25538  							}
 25539  						} else {
 25540  							if isFlexible {
 25541  								v = b.CompactString()
 25542  							} else {
 25543  								v = b.String()
 25544  							}
 25545  						}
 25546  						s.Name = v
 25547  					}
 25548  					{
 25549  						var v *string
 25550  						if isFlexible {
 25551  							if unsafe {
 25552  								v = b.UnsafeCompactNullableString()
 25553  							} else {
 25554  								v = b.CompactNullableString()
 25555  							}
 25556  						} else {
 25557  							if unsafe {
 25558  								v = b.UnsafeNullableString()
 25559  							} else {
 25560  								v = b.NullableString()
 25561  							}
 25562  						}
 25563  						s.Value = v
 25564  					}
 25565  					{
 25566  						v := b.Bool()
 25567  						s.ReadOnly = v
 25568  					}
 25569  					if version >= 0 && version <= 0 {
 25570  						v := b.Bool()
 25571  						s.IsDefault = v
 25572  					}
 25573  					if version >= 1 {
 25574  						var t ConfigSource
 25575  						{
 25576  							v := b.Int8()
 25577  							t = ConfigSource(v)
 25578  						}
 25579  						v := t
 25580  						s.Source = v
 25581  					}
 25582  					{
 25583  						v := b.Bool()
 25584  						s.IsSensitive = v
 25585  					}
 25586  					if version >= 1 {
 25587  						v := s.ConfigSynonyms
 25588  						a := v
 25589  						var l int32
 25590  						if isFlexible {
 25591  							l = b.CompactArrayLen()
 25592  						} else {
 25593  							l = b.ArrayLen()
 25594  						}
 25595  						if !b.Ok() {
 25596  							return b.Complete()
 25597  						}
 25598  						a = a[:0]
 25599  						if l > 0 {
 25600  							a = append(a, make([]DescribeConfigsResponseResourceConfigConfigSynonym, l)...)
 25601  						}
 25602  						for i := int32(0); i < l; i++ {
 25603  							v := &a[i]
 25604  							v.Default()
 25605  							s := v
 25606  							{
 25607  								var v string
 25608  								if unsafe {
 25609  									if isFlexible {
 25610  										v = b.UnsafeCompactString()
 25611  									} else {
 25612  										v = b.UnsafeString()
 25613  									}
 25614  								} else {
 25615  									if isFlexible {
 25616  										v = b.CompactString()
 25617  									} else {
 25618  										v = b.String()
 25619  									}
 25620  								}
 25621  								s.Name = v
 25622  							}
 25623  							{
 25624  								var v *string
 25625  								if isFlexible {
 25626  									if unsafe {
 25627  										v = b.UnsafeCompactNullableString()
 25628  									} else {
 25629  										v = b.CompactNullableString()
 25630  									}
 25631  								} else {
 25632  									if unsafe {
 25633  										v = b.UnsafeNullableString()
 25634  									} else {
 25635  										v = b.NullableString()
 25636  									}
 25637  								}
 25638  								s.Value = v
 25639  							}
 25640  							{
 25641  								var t ConfigSource
 25642  								{
 25643  									v := b.Int8()
 25644  									t = ConfigSource(v)
 25645  								}
 25646  								v := t
 25647  								s.Source = v
 25648  							}
 25649  							if isFlexible {
 25650  								s.UnknownTags = internalReadTags(&b)
 25651  							}
 25652  						}
 25653  						v = a
 25654  						s.ConfigSynonyms = v
 25655  					}
 25656  					if version >= 3 {
 25657  						var t ConfigType
 25658  						{
 25659  							v := b.Int8()
 25660  							t = ConfigType(v)
 25661  						}
 25662  						v := t
 25663  						s.ConfigType = v
 25664  					}
 25665  					if version >= 3 {
 25666  						var v *string
 25667  						if isFlexible {
 25668  							if unsafe {
 25669  								v = b.UnsafeCompactNullableString()
 25670  							} else {
 25671  								v = b.CompactNullableString()
 25672  							}
 25673  						} else {
 25674  							if unsafe {
 25675  								v = b.UnsafeNullableString()
 25676  							} else {
 25677  								v = b.NullableString()
 25678  							}
 25679  						}
 25680  						s.Documentation = v
 25681  					}
 25682  					if isFlexible {
 25683  						s.UnknownTags = internalReadTags(&b)
 25684  					}
 25685  				}
 25686  				v = a
 25687  				s.Configs = v
 25688  			}
 25689  			if isFlexible {
 25690  				s.UnknownTags = internalReadTags(&b)
 25691  			}
 25692  		}
 25693  		v = a
 25694  		s.Resources = v
 25695  	}
 25696  	if isFlexible {
 25697  		s.UnknownTags = internalReadTags(&b)
 25698  	}
 25699  	return b.Complete()
 25700  }
 25701  
 25702  // NewPtrDescribeConfigsResponse returns a pointer to a default DescribeConfigsResponse
 25703  // This is a shortcut for creating a new(struct) and calling Default yourself.
 25704  func NewPtrDescribeConfigsResponse() *DescribeConfigsResponse {
 25705  	var v DescribeConfigsResponse
 25706  	v.Default()
 25707  	return &v
 25708  }
 25709  
 25710  // Default sets any default fields. Calling this allows for future compatibility
 25711  // if new fields are added to DescribeConfigsResponse.
 25712  func (v *DescribeConfigsResponse) Default() {
 25713  }
 25714  
 25715  // NewDescribeConfigsResponse returns a default DescribeConfigsResponse
 25716  // This is a shortcut for creating a struct and calling Default yourself.
 25717  func NewDescribeConfigsResponse() DescribeConfigsResponse {
 25718  	var v DescribeConfigsResponse
 25719  	v.Default()
 25720  	return v
 25721  }
 25722  
 25723  type AlterConfigsRequestResourceConfig struct {
 25724  	// Name is a key to set (e.g. segment.bytes).
 25725  	Name string
 25726  
 25727  	// Value is a value to set for the key (e.g. 10).
 25728  	Value *string
 25729  
 25730  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25731  	UnknownTags Tags // v2+
 25732  }
 25733  
 25734  // Default sets any default fields. Calling this allows for future compatibility
 25735  // if new fields are added to AlterConfigsRequestResourceConfig.
 25736  func (v *AlterConfigsRequestResourceConfig) Default() {
 25737  }
 25738  
 25739  // NewAlterConfigsRequestResourceConfig returns a default AlterConfigsRequestResourceConfig
 25740  // This is a shortcut for creating a struct and calling Default yourself.
 25741  func NewAlterConfigsRequestResourceConfig() AlterConfigsRequestResourceConfig {
 25742  	var v AlterConfigsRequestResourceConfig
 25743  	v.Default()
 25744  	return v
 25745  }
 25746  
 25747  type AlterConfigsRequestResource struct {
 25748  	// ResourceType is an enum corresponding to the type of config to alter.
 25749  	// The only two valid values are 2 (for topic) and 4 (for broker).
 25750  	ResourceType ConfigResourceType
 25751  
 25752  	// ResourceName is the name of config to alter.
 25753  	//
 25754  	// If the requested type is a topic, this corresponds to a topic name.
 25755  	//
 25756  	// If the requested type if a broker, this should either be empty or be
 25757  	// the ID of the broker this request is issued to. If it is empty, this
 25758  	// updates all broker configs. If a specific ID, this updates just the
 25759  	// broker. Using a specific ID also ensures that brokers reload config
 25760  	// or secret files even if the file path has not changed. Lastly, password
 25761  	// config options can only be defined on a per broker basis.
 25762  	//
 25763  	// If the type is broker logger, this must be a broker ID.
 25764  	ResourceName string
 25765  
 25766  	// Configs contains key/value config pairs to set on the resource.
 25767  	Configs []AlterConfigsRequestResourceConfig
 25768  
 25769  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25770  	UnknownTags Tags // v2+
 25771  }
 25772  
 25773  // Default sets any default fields. Calling this allows for future compatibility
 25774  // if new fields are added to AlterConfigsRequestResource.
 25775  func (v *AlterConfigsRequestResource) Default() {
 25776  }
 25777  
 25778  // NewAlterConfigsRequestResource returns a default AlterConfigsRequestResource
 25779  // This is a shortcut for creating a struct and calling Default yourself.
 25780  func NewAlterConfigsRequestResource() AlterConfigsRequestResource {
 25781  	var v AlterConfigsRequestResource
 25782  	v.Default()
 25783  	return v
 25784  }
 25785  
 25786  // AlterConfigsRequest issues a request to alter either topic or broker
 25787  // configs.
 25788  //
 25789  // Note that to alter configs, you must specify the whole config on every
 25790  // request. All existing non-static values will be removed. This means that
 25791  // to add one key/value to a config, you must describe the config and then
 25792  // issue an alter request with the current config with the new key value.
 25793  // This also means that dynamic sensitive values, which are not returned
 25794  // in describe configs, will be lost.
 25795  //
 25796  // To fix this problem, the AlterConfigs request / response was deprecated
 25797  // in Kafka 2.3.0 in favor of the new IncrementalAlterConfigs request / response.
 25798  // See KIP-339 for more details.
 25799  type AlterConfigsRequest struct {
 25800  	// Version is the version of this message used with a Kafka broker.
 25801  	Version int16
 25802  
 25803  	// Resources is an array of configs to alter.
 25804  	Resources []AlterConfigsRequestResource
 25805  
 25806  	// ValidateOnly validates the request but does not apply it.
 25807  	ValidateOnly bool
 25808  
 25809  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 25810  	UnknownTags Tags // v2+
 25811  }
 25812  
 25813  func (*AlterConfigsRequest) Key() int16                 { return 33 }
 25814  func (*AlterConfigsRequest) MaxVersion() int16          { return 2 }
 25815  func (v *AlterConfigsRequest) SetVersion(version int16) { v.Version = version }
 25816  func (v *AlterConfigsRequest) GetVersion() int16        { return v.Version }
 25817  func (v *AlterConfigsRequest) IsFlexible() bool         { return v.Version >= 2 }
 25818  func (v *AlterConfigsRequest) ResponseKind() Response {
 25819  	r := &AlterConfigsResponse{Version: v.Version}
 25820  	r.Default()
 25821  	return r
 25822  }
 25823  
 25824  // RequestWith is requests v on r and returns the response or an error.
 25825  // For sharded requests, the response may be merged and still return an error.
 25826  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 25827  func (v *AlterConfigsRequest) RequestWith(ctx context.Context, r Requestor) (*AlterConfigsResponse, error) {
 25828  	kresp, err := r.Request(ctx, v)
 25829  	resp, _ := kresp.(*AlterConfigsResponse)
 25830  	return resp, err
 25831  }
 25832  
 25833  func (v *AlterConfigsRequest) AppendTo(dst []byte) []byte {
 25834  	version := v.Version
 25835  	_ = version
 25836  	isFlexible := version >= 2
 25837  	_ = isFlexible
 25838  	{
 25839  		v := v.Resources
 25840  		if isFlexible {
 25841  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 25842  		} else {
 25843  			dst = kbin.AppendArrayLen(dst, len(v))
 25844  		}
 25845  		for i := range v {
 25846  			v := &v[i]
 25847  			{
 25848  				v := v.ResourceType
 25849  				{
 25850  					v := int8(v)
 25851  					dst = kbin.AppendInt8(dst, v)
 25852  				}
 25853  			}
 25854  			{
 25855  				v := v.ResourceName
 25856  				if isFlexible {
 25857  					dst = kbin.AppendCompactString(dst, v)
 25858  				} else {
 25859  					dst = kbin.AppendString(dst, v)
 25860  				}
 25861  			}
 25862  			{
 25863  				v := v.Configs
 25864  				if isFlexible {
 25865  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 25866  				} else {
 25867  					dst = kbin.AppendArrayLen(dst, len(v))
 25868  				}
 25869  				for i := range v {
 25870  					v := &v[i]
 25871  					{
 25872  						v := v.Name
 25873  						if isFlexible {
 25874  							dst = kbin.AppendCompactString(dst, v)
 25875  						} else {
 25876  							dst = kbin.AppendString(dst, v)
 25877  						}
 25878  					}
 25879  					{
 25880  						v := v.Value
 25881  						if isFlexible {
 25882  							dst = kbin.AppendCompactNullableString(dst, v)
 25883  						} else {
 25884  							dst = kbin.AppendNullableString(dst, v)
 25885  						}
 25886  					}
 25887  					if isFlexible {
 25888  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25889  						dst = v.UnknownTags.AppendEach(dst)
 25890  					}
 25891  				}
 25892  			}
 25893  			if isFlexible {
 25894  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25895  				dst = v.UnknownTags.AppendEach(dst)
 25896  			}
 25897  		}
 25898  	}
 25899  	{
 25900  		v := v.ValidateOnly
 25901  		dst = kbin.AppendBool(dst, v)
 25902  	}
 25903  	if isFlexible {
 25904  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 25905  		dst = v.UnknownTags.AppendEach(dst)
 25906  	}
 25907  	return dst
 25908  }
 25909  
 25910  func (v *AlterConfigsRequest) ReadFrom(src []byte) error {
 25911  	return v.readFrom(src, false)
 25912  }
 25913  
 25914  func (v *AlterConfigsRequest) UnsafeReadFrom(src []byte) error {
 25915  	return v.readFrom(src, true)
 25916  }
 25917  
 25918  func (v *AlterConfigsRequest) readFrom(src []byte, unsafe bool) error {
 25919  	v.Default()
 25920  	b := kbin.Reader{Src: src}
 25921  	version := v.Version
 25922  	_ = version
 25923  	isFlexible := version >= 2
 25924  	_ = isFlexible
 25925  	s := v
 25926  	{
 25927  		v := s.Resources
 25928  		a := v
 25929  		var l int32
 25930  		if isFlexible {
 25931  			l = b.CompactArrayLen()
 25932  		} else {
 25933  			l = b.ArrayLen()
 25934  		}
 25935  		if !b.Ok() {
 25936  			return b.Complete()
 25937  		}
 25938  		a = a[:0]
 25939  		if l > 0 {
 25940  			a = append(a, make([]AlterConfigsRequestResource, l)...)
 25941  		}
 25942  		for i := int32(0); i < l; i++ {
 25943  			v := &a[i]
 25944  			v.Default()
 25945  			s := v
 25946  			{
 25947  				var t ConfigResourceType
 25948  				{
 25949  					v := b.Int8()
 25950  					t = ConfigResourceType(v)
 25951  				}
 25952  				v := t
 25953  				s.ResourceType = v
 25954  			}
 25955  			{
 25956  				var v string
 25957  				if unsafe {
 25958  					if isFlexible {
 25959  						v = b.UnsafeCompactString()
 25960  					} else {
 25961  						v = b.UnsafeString()
 25962  					}
 25963  				} else {
 25964  					if isFlexible {
 25965  						v = b.CompactString()
 25966  					} else {
 25967  						v = b.String()
 25968  					}
 25969  				}
 25970  				s.ResourceName = v
 25971  			}
 25972  			{
 25973  				v := s.Configs
 25974  				a := v
 25975  				var l int32
 25976  				if isFlexible {
 25977  					l = b.CompactArrayLen()
 25978  				} else {
 25979  					l = b.ArrayLen()
 25980  				}
 25981  				if !b.Ok() {
 25982  					return b.Complete()
 25983  				}
 25984  				a = a[:0]
 25985  				if l > 0 {
 25986  					a = append(a, make([]AlterConfigsRequestResourceConfig, l)...)
 25987  				}
 25988  				for i := int32(0); i < l; i++ {
 25989  					v := &a[i]
 25990  					v.Default()
 25991  					s := v
 25992  					{
 25993  						var v string
 25994  						if unsafe {
 25995  							if isFlexible {
 25996  								v = b.UnsafeCompactString()
 25997  							} else {
 25998  								v = b.UnsafeString()
 25999  							}
 26000  						} else {
 26001  							if isFlexible {
 26002  								v = b.CompactString()
 26003  							} else {
 26004  								v = b.String()
 26005  							}
 26006  						}
 26007  						s.Name = v
 26008  					}
 26009  					{
 26010  						var v *string
 26011  						if isFlexible {
 26012  							if unsafe {
 26013  								v = b.UnsafeCompactNullableString()
 26014  							} else {
 26015  								v = b.CompactNullableString()
 26016  							}
 26017  						} else {
 26018  							if unsafe {
 26019  								v = b.UnsafeNullableString()
 26020  							} else {
 26021  								v = b.NullableString()
 26022  							}
 26023  						}
 26024  						s.Value = v
 26025  					}
 26026  					if isFlexible {
 26027  						s.UnknownTags = internalReadTags(&b)
 26028  					}
 26029  				}
 26030  				v = a
 26031  				s.Configs = v
 26032  			}
 26033  			if isFlexible {
 26034  				s.UnknownTags = internalReadTags(&b)
 26035  			}
 26036  		}
 26037  		v = a
 26038  		s.Resources = v
 26039  	}
 26040  	{
 26041  		v := b.Bool()
 26042  		s.ValidateOnly = v
 26043  	}
 26044  	if isFlexible {
 26045  		s.UnknownTags = internalReadTags(&b)
 26046  	}
 26047  	return b.Complete()
 26048  }
 26049  
 26050  // NewPtrAlterConfigsRequest returns a pointer to a default AlterConfigsRequest
 26051  // This is a shortcut for creating a new(struct) and calling Default yourself.
 26052  func NewPtrAlterConfigsRequest() *AlterConfigsRequest {
 26053  	var v AlterConfigsRequest
 26054  	v.Default()
 26055  	return &v
 26056  }
 26057  
 26058  // Default sets any default fields. Calling this allows for future compatibility
 26059  // if new fields are added to AlterConfigsRequest.
 26060  func (v *AlterConfigsRequest) Default() {
 26061  }
 26062  
 26063  // NewAlterConfigsRequest returns a default AlterConfigsRequest
 26064  // This is a shortcut for creating a struct and calling Default yourself.
 26065  func NewAlterConfigsRequest() AlterConfigsRequest {
 26066  	var v AlterConfigsRequest
 26067  	v.Default()
 26068  	return v
 26069  }
 26070  
 26071  type AlterConfigsResponseResource struct {
 26072  	// ErrorCode is the error code returned for altering configs.
 26073  	//
 26074  	// CLUSTER_AUTHORIZATION_FAILED is returned if asking to alter broker
 26075  	// configs but the client is not authorized to do so.
 26076  	//
 26077  	// TOPIC_AUTHORIZATION_FAILED is returned if asking to alter topic
 26078  	// configs but the client is not authorized to do so.
 26079  	//
 26080  	// INVALID_TOPIC_EXCEPTION is returned if the requested topic was invalid.
 26081  	//
 26082  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 26083  	// the requested topic.
 26084  	//
 26085  	// INVALID_REQUEST is returned if the requested config is invalid or if
 26086  	// asking Kafka to alter an invalid resource.
 26087  	ErrorCode int16
 26088  
 26089  	// ErrorMessage is an informative message if the alter config failed.
 26090  	ErrorMessage *string
 26091  
 26092  	// ResourceType is the enum corresponding to the type of altered config.
 26093  	ResourceType ConfigResourceType
 26094  
 26095  	// ResourceName is the name corresponding to the alter config request.
 26096  	ResourceName string
 26097  
 26098  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26099  	UnknownTags Tags // v2+
 26100  }
 26101  
 26102  // Default sets any default fields. Calling this allows for future compatibility
 26103  // if new fields are added to AlterConfigsResponseResource.
 26104  func (v *AlterConfigsResponseResource) Default() {
 26105  }
 26106  
 26107  // NewAlterConfigsResponseResource returns a default AlterConfigsResponseResource
 26108  // This is a shortcut for creating a struct and calling Default yourself.
 26109  func NewAlterConfigsResponseResource() AlterConfigsResponseResource {
 26110  	var v AlterConfigsResponseResource
 26111  	v.Default()
 26112  	return v
 26113  }
 26114  
 26115  // AlterConfigsResponse is returned from an AlterConfigsRequest.
 26116  type AlterConfigsResponse struct {
 26117  	// Version is the version of this message used with a Kafka broker.
 26118  	Version int16
 26119  
 26120  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 26121  	// after this request.
 26122  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 26123  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 26124  	//
 26125  	// This request switched at version 1.
 26126  	ThrottleMillis int32
 26127  
 26128  	// Resources are responses for each resource in the alter request.
 26129  	Resources []AlterConfigsResponseResource
 26130  
 26131  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26132  	UnknownTags Tags // v2+
 26133  }
 26134  
 26135  func (*AlterConfigsResponse) Key() int16                         { return 33 }
 26136  func (*AlterConfigsResponse) MaxVersion() int16                  { return 2 }
 26137  func (v *AlterConfigsResponse) SetVersion(version int16)         { v.Version = version }
 26138  func (v *AlterConfigsResponse) GetVersion() int16                { return v.Version }
 26139  func (v *AlterConfigsResponse) IsFlexible() bool                 { return v.Version >= 2 }
 26140  func (v *AlterConfigsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 26141  func (v *AlterConfigsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 26142  func (v *AlterConfigsResponse) RequestKind() Request             { return &AlterConfigsRequest{Version: v.Version} }
 26143  
 26144  func (v *AlterConfigsResponse) AppendTo(dst []byte) []byte {
 26145  	version := v.Version
 26146  	_ = version
 26147  	isFlexible := version >= 2
 26148  	_ = isFlexible
 26149  	{
 26150  		v := v.ThrottleMillis
 26151  		dst = kbin.AppendInt32(dst, v)
 26152  	}
 26153  	{
 26154  		v := v.Resources
 26155  		if isFlexible {
 26156  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 26157  		} else {
 26158  			dst = kbin.AppendArrayLen(dst, len(v))
 26159  		}
 26160  		for i := range v {
 26161  			v := &v[i]
 26162  			{
 26163  				v := v.ErrorCode
 26164  				dst = kbin.AppendInt16(dst, v)
 26165  			}
 26166  			{
 26167  				v := v.ErrorMessage
 26168  				if isFlexible {
 26169  					dst = kbin.AppendCompactNullableString(dst, v)
 26170  				} else {
 26171  					dst = kbin.AppendNullableString(dst, v)
 26172  				}
 26173  			}
 26174  			{
 26175  				v := v.ResourceType
 26176  				{
 26177  					v := int8(v)
 26178  					dst = kbin.AppendInt8(dst, v)
 26179  				}
 26180  			}
 26181  			{
 26182  				v := v.ResourceName
 26183  				if isFlexible {
 26184  					dst = kbin.AppendCompactString(dst, v)
 26185  				} else {
 26186  					dst = kbin.AppendString(dst, v)
 26187  				}
 26188  			}
 26189  			if isFlexible {
 26190  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26191  				dst = v.UnknownTags.AppendEach(dst)
 26192  			}
 26193  		}
 26194  	}
 26195  	if isFlexible {
 26196  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26197  		dst = v.UnknownTags.AppendEach(dst)
 26198  	}
 26199  	return dst
 26200  }
 26201  
 26202  func (v *AlterConfigsResponse) ReadFrom(src []byte) error {
 26203  	return v.readFrom(src, false)
 26204  }
 26205  
 26206  func (v *AlterConfigsResponse) UnsafeReadFrom(src []byte) error {
 26207  	return v.readFrom(src, true)
 26208  }
 26209  
 26210  func (v *AlterConfigsResponse) readFrom(src []byte, unsafe bool) error {
 26211  	v.Default()
 26212  	b := kbin.Reader{Src: src}
 26213  	version := v.Version
 26214  	_ = version
 26215  	isFlexible := version >= 2
 26216  	_ = isFlexible
 26217  	s := v
 26218  	{
 26219  		v := b.Int32()
 26220  		s.ThrottleMillis = v
 26221  	}
 26222  	{
 26223  		v := s.Resources
 26224  		a := v
 26225  		var l int32
 26226  		if isFlexible {
 26227  			l = b.CompactArrayLen()
 26228  		} else {
 26229  			l = b.ArrayLen()
 26230  		}
 26231  		if !b.Ok() {
 26232  			return b.Complete()
 26233  		}
 26234  		a = a[:0]
 26235  		if l > 0 {
 26236  			a = append(a, make([]AlterConfigsResponseResource, l)...)
 26237  		}
 26238  		for i := int32(0); i < l; i++ {
 26239  			v := &a[i]
 26240  			v.Default()
 26241  			s := v
 26242  			{
 26243  				v := b.Int16()
 26244  				s.ErrorCode = v
 26245  			}
 26246  			{
 26247  				var v *string
 26248  				if isFlexible {
 26249  					if unsafe {
 26250  						v = b.UnsafeCompactNullableString()
 26251  					} else {
 26252  						v = b.CompactNullableString()
 26253  					}
 26254  				} else {
 26255  					if unsafe {
 26256  						v = b.UnsafeNullableString()
 26257  					} else {
 26258  						v = b.NullableString()
 26259  					}
 26260  				}
 26261  				s.ErrorMessage = v
 26262  			}
 26263  			{
 26264  				var t ConfigResourceType
 26265  				{
 26266  					v := b.Int8()
 26267  					t = ConfigResourceType(v)
 26268  				}
 26269  				v := t
 26270  				s.ResourceType = v
 26271  			}
 26272  			{
 26273  				var v string
 26274  				if unsafe {
 26275  					if isFlexible {
 26276  						v = b.UnsafeCompactString()
 26277  					} else {
 26278  						v = b.UnsafeString()
 26279  					}
 26280  				} else {
 26281  					if isFlexible {
 26282  						v = b.CompactString()
 26283  					} else {
 26284  						v = b.String()
 26285  					}
 26286  				}
 26287  				s.ResourceName = v
 26288  			}
 26289  			if isFlexible {
 26290  				s.UnknownTags = internalReadTags(&b)
 26291  			}
 26292  		}
 26293  		v = a
 26294  		s.Resources = v
 26295  	}
 26296  	if isFlexible {
 26297  		s.UnknownTags = internalReadTags(&b)
 26298  	}
 26299  	return b.Complete()
 26300  }
 26301  
 26302  // NewPtrAlterConfigsResponse returns a pointer to a default AlterConfigsResponse
 26303  // This is a shortcut for creating a new(struct) and calling Default yourself.
 26304  func NewPtrAlterConfigsResponse() *AlterConfigsResponse {
 26305  	var v AlterConfigsResponse
 26306  	v.Default()
 26307  	return &v
 26308  }
 26309  
 26310  // Default sets any default fields. Calling this allows for future compatibility
 26311  // if new fields are added to AlterConfigsResponse.
 26312  func (v *AlterConfigsResponse) Default() {
 26313  }
 26314  
 26315  // NewAlterConfigsResponse returns a default AlterConfigsResponse
 26316  // This is a shortcut for creating a struct and calling Default yourself.
 26317  func NewAlterConfigsResponse() AlterConfigsResponse {
 26318  	var v AlterConfigsResponse
 26319  	v.Default()
 26320  	return v
 26321  }
 26322  
 26323  type AlterReplicaLogDirsRequestDirTopic struct {
 26324  	// Topic is a topic to move.
 26325  	Topic string
 26326  
 26327  	// Partitions contains partitions for the topic to move.
 26328  	Partitions []int32
 26329  
 26330  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26331  	UnknownTags Tags // v2+
 26332  }
 26333  
 26334  // Default sets any default fields. Calling this allows for future compatibility
 26335  // if new fields are added to AlterReplicaLogDirsRequestDirTopic.
 26336  func (v *AlterReplicaLogDirsRequestDirTopic) Default() {
 26337  }
 26338  
 26339  // NewAlterReplicaLogDirsRequestDirTopic returns a default AlterReplicaLogDirsRequestDirTopic
 26340  // This is a shortcut for creating a struct and calling Default yourself.
 26341  func NewAlterReplicaLogDirsRequestDirTopic() AlterReplicaLogDirsRequestDirTopic {
 26342  	var v AlterReplicaLogDirsRequestDirTopic
 26343  	v.Default()
 26344  	return v
 26345  }
 26346  
 26347  type AlterReplicaLogDirsRequestDir struct {
 26348  	// Dir is an absolute path where everything listed below should
 26349  	// end up.
 26350  	Dir string
 26351  
 26352  	// Topics contains topics to move to the above log directory.
 26353  	Topics []AlterReplicaLogDirsRequestDirTopic
 26354  
 26355  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26356  	UnknownTags Tags // v2+
 26357  }
 26358  
 26359  // Default sets any default fields. Calling this allows for future compatibility
 26360  // if new fields are added to AlterReplicaLogDirsRequestDir.
 26361  func (v *AlterReplicaLogDirsRequestDir) Default() {
 26362  }
 26363  
 26364  // NewAlterReplicaLogDirsRequestDir returns a default AlterReplicaLogDirsRequestDir
 26365  // This is a shortcut for creating a struct and calling Default yourself.
 26366  func NewAlterReplicaLogDirsRequestDir() AlterReplicaLogDirsRequestDir {
 26367  	var v AlterReplicaLogDirsRequestDir
 26368  	v.Default()
 26369  	return v
 26370  }
 26371  
 26372  // AlterReplicaLogDirsRequest requests for log directories to be moved
 26373  // within Kafka.
 26374  //
 26375  // This is primarily useful for moving directories between disks.
 26376  type AlterReplicaLogDirsRequest struct {
 26377  	// Version is the version of this message used with a Kafka broker.
 26378  	Version int16
 26379  
 26380  	// Dirs contains absolute paths of where you want things to end up.
 26381  	Dirs []AlterReplicaLogDirsRequestDir
 26382  
 26383  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26384  	UnknownTags Tags // v2+
 26385  }
 26386  
 26387  func (*AlterReplicaLogDirsRequest) Key() int16                 { return 34 }
 26388  func (*AlterReplicaLogDirsRequest) MaxVersion() int16          { return 2 }
 26389  func (v *AlterReplicaLogDirsRequest) SetVersion(version int16) { v.Version = version }
 26390  func (v *AlterReplicaLogDirsRequest) GetVersion() int16        { return v.Version }
 26391  func (v *AlterReplicaLogDirsRequest) IsFlexible() bool         { return v.Version >= 2 }
 26392  func (v *AlterReplicaLogDirsRequest) ResponseKind() Response {
 26393  	r := &AlterReplicaLogDirsResponse{Version: v.Version}
 26394  	r.Default()
 26395  	return r
 26396  }
 26397  
 26398  // RequestWith is requests v on r and returns the response or an error.
 26399  // For sharded requests, the response may be merged and still return an error.
 26400  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 26401  func (v *AlterReplicaLogDirsRequest) RequestWith(ctx context.Context, r Requestor) (*AlterReplicaLogDirsResponse, error) {
 26402  	kresp, err := r.Request(ctx, v)
 26403  	resp, _ := kresp.(*AlterReplicaLogDirsResponse)
 26404  	return resp, err
 26405  }
 26406  
 26407  func (v *AlterReplicaLogDirsRequest) AppendTo(dst []byte) []byte {
 26408  	version := v.Version
 26409  	_ = version
 26410  	isFlexible := version >= 2
 26411  	_ = isFlexible
 26412  	{
 26413  		v := v.Dirs
 26414  		if isFlexible {
 26415  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 26416  		} else {
 26417  			dst = kbin.AppendArrayLen(dst, len(v))
 26418  		}
 26419  		for i := range v {
 26420  			v := &v[i]
 26421  			{
 26422  				v := v.Dir
 26423  				if isFlexible {
 26424  					dst = kbin.AppendCompactString(dst, v)
 26425  				} else {
 26426  					dst = kbin.AppendString(dst, v)
 26427  				}
 26428  			}
 26429  			{
 26430  				v := v.Topics
 26431  				if isFlexible {
 26432  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 26433  				} else {
 26434  					dst = kbin.AppendArrayLen(dst, len(v))
 26435  				}
 26436  				for i := range v {
 26437  					v := &v[i]
 26438  					{
 26439  						v := v.Topic
 26440  						if isFlexible {
 26441  							dst = kbin.AppendCompactString(dst, v)
 26442  						} else {
 26443  							dst = kbin.AppendString(dst, v)
 26444  						}
 26445  					}
 26446  					{
 26447  						v := v.Partitions
 26448  						if isFlexible {
 26449  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 26450  						} else {
 26451  							dst = kbin.AppendArrayLen(dst, len(v))
 26452  						}
 26453  						for i := range v {
 26454  							v := v[i]
 26455  							dst = kbin.AppendInt32(dst, v)
 26456  						}
 26457  					}
 26458  					if isFlexible {
 26459  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26460  						dst = v.UnknownTags.AppendEach(dst)
 26461  					}
 26462  				}
 26463  			}
 26464  			if isFlexible {
 26465  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26466  				dst = v.UnknownTags.AppendEach(dst)
 26467  			}
 26468  		}
 26469  	}
 26470  	if isFlexible {
 26471  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26472  		dst = v.UnknownTags.AppendEach(dst)
 26473  	}
 26474  	return dst
 26475  }
 26476  
 26477  func (v *AlterReplicaLogDirsRequest) ReadFrom(src []byte) error {
 26478  	return v.readFrom(src, false)
 26479  }
 26480  
 26481  func (v *AlterReplicaLogDirsRequest) UnsafeReadFrom(src []byte) error {
 26482  	return v.readFrom(src, true)
 26483  }
 26484  
 26485  func (v *AlterReplicaLogDirsRequest) readFrom(src []byte, unsafe bool) error {
 26486  	v.Default()
 26487  	b := kbin.Reader{Src: src}
 26488  	version := v.Version
 26489  	_ = version
 26490  	isFlexible := version >= 2
 26491  	_ = isFlexible
 26492  	s := v
 26493  	{
 26494  		v := s.Dirs
 26495  		a := v
 26496  		var l int32
 26497  		if isFlexible {
 26498  			l = b.CompactArrayLen()
 26499  		} else {
 26500  			l = b.ArrayLen()
 26501  		}
 26502  		if !b.Ok() {
 26503  			return b.Complete()
 26504  		}
 26505  		a = a[:0]
 26506  		if l > 0 {
 26507  			a = append(a, make([]AlterReplicaLogDirsRequestDir, l)...)
 26508  		}
 26509  		for i := int32(0); i < l; i++ {
 26510  			v := &a[i]
 26511  			v.Default()
 26512  			s := v
 26513  			{
 26514  				var v string
 26515  				if unsafe {
 26516  					if isFlexible {
 26517  						v = b.UnsafeCompactString()
 26518  					} else {
 26519  						v = b.UnsafeString()
 26520  					}
 26521  				} else {
 26522  					if isFlexible {
 26523  						v = b.CompactString()
 26524  					} else {
 26525  						v = b.String()
 26526  					}
 26527  				}
 26528  				s.Dir = v
 26529  			}
 26530  			{
 26531  				v := s.Topics
 26532  				a := v
 26533  				var l int32
 26534  				if isFlexible {
 26535  					l = b.CompactArrayLen()
 26536  				} else {
 26537  					l = b.ArrayLen()
 26538  				}
 26539  				if !b.Ok() {
 26540  					return b.Complete()
 26541  				}
 26542  				a = a[:0]
 26543  				if l > 0 {
 26544  					a = append(a, make([]AlterReplicaLogDirsRequestDirTopic, l)...)
 26545  				}
 26546  				for i := int32(0); i < l; i++ {
 26547  					v := &a[i]
 26548  					v.Default()
 26549  					s := v
 26550  					{
 26551  						var v string
 26552  						if unsafe {
 26553  							if isFlexible {
 26554  								v = b.UnsafeCompactString()
 26555  							} else {
 26556  								v = b.UnsafeString()
 26557  							}
 26558  						} else {
 26559  							if isFlexible {
 26560  								v = b.CompactString()
 26561  							} else {
 26562  								v = b.String()
 26563  							}
 26564  						}
 26565  						s.Topic = v
 26566  					}
 26567  					{
 26568  						v := s.Partitions
 26569  						a := v
 26570  						var l int32
 26571  						if isFlexible {
 26572  							l = b.CompactArrayLen()
 26573  						} else {
 26574  							l = b.ArrayLen()
 26575  						}
 26576  						if !b.Ok() {
 26577  							return b.Complete()
 26578  						}
 26579  						a = a[:0]
 26580  						if l > 0 {
 26581  							a = append(a, make([]int32, l)...)
 26582  						}
 26583  						for i := int32(0); i < l; i++ {
 26584  							v := b.Int32()
 26585  							a[i] = v
 26586  						}
 26587  						v = a
 26588  						s.Partitions = v
 26589  					}
 26590  					if isFlexible {
 26591  						s.UnknownTags = internalReadTags(&b)
 26592  					}
 26593  				}
 26594  				v = a
 26595  				s.Topics = v
 26596  			}
 26597  			if isFlexible {
 26598  				s.UnknownTags = internalReadTags(&b)
 26599  			}
 26600  		}
 26601  		v = a
 26602  		s.Dirs = v
 26603  	}
 26604  	if isFlexible {
 26605  		s.UnknownTags = internalReadTags(&b)
 26606  	}
 26607  	return b.Complete()
 26608  }
 26609  
 26610  // NewPtrAlterReplicaLogDirsRequest returns a pointer to a default AlterReplicaLogDirsRequest
 26611  // This is a shortcut for creating a new(struct) and calling Default yourself.
 26612  func NewPtrAlterReplicaLogDirsRequest() *AlterReplicaLogDirsRequest {
 26613  	var v AlterReplicaLogDirsRequest
 26614  	v.Default()
 26615  	return &v
 26616  }
 26617  
 26618  // Default sets any default fields. Calling this allows for future compatibility
 26619  // if new fields are added to AlterReplicaLogDirsRequest.
 26620  func (v *AlterReplicaLogDirsRequest) Default() {
 26621  }
 26622  
 26623  // NewAlterReplicaLogDirsRequest returns a default AlterReplicaLogDirsRequest
 26624  // This is a shortcut for creating a struct and calling Default yourself.
 26625  func NewAlterReplicaLogDirsRequest() AlterReplicaLogDirsRequest {
 26626  	var v AlterReplicaLogDirsRequest
 26627  	v.Default()
 26628  	return v
 26629  }
 26630  
 26631  type AlterReplicaLogDirsResponseTopicPartition struct {
 26632  	// Partition is the partition this array slot corresponds to.
 26633  	Partition int32
 26634  
 26635  	// CLUSTER_AUTHORIZATION_FAILED is returned if the client is not
 26636  	// authorized to alter replica dirs.
 26637  	//
 26638  	// LOG_DIR_NOT_FOUND is returned when the requested log directory
 26639  	// is not in the broker config.
 26640  	//
 26641  	// KAFKA_STORAGE_EXCEPTION is returned when destination directory or
 26642  	// requested replica is offline.
 26643  	//
 26644  	// REPLICA_NOT_AVAILABLE is returned if the replica does not exist
 26645  	// yet.
 26646  	ErrorCode int16
 26647  
 26648  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26649  	UnknownTags Tags // v2+
 26650  }
 26651  
 26652  // Default sets any default fields. Calling this allows for future compatibility
 26653  // if new fields are added to AlterReplicaLogDirsResponseTopicPartition.
 26654  func (v *AlterReplicaLogDirsResponseTopicPartition) Default() {
 26655  }
 26656  
 26657  // NewAlterReplicaLogDirsResponseTopicPartition returns a default AlterReplicaLogDirsResponseTopicPartition
 26658  // This is a shortcut for creating a struct and calling Default yourself.
 26659  func NewAlterReplicaLogDirsResponseTopicPartition() AlterReplicaLogDirsResponseTopicPartition {
 26660  	var v AlterReplicaLogDirsResponseTopicPartition
 26661  	v.Default()
 26662  	return v
 26663  }
 26664  
 26665  type AlterReplicaLogDirsResponseTopic struct {
 26666  	// Topic is the topic this array slot corresponds to.
 26667  	Topic string
 26668  
 26669  	// Partitions contains responses to each partition that was requested
 26670  	// to move.
 26671  	Partitions []AlterReplicaLogDirsResponseTopicPartition
 26672  
 26673  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26674  	UnknownTags Tags // v2+
 26675  }
 26676  
 26677  // Default sets any default fields. Calling this allows for future compatibility
 26678  // if new fields are added to AlterReplicaLogDirsResponseTopic.
 26679  func (v *AlterReplicaLogDirsResponseTopic) Default() {
 26680  }
 26681  
 26682  // NewAlterReplicaLogDirsResponseTopic returns a default AlterReplicaLogDirsResponseTopic
 26683  // This is a shortcut for creating a struct and calling Default yourself.
 26684  func NewAlterReplicaLogDirsResponseTopic() AlterReplicaLogDirsResponseTopic {
 26685  	var v AlterReplicaLogDirsResponseTopic
 26686  	v.Default()
 26687  	return v
 26688  }
 26689  
 26690  // AlterReplicaLogDirsResponse is returned from an AlterReplicaLogDirsRequest.
 26691  type AlterReplicaLogDirsResponse struct {
 26692  	// Version is the version of this message used with a Kafka broker.
 26693  	Version int16
 26694  
 26695  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 26696  	// after this request.
 26697  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 26698  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 26699  	//
 26700  	// This request switched at version 1.
 26701  	ThrottleMillis int32
 26702  
 26703  	// Topics contains responses to each topic that had partitions requested
 26704  	// for moving.
 26705  	Topics []AlterReplicaLogDirsResponseTopic
 26706  
 26707  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26708  	UnknownTags Tags // v2+
 26709  }
 26710  
 26711  func (*AlterReplicaLogDirsResponse) Key() int16                 { return 34 }
 26712  func (*AlterReplicaLogDirsResponse) MaxVersion() int16          { return 2 }
 26713  func (v *AlterReplicaLogDirsResponse) SetVersion(version int16) { v.Version = version }
 26714  func (v *AlterReplicaLogDirsResponse) GetVersion() int16        { return v.Version }
 26715  func (v *AlterReplicaLogDirsResponse) IsFlexible() bool         { return v.Version >= 2 }
 26716  func (v *AlterReplicaLogDirsResponse) Throttle() (int32, bool) {
 26717  	return v.ThrottleMillis, v.Version >= 1
 26718  }
 26719  
 26720  func (v *AlterReplicaLogDirsResponse) SetThrottle(throttleMillis int32) {
 26721  	v.ThrottleMillis = throttleMillis
 26722  }
 26723  
 26724  func (v *AlterReplicaLogDirsResponse) RequestKind() Request {
 26725  	return &AlterReplicaLogDirsRequest{Version: v.Version}
 26726  }
 26727  
 26728  func (v *AlterReplicaLogDirsResponse) AppendTo(dst []byte) []byte {
 26729  	version := v.Version
 26730  	_ = version
 26731  	isFlexible := version >= 2
 26732  	_ = isFlexible
 26733  	{
 26734  		v := v.ThrottleMillis
 26735  		dst = kbin.AppendInt32(dst, v)
 26736  	}
 26737  	{
 26738  		v := v.Topics
 26739  		if isFlexible {
 26740  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 26741  		} else {
 26742  			dst = kbin.AppendArrayLen(dst, len(v))
 26743  		}
 26744  		for i := range v {
 26745  			v := &v[i]
 26746  			{
 26747  				v := v.Topic
 26748  				if isFlexible {
 26749  					dst = kbin.AppendCompactString(dst, v)
 26750  				} else {
 26751  					dst = kbin.AppendString(dst, v)
 26752  				}
 26753  			}
 26754  			{
 26755  				v := v.Partitions
 26756  				if isFlexible {
 26757  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 26758  				} else {
 26759  					dst = kbin.AppendArrayLen(dst, len(v))
 26760  				}
 26761  				for i := range v {
 26762  					v := &v[i]
 26763  					{
 26764  						v := v.Partition
 26765  						dst = kbin.AppendInt32(dst, v)
 26766  					}
 26767  					{
 26768  						v := v.ErrorCode
 26769  						dst = kbin.AppendInt16(dst, v)
 26770  					}
 26771  					if isFlexible {
 26772  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26773  						dst = v.UnknownTags.AppendEach(dst)
 26774  					}
 26775  				}
 26776  			}
 26777  			if isFlexible {
 26778  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26779  				dst = v.UnknownTags.AppendEach(dst)
 26780  			}
 26781  		}
 26782  	}
 26783  	if isFlexible {
 26784  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 26785  		dst = v.UnknownTags.AppendEach(dst)
 26786  	}
 26787  	return dst
 26788  }
 26789  
 26790  func (v *AlterReplicaLogDirsResponse) ReadFrom(src []byte) error {
 26791  	return v.readFrom(src, false)
 26792  }
 26793  
 26794  func (v *AlterReplicaLogDirsResponse) UnsafeReadFrom(src []byte) error {
 26795  	return v.readFrom(src, true)
 26796  }
 26797  
 26798  func (v *AlterReplicaLogDirsResponse) readFrom(src []byte, unsafe bool) error {
 26799  	v.Default()
 26800  	b := kbin.Reader{Src: src}
 26801  	version := v.Version
 26802  	_ = version
 26803  	isFlexible := version >= 2
 26804  	_ = isFlexible
 26805  	s := v
 26806  	{
 26807  		v := b.Int32()
 26808  		s.ThrottleMillis = v
 26809  	}
 26810  	{
 26811  		v := s.Topics
 26812  		a := v
 26813  		var l int32
 26814  		if isFlexible {
 26815  			l = b.CompactArrayLen()
 26816  		} else {
 26817  			l = b.ArrayLen()
 26818  		}
 26819  		if !b.Ok() {
 26820  			return b.Complete()
 26821  		}
 26822  		a = a[:0]
 26823  		if l > 0 {
 26824  			a = append(a, make([]AlterReplicaLogDirsResponseTopic, l)...)
 26825  		}
 26826  		for i := int32(0); i < l; i++ {
 26827  			v := &a[i]
 26828  			v.Default()
 26829  			s := v
 26830  			{
 26831  				var v string
 26832  				if unsafe {
 26833  					if isFlexible {
 26834  						v = b.UnsafeCompactString()
 26835  					} else {
 26836  						v = b.UnsafeString()
 26837  					}
 26838  				} else {
 26839  					if isFlexible {
 26840  						v = b.CompactString()
 26841  					} else {
 26842  						v = b.String()
 26843  					}
 26844  				}
 26845  				s.Topic = v
 26846  			}
 26847  			{
 26848  				v := s.Partitions
 26849  				a := v
 26850  				var l int32
 26851  				if isFlexible {
 26852  					l = b.CompactArrayLen()
 26853  				} else {
 26854  					l = b.ArrayLen()
 26855  				}
 26856  				if !b.Ok() {
 26857  					return b.Complete()
 26858  				}
 26859  				a = a[:0]
 26860  				if l > 0 {
 26861  					a = append(a, make([]AlterReplicaLogDirsResponseTopicPartition, l)...)
 26862  				}
 26863  				for i := int32(0); i < l; i++ {
 26864  					v := &a[i]
 26865  					v.Default()
 26866  					s := v
 26867  					{
 26868  						v := b.Int32()
 26869  						s.Partition = v
 26870  					}
 26871  					{
 26872  						v := b.Int16()
 26873  						s.ErrorCode = v
 26874  					}
 26875  					if isFlexible {
 26876  						s.UnknownTags = internalReadTags(&b)
 26877  					}
 26878  				}
 26879  				v = a
 26880  				s.Partitions = v
 26881  			}
 26882  			if isFlexible {
 26883  				s.UnknownTags = internalReadTags(&b)
 26884  			}
 26885  		}
 26886  		v = a
 26887  		s.Topics = v
 26888  	}
 26889  	if isFlexible {
 26890  		s.UnknownTags = internalReadTags(&b)
 26891  	}
 26892  	return b.Complete()
 26893  }
 26894  
 26895  // NewPtrAlterReplicaLogDirsResponse returns a pointer to a default AlterReplicaLogDirsResponse
 26896  // This is a shortcut for creating a new(struct) and calling Default yourself.
 26897  func NewPtrAlterReplicaLogDirsResponse() *AlterReplicaLogDirsResponse {
 26898  	var v AlterReplicaLogDirsResponse
 26899  	v.Default()
 26900  	return &v
 26901  }
 26902  
 26903  // Default sets any default fields. Calling this allows for future compatibility
 26904  // if new fields are added to AlterReplicaLogDirsResponse.
 26905  func (v *AlterReplicaLogDirsResponse) Default() {
 26906  }
 26907  
 26908  // NewAlterReplicaLogDirsResponse returns a default AlterReplicaLogDirsResponse
 26909  // This is a shortcut for creating a struct and calling Default yourself.
 26910  func NewAlterReplicaLogDirsResponse() AlterReplicaLogDirsResponse {
 26911  	var v AlterReplicaLogDirsResponse
 26912  	v.Default()
 26913  	return v
 26914  }
 26915  
 26916  type DescribeLogDirsRequestTopic struct {
 26917  	// Topic is a topic to describe the log dir of.
 26918  	Topic string
 26919  
 26920  	// Partitions contains topic partitions to describe the log dirs of.
 26921  	Partitions []int32
 26922  
 26923  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26924  	UnknownTags Tags // v2+
 26925  }
 26926  
 26927  // Default sets any default fields. Calling this allows for future compatibility
 26928  // if new fields are added to DescribeLogDirsRequestTopic.
 26929  func (v *DescribeLogDirsRequestTopic) Default() {
 26930  }
 26931  
 26932  // NewDescribeLogDirsRequestTopic returns a default DescribeLogDirsRequestTopic
 26933  // This is a shortcut for creating a struct and calling Default yourself.
 26934  func NewDescribeLogDirsRequestTopic() DescribeLogDirsRequestTopic {
 26935  	var v DescribeLogDirsRequestTopic
 26936  	v.Default()
 26937  	return v
 26938  }
 26939  
 26940  // DescribeLogDirsRequest requests directory information for topic partitions.
 26941  // This request was added in support of KIP-113.
 26942  type DescribeLogDirsRequest struct {
 26943  	// Version is the version of this message used with a Kafka broker.
 26944  	Version int16
 26945  
 26946  	// Topics is an array of topics to describe the log dirs of. If this is
 26947  	// null, the response includes all topics and all of their partitions.
 26948  	Topics []DescribeLogDirsRequestTopic
 26949  
 26950  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 26951  	UnknownTags Tags // v2+
 26952  }
 26953  
 26954  func (*DescribeLogDirsRequest) Key() int16                 { return 35 }
 26955  func (*DescribeLogDirsRequest) MaxVersion() int16          { return 4 }
 26956  func (v *DescribeLogDirsRequest) SetVersion(version int16) { v.Version = version }
 26957  func (v *DescribeLogDirsRequest) GetVersion() int16        { return v.Version }
 26958  func (v *DescribeLogDirsRequest) IsFlexible() bool         { return v.Version >= 2 }
 26959  func (v *DescribeLogDirsRequest) ResponseKind() Response {
 26960  	r := &DescribeLogDirsResponse{Version: v.Version}
 26961  	r.Default()
 26962  	return r
 26963  }
 26964  
 26965  // RequestWith is requests v on r and returns the response or an error.
 26966  // For sharded requests, the response may be merged and still return an error.
 26967  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 26968  func (v *DescribeLogDirsRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeLogDirsResponse, error) {
 26969  	kresp, err := r.Request(ctx, v)
 26970  	resp, _ := kresp.(*DescribeLogDirsResponse)
 26971  	return resp, err
 26972  }
 26973  
 26974  func (v *DescribeLogDirsRequest) AppendTo(dst []byte) []byte {
 26975  	version := v.Version
 26976  	_ = version
 26977  	isFlexible := version >= 2
 26978  	_ = isFlexible
 26979  	{
 26980  		v := v.Topics
 26981  		if isFlexible {
 26982  			dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 26983  		} else {
 26984  			dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 26985  		}
 26986  		for i := range v {
 26987  			v := &v[i]
 26988  			{
 26989  				v := v.Topic
 26990  				if isFlexible {
 26991  					dst = kbin.AppendCompactString(dst, v)
 26992  				} else {
 26993  					dst = kbin.AppendString(dst, v)
 26994  				}
 26995  			}
 26996  			{
 26997  				v := v.Partitions
 26998  				if isFlexible {
 26999  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 27000  				} else {
 27001  					dst = kbin.AppendArrayLen(dst, len(v))
 27002  				}
 27003  				for i := range v {
 27004  					v := v[i]
 27005  					dst = kbin.AppendInt32(dst, v)
 27006  				}
 27007  			}
 27008  			if isFlexible {
 27009  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27010  				dst = v.UnknownTags.AppendEach(dst)
 27011  			}
 27012  		}
 27013  	}
 27014  	if isFlexible {
 27015  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27016  		dst = v.UnknownTags.AppendEach(dst)
 27017  	}
 27018  	return dst
 27019  }
 27020  
 27021  func (v *DescribeLogDirsRequest) ReadFrom(src []byte) error {
 27022  	return v.readFrom(src, false)
 27023  }
 27024  
 27025  func (v *DescribeLogDirsRequest) UnsafeReadFrom(src []byte) error {
 27026  	return v.readFrom(src, true)
 27027  }
 27028  
 27029  func (v *DescribeLogDirsRequest) readFrom(src []byte, unsafe bool) error {
 27030  	v.Default()
 27031  	b := kbin.Reader{Src: src}
 27032  	version := v.Version
 27033  	_ = version
 27034  	isFlexible := version >= 2
 27035  	_ = isFlexible
 27036  	s := v
 27037  	{
 27038  		v := s.Topics
 27039  		a := v
 27040  		var l int32
 27041  		if isFlexible {
 27042  			l = b.CompactArrayLen()
 27043  		} else {
 27044  			l = b.ArrayLen()
 27045  		}
 27046  		if version < 0 || l == 0 {
 27047  			a = []DescribeLogDirsRequestTopic{}
 27048  		}
 27049  		if !b.Ok() {
 27050  			return b.Complete()
 27051  		}
 27052  		a = a[:0]
 27053  		if l > 0 {
 27054  			a = append(a, make([]DescribeLogDirsRequestTopic, l)...)
 27055  		}
 27056  		for i := int32(0); i < l; i++ {
 27057  			v := &a[i]
 27058  			v.Default()
 27059  			s := v
 27060  			{
 27061  				var v string
 27062  				if unsafe {
 27063  					if isFlexible {
 27064  						v = b.UnsafeCompactString()
 27065  					} else {
 27066  						v = b.UnsafeString()
 27067  					}
 27068  				} else {
 27069  					if isFlexible {
 27070  						v = b.CompactString()
 27071  					} else {
 27072  						v = b.String()
 27073  					}
 27074  				}
 27075  				s.Topic = v
 27076  			}
 27077  			{
 27078  				v := s.Partitions
 27079  				a := v
 27080  				var l int32
 27081  				if isFlexible {
 27082  					l = b.CompactArrayLen()
 27083  				} else {
 27084  					l = b.ArrayLen()
 27085  				}
 27086  				if !b.Ok() {
 27087  					return b.Complete()
 27088  				}
 27089  				a = a[:0]
 27090  				if l > 0 {
 27091  					a = append(a, make([]int32, l)...)
 27092  				}
 27093  				for i := int32(0); i < l; i++ {
 27094  					v := b.Int32()
 27095  					a[i] = v
 27096  				}
 27097  				v = a
 27098  				s.Partitions = v
 27099  			}
 27100  			if isFlexible {
 27101  				s.UnknownTags = internalReadTags(&b)
 27102  			}
 27103  		}
 27104  		v = a
 27105  		s.Topics = v
 27106  	}
 27107  	if isFlexible {
 27108  		s.UnknownTags = internalReadTags(&b)
 27109  	}
 27110  	return b.Complete()
 27111  }
 27112  
 27113  // NewPtrDescribeLogDirsRequest returns a pointer to a default DescribeLogDirsRequest
 27114  // This is a shortcut for creating a new(struct) and calling Default yourself.
 27115  func NewPtrDescribeLogDirsRequest() *DescribeLogDirsRequest {
 27116  	var v DescribeLogDirsRequest
 27117  	v.Default()
 27118  	return &v
 27119  }
 27120  
 27121  // Default sets any default fields. Calling this allows for future compatibility
 27122  // if new fields are added to DescribeLogDirsRequest.
 27123  func (v *DescribeLogDirsRequest) Default() {
 27124  }
 27125  
 27126  // NewDescribeLogDirsRequest returns a default DescribeLogDirsRequest
 27127  // This is a shortcut for creating a struct and calling Default yourself.
 27128  func NewDescribeLogDirsRequest() DescribeLogDirsRequest {
 27129  	var v DescribeLogDirsRequest
 27130  	v.Default()
 27131  	return v
 27132  }
 27133  
 27134  type DescribeLogDirsResponseDirTopicPartition struct {
 27135  	// Partition is a partition ID.
 27136  	Partition int32
 27137  
 27138  	// Size is the total size of the log sements of this partition, in bytes.
 27139  	Size int64
 27140  
 27141  	// OffsetLag is how far behind the log end offset is compared to
 27142  	// the partition's high watermark (if this is the current log for
 27143  	// the partition) or compared to the current replica's log end
 27144  	// offset (if this is the future log for the patition).
 27145  	//
 27146  	// The math is,
 27147  	//
 27148  	// if IsFuture, localLogEndOffset - futurelogEndOffset.
 27149  	//
 27150  	// otherwise, max(localHighWatermark - logEndOffset, 0).
 27151  	OffsetLag int64
 27152  
 27153  	// IsFuture is true if this replica was created by an
 27154  	// AlterReplicaLogDirsRequest and will replace the current log of the
 27155  	// replica in the future.
 27156  	IsFuture bool
 27157  
 27158  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27159  	UnknownTags Tags // v2+
 27160  }
 27161  
 27162  // Default sets any default fields. Calling this allows for future compatibility
 27163  // if new fields are added to DescribeLogDirsResponseDirTopicPartition.
 27164  func (v *DescribeLogDirsResponseDirTopicPartition) Default() {
 27165  }
 27166  
 27167  // NewDescribeLogDirsResponseDirTopicPartition returns a default DescribeLogDirsResponseDirTopicPartition
 27168  // This is a shortcut for creating a struct and calling Default yourself.
 27169  func NewDescribeLogDirsResponseDirTopicPartition() DescribeLogDirsResponseDirTopicPartition {
 27170  	var v DescribeLogDirsResponseDirTopicPartition
 27171  	v.Default()
 27172  	return v
 27173  }
 27174  
 27175  type DescribeLogDirsResponseDirTopic struct {
 27176  	// Topic is the name of a Kafka topic.
 27177  	Topic string
 27178  
 27179  	// Partitions is the set of queried partitions for a topic that are
 27180  	// within a log directory.
 27181  	Partitions []DescribeLogDirsResponseDirTopicPartition
 27182  
 27183  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27184  	UnknownTags Tags // v2+
 27185  }
 27186  
 27187  // Default sets any default fields. Calling this allows for future compatibility
 27188  // if new fields are added to DescribeLogDirsResponseDirTopic.
 27189  func (v *DescribeLogDirsResponseDirTopic) Default() {
 27190  }
 27191  
 27192  // NewDescribeLogDirsResponseDirTopic returns a default DescribeLogDirsResponseDirTopic
 27193  // This is a shortcut for creating a struct and calling Default yourself.
 27194  func NewDescribeLogDirsResponseDirTopic() DescribeLogDirsResponseDirTopic {
 27195  	var v DescribeLogDirsResponseDirTopic
 27196  	v.Default()
 27197  	return v
 27198  }
 27199  
 27200  type DescribeLogDirsResponseDir struct {
 27201  	// ErrorCode is the error code returned for describing log dirs.
 27202  	//
 27203  	// KAFKA_STORAGE_ERROR is returned if the log directory is offline.
 27204  	ErrorCode int16
 27205  
 27206  	// Dir is the absolute path of a log directory.
 27207  	Dir string
 27208  
 27209  	// Topics is an array of topics within a log directory.
 27210  	Topics []DescribeLogDirsResponseDirTopic
 27211  
 27212  	// TotalBytes is the total size in bytes of the volume the log directory is
 27213  	// in.
 27214  	//
 27215  	// This field has a default of -1.
 27216  	TotalBytes int64 // v4+
 27217  
 27218  	// UsableBytes is the usable size in bytes of the volume the log directory
 27219  	// is in.
 27220  	//
 27221  	// This field has a default of -1.
 27222  	UsableBytes int64 // v4+
 27223  
 27224  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27225  	UnknownTags Tags // v2+
 27226  }
 27227  
 27228  // Default sets any default fields. Calling this allows for future compatibility
 27229  // if new fields are added to DescribeLogDirsResponseDir.
 27230  func (v *DescribeLogDirsResponseDir) Default() {
 27231  	v.TotalBytes = -1
 27232  	v.UsableBytes = -1
 27233  }
 27234  
 27235  // NewDescribeLogDirsResponseDir returns a default DescribeLogDirsResponseDir
 27236  // This is a shortcut for creating a struct and calling Default yourself.
 27237  func NewDescribeLogDirsResponseDir() DescribeLogDirsResponseDir {
 27238  	var v DescribeLogDirsResponseDir
 27239  	v.Default()
 27240  	return v
 27241  }
 27242  
 27243  // DescribeLogDirsResponse is returned from a DescribeLogDirsRequest.
 27244  type DescribeLogDirsResponse struct {
 27245  	// Version is the version of this message used with a Kafka broker.
 27246  	Version int16
 27247  
 27248  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 27249  	// after this request.
 27250  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 27251  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 27252  	//
 27253  	// This request switched at version 1.
 27254  	ThrottleMillis int32
 27255  
 27256  	// The error code, or 0 if there was no error.
 27257  	ErrorCode int16 // v3+
 27258  
 27259  	// Dirs pairs log directories with the topics and partitions that are
 27260  	// stored in those directores.
 27261  	Dirs []DescribeLogDirsResponseDir
 27262  
 27263  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27264  	UnknownTags Tags // v2+
 27265  }
 27266  
 27267  func (*DescribeLogDirsResponse) Key() int16                 { return 35 }
 27268  func (*DescribeLogDirsResponse) MaxVersion() int16          { return 4 }
 27269  func (v *DescribeLogDirsResponse) SetVersion(version int16) { v.Version = version }
 27270  func (v *DescribeLogDirsResponse) GetVersion() int16        { return v.Version }
 27271  func (v *DescribeLogDirsResponse) IsFlexible() bool         { return v.Version >= 2 }
 27272  func (v *DescribeLogDirsResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 1 }
 27273  func (v *DescribeLogDirsResponse) SetThrottle(throttleMillis int32) {
 27274  	v.ThrottleMillis = throttleMillis
 27275  }
 27276  
 27277  func (v *DescribeLogDirsResponse) RequestKind() Request {
 27278  	return &DescribeLogDirsRequest{Version: v.Version}
 27279  }
 27280  
 27281  func (v *DescribeLogDirsResponse) AppendTo(dst []byte) []byte {
 27282  	version := v.Version
 27283  	_ = version
 27284  	isFlexible := version >= 2
 27285  	_ = isFlexible
 27286  	{
 27287  		v := v.ThrottleMillis
 27288  		dst = kbin.AppendInt32(dst, v)
 27289  	}
 27290  	if version >= 3 {
 27291  		v := v.ErrorCode
 27292  		dst = kbin.AppendInt16(dst, v)
 27293  	}
 27294  	{
 27295  		v := v.Dirs
 27296  		if isFlexible {
 27297  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 27298  		} else {
 27299  			dst = kbin.AppendArrayLen(dst, len(v))
 27300  		}
 27301  		for i := range v {
 27302  			v := &v[i]
 27303  			{
 27304  				v := v.ErrorCode
 27305  				dst = kbin.AppendInt16(dst, v)
 27306  			}
 27307  			{
 27308  				v := v.Dir
 27309  				if isFlexible {
 27310  					dst = kbin.AppendCompactString(dst, v)
 27311  				} else {
 27312  					dst = kbin.AppendString(dst, v)
 27313  				}
 27314  			}
 27315  			{
 27316  				v := v.Topics
 27317  				if isFlexible {
 27318  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 27319  				} else {
 27320  					dst = kbin.AppendArrayLen(dst, len(v))
 27321  				}
 27322  				for i := range v {
 27323  					v := &v[i]
 27324  					{
 27325  						v := v.Topic
 27326  						if isFlexible {
 27327  							dst = kbin.AppendCompactString(dst, v)
 27328  						} else {
 27329  							dst = kbin.AppendString(dst, v)
 27330  						}
 27331  					}
 27332  					{
 27333  						v := v.Partitions
 27334  						if isFlexible {
 27335  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 27336  						} else {
 27337  							dst = kbin.AppendArrayLen(dst, len(v))
 27338  						}
 27339  						for i := range v {
 27340  							v := &v[i]
 27341  							{
 27342  								v := v.Partition
 27343  								dst = kbin.AppendInt32(dst, v)
 27344  							}
 27345  							{
 27346  								v := v.Size
 27347  								dst = kbin.AppendInt64(dst, v)
 27348  							}
 27349  							{
 27350  								v := v.OffsetLag
 27351  								dst = kbin.AppendInt64(dst, v)
 27352  							}
 27353  							{
 27354  								v := v.IsFuture
 27355  								dst = kbin.AppendBool(dst, v)
 27356  							}
 27357  							if isFlexible {
 27358  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27359  								dst = v.UnknownTags.AppendEach(dst)
 27360  							}
 27361  						}
 27362  					}
 27363  					if isFlexible {
 27364  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27365  						dst = v.UnknownTags.AppendEach(dst)
 27366  					}
 27367  				}
 27368  			}
 27369  			if version >= 4 {
 27370  				v := v.TotalBytes
 27371  				dst = kbin.AppendInt64(dst, v)
 27372  			}
 27373  			if version >= 4 {
 27374  				v := v.UsableBytes
 27375  				dst = kbin.AppendInt64(dst, v)
 27376  			}
 27377  			if isFlexible {
 27378  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27379  				dst = v.UnknownTags.AppendEach(dst)
 27380  			}
 27381  		}
 27382  	}
 27383  	if isFlexible {
 27384  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27385  		dst = v.UnknownTags.AppendEach(dst)
 27386  	}
 27387  	return dst
 27388  }
 27389  
 27390  func (v *DescribeLogDirsResponse) ReadFrom(src []byte) error {
 27391  	return v.readFrom(src, false)
 27392  }
 27393  
 27394  func (v *DescribeLogDirsResponse) UnsafeReadFrom(src []byte) error {
 27395  	return v.readFrom(src, true)
 27396  }
 27397  
 27398  func (v *DescribeLogDirsResponse) readFrom(src []byte, unsafe bool) error {
 27399  	v.Default()
 27400  	b := kbin.Reader{Src: src}
 27401  	version := v.Version
 27402  	_ = version
 27403  	isFlexible := version >= 2
 27404  	_ = isFlexible
 27405  	s := v
 27406  	{
 27407  		v := b.Int32()
 27408  		s.ThrottleMillis = v
 27409  	}
 27410  	if version >= 3 {
 27411  		v := b.Int16()
 27412  		s.ErrorCode = v
 27413  	}
 27414  	{
 27415  		v := s.Dirs
 27416  		a := v
 27417  		var l int32
 27418  		if isFlexible {
 27419  			l = b.CompactArrayLen()
 27420  		} else {
 27421  			l = b.ArrayLen()
 27422  		}
 27423  		if !b.Ok() {
 27424  			return b.Complete()
 27425  		}
 27426  		a = a[:0]
 27427  		if l > 0 {
 27428  			a = append(a, make([]DescribeLogDirsResponseDir, l)...)
 27429  		}
 27430  		for i := int32(0); i < l; i++ {
 27431  			v := &a[i]
 27432  			v.Default()
 27433  			s := v
 27434  			{
 27435  				v := b.Int16()
 27436  				s.ErrorCode = v
 27437  			}
 27438  			{
 27439  				var v string
 27440  				if unsafe {
 27441  					if isFlexible {
 27442  						v = b.UnsafeCompactString()
 27443  					} else {
 27444  						v = b.UnsafeString()
 27445  					}
 27446  				} else {
 27447  					if isFlexible {
 27448  						v = b.CompactString()
 27449  					} else {
 27450  						v = b.String()
 27451  					}
 27452  				}
 27453  				s.Dir = v
 27454  			}
 27455  			{
 27456  				v := s.Topics
 27457  				a := v
 27458  				var l int32
 27459  				if isFlexible {
 27460  					l = b.CompactArrayLen()
 27461  				} else {
 27462  					l = b.ArrayLen()
 27463  				}
 27464  				if !b.Ok() {
 27465  					return b.Complete()
 27466  				}
 27467  				a = a[:0]
 27468  				if l > 0 {
 27469  					a = append(a, make([]DescribeLogDirsResponseDirTopic, l)...)
 27470  				}
 27471  				for i := int32(0); i < l; i++ {
 27472  					v := &a[i]
 27473  					v.Default()
 27474  					s := v
 27475  					{
 27476  						var v string
 27477  						if unsafe {
 27478  							if isFlexible {
 27479  								v = b.UnsafeCompactString()
 27480  							} else {
 27481  								v = b.UnsafeString()
 27482  							}
 27483  						} else {
 27484  							if isFlexible {
 27485  								v = b.CompactString()
 27486  							} else {
 27487  								v = b.String()
 27488  							}
 27489  						}
 27490  						s.Topic = v
 27491  					}
 27492  					{
 27493  						v := s.Partitions
 27494  						a := v
 27495  						var l int32
 27496  						if isFlexible {
 27497  							l = b.CompactArrayLen()
 27498  						} else {
 27499  							l = b.ArrayLen()
 27500  						}
 27501  						if !b.Ok() {
 27502  							return b.Complete()
 27503  						}
 27504  						a = a[:0]
 27505  						if l > 0 {
 27506  							a = append(a, make([]DescribeLogDirsResponseDirTopicPartition, l)...)
 27507  						}
 27508  						for i := int32(0); i < l; i++ {
 27509  							v := &a[i]
 27510  							v.Default()
 27511  							s := v
 27512  							{
 27513  								v := b.Int32()
 27514  								s.Partition = v
 27515  							}
 27516  							{
 27517  								v := b.Int64()
 27518  								s.Size = v
 27519  							}
 27520  							{
 27521  								v := b.Int64()
 27522  								s.OffsetLag = v
 27523  							}
 27524  							{
 27525  								v := b.Bool()
 27526  								s.IsFuture = v
 27527  							}
 27528  							if isFlexible {
 27529  								s.UnknownTags = internalReadTags(&b)
 27530  							}
 27531  						}
 27532  						v = a
 27533  						s.Partitions = v
 27534  					}
 27535  					if isFlexible {
 27536  						s.UnknownTags = internalReadTags(&b)
 27537  					}
 27538  				}
 27539  				v = a
 27540  				s.Topics = v
 27541  			}
 27542  			if version >= 4 {
 27543  				v := b.Int64()
 27544  				s.TotalBytes = v
 27545  			}
 27546  			if version >= 4 {
 27547  				v := b.Int64()
 27548  				s.UsableBytes = v
 27549  			}
 27550  			if isFlexible {
 27551  				s.UnknownTags = internalReadTags(&b)
 27552  			}
 27553  		}
 27554  		v = a
 27555  		s.Dirs = v
 27556  	}
 27557  	if isFlexible {
 27558  		s.UnknownTags = internalReadTags(&b)
 27559  	}
 27560  	return b.Complete()
 27561  }
 27562  
 27563  // NewPtrDescribeLogDirsResponse returns a pointer to a default DescribeLogDirsResponse
 27564  // This is a shortcut for creating a new(struct) and calling Default yourself.
 27565  func NewPtrDescribeLogDirsResponse() *DescribeLogDirsResponse {
 27566  	var v DescribeLogDirsResponse
 27567  	v.Default()
 27568  	return &v
 27569  }
 27570  
 27571  // Default sets any default fields. Calling this allows for future compatibility
 27572  // if new fields are added to DescribeLogDirsResponse.
 27573  func (v *DescribeLogDirsResponse) Default() {
 27574  }
 27575  
 27576  // NewDescribeLogDirsResponse returns a default DescribeLogDirsResponse
 27577  // This is a shortcut for creating a struct and calling Default yourself.
 27578  func NewDescribeLogDirsResponse() DescribeLogDirsResponse {
 27579  	var v DescribeLogDirsResponse
 27580  	v.Default()
 27581  	return v
 27582  }
 27583  
 27584  // SASLAuthenticate continues a sasl authentication flow. Prior to Kafka 1.0.0,
 27585  // authenticating with sasl involved sending raw blobs of data back and forth.
 27586  // After, those blobs are wrapped in a SASLAuthenticateRequest The benefit of
 27587  // this wrapping is that Kafka can indicate errors in the response, rather than
 27588  // just closing the connection. Additionally, the response allows for further
 27589  // extension fields.
 27590  type SASLAuthenticateRequest struct {
 27591  	// Version is the version of this message used with a Kafka broker.
 27592  	Version int16
 27593  
 27594  	// SASLAuthBytes contains bytes for a SASL client request.
 27595  	SASLAuthBytes []byte
 27596  
 27597  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27598  	UnknownTags Tags // v2+
 27599  }
 27600  
 27601  func (*SASLAuthenticateRequest) Key() int16                 { return 36 }
 27602  func (*SASLAuthenticateRequest) MaxVersion() int16          { return 2 }
 27603  func (v *SASLAuthenticateRequest) SetVersion(version int16) { v.Version = version }
 27604  func (v *SASLAuthenticateRequest) GetVersion() int16        { return v.Version }
 27605  func (v *SASLAuthenticateRequest) IsFlexible() bool         { return v.Version >= 2 }
 27606  func (v *SASLAuthenticateRequest) ResponseKind() Response {
 27607  	r := &SASLAuthenticateResponse{Version: v.Version}
 27608  	r.Default()
 27609  	return r
 27610  }
 27611  
 27612  // RequestWith is requests v on r and returns the response or an error.
 27613  // For sharded requests, the response may be merged and still return an error.
 27614  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 27615  func (v *SASLAuthenticateRequest) RequestWith(ctx context.Context, r Requestor) (*SASLAuthenticateResponse, error) {
 27616  	kresp, err := r.Request(ctx, v)
 27617  	resp, _ := kresp.(*SASLAuthenticateResponse)
 27618  	return resp, err
 27619  }
 27620  
 27621  func (v *SASLAuthenticateRequest) AppendTo(dst []byte) []byte {
 27622  	version := v.Version
 27623  	_ = version
 27624  	isFlexible := version >= 2
 27625  	_ = isFlexible
 27626  	{
 27627  		v := v.SASLAuthBytes
 27628  		if isFlexible {
 27629  			dst = kbin.AppendCompactBytes(dst, v)
 27630  		} else {
 27631  			dst = kbin.AppendBytes(dst, v)
 27632  		}
 27633  	}
 27634  	if isFlexible {
 27635  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27636  		dst = v.UnknownTags.AppendEach(dst)
 27637  	}
 27638  	return dst
 27639  }
 27640  
 27641  func (v *SASLAuthenticateRequest) ReadFrom(src []byte) error {
 27642  	return v.readFrom(src, false)
 27643  }
 27644  
 27645  func (v *SASLAuthenticateRequest) UnsafeReadFrom(src []byte) error {
 27646  	return v.readFrom(src, true)
 27647  }
 27648  
 27649  func (v *SASLAuthenticateRequest) readFrom(src []byte, unsafe bool) error {
 27650  	v.Default()
 27651  	b := kbin.Reader{Src: src}
 27652  	version := v.Version
 27653  	_ = version
 27654  	isFlexible := version >= 2
 27655  	_ = isFlexible
 27656  	s := v
 27657  	{
 27658  		var v []byte
 27659  		if isFlexible {
 27660  			v = b.CompactBytes()
 27661  		} else {
 27662  			v = b.Bytes()
 27663  		}
 27664  		s.SASLAuthBytes = v
 27665  	}
 27666  	if isFlexible {
 27667  		s.UnknownTags = internalReadTags(&b)
 27668  	}
 27669  	return b.Complete()
 27670  }
 27671  
 27672  // NewPtrSASLAuthenticateRequest returns a pointer to a default SASLAuthenticateRequest
 27673  // This is a shortcut for creating a new(struct) and calling Default yourself.
 27674  func NewPtrSASLAuthenticateRequest() *SASLAuthenticateRequest {
 27675  	var v SASLAuthenticateRequest
 27676  	v.Default()
 27677  	return &v
 27678  }
 27679  
 27680  // Default sets any default fields. Calling this allows for future compatibility
 27681  // if new fields are added to SASLAuthenticateRequest.
 27682  func (v *SASLAuthenticateRequest) Default() {
 27683  }
 27684  
 27685  // NewSASLAuthenticateRequest returns a default SASLAuthenticateRequest
 27686  // This is a shortcut for creating a struct and calling Default yourself.
 27687  func NewSASLAuthenticateRequest() SASLAuthenticateRequest {
 27688  	var v SASLAuthenticateRequest
 27689  	v.Default()
 27690  	return v
 27691  }
 27692  
 27693  // SASLAuthenticateResponse is returned for a SASLAuthenticateRequest.
 27694  type SASLAuthenticateResponse struct {
 27695  	// Version is the version of this message used with a Kafka broker.
 27696  	Version int16
 27697  
 27698  	// ErrorCode is a potential error.
 27699  	ErrorCode int16
 27700  
 27701  	// ErrorMessage can contain a message for an error.
 27702  	ErrorMessage *string
 27703  
 27704  	// SASLAuthBytes is the server challenge continuing SASL flow.
 27705  	SASLAuthBytes []byte
 27706  
 27707  	// SessionLifetimeMillis, added in Kafka 2.2.0, is how long the SASL
 27708  	// authentication is valid for. This timeout is only enforced if the request
 27709  	// was v1. After this timeout, Kafka expects the next bytes on the wire to
 27710  	// begin reauthentication. Otherwise, Kafka closes the connection.
 27711  	SessionLifetimeMillis int64 // v1+
 27712  
 27713  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27714  	UnknownTags Tags // v2+
 27715  }
 27716  
 27717  func (*SASLAuthenticateResponse) Key() int16                 { return 36 }
 27718  func (*SASLAuthenticateResponse) MaxVersion() int16          { return 2 }
 27719  func (v *SASLAuthenticateResponse) SetVersion(version int16) { v.Version = version }
 27720  func (v *SASLAuthenticateResponse) GetVersion() int16        { return v.Version }
 27721  func (v *SASLAuthenticateResponse) IsFlexible() bool         { return v.Version >= 2 }
 27722  func (v *SASLAuthenticateResponse) RequestKind() Request {
 27723  	return &SASLAuthenticateRequest{Version: v.Version}
 27724  }
 27725  
 27726  func (v *SASLAuthenticateResponse) AppendTo(dst []byte) []byte {
 27727  	version := v.Version
 27728  	_ = version
 27729  	isFlexible := version >= 2
 27730  	_ = isFlexible
 27731  	{
 27732  		v := v.ErrorCode
 27733  		dst = kbin.AppendInt16(dst, v)
 27734  	}
 27735  	{
 27736  		v := v.ErrorMessage
 27737  		if isFlexible {
 27738  			dst = kbin.AppendCompactNullableString(dst, v)
 27739  		} else {
 27740  			dst = kbin.AppendNullableString(dst, v)
 27741  		}
 27742  	}
 27743  	{
 27744  		v := v.SASLAuthBytes
 27745  		if isFlexible {
 27746  			dst = kbin.AppendCompactBytes(dst, v)
 27747  		} else {
 27748  			dst = kbin.AppendBytes(dst, v)
 27749  		}
 27750  	}
 27751  	if version >= 1 {
 27752  		v := v.SessionLifetimeMillis
 27753  		dst = kbin.AppendInt64(dst, v)
 27754  	}
 27755  	if isFlexible {
 27756  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27757  		dst = v.UnknownTags.AppendEach(dst)
 27758  	}
 27759  	return dst
 27760  }
 27761  
 27762  func (v *SASLAuthenticateResponse) ReadFrom(src []byte) error {
 27763  	return v.readFrom(src, false)
 27764  }
 27765  
 27766  func (v *SASLAuthenticateResponse) UnsafeReadFrom(src []byte) error {
 27767  	return v.readFrom(src, true)
 27768  }
 27769  
 27770  func (v *SASLAuthenticateResponse) readFrom(src []byte, unsafe bool) error {
 27771  	v.Default()
 27772  	b := kbin.Reader{Src: src}
 27773  	version := v.Version
 27774  	_ = version
 27775  	isFlexible := version >= 2
 27776  	_ = isFlexible
 27777  	s := v
 27778  	{
 27779  		v := b.Int16()
 27780  		s.ErrorCode = v
 27781  	}
 27782  	{
 27783  		var v *string
 27784  		if isFlexible {
 27785  			if unsafe {
 27786  				v = b.UnsafeCompactNullableString()
 27787  			} else {
 27788  				v = b.CompactNullableString()
 27789  			}
 27790  		} else {
 27791  			if unsafe {
 27792  				v = b.UnsafeNullableString()
 27793  			} else {
 27794  				v = b.NullableString()
 27795  			}
 27796  		}
 27797  		s.ErrorMessage = v
 27798  	}
 27799  	{
 27800  		var v []byte
 27801  		if isFlexible {
 27802  			v = b.CompactBytes()
 27803  		} else {
 27804  			v = b.Bytes()
 27805  		}
 27806  		s.SASLAuthBytes = v
 27807  	}
 27808  	if version >= 1 {
 27809  		v := b.Int64()
 27810  		s.SessionLifetimeMillis = v
 27811  	}
 27812  	if isFlexible {
 27813  		s.UnknownTags = internalReadTags(&b)
 27814  	}
 27815  	return b.Complete()
 27816  }
 27817  
 27818  // NewPtrSASLAuthenticateResponse returns a pointer to a default SASLAuthenticateResponse
 27819  // This is a shortcut for creating a new(struct) and calling Default yourself.
 27820  func NewPtrSASLAuthenticateResponse() *SASLAuthenticateResponse {
 27821  	var v SASLAuthenticateResponse
 27822  	v.Default()
 27823  	return &v
 27824  }
 27825  
 27826  // Default sets any default fields. Calling this allows for future compatibility
 27827  // if new fields are added to SASLAuthenticateResponse.
 27828  func (v *SASLAuthenticateResponse) Default() {
 27829  }
 27830  
 27831  // NewSASLAuthenticateResponse returns a default SASLAuthenticateResponse
 27832  // This is a shortcut for creating a struct and calling Default yourself.
 27833  func NewSASLAuthenticateResponse() SASLAuthenticateResponse {
 27834  	var v SASLAuthenticateResponse
 27835  	v.Default()
 27836  	return v
 27837  }
 27838  
 27839  type CreatePartitionsRequestTopicAssignment struct {
 27840  	// Replicas are replicas to assign a new partition to.
 27841  	Replicas []int32
 27842  
 27843  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27844  	UnknownTags Tags // v2+
 27845  }
 27846  
 27847  // Default sets any default fields. Calling this allows for future compatibility
 27848  // if new fields are added to CreatePartitionsRequestTopicAssignment.
 27849  func (v *CreatePartitionsRequestTopicAssignment) Default() {
 27850  }
 27851  
 27852  // NewCreatePartitionsRequestTopicAssignment returns a default CreatePartitionsRequestTopicAssignment
 27853  // This is a shortcut for creating a struct and calling Default yourself.
 27854  func NewCreatePartitionsRequestTopicAssignment() CreatePartitionsRequestTopicAssignment {
 27855  	var v CreatePartitionsRequestTopicAssignment
 27856  	v.Default()
 27857  	return v
 27858  }
 27859  
 27860  type CreatePartitionsRequestTopic struct {
 27861  	// Topic is a topic for which to create additional partitions for.
 27862  	Topic string
 27863  
 27864  	// Count is the final count of partitions this topic must have after this
 27865  	// request. This must be greater than the current number of partitions.
 27866  	Count int32
 27867  
 27868  	// Assignment is a two-level array, the first corresponding to new
 27869  	// partitions, the second contining broker IDs for where new partition
 27870  	// replicas should live.
 27871  	//
 27872  	// The second level, the replicas, cannot have duplicate broker IDs (i.e.
 27873  	// you cannot replicate a single partition twice on the same broker).
 27874  	// Additionally, the number of replicas must match the current number of
 27875  	// replicas per partition on the topic.
 27876  	//
 27877  	// The first level's length must be equal to the delta of Count and the
 27878  	// current number of partitions.
 27879  	Assignment []CreatePartitionsRequestTopicAssignment
 27880  
 27881  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27882  	UnknownTags Tags // v2+
 27883  }
 27884  
 27885  // Default sets any default fields. Calling this allows for future compatibility
 27886  // if new fields are added to CreatePartitionsRequestTopic.
 27887  func (v *CreatePartitionsRequestTopic) Default() {
 27888  }
 27889  
 27890  // NewCreatePartitionsRequestTopic returns a default CreatePartitionsRequestTopic
 27891  // This is a shortcut for creating a struct and calling Default yourself.
 27892  func NewCreatePartitionsRequestTopic() CreatePartitionsRequestTopic {
 27893  	var v CreatePartitionsRequestTopic
 27894  	v.Default()
 27895  	return v
 27896  }
 27897  
 27898  // CreatePartitionsRequest creates additional partitions for topics.
 27899  type CreatePartitionsRequest struct {
 27900  	// Version is the version of this message used with a Kafka broker.
 27901  	Version int16
 27902  
 27903  	// Topics contains topics to create partitions for.
 27904  	Topics []CreatePartitionsRequestTopic
 27905  
 27906  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 27907  	// This field has no effect on Kafka's processing of the request; the request
 27908  	// will continue to be processed if the timeout is reached. If the timeout is
 27909  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 27910  	//
 27911  	// This field has a default of 15000.
 27912  	TimeoutMillis int32
 27913  
 27914  	// ValidateOnly is makes this request a dry-run; everything is validated but
 27915  	// no partitions are actually created.
 27916  	ValidateOnly bool
 27917  
 27918  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 27919  	UnknownTags Tags // v2+
 27920  }
 27921  
 27922  func (*CreatePartitionsRequest) Key() int16                       { return 37 }
 27923  func (*CreatePartitionsRequest) MaxVersion() int16                { return 3 }
 27924  func (v *CreatePartitionsRequest) SetVersion(version int16)       { v.Version = version }
 27925  func (v *CreatePartitionsRequest) GetVersion() int16              { return v.Version }
 27926  func (v *CreatePartitionsRequest) IsFlexible() bool               { return v.Version >= 2 }
 27927  func (v *CreatePartitionsRequest) Timeout() int32                 { return v.TimeoutMillis }
 27928  func (v *CreatePartitionsRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
 27929  func (v *CreatePartitionsRequest) IsAdminRequest()                {}
 27930  func (v *CreatePartitionsRequest) ResponseKind() Response {
 27931  	r := &CreatePartitionsResponse{Version: v.Version}
 27932  	r.Default()
 27933  	return r
 27934  }
 27935  
 27936  // RequestWith is requests v on r and returns the response or an error.
 27937  // For sharded requests, the response may be merged and still return an error.
 27938  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 27939  func (v *CreatePartitionsRequest) RequestWith(ctx context.Context, r Requestor) (*CreatePartitionsResponse, error) {
 27940  	kresp, err := r.Request(ctx, v)
 27941  	resp, _ := kresp.(*CreatePartitionsResponse)
 27942  	return resp, err
 27943  }
 27944  
 27945  func (v *CreatePartitionsRequest) AppendTo(dst []byte) []byte {
 27946  	version := v.Version
 27947  	_ = version
 27948  	isFlexible := version >= 2
 27949  	_ = isFlexible
 27950  	{
 27951  		v := v.Topics
 27952  		if isFlexible {
 27953  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 27954  		} else {
 27955  			dst = kbin.AppendArrayLen(dst, len(v))
 27956  		}
 27957  		for i := range v {
 27958  			v := &v[i]
 27959  			{
 27960  				v := v.Topic
 27961  				if isFlexible {
 27962  					dst = kbin.AppendCompactString(dst, v)
 27963  				} else {
 27964  					dst = kbin.AppendString(dst, v)
 27965  				}
 27966  			}
 27967  			{
 27968  				v := v.Count
 27969  				dst = kbin.AppendInt32(dst, v)
 27970  			}
 27971  			{
 27972  				v := v.Assignment
 27973  				if isFlexible {
 27974  					dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 27975  				} else {
 27976  					dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 27977  				}
 27978  				for i := range v {
 27979  					v := &v[i]
 27980  					{
 27981  						v := v.Replicas
 27982  						if isFlexible {
 27983  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 27984  						} else {
 27985  							dst = kbin.AppendArrayLen(dst, len(v))
 27986  						}
 27987  						for i := range v {
 27988  							v := v[i]
 27989  							dst = kbin.AppendInt32(dst, v)
 27990  						}
 27991  					}
 27992  					if isFlexible {
 27993  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 27994  						dst = v.UnknownTags.AppendEach(dst)
 27995  					}
 27996  				}
 27997  			}
 27998  			if isFlexible {
 27999  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28000  				dst = v.UnknownTags.AppendEach(dst)
 28001  			}
 28002  		}
 28003  	}
 28004  	{
 28005  		v := v.TimeoutMillis
 28006  		dst = kbin.AppendInt32(dst, v)
 28007  	}
 28008  	{
 28009  		v := v.ValidateOnly
 28010  		dst = kbin.AppendBool(dst, v)
 28011  	}
 28012  	if isFlexible {
 28013  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28014  		dst = v.UnknownTags.AppendEach(dst)
 28015  	}
 28016  	return dst
 28017  }
 28018  
 28019  func (v *CreatePartitionsRequest) ReadFrom(src []byte) error {
 28020  	return v.readFrom(src, false)
 28021  }
 28022  
 28023  func (v *CreatePartitionsRequest) UnsafeReadFrom(src []byte) error {
 28024  	return v.readFrom(src, true)
 28025  }
 28026  
 28027  func (v *CreatePartitionsRequest) readFrom(src []byte, unsafe bool) error {
 28028  	v.Default()
 28029  	b := kbin.Reader{Src: src}
 28030  	version := v.Version
 28031  	_ = version
 28032  	isFlexible := version >= 2
 28033  	_ = isFlexible
 28034  	s := v
 28035  	{
 28036  		v := s.Topics
 28037  		a := v
 28038  		var l int32
 28039  		if isFlexible {
 28040  			l = b.CompactArrayLen()
 28041  		} else {
 28042  			l = b.ArrayLen()
 28043  		}
 28044  		if !b.Ok() {
 28045  			return b.Complete()
 28046  		}
 28047  		a = a[:0]
 28048  		if l > 0 {
 28049  			a = append(a, make([]CreatePartitionsRequestTopic, l)...)
 28050  		}
 28051  		for i := int32(0); i < l; i++ {
 28052  			v := &a[i]
 28053  			v.Default()
 28054  			s := v
 28055  			{
 28056  				var v string
 28057  				if unsafe {
 28058  					if isFlexible {
 28059  						v = b.UnsafeCompactString()
 28060  					} else {
 28061  						v = b.UnsafeString()
 28062  					}
 28063  				} else {
 28064  					if isFlexible {
 28065  						v = b.CompactString()
 28066  					} else {
 28067  						v = b.String()
 28068  					}
 28069  				}
 28070  				s.Topic = v
 28071  			}
 28072  			{
 28073  				v := b.Int32()
 28074  				s.Count = v
 28075  			}
 28076  			{
 28077  				v := s.Assignment
 28078  				a := v
 28079  				var l int32
 28080  				if isFlexible {
 28081  					l = b.CompactArrayLen()
 28082  				} else {
 28083  					l = b.ArrayLen()
 28084  				}
 28085  				if version < 0 || l == 0 {
 28086  					a = []CreatePartitionsRequestTopicAssignment{}
 28087  				}
 28088  				if !b.Ok() {
 28089  					return b.Complete()
 28090  				}
 28091  				a = a[:0]
 28092  				if l > 0 {
 28093  					a = append(a, make([]CreatePartitionsRequestTopicAssignment, l)...)
 28094  				}
 28095  				for i := int32(0); i < l; i++ {
 28096  					v := &a[i]
 28097  					v.Default()
 28098  					s := v
 28099  					{
 28100  						v := s.Replicas
 28101  						a := v
 28102  						var l int32
 28103  						if isFlexible {
 28104  							l = b.CompactArrayLen()
 28105  						} else {
 28106  							l = b.ArrayLen()
 28107  						}
 28108  						if !b.Ok() {
 28109  							return b.Complete()
 28110  						}
 28111  						a = a[:0]
 28112  						if l > 0 {
 28113  							a = append(a, make([]int32, l)...)
 28114  						}
 28115  						for i := int32(0); i < l; i++ {
 28116  							v := b.Int32()
 28117  							a[i] = v
 28118  						}
 28119  						v = a
 28120  						s.Replicas = v
 28121  					}
 28122  					if isFlexible {
 28123  						s.UnknownTags = internalReadTags(&b)
 28124  					}
 28125  				}
 28126  				v = a
 28127  				s.Assignment = v
 28128  			}
 28129  			if isFlexible {
 28130  				s.UnknownTags = internalReadTags(&b)
 28131  			}
 28132  		}
 28133  		v = a
 28134  		s.Topics = v
 28135  	}
 28136  	{
 28137  		v := b.Int32()
 28138  		s.TimeoutMillis = v
 28139  	}
 28140  	{
 28141  		v := b.Bool()
 28142  		s.ValidateOnly = v
 28143  	}
 28144  	if isFlexible {
 28145  		s.UnknownTags = internalReadTags(&b)
 28146  	}
 28147  	return b.Complete()
 28148  }
 28149  
 28150  // NewPtrCreatePartitionsRequest returns a pointer to a default CreatePartitionsRequest
 28151  // This is a shortcut for creating a new(struct) and calling Default yourself.
 28152  func NewPtrCreatePartitionsRequest() *CreatePartitionsRequest {
 28153  	var v CreatePartitionsRequest
 28154  	v.Default()
 28155  	return &v
 28156  }
 28157  
 28158  // Default sets any default fields. Calling this allows for future compatibility
 28159  // if new fields are added to CreatePartitionsRequest.
 28160  func (v *CreatePartitionsRequest) Default() {
 28161  	v.TimeoutMillis = 15000
 28162  }
 28163  
 28164  // NewCreatePartitionsRequest returns a default CreatePartitionsRequest
 28165  // This is a shortcut for creating a struct and calling Default yourself.
 28166  func NewCreatePartitionsRequest() CreatePartitionsRequest {
 28167  	var v CreatePartitionsRequest
 28168  	v.Default()
 28169  	return v
 28170  }
 28171  
 28172  type CreatePartitionsResponseTopic struct {
 28173  	// Topic is the topic that partitions were requested to be made for.
 28174  	Topic string
 28175  
 28176  	// ErrorCode is the error code returned for each topic in the request.
 28177  	//
 28178  	// NOT_CONTROLLER is returned if the request was not issued to a Kafka
 28179  	// controller.
 28180  	//
 28181  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized
 28182  	// to create partitions for a topic.
 28183  	//
 28184  	// INVALID_REQUEST is returned for duplicate topics in the request.
 28185  	//
 28186  	// INVALID_TOPIC_EXCEPTION is returned if the topic is queued for deletion.
 28187  	//
 28188  	// REASSIGNMENT_IN_PROGRESS is returned if the request was issued while
 28189  	// partitions were being reassigned.
 28190  	//
 28191  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 28192  	// the topic for which to create partitions.
 28193  	//
 28194  	// INVALID_PARTITIONS is returned if the request would drop the total
 28195  	// count of partitions down, or if the request would not add any more
 28196  	// partitions, or if the request uses unknown brokers, or if the request
 28197  	// assigns a different number of brokers than the increase in the
 28198  	// partition count.
 28199  	ErrorCode int16
 28200  
 28201  	// ErrorMessage is an informative message if the topic creation failed.
 28202  	ErrorMessage *string
 28203  
 28204  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 28205  	UnknownTags Tags // v2+
 28206  }
 28207  
 28208  // Default sets any default fields. Calling this allows for future compatibility
 28209  // if new fields are added to CreatePartitionsResponseTopic.
 28210  func (v *CreatePartitionsResponseTopic) Default() {
 28211  }
 28212  
 28213  // NewCreatePartitionsResponseTopic returns a default CreatePartitionsResponseTopic
 28214  // This is a shortcut for creating a struct and calling Default yourself.
 28215  func NewCreatePartitionsResponseTopic() CreatePartitionsResponseTopic {
 28216  	var v CreatePartitionsResponseTopic
 28217  	v.Default()
 28218  	return v
 28219  }
 28220  
 28221  // CreatePartitionsResponse is returned from a CreatePartitionsRequest.
 28222  type CreatePartitionsResponse struct {
 28223  	// Version is the version of this message used with a Kafka broker.
 28224  	Version int16
 28225  
 28226  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 28227  	// after this request.
 28228  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 28229  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 28230  	//
 28231  	// This request switched at version 1.
 28232  	ThrottleMillis int32
 28233  
 28234  	// Topics is a response to each topic in the creation request.
 28235  	Topics []CreatePartitionsResponseTopic
 28236  
 28237  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 28238  	UnknownTags Tags // v2+
 28239  }
 28240  
 28241  func (*CreatePartitionsResponse) Key() int16                 { return 37 }
 28242  func (*CreatePartitionsResponse) MaxVersion() int16          { return 3 }
 28243  func (v *CreatePartitionsResponse) SetVersion(version int16) { v.Version = version }
 28244  func (v *CreatePartitionsResponse) GetVersion() int16        { return v.Version }
 28245  func (v *CreatePartitionsResponse) IsFlexible() bool         { return v.Version >= 2 }
 28246  func (v *CreatePartitionsResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 1 }
 28247  func (v *CreatePartitionsResponse) SetThrottle(throttleMillis int32) {
 28248  	v.ThrottleMillis = throttleMillis
 28249  }
 28250  
 28251  func (v *CreatePartitionsResponse) RequestKind() Request {
 28252  	return &CreatePartitionsRequest{Version: v.Version}
 28253  }
 28254  
 28255  func (v *CreatePartitionsResponse) AppendTo(dst []byte) []byte {
 28256  	version := v.Version
 28257  	_ = version
 28258  	isFlexible := version >= 2
 28259  	_ = isFlexible
 28260  	{
 28261  		v := v.ThrottleMillis
 28262  		dst = kbin.AppendInt32(dst, v)
 28263  	}
 28264  	{
 28265  		v := v.Topics
 28266  		if isFlexible {
 28267  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 28268  		} else {
 28269  			dst = kbin.AppendArrayLen(dst, len(v))
 28270  		}
 28271  		for i := range v {
 28272  			v := &v[i]
 28273  			{
 28274  				v := v.Topic
 28275  				if isFlexible {
 28276  					dst = kbin.AppendCompactString(dst, v)
 28277  				} else {
 28278  					dst = kbin.AppendString(dst, v)
 28279  				}
 28280  			}
 28281  			{
 28282  				v := v.ErrorCode
 28283  				dst = kbin.AppendInt16(dst, v)
 28284  			}
 28285  			{
 28286  				v := v.ErrorMessage
 28287  				if isFlexible {
 28288  					dst = kbin.AppendCompactNullableString(dst, v)
 28289  				} else {
 28290  					dst = kbin.AppendNullableString(dst, v)
 28291  				}
 28292  			}
 28293  			if isFlexible {
 28294  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28295  				dst = v.UnknownTags.AppendEach(dst)
 28296  			}
 28297  		}
 28298  	}
 28299  	if isFlexible {
 28300  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28301  		dst = v.UnknownTags.AppendEach(dst)
 28302  	}
 28303  	return dst
 28304  }
 28305  
 28306  func (v *CreatePartitionsResponse) ReadFrom(src []byte) error {
 28307  	return v.readFrom(src, false)
 28308  }
 28309  
 28310  func (v *CreatePartitionsResponse) UnsafeReadFrom(src []byte) error {
 28311  	return v.readFrom(src, true)
 28312  }
 28313  
 28314  func (v *CreatePartitionsResponse) readFrom(src []byte, unsafe bool) error {
 28315  	v.Default()
 28316  	b := kbin.Reader{Src: src}
 28317  	version := v.Version
 28318  	_ = version
 28319  	isFlexible := version >= 2
 28320  	_ = isFlexible
 28321  	s := v
 28322  	{
 28323  		v := b.Int32()
 28324  		s.ThrottleMillis = v
 28325  	}
 28326  	{
 28327  		v := s.Topics
 28328  		a := v
 28329  		var l int32
 28330  		if isFlexible {
 28331  			l = b.CompactArrayLen()
 28332  		} else {
 28333  			l = b.ArrayLen()
 28334  		}
 28335  		if !b.Ok() {
 28336  			return b.Complete()
 28337  		}
 28338  		a = a[:0]
 28339  		if l > 0 {
 28340  			a = append(a, make([]CreatePartitionsResponseTopic, l)...)
 28341  		}
 28342  		for i := int32(0); i < l; i++ {
 28343  			v := &a[i]
 28344  			v.Default()
 28345  			s := v
 28346  			{
 28347  				var v string
 28348  				if unsafe {
 28349  					if isFlexible {
 28350  						v = b.UnsafeCompactString()
 28351  					} else {
 28352  						v = b.UnsafeString()
 28353  					}
 28354  				} else {
 28355  					if isFlexible {
 28356  						v = b.CompactString()
 28357  					} else {
 28358  						v = b.String()
 28359  					}
 28360  				}
 28361  				s.Topic = v
 28362  			}
 28363  			{
 28364  				v := b.Int16()
 28365  				s.ErrorCode = v
 28366  			}
 28367  			{
 28368  				var v *string
 28369  				if isFlexible {
 28370  					if unsafe {
 28371  						v = b.UnsafeCompactNullableString()
 28372  					} else {
 28373  						v = b.CompactNullableString()
 28374  					}
 28375  				} else {
 28376  					if unsafe {
 28377  						v = b.UnsafeNullableString()
 28378  					} else {
 28379  						v = b.NullableString()
 28380  					}
 28381  				}
 28382  				s.ErrorMessage = v
 28383  			}
 28384  			if isFlexible {
 28385  				s.UnknownTags = internalReadTags(&b)
 28386  			}
 28387  		}
 28388  		v = a
 28389  		s.Topics = v
 28390  	}
 28391  	if isFlexible {
 28392  		s.UnknownTags = internalReadTags(&b)
 28393  	}
 28394  	return b.Complete()
 28395  }
 28396  
 28397  // NewPtrCreatePartitionsResponse returns a pointer to a default CreatePartitionsResponse
 28398  // This is a shortcut for creating a new(struct) and calling Default yourself.
 28399  func NewPtrCreatePartitionsResponse() *CreatePartitionsResponse {
 28400  	var v CreatePartitionsResponse
 28401  	v.Default()
 28402  	return &v
 28403  }
 28404  
 28405  // Default sets any default fields. Calling this allows for future compatibility
 28406  // if new fields are added to CreatePartitionsResponse.
 28407  func (v *CreatePartitionsResponse) Default() {
 28408  }
 28409  
 28410  // NewCreatePartitionsResponse returns a default CreatePartitionsResponse
 28411  // This is a shortcut for creating a struct and calling Default yourself.
 28412  func NewCreatePartitionsResponse() CreatePartitionsResponse {
 28413  	var v CreatePartitionsResponse
 28414  	v.Default()
 28415  	return v
 28416  }
 28417  
 28418  type CreateDelegationTokenRequestRenewer struct {
 28419  	// PrincipalType is the "type" this principal is. This must be "User".
 28420  	PrincipalType string
 28421  
 28422  	// PrincipalName is the user name allowed to renew the returned token.
 28423  	PrincipalName string
 28424  
 28425  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 28426  	UnknownTags Tags // v2+
 28427  }
 28428  
 28429  // Default sets any default fields. Calling this allows for future compatibility
 28430  // if new fields are added to CreateDelegationTokenRequestRenewer.
 28431  func (v *CreateDelegationTokenRequestRenewer) Default() {
 28432  }
 28433  
 28434  // NewCreateDelegationTokenRequestRenewer returns a default CreateDelegationTokenRequestRenewer
 28435  // This is a shortcut for creating a struct and calling Default yourself.
 28436  func NewCreateDelegationTokenRequestRenewer() CreateDelegationTokenRequestRenewer {
 28437  	var v CreateDelegationTokenRequestRenewer
 28438  	v.Default()
 28439  	return v
 28440  }
 28441  
 28442  // CreateDelegationTokenRequest issues a request to create a delegation token.
 28443  //
 28444  // Creating delegation tokens allows for an (ideally) quicker and easier method
 28445  // of enabling authorization for a wide array of clients. Rather than having to
 28446  // manage many passwords external to Kafka, you only need to manage a few
 28447  // accounts and use those to create delegation tokens per client.
 28448  //
 28449  // Note that delegation tokens inherit the same ACLs as the user creating the
 28450  // token. Thus, if you want to properly scope ACLs, you should not create
 28451  // delegation tokens with admin accounts.
 28452  //
 28453  // Delegation tokens live inside of Kafka and use SASL SCRAM-SHA-256 for
 28454  // authorization.
 28455  type CreateDelegationTokenRequest struct {
 28456  	// Version is the version of this message used with a Kafka broker.
 28457  	Version int16
 28458  
 28459  	// The principal type of the owner of the token. If null, this defaults
 28460  	// to the token request principal.
 28461  	OwnerPrincipalType *string // v3+
 28462  
 28463  	// Principal name of the owner of the token. If null, this defaults to
 28464  	// the token request principal.
 28465  	OwnerPrincipalName *string // v3+
 28466  
 28467  	// Renewers is a list of who can renew this delegation token. If empty, the
 28468  	// default is the principal (user) who created the token.
 28469  	Renewers []CreateDelegationTokenRequestRenewer
 28470  
 28471  	// MaxLifetimeMillis is how long this delegation token will be valid for.
 28472  	// If -1, the default will be the server's delegation.token.max.lifetime.ms.
 28473  	MaxLifetimeMillis int64
 28474  
 28475  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 28476  	UnknownTags Tags // v2+
 28477  }
 28478  
 28479  func (*CreateDelegationTokenRequest) Key() int16                 { return 38 }
 28480  func (*CreateDelegationTokenRequest) MaxVersion() int16          { return 3 }
 28481  func (v *CreateDelegationTokenRequest) SetVersion(version int16) { v.Version = version }
 28482  func (v *CreateDelegationTokenRequest) GetVersion() int16        { return v.Version }
 28483  func (v *CreateDelegationTokenRequest) IsFlexible() bool         { return v.Version >= 2 }
 28484  func (v *CreateDelegationTokenRequest) ResponseKind() Response {
 28485  	r := &CreateDelegationTokenResponse{Version: v.Version}
 28486  	r.Default()
 28487  	return r
 28488  }
 28489  
 28490  // RequestWith is requests v on r and returns the response or an error.
 28491  // For sharded requests, the response may be merged and still return an error.
 28492  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 28493  func (v *CreateDelegationTokenRequest) RequestWith(ctx context.Context, r Requestor) (*CreateDelegationTokenResponse, error) {
 28494  	kresp, err := r.Request(ctx, v)
 28495  	resp, _ := kresp.(*CreateDelegationTokenResponse)
 28496  	return resp, err
 28497  }
 28498  
 28499  func (v *CreateDelegationTokenRequest) AppendTo(dst []byte) []byte {
 28500  	version := v.Version
 28501  	_ = version
 28502  	isFlexible := version >= 2
 28503  	_ = isFlexible
 28504  	if version >= 3 {
 28505  		v := v.OwnerPrincipalType
 28506  		if isFlexible {
 28507  			dst = kbin.AppendCompactNullableString(dst, v)
 28508  		} else {
 28509  			dst = kbin.AppendNullableString(dst, v)
 28510  		}
 28511  	}
 28512  	if version >= 3 {
 28513  		v := v.OwnerPrincipalName
 28514  		if isFlexible {
 28515  			dst = kbin.AppendCompactNullableString(dst, v)
 28516  		} else {
 28517  			dst = kbin.AppendNullableString(dst, v)
 28518  		}
 28519  	}
 28520  	{
 28521  		v := v.Renewers
 28522  		if isFlexible {
 28523  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 28524  		} else {
 28525  			dst = kbin.AppendArrayLen(dst, len(v))
 28526  		}
 28527  		for i := range v {
 28528  			v := &v[i]
 28529  			{
 28530  				v := v.PrincipalType
 28531  				if isFlexible {
 28532  					dst = kbin.AppendCompactString(dst, v)
 28533  				} else {
 28534  					dst = kbin.AppendString(dst, v)
 28535  				}
 28536  			}
 28537  			{
 28538  				v := v.PrincipalName
 28539  				if isFlexible {
 28540  					dst = kbin.AppendCompactString(dst, v)
 28541  				} else {
 28542  					dst = kbin.AppendString(dst, v)
 28543  				}
 28544  			}
 28545  			if isFlexible {
 28546  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28547  				dst = v.UnknownTags.AppendEach(dst)
 28548  			}
 28549  		}
 28550  	}
 28551  	{
 28552  		v := v.MaxLifetimeMillis
 28553  		dst = kbin.AppendInt64(dst, v)
 28554  	}
 28555  	if isFlexible {
 28556  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28557  		dst = v.UnknownTags.AppendEach(dst)
 28558  	}
 28559  	return dst
 28560  }
 28561  
 28562  func (v *CreateDelegationTokenRequest) ReadFrom(src []byte) error {
 28563  	return v.readFrom(src, false)
 28564  }
 28565  
 28566  func (v *CreateDelegationTokenRequest) UnsafeReadFrom(src []byte) error {
 28567  	return v.readFrom(src, true)
 28568  }
 28569  
 28570  func (v *CreateDelegationTokenRequest) readFrom(src []byte, unsafe bool) error {
 28571  	v.Default()
 28572  	b := kbin.Reader{Src: src}
 28573  	version := v.Version
 28574  	_ = version
 28575  	isFlexible := version >= 2
 28576  	_ = isFlexible
 28577  	s := v
 28578  	if version >= 3 {
 28579  		var v *string
 28580  		if isFlexible {
 28581  			if unsafe {
 28582  				v = b.UnsafeCompactNullableString()
 28583  			} else {
 28584  				v = b.CompactNullableString()
 28585  			}
 28586  		} else {
 28587  			if unsafe {
 28588  				v = b.UnsafeNullableString()
 28589  			} else {
 28590  				v = b.NullableString()
 28591  			}
 28592  		}
 28593  		s.OwnerPrincipalType = v
 28594  	}
 28595  	if version >= 3 {
 28596  		var v *string
 28597  		if isFlexible {
 28598  			if unsafe {
 28599  				v = b.UnsafeCompactNullableString()
 28600  			} else {
 28601  				v = b.CompactNullableString()
 28602  			}
 28603  		} else {
 28604  			if unsafe {
 28605  				v = b.UnsafeNullableString()
 28606  			} else {
 28607  				v = b.NullableString()
 28608  			}
 28609  		}
 28610  		s.OwnerPrincipalName = v
 28611  	}
 28612  	{
 28613  		v := s.Renewers
 28614  		a := v
 28615  		var l int32
 28616  		if isFlexible {
 28617  			l = b.CompactArrayLen()
 28618  		} else {
 28619  			l = b.ArrayLen()
 28620  		}
 28621  		if !b.Ok() {
 28622  			return b.Complete()
 28623  		}
 28624  		a = a[:0]
 28625  		if l > 0 {
 28626  			a = append(a, make([]CreateDelegationTokenRequestRenewer, l)...)
 28627  		}
 28628  		for i := int32(0); i < l; i++ {
 28629  			v := &a[i]
 28630  			v.Default()
 28631  			s := v
 28632  			{
 28633  				var v string
 28634  				if unsafe {
 28635  					if isFlexible {
 28636  						v = b.UnsafeCompactString()
 28637  					} else {
 28638  						v = b.UnsafeString()
 28639  					}
 28640  				} else {
 28641  					if isFlexible {
 28642  						v = b.CompactString()
 28643  					} else {
 28644  						v = b.String()
 28645  					}
 28646  				}
 28647  				s.PrincipalType = v
 28648  			}
 28649  			{
 28650  				var v string
 28651  				if unsafe {
 28652  					if isFlexible {
 28653  						v = b.UnsafeCompactString()
 28654  					} else {
 28655  						v = b.UnsafeString()
 28656  					}
 28657  				} else {
 28658  					if isFlexible {
 28659  						v = b.CompactString()
 28660  					} else {
 28661  						v = b.String()
 28662  					}
 28663  				}
 28664  				s.PrincipalName = v
 28665  			}
 28666  			if isFlexible {
 28667  				s.UnknownTags = internalReadTags(&b)
 28668  			}
 28669  		}
 28670  		v = a
 28671  		s.Renewers = v
 28672  	}
 28673  	{
 28674  		v := b.Int64()
 28675  		s.MaxLifetimeMillis = v
 28676  	}
 28677  	if isFlexible {
 28678  		s.UnknownTags = internalReadTags(&b)
 28679  	}
 28680  	return b.Complete()
 28681  }
 28682  
 28683  // NewPtrCreateDelegationTokenRequest returns a pointer to a default CreateDelegationTokenRequest
 28684  // This is a shortcut for creating a new(struct) and calling Default yourself.
 28685  func NewPtrCreateDelegationTokenRequest() *CreateDelegationTokenRequest {
 28686  	var v CreateDelegationTokenRequest
 28687  	v.Default()
 28688  	return &v
 28689  }
 28690  
 28691  // Default sets any default fields. Calling this allows for future compatibility
 28692  // if new fields are added to CreateDelegationTokenRequest.
 28693  func (v *CreateDelegationTokenRequest) Default() {
 28694  }
 28695  
 28696  // NewCreateDelegationTokenRequest returns a default CreateDelegationTokenRequest
 28697  // This is a shortcut for creating a struct and calling Default yourself.
 28698  func NewCreateDelegationTokenRequest() CreateDelegationTokenRequest {
 28699  	var v CreateDelegationTokenRequest
 28700  	v.Default()
 28701  	return v
 28702  }
 28703  
 28704  // CreateDelegationTokenResponse is a response to a CreateDelegationTokenRequest.
 28705  type CreateDelegationTokenResponse struct {
 28706  	// Version is the version of this message used with a Kafka broker.
 28707  	Version int16
 28708  
 28709  	// ErrorCode is any error that caused the request to fail.
 28710  	ErrorCode int16
 28711  
 28712  	// PrincipalType is the type of principal that granted this delegation token.
 28713  	// This will always be "User" with the simple authorizer.
 28714  	PrincipalType string
 28715  
 28716  	// PrincipalName is the name of the principal that granted this delegation
 28717  	// token.
 28718  	PrincipalName string
 28719  
 28720  	// The principal type of the requester of the token.
 28721  	TokenRequesterPrincipalType string // v3+
 28722  
 28723  	// The principal name of the requester token.
 28724  	TokenRequesterPrincipalName string // v3+
 28725  
 28726  	// IssueTimestamp is the millisecond timestamp this delegation token was
 28727  	// issued.
 28728  	IssueTimestamp int64
 28729  
 28730  	// ExpiryTimestamp is the millisecond timestamp this token will expire. The
 28731  	// token can be renewed up to MaxTimestamp, past which point, it will be
 28732  	// invalid. The Kafka default is 24h.
 28733  	ExpiryTimestamp int64
 28734  
 28735  	// MaxTimestamp is the millisecond timestamp past which this token cannot
 28736  	// be renewed.
 28737  	MaxTimestamp int64
 28738  
 28739  	// TokenID is the ID of this token; this will be used as the username for
 28740  	// scram authentication.
 28741  	TokenID string
 28742  
 28743  	// HMAC is the password of this token; this will be used as the password for
 28744  	// scram authentication.
 28745  	HMAC []byte
 28746  
 28747  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 28748  	// after this request.
 28749  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 28750  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 28751  	//
 28752  	// This request switched at version 1.
 28753  	ThrottleMillis int32
 28754  
 28755  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 28756  	UnknownTags Tags // v2+
 28757  }
 28758  
 28759  func (*CreateDelegationTokenResponse) Key() int16                 { return 38 }
 28760  func (*CreateDelegationTokenResponse) MaxVersion() int16          { return 3 }
 28761  func (v *CreateDelegationTokenResponse) SetVersion(version int16) { v.Version = version }
 28762  func (v *CreateDelegationTokenResponse) GetVersion() int16        { return v.Version }
 28763  func (v *CreateDelegationTokenResponse) IsFlexible() bool         { return v.Version >= 2 }
 28764  func (v *CreateDelegationTokenResponse) Throttle() (int32, bool) {
 28765  	return v.ThrottleMillis, v.Version >= 1
 28766  }
 28767  
 28768  func (v *CreateDelegationTokenResponse) SetThrottle(throttleMillis int32) {
 28769  	v.ThrottleMillis = throttleMillis
 28770  }
 28771  
 28772  func (v *CreateDelegationTokenResponse) RequestKind() Request {
 28773  	return &CreateDelegationTokenRequest{Version: v.Version}
 28774  }
 28775  
 28776  func (v *CreateDelegationTokenResponse) AppendTo(dst []byte) []byte {
 28777  	version := v.Version
 28778  	_ = version
 28779  	isFlexible := version >= 2
 28780  	_ = isFlexible
 28781  	{
 28782  		v := v.ErrorCode
 28783  		dst = kbin.AppendInt16(dst, v)
 28784  	}
 28785  	{
 28786  		v := v.PrincipalType
 28787  		if isFlexible {
 28788  			dst = kbin.AppendCompactString(dst, v)
 28789  		} else {
 28790  			dst = kbin.AppendString(dst, v)
 28791  		}
 28792  	}
 28793  	{
 28794  		v := v.PrincipalName
 28795  		if isFlexible {
 28796  			dst = kbin.AppendCompactString(dst, v)
 28797  		} else {
 28798  			dst = kbin.AppendString(dst, v)
 28799  		}
 28800  	}
 28801  	if version >= 3 {
 28802  		v := v.TokenRequesterPrincipalType
 28803  		if isFlexible {
 28804  			dst = kbin.AppendCompactString(dst, v)
 28805  		} else {
 28806  			dst = kbin.AppendString(dst, v)
 28807  		}
 28808  	}
 28809  	if version >= 3 {
 28810  		v := v.TokenRequesterPrincipalName
 28811  		if isFlexible {
 28812  			dst = kbin.AppendCompactString(dst, v)
 28813  		} else {
 28814  			dst = kbin.AppendString(dst, v)
 28815  		}
 28816  	}
 28817  	{
 28818  		v := v.IssueTimestamp
 28819  		dst = kbin.AppendInt64(dst, v)
 28820  	}
 28821  	{
 28822  		v := v.ExpiryTimestamp
 28823  		dst = kbin.AppendInt64(dst, v)
 28824  	}
 28825  	{
 28826  		v := v.MaxTimestamp
 28827  		dst = kbin.AppendInt64(dst, v)
 28828  	}
 28829  	{
 28830  		v := v.TokenID
 28831  		if isFlexible {
 28832  			dst = kbin.AppendCompactString(dst, v)
 28833  		} else {
 28834  			dst = kbin.AppendString(dst, v)
 28835  		}
 28836  	}
 28837  	{
 28838  		v := v.HMAC
 28839  		if isFlexible {
 28840  			dst = kbin.AppendCompactBytes(dst, v)
 28841  		} else {
 28842  			dst = kbin.AppendBytes(dst, v)
 28843  		}
 28844  	}
 28845  	{
 28846  		v := v.ThrottleMillis
 28847  		dst = kbin.AppendInt32(dst, v)
 28848  	}
 28849  	if isFlexible {
 28850  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 28851  		dst = v.UnknownTags.AppendEach(dst)
 28852  	}
 28853  	return dst
 28854  }
 28855  
 28856  func (v *CreateDelegationTokenResponse) ReadFrom(src []byte) error {
 28857  	return v.readFrom(src, false)
 28858  }
 28859  
 28860  func (v *CreateDelegationTokenResponse) UnsafeReadFrom(src []byte) error {
 28861  	return v.readFrom(src, true)
 28862  }
 28863  
 28864  func (v *CreateDelegationTokenResponse) readFrom(src []byte, unsafe bool) error {
 28865  	v.Default()
 28866  	b := kbin.Reader{Src: src}
 28867  	version := v.Version
 28868  	_ = version
 28869  	isFlexible := version >= 2
 28870  	_ = isFlexible
 28871  	s := v
 28872  	{
 28873  		v := b.Int16()
 28874  		s.ErrorCode = v
 28875  	}
 28876  	{
 28877  		var v string
 28878  		if unsafe {
 28879  			if isFlexible {
 28880  				v = b.UnsafeCompactString()
 28881  			} else {
 28882  				v = b.UnsafeString()
 28883  			}
 28884  		} else {
 28885  			if isFlexible {
 28886  				v = b.CompactString()
 28887  			} else {
 28888  				v = b.String()
 28889  			}
 28890  		}
 28891  		s.PrincipalType = v
 28892  	}
 28893  	{
 28894  		var v string
 28895  		if unsafe {
 28896  			if isFlexible {
 28897  				v = b.UnsafeCompactString()
 28898  			} else {
 28899  				v = b.UnsafeString()
 28900  			}
 28901  		} else {
 28902  			if isFlexible {
 28903  				v = b.CompactString()
 28904  			} else {
 28905  				v = b.String()
 28906  			}
 28907  		}
 28908  		s.PrincipalName = v
 28909  	}
 28910  	if version >= 3 {
 28911  		var v string
 28912  		if unsafe {
 28913  			if isFlexible {
 28914  				v = b.UnsafeCompactString()
 28915  			} else {
 28916  				v = b.UnsafeString()
 28917  			}
 28918  		} else {
 28919  			if isFlexible {
 28920  				v = b.CompactString()
 28921  			} else {
 28922  				v = b.String()
 28923  			}
 28924  		}
 28925  		s.TokenRequesterPrincipalType = v
 28926  	}
 28927  	if version >= 3 {
 28928  		var v string
 28929  		if unsafe {
 28930  			if isFlexible {
 28931  				v = b.UnsafeCompactString()
 28932  			} else {
 28933  				v = b.UnsafeString()
 28934  			}
 28935  		} else {
 28936  			if isFlexible {
 28937  				v = b.CompactString()
 28938  			} else {
 28939  				v = b.String()
 28940  			}
 28941  		}
 28942  		s.TokenRequesterPrincipalName = v
 28943  	}
 28944  	{
 28945  		v := b.Int64()
 28946  		s.IssueTimestamp = v
 28947  	}
 28948  	{
 28949  		v := b.Int64()
 28950  		s.ExpiryTimestamp = v
 28951  	}
 28952  	{
 28953  		v := b.Int64()
 28954  		s.MaxTimestamp = v
 28955  	}
 28956  	{
 28957  		var v string
 28958  		if unsafe {
 28959  			if isFlexible {
 28960  				v = b.UnsafeCompactString()
 28961  			} else {
 28962  				v = b.UnsafeString()
 28963  			}
 28964  		} else {
 28965  			if isFlexible {
 28966  				v = b.CompactString()
 28967  			} else {
 28968  				v = b.String()
 28969  			}
 28970  		}
 28971  		s.TokenID = v
 28972  	}
 28973  	{
 28974  		var v []byte
 28975  		if isFlexible {
 28976  			v = b.CompactBytes()
 28977  		} else {
 28978  			v = b.Bytes()
 28979  		}
 28980  		s.HMAC = v
 28981  	}
 28982  	{
 28983  		v := b.Int32()
 28984  		s.ThrottleMillis = v
 28985  	}
 28986  	if isFlexible {
 28987  		s.UnknownTags = internalReadTags(&b)
 28988  	}
 28989  	return b.Complete()
 28990  }
 28991  
 28992  // NewPtrCreateDelegationTokenResponse returns a pointer to a default CreateDelegationTokenResponse
 28993  // This is a shortcut for creating a new(struct) and calling Default yourself.
 28994  func NewPtrCreateDelegationTokenResponse() *CreateDelegationTokenResponse {
 28995  	var v CreateDelegationTokenResponse
 28996  	v.Default()
 28997  	return &v
 28998  }
 28999  
 29000  // Default sets any default fields. Calling this allows for future compatibility
 29001  // if new fields are added to CreateDelegationTokenResponse.
 29002  func (v *CreateDelegationTokenResponse) Default() {
 29003  }
 29004  
 29005  // NewCreateDelegationTokenResponse returns a default CreateDelegationTokenResponse
 29006  // This is a shortcut for creating a struct and calling Default yourself.
 29007  func NewCreateDelegationTokenResponse() CreateDelegationTokenResponse {
 29008  	var v CreateDelegationTokenResponse
 29009  	v.Default()
 29010  	return v
 29011  }
 29012  
 29013  // RenewDelegationTokenRequest is a request to renew a delegation token that
 29014  // has not yet hit its max timestamp. Note that a client using a token cannot
 29015  // renew its own token.
 29016  type RenewDelegationTokenRequest struct {
 29017  	// Version is the version of this message used with a Kafka broker.
 29018  	Version int16
 29019  
 29020  	// HMAC is the HMAC of the token to be renewed.
 29021  	HMAC []byte
 29022  
 29023  	// RenewTimeMillis is how long to renew the token for. If -1, Kafka uses its
 29024  	// delegation.token.max.lifetime.ms.
 29025  	RenewTimeMillis int64
 29026  
 29027  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29028  	UnknownTags Tags // v2+
 29029  }
 29030  
 29031  func (*RenewDelegationTokenRequest) Key() int16                 { return 39 }
 29032  func (*RenewDelegationTokenRequest) MaxVersion() int16          { return 2 }
 29033  func (v *RenewDelegationTokenRequest) SetVersion(version int16) { v.Version = version }
 29034  func (v *RenewDelegationTokenRequest) GetVersion() int16        { return v.Version }
 29035  func (v *RenewDelegationTokenRequest) IsFlexible() bool         { return v.Version >= 2 }
 29036  func (v *RenewDelegationTokenRequest) ResponseKind() Response {
 29037  	r := &RenewDelegationTokenResponse{Version: v.Version}
 29038  	r.Default()
 29039  	return r
 29040  }
 29041  
 29042  // RequestWith is requests v on r and returns the response or an error.
 29043  // For sharded requests, the response may be merged and still return an error.
 29044  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 29045  func (v *RenewDelegationTokenRequest) RequestWith(ctx context.Context, r Requestor) (*RenewDelegationTokenResponse, error) {
 29046  	kresp, err := r.Request(ctx, v)
 29047  	resp, _ := kresp.(*RenewDelegationTokenResponse)
 29048  	return resp, err
 29049  }
 29050  
 29051  func (v *RenewDelegationTokenRequest) AppendTo(dst []byte) []byte {
 29052  	version := v.Version
 29053  	_ = version
 29054  	isFlexible := version >= 2
 29055  	_ = isFlexible
 29056  	{
 29057  		v := v.HMAC
 29058  		if isFlexible {
 29059  			dst = kbin.AppendCompactBytes(dst, v)
 29060  		} else {
 29061  			dst = kbin.AppendBytes(dst, v)
 29062  		}
 29063  	}
 29064  	{
 29065  		v := v.RenewTimeMillis
 29066  		dst = kbin.AppendInt64(dst, v)
 29067  	}
 29068  	if isFlexible {
 29069  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29070  		dst = v.UnknownTags.AppendEach(dst)
 29071  	}
 29072  	return dst
 29073  }
 29074  
 29075  func (v *RenewDelegationTokenRequest) ReadFrom(src []byte) error {
 29076  	return v.readFrom(src, false)
 29077  }
 29078  
 29079  func (v *RenewDelegationTokenRequest) UnsafeReadFrom(src []byte) error {
 29080  	return v.readFrom(src, true)
 29081  }
 29082  
 29083  func (v *RenewDelegationTokenRequest) readFrom(src []byte, unsafe bool) error {
 29084  	v.Default()
 29085  	b := kbin.Reader{Src: src}
 29086  	version := v.Version
 29087  	_ = version
 29088  	isFlexible := version >= 2
 29089  	_ = isFlexible
 29090  	s := v
 29091  	{
 29092  		var v []byte
 29093  		if isFlexible {
 29094  			v = b.CompactBytes()
 29095  		} else {
 29096  			v = b.Bytes()
 29097  		}
 29098  		s.HMAC = v
 29099  	}
 29100  	{
 29101  		v := b.Int64()
 29102  		s.RenewTimeMillis = v
 29103  	}
 29104  	if isFlexible {
 29105  		s.UnknownTags = internalReadTags(&b)
 29106  	}
 29107  	return b.Complete()
 29108  }
 29109  
 29110  // NewPtrRenewDelegationTokenRequest returns a pointer to a default RenewDelegationTokenRequest
 29111  // This is a shortcut for creating a new(struct) and calling Default yourself.
 29112  func NewPtrRenewDelegationTokenRequest() *RenewDelegationTokenRequest {
 29113  	var v RenewDelegationTokenRequest
 29114  	v.Default()
 29115  	return &v
 29116  }
 29117  
 29118  // Default sets any default fields. Calling this allows for future compatibility
 29119  // if new fields are added to RenewDelegationTokenRequest.
 29120  func (v *RenewDelegationTokenRequest) Default() {
 29121  }
 29122  
 29123  // NewRenewDelegationTokenRequest returns a default RenewDelegationTokenRequest
 29124  // This is a shortcut for creating a struct and calling Default yourself.
 29125  func NewRenewDelegationTokenRequest() RenewDelegationTokenRequest {
 29126  	var v RenewDelegationTokenRequest
 29127  	v.Default()
 29128  	return v
 29129  }
 29130  
 29131  // RenewDelegationTokenResponse is a response to a RenewDelegationTokenRequest.
 29132  type RenewDelegationTokenResponse struct {
 29133  	// Version is the version of this message used with a Kafka broker.
 29134  	Version int16
 29135  
 29136  	// ErrorCode is any error that caused the request to fail.
 29137  	ErrorCode int16
 29138  
 29139  	// ExpiryTimestamp is the millisecond timestamp this token will expire. The
 29140  	// token can be renewed up to MaxTimestamp, past which point, it will be
 29141  	// invalid. The Kafka default is 24h.
 29142  	ExpiryTimestamp int64
 29143  
 29144  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 29145  	// after this request.
 29146  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 29147  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 29148  	//
 29149  	// This request switched at version 1.
 29150  	ThrottleMillis int32
 29151  
 29152  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29153  	UnknownTags Tags // v2+
 29154  }
 29155  
 29156  func (*RenewDelegationTokenResponse) Key() int16                 { return 39 }
 29157  func (*RenewDelegationTokenResponse) MaxVersion() int16          { return 2 }
 29158  func (v *RenewDelegationTokenResponse) SetVersion(version int16) { v.Version = version }
 29159  func (v *RenewDelegationTokenResponse) GetVersion() int16        { return v.Version }
 29160  func (v *RenewDelegationTokenResponse) IsFlexible() bool         { return v.Version >= 2 }
 29161  func (v *RenewDelegationTokenResponse) Throttle() (int32, bool) {
 29162  	return v.ThrottleMillis, v.Version >= 1
 29163  }
 29164  
 29165  func (v *RenewDelegationTokenResponse) SetThrottle(throttleMillis int32) {
 29166  	v.ThrottleMillis = throttleMillis
 29167  }
 29168  
 29169  func (v *RenewDelegationTokenResponse) RequestKind() Request {
 29170  	return &RenewDelegationTokenRequest{Version: v.Version}
 29171  }
 29172  
 29173  func (v *RenewDelegationTokenResponse) AppendTo(dst []byte) []byte {
 29174  	version := v.Version
 29175  	_ = version
 29176  	isFlexible := version >= 2
 29177  	_ = isFlexible
 29178  	{
 29179  		v := v.ErrorCode
 29180  		dst = kbin.AppendInt16(dst, v)
 29181  	}
 29182  	{
 29183  		v := v.ExpiryTimestamp
 29184  		dst = kbin.AppendInt64(dst, v)
 29185  	}
 29186  	{
 29187  		v := v.ThrottleMillis
 29188  		dst = kbin.AppendInt32(dst, v)
 29189  	}
 29190  	if isFlexible {
 29191  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29192  		dst = v.UnknownTags.AppendEach(dst)
 29193  	}
 29194  	return dst
 29195  }
 29196  
 29197  func (v *RenewDelegationTokenResponse) ReadFrom(src []byte) error {
 29198  	return v.readFrom(src, false)
 29199  }
 29200  
 29201  func (v *RenewDelegationTokenResponse) UnsafeReadFrom(src []byte) error {
 29202  	return v.readFrom(src, true)
 29203  }
 29204  
 29205  func (v *RenewDelegationTokenResponse) readFrom(src []byte, unsafe bool) error {
 29206  	v.Default()
 29207  	b := kbin.Reader{Src: src}
 29208  	version := v.Version
 29209  	_ = version
 29210  	isFlexible := version >= 2
 29211  	_ = isFlexible
 29212  	s := v
 29213  	{
 29214  		v := b.Int16()
 29215  		s.ErrorCode = v
 29216  	}
 29217  	{
 29218  		v := b.Int64()
 29219  		s.ExpiryTimestamp = v
 29220  	}
 29221  	{
 29222  		v := b.Int32()
 29223  		s.ThrottleMillis = v
 29224  	}
 29225  	if isFlexible {
 29226  		s.UnknownTags = internalReadTags(&b)
 29227  	}
 29228  	return b.Complete()
 29229  }
 29230  
 29231  // NewPtrRenewDelegationTokenResponse returns a pointer to a default RenewDelegationTokenResponse
 29232  // This is a shortcut for creating a new(struct) and calling Default yourself.
 29233  func NewPtrRenewDelegationTokenResponse() *RenewDelegationTokenResponse {
 29234  	var v RenewDelegationTokenResponse
 29235  	v.Default()
 29236  	return &v
 29237  }
 29238  
 29239  // Default sets any default fields. Calling this allows for future compatibility
 29240  // if new fields are added to RenewDelegationTokenResponse.
 29241  func (v *RenewDelegationTokenResponse) Default() {
 29242  }
 29243  
 29244  // NewRenewDelegationTokenResponse returns a default RenewDelegationTokenResponse
 29245  // This is a shortcut for creating a struct and calling Default yourself.
 29246  func NewRenewDelegationTokenResponse() RenewDelegationTokenResponse {
 29247  	var v RenewDelegationTokenResponse
 29248  	v.Default()
 29249  	return v
 29250  }
 29251  
 29252  // ExpireDelegationTokenRequest is a request to change the expiry timestamp
 29253  // of a delegation token. Note that a client using a token cannot expire its
 29254  // own token.
 29255  type ExpireDelegationTokenRequest struct {
 29256  	// Version is the version of this message used with a Kafka broker.
 29257  	Version int16
 29258  
 29259  	// HMAC is the HMAC of the token to change the expiry timestamp of.
 29260  	HMAC []byte
 29261  
 29262  	// ExpiryPeriodMillis changes the delegation token's expiry timestamp to
 29263  	// now + expiry time millis. This can be used to force tokens to expire
 29264  	// quickly, or to allow tokens a grace period before expiry. You cannot
 29265  	// add enough expiry that exceeds the original max timestamp.
 29266  	ExpiryPeriodMillis int64
 29267  
 29268  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29269  	UnknownTags Tags // v2+
 29270  }
 29271  
 29272  func (*ExpireDelegationTokenRequest) Key() int16                 { return 40 }
 29273  func (*ExpireDelegationTokenRequest) MaxVersion() int16          { return 2 }
 29274  func (v *ExpireDelegationTokenRequest) SetVersion(version int16) { v.Version = version }
 29275  func (v *ExpireDelegationTokenRequest) GetVersion() int16        { return v.Version }
 29276  func (v *ExpireDelegationTokenRequest) IsFlexible() bool         { return v.Version >= 2 }
 29277  func (v *ExpireDelegationTokenRequest) ResponseKind() Response {
 29278  	r := &ExpireDelegationTokenResponse{Version: v.Version}
 29279  	r.Default()
 29280  	return r
 29281  }
 29282  
 29283  // RequestWith is requests v on r and returns the response or an error.
 29284  // For sharded requests, the response may be merged and still return an error.
 29285  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 29286  func (v *ExpireDelegationTokenRequest) RequestWith(ctx context.Context, r Requestor) (*ExpireDelegationTokenResponse, error) {
 29287  	kresp, err := r.Request(ctx, v)
 29288  	resp, _ := kresp.(*ExpireDelegationTokenResponse)
 29289  	return resp, err
 29290  }
 29291  
 29292  func (v *ExpireDelegationTokenRequest) AppendTo(dst []byte) []byte {
 29293  	version := v.Version
 29294  	_ = version
 29295  	isFlexible := version >= 2
 29296  	_ = isFlexible
 29297  	{
 29298  		v := v.HMAC
 29299  		if isFlexible {
 29300  			dst = kbin.AppendCompactBytes(dst, v)
 29301  		} else {
 29302  			dst = kbin.AppendBytes(dst, v)
 29303  		}
 29304  	}
 29305  	{
 29306  		v := v.ExpiryPeriodMillis
 29307  		dst = kbin.AppendInt64(dst, v)
 29308  	}
 29309  	if isFlexible {
 29310  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29311  		dst = v.UnknownTags.AppendEach(dst)
 29312  	}
 29313  	return dst
 29314  }
 29315  
 29316  func (v *ExpireDelegationTokenRequest) ReadFrom(src []byte) error {
 29317  	return v.readFrom(src, false)
 29318  }
 29319  
 29320  func (v *ExpireDelegationTokenRequest) UnsafeReadFrom(src []byte) error {
 29321  	return v.readFrom(src, true)
 29322  }
 29323  
 29324  func (v *ExpireDelegationTokenRequest) readFrom(src []byte, unsafe bool) error {
 29325  	v.Default()
 29326  	b := kbin.Reader{Src: src}
 29327  	version := v.Version
 29328  	_ = version
 29329  	isFlexible := version >= 2
 29330  	_ = isFlexible
 29331  	s := v
 29332  	{
 29333  		var v []byte
 29334  		if isFlexible {
 29335  			v = b.CompactBytes()
 29336  		} else {
 29337  			v = b.Bytes()
 29338  		}
 29339  		s.HMAC = v
 29340  	}
 29341  	{
 29342  		v := b.Int64()
 29343  		s.ExpiryPeriodMillis = v
 29344  	}
 29345  	if isFlexible {
 29346  		s.UnknownTags = internalReadTags(&b)
 29347  	}
 29348  	return b.Complete()
 29349  }
 29350  
 29351  // NewPtrExpireDelegationTokenRequest returns a pointer to a default ExpireDelegationTokenRequest
 29352  // This is a shortcut for creating a new(struct) and calling Default yourself.
 29353  func NewPtrExpireDelegationTokenRequest() *ExpireDelegationTokenRequest {
 29354  	var v ExpireDelegationTokenRequest
 29355  	v.Default()
 29356  	return &v
 29357  }
 29358  
 29359  // Default sets any default fields. Calling this allows for future compatibility
 29360  // if new fields are added to ExpireDelegationTokenRequest.
 29361  func (v *ExpireDelegationTokenRequest) Default() {
 29362  }
 29363  
 29364  // NewExpireDelegationTokenRequest returns a default ExpireDelegationTokenRequest
 29365  // This is a shortcut for creating a struct and calling Default yourself.
 29366  func NewExpireDelegationTokenRequest() ExpireDelegationTokenRequest {
 29367  	var v ExpireDelegationTokenRequest
 29368  	v.Default()
 29369  	return v
 29370  }
 29371  
 29372  // ExpireDelegationTokenResponse is a response to an ExpireDelegationTokenRequest.
 29373  type ExpireDelegationTokenResponse struct {
 29374  	// Version is the version of this message used with a Kafka broker.
 29375  	Version int16
 29376  
 29377  	// ErrorCode is any error that caused the request to fail.
 29378  	ErrorCode int16
 29379  
 29380  	// ExpiryTimestamp is the new timestamp at which the delegation token will
 29381  	// expire.
 29382  	ExpiryTimestamp int64
 29383  
 29384  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 29385  	// after this request.
 29386  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 29387  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 29388  	//
 29389  	// This request switched at version 1.
 29390  	ThrottleMillis int32
 29391  
 29392  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29393  	UnknownTags Tags // v2+
 29394  }
 29395  
 29396  func (*ExpireDelegationTokenResponse) Key() int16                 { return 40 }
 29397  func (*ExpireDelegationTokenResponse) MaxVersion() int16          { return 2 }
 29398  func (v *ExpireDelegationTokenResponse) SetVersion(version int16) { v.Version = version }
 29399  func (v *ExpireDelegationTokenResponse) GetVersion() int16        { return v.Version }
 29400  func (v *ExpireDelegationTokenResponse) IsFlexible() bool         { return v.Version >= 2 }
 29401  func (v *ExpireDelegationTokenResponse) Throttle() (int32, bool) {
 29402  	return v.ThrottleMillis, v.Version >= 1
 29403  }
 29404  
 29405  func (v *ExpireDelegationTokenResponse) SetThrottle(throttleMillis int32) {
 29406  	v.ThrottleMillis = throttleMillis
 29407  }
 29408  
 29409  func (v *ExpireDelegationTokenResponse) RequestKind() Request {
 29410  	return &ExpireDelegationTokenRequest{Version: v.Version}
 29411  }
 29412  
 29413  func (v *ExpireDelegationTokenResponse) AppendTo(dst []byte) []byte {
 29414  	version := v.Version
 29415  	_ = version
 29416  	isFlexible := version >= 2
 29417  	_ = isFlexible
 29418  	{
 29419  		v := v.ErrorCode
 29420  		dst = kbin.AppendInt16(dst, v)
 29421  	}
 29422  	{
 29423  		v := v.ExpiryTimestamp
 29424  		dst = kbin.AppendInt64(dst, v)
 29425  	}
 29426  	{
 29427  		v := v.ThrottleMillis
 29428  		dst = kbin.AppendInt32(dst, v)
 29429  	}
 29430  	if isFlexible {
 29431  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29432  		dst = v.UnknownTags.AppendEach(dst)
 29433  	}
 29434  	return dst
 29435  }
 29436  
 29437  func (v *ExpireDelegationTokenResponse) ReadFrom(src []byte) error {
 29438  	return v.readFrom(src, false)
 29439  }
 29440  
 29441  func (v *ExpireDelegationTokenResponse) UnsafeReadFrom(src []byte) error {
 29442  	return v.readFrom(src, true)
 29443  }
 29444  
 29445  func (v *ExpireDelegationTokenResponse) readFrom(src []byte, unsafe bool) error {
 29446  	v.Default()
 29447  	b := kbin.Reader{Src: src}
 29448  	version := v.Version
 29449  	_ = version
 29450  	isFlexible := version >= 2
 29451  	_ = isFlexible
 29452  	s := v
 29453  	{
 29454  		v := b.Int16()
 29455  		s.ErrorCode = v
 29456  	}
 29457  	{
 29458  		v := b.Int64()
 29459  		s.ExpiryTimestamp = v
 29460  	}
 29461  	{
 29462  		v := b.Int32()
 29463  		s.ThrottleMillis = v
 29464  	}
 29465  	if isFlexible {
 29466  		s.UnknownTags = internalReadTags(&b)
 29467  	}
 29468  	return b.Complete()
 29469  }
 29470  
 29471  // NewPtrExpireDelegationTokenResponse returns a pointer to a default ExpireDelegationTokenResponse
 29472  // This is a shortcut for creating a new(struct) and calling Default yourself.
 29473  func NewPtrExpireDelegationTokenResponse() *ExpireDelegationTokenResponse {
 29474  	var v ExpireDelegationTokenResponse
 29475  	v.Default()
 29476  	return &v
 29477  }
 29478  
 29479  // Default sets any default fields. Calling this allows for future compatibility
 29480  // if new fields are added to ExpireDelegationTokenResponse.
 29481  func (v *ExpireDelegationTokenResponse) Default() {
 29482  }
 29483  
 29484  // NewExpireDelegationTokenResponse returns a default ExpireDelegationTokenResponse
 29485  // This is a shortcut for creating a struct and calling Default yourself.
 29486  func NewExpireDelegationTokenResponse() ExpireDelegationTokenResponse {
 29487  	var v ExpireDelegationTokenResponse
 29488  	v.Default()
 29489  	return v
 29490  }
 29491  
 29492  type DescribeDelegationTokenRequestOwner struct {
 29493  	// PrincipalType is a type to match to describe delegation tokens created
 29494  	// with this principal. This would be "User" with the simple authorizer.
 29495  	PrincipalType string
 29496  
 29497  	// PrincipalName is the name to match to describe delegation tokens created
 29498  	// with this principal.
 29499  	PrincipalName string
 29500  
 29501  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29502  	UnknownTags Tags // v2+
 29503  }
 29504  
 29505  // Default sets any default fields. Calling this allows for future compatibility
 29506  // if new fields are added to DescribeDelegationTokenRequestOwner.
 29507  func (v *DescribeDelegationTokenRequestOwner) Default() {
 29508  }
 29509  
 29510  // NewDescribeDelegationTokenRequestOwner returns a default DescribeDelegationTokenRequestOwner
 29511  // This is a shortcut for creating a struct and calling Default yourself.
 29512  func NewDescribeDelegationTokenRequestOwner() DescribeDelegationTokenRequestOwner {
 29513  	var v DescribeDelegationTokenRequestOwner
 29514  	v.Default()
 29515  	return v
 29516  }
 29517  
 29518  // DescribeDelegationTokenRequest is a request to describe delegation tokens.
 29519  type DescribeDelegationTokenRequest struct {
 29520  	// Version is the version of this message used with a Kafka broker.
 29521  	Version int16
 29522  
 29523  	// Owners contains owners to describe delegation tokens for, or null for all.
 29524  	// If non-null, only tokens created from a matching principal type, name
 29525  	// combination are printed.
 29526  	Owners []DescribeDelegationTokenRequestOwner
 29527  
 29528  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29529  	UnknownTags Tags // v2+
 29530  }
 29531  
 29532  func (*DescribeDelegationTokenRequest) Key() int16                 { return 41 }
 29533  func (*DescribeDelegationTokenRequest) MaxVersion() int16          { return 3 }
 29534  func (v *DescribeDelegationTokenRequest) SetVersion(version int16) { v.Version = version }
 29535  func (v *DescribeDelegationTokenRequest) GetVersion() int16        { return v.Version }
 29536  func (v *DescribeDelegationTokenRequest) IsFlexible() bool         { return v.Version >= 2 }
 29537  func (v *DescribeDelegationTokenRequest) ResponseKind() Response {
 29538  	r := &DescribeDelegationTokenResponse{Version: v.Version}
 29539  	r.Default()
 29540  	return r
 29541  }
 29542  
 29543  // RequestWith is requests v on r and returns the response or an error.
 29544  // For sharded requests, the response may be merged and still return an error.
 29545  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 29546  func (v *DescribeDelegationTokenRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeDelegationTokenResponse, error) {
 29547  	kresp, err := r.Request(ctx, v)
 29548  	resp, _ := kresp.(*DescribeDelegationTokenResponse)
 29549  	return resp, err
 29550  }
 29551  
 29552  func (v *DescribeDelegationTokenRequest) AppendTo(dst []byte) []byte {
 29553  	version := v.Version
 29554  	_ = version
 29555  	isFlexible := version >= 2
 29556  	_ = isFlexible
 29557  	{
 29558  		v := v.Owners
 29559  		if isFlexible {
 29560  			dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 29561  		} else {
 29562  			dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 29563  		}
 29564  		for i := range v {
 29565  			v := &v[i]
 29566  			{
 29567  				v := v.PrincipalType
 29568  				if isFlexible {
 29569  					dst = kbin.AppendCompactString(dst, v)
 29570  				} else {
 29571  					dst = kbin.AppendString(dst, v)
 29572  				}
 29573  			}
 29574  			{
 29575  				v := v.PrincipalName
 29576  				if isFlexible {
 29577  					dst = kbin.AppendCompactString(dst, v)
 29578  				} else {
 29579  					dst = kbin.AppendString(dst, v)
 29580  				}
 29581  			}
 29582  			if isFlexible {
 29583  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29584  				dst = v.UnknownTags.AppendEach(dst)
 29585  			}
 29586  		}
 29587  	}
 29588  	if isFlexible {
 29589  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29590  		dst = v.UnknownTags.AppendEach(dst)
 29591  	}
 29592  	return dst
 29593  }
 29594  
 29595  func (v *DescribeDelegationTokenRequest) ReadFrom(src []byte) error {
 29596  	return v.readFrom(src, false)
 29597  }
 29598  
 29599  func (v *DescribeDelegationTokenRequest) UnsafeReadFrom(src []byte) error {
 29600  	return v.readFrom(src, true)
 29601  }
 29602  
 29603  func (v *DescribeDelegationTokenRequest) readFrom(src []byte, unsafe bool) error {
 29604  	v.Default()
 29605  	b := kbin.Reader{Src: src}
 29606  	version := v.Version
 29607  	_ = version
 29608  	isFlexible := version >= 2
 29609  	_ = isFlexible
 29610  	s := v
 29611  	{
 29612  		v := s.Owners
 29613  		a := v
 29614  		var l int32
 29615  		if isFlexible {
 29616  			l = b.CompactArrayLen()
 29617  		} else {
 29618  			l = b.ArrayLen()
 29619  		}
 29620  		if version < 0 || l == 0 {
 29621  			a = []DescribeDelegationTokenRequestOwner{}
 29622  		}
 29623  		if !b.Ok() {
 29624  			return b.Complete()
 29625  		}
 29626  		a = a[:0]
 29627  		if l > 0 {
 29628  			a = append(a, make([]DescribeDelegationTokenRequestOwner, l)...)
 29629  		}
 29630  		for i := int32(0); i < l; i++ {
 29631  			v := &a[i]
 29632  			v.Default()
 29633  			s := v
 29634  			{
 29635  				var v string
 29636  				if unsafe {
 29637  					if isFlexible {
 29638  						v = b.UnsafeCompactString()
 29639  					} else {
 29640  						v = b.UnsafeString()
 29641  					}
 29642  				} else {
 29643  					if isFlexible {
 29644  						v = b.CompactString()
 29645  					} else {
 29646  						v = b.String()
 29647  					}
 29648  				}
 29649  				s.PrincipalType = v
 29650  			}
 29651  			{
 29652  				var v string
 29653  				if unsafe {
 29654  					if isFlexible {
 29655  						v = b.UnsafeCompactString()
 29656  					} else {
 29657  						v = b.UnsafeString()
 29658  					}
 29659  				} else {
 29660  					if isFlexible {
 29661  						v = b.CompactString()
 29662  					} else {
 29663  						v = b.String()
 29664  					}
 29665  				}
 29666  				s.PrincipalName = v
 29667  			}
 29668  			if isFlexible {
 29669  				s.UnknownTags = internalReadTags(&b)
 29670  			}
 29671  		}
 29672  		v = a
 29673  		s.Owners = v
 29674  	}
 29675  	if isFlexible {
 29676  		s.UnknownTags = internalReadTags(&b)
 29677  	}
 29678  	return b.Complete()
 29679  }
 29680  
 29681  // NewPtrDescribeDelegationTokenRequest returns a pointer to a default DescribeDelegationTokenRequest
 29682  // This is a shortcut for creating a new(struct) and calling Default yourself.
 29683  func NewPtrDescribeDelegationTokenRequest() *DescribeDelegationTokenRequest {
 29684  	var v DescribeDelegationTokenRequest
 29685  	v.Default()
 29686  	return &v
 29687  }
 29688  
 29689  // Default sets any default fields. Calling this allows for future compatibility
 29690  // if new fields are added to DescribeDelegationTokenRequest.
 29691  func (v *DescribeDelegationTokenRequest) Default() {
 29692  }
 29693  
 29694  // NewDescribeDelegationTokenRequest returns a default DescribeDelegationTokenRequest
 29695  // This is a shortcut for creating a struct and calling Default yourself.
 29696  func NewDescribeDelegationTokenRequest() DescribeDelegationTokenRequest {
 29697  	var v DescribeDelegationTokenRequest
 29698  	v.Default()
 29699  	return v
 29700  }
 29701  
 29702  type DescribeDelegationTokenResponseTokenDetailRenewer struct {
 29703  	PrincipalType string
 29704  
 29705  	PrincipalName string
 29706  
 29707  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29708  	UnknownTags Tags // v2+
 29709  }
 29710  
 29711  // Default sets any default fields. Calling this allows for future compatibility
 29712  // if new fields are added to DescribeDelegationTokenResponseTokenDetailRenewer.
 29713  func (v *DescribeDelegationTokenResponseTokenDetailRenewer) Default() {
 29714  }
 29715  
 29716  // NewDescribeDelegationTokenResponseTokenDetailRenewer returns a default DescribeDelegationTokenResponseTokenDetailRenewer
 29717  // This is a shortcut for creating a struct and calling Default yourself.
 29718  func NewDescribeDelegationTokenResponseTokenDetailRenewer() DescribeDelegationTokenResponseTokenDetailRenewer {
 29719  	var v DescribeDelegationTokenResponseTokenDetailRenewer
 29720  	v.Default()
 29721  	return v
 29722  }
 29723  
 29724  type DescribeDelegationTokenResponseTokenDetail struct {
 29725  	// PrincipalType is the principal type of who created this token.
 29726  	PrincipalType string
 29727  
 29728  	// PrincipalName is the principal name of who created this token.
 29729  	PrincipalName string
 29730  
 29731  	// The principal type of the requester of the token.
 29732  	TokenRequesterPrincipalType string // v3+
 29733  
 29734  	// The principal name of the requester token.
 29735  	TokenRequesterPrincipalName string // v3+
 29736  
 29737  	// IssueTimestamp is the millisecond timestamp of when this token was issued.
 29738  	IssueTimestamp int64
 29739  
 29740  	// ExpiryTimestamp is the millisecond timestamp of when this token will expire.
 29741  	ExpiryTimestamp int64
 29742  
 29743  	// MaxTimestamp is the millisecond timestamp past which whis token cannot
 29744  	// be renewed.
 29745  	MaxTimestamp int64
 29746  
 29747  	// TokenID is the ID (scram username) of this token.
 29748  	TokenID string
 29749  
 29750  	// HMAC is the password of this token.
 29751  	HMAC []byte
 29752  
 29753  	// Renewers is a list of users that can renew this token.
 29754  	Renewers []DescribeDelegationTokenResponseTokenDetailRenewer
 29755  
 29756  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29757  	UnknownTags Tags // v2+
 29758  }
 29759  
 29760  // Default sets any default fields. Calling this allows for future compatibility
 29761  // if new fields are added to DescribeDelegationTokenResponseTokenDetail.
 29762  func (v *DescribeDelegationTokenResponseTokenDetail) Default() {
 29763  }
 29764  
 29765  // NewDescribeDelegationTokenResponseTokenDetail returns a default DescribeDelegationTokenResponseTokenDetail
 29766  // This is a shortcut for creating a struct and calling Default yourself.
 29767  func NewDescribeDelegationTokenResponseTokenDetail() DescribeDelegationTokenResponseTokenDetail {
 29768  	var v DescribeDelegationTokenResponseTokenDetail
 29769  	v.Default()
 29770  	return v
 29771  }
 29772  
 29773  // DescribeDelegationTokenResponsee is a response to a DescribeDelegationTokenRequest.
 29774  type DescribeDelegationTokenResponse struct {
 29775  	// Version is the version of this message used with a Kafka broker.
 29776  	Version int16
 29777  
 29778  	// ErrorCode is any error that caused the request to fail.
 29779  	ErrorCode int16
 29780  
 29781  	// TokenDetails shows information about each token created from any principal
 29782  	// in the request.
 29783  	TokenDetails []DescribeDelegationTokenResponseTokenDetail
 29784  
 29785  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 29786  	// after this request.
 29787  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 29788  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 29789  	//
 29790  	// This request switched at version 1.
 29791  	ThrottleMillis int32
 29792  
 29793  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 29794  	UnknownTags Tags // v2+
 29795  }
 29796  
 29797  func (*DescribeDelegationTokenResponse) Key() int16                 { return 41 }
 29798  func (*DescribeDelegationTokenResponse) MaxVersion() int16          { return 3 }
 29799  func (v *DescribeDelegationTokenResponse) SetVersion(version int16) { v.Version = version }
 29800  func (v *DescribeDelegationTokenResponse) GetVersion() int16        { return v.Version }
 29801  func (v *DescribeDelegationTokenResponse) IsFlexible() bool         { return v.Version >= 2 }
 29802  func (v *DescribeDelegationTokenResponse) Throttle() (int32, bool) {
 29803  	return v.ThrottleMillis, v.Version >= 1
 29804  }
 29805  
 29806  func (v *DescribeDelegationTokenResponse) SetThrottle(throttleMillis int32) {
 29807  	v.ThrottleMillis = throttleMillis
 29808  }
 29809  
 29810  func (v *DescribeDelegationTokenResponse) RequestKind() Request {
 29811  	return &DescribeDelegationTokenRequest{Version: v.Version}
 29812  }
 29813  
 29814  func (v *DescribeDelegationTokenResponse) AppendTo(dst []byte) []byte {
 29815  	version := v.Version
 29816  	_ = version
 29817  	isFlexible := version >= 2
 29818  	_ = isFlexible
 29819  	{
 29820  		v := v.ErrorCode
 29821  		dst = kbin.AppendInt16(dst, v)
 29822  	}
 29823  	{
 29824  		v := v.TokenDetails
 29825  		if isFlexible {
 29826  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 29827  		} else {
 29828  			dst = kbin.AppendArrayLen(dst, len(v))
 29829  		}
 29830  		for i := range v {
 29831  			v := &v[i]
 29832  			{
 29833  				v := v.PrincipalType
 29834  				if isFlexible {
 29835  					dst = kbin.AppendCompactString(dst, v)
 29836  				} else {
 29837  					dst = kbin.AppendString(dst, v)
 29838  				}
 29839  			}
 29840  			{
 29841  				v := v.PrincipalName
 29842  				if isFlexible {
 29843  					dst = kbin.AppendCompactString(dst, v)
 29844  				} else {
 29845  					dst = kbin.AppendString(dst, v)
 29846  				}
 29847  			}
 29848  			if version >= 3 {
 29849  				v := v.TokenRequesterPrincipalType
 29850  				if isFlexible {
 29851  					dst = kbin.AppendCompactString(dst, v)
 29852  				} else {
 29853  					dst = kbin.AppendString(dst, v)
 29854  				}
 29855  			}
 29856  			if version >= 3 {
 29857  				v := v.TokenRequesterPrincipalName
 29858  				if isFlexible {
 29859  					dst = kbin.AppendCompactString(dst, v)
 29860  				} else {
 29861  					dst = kbin.AppendString(dst, v)
 29862  				}
 29863  			}
 29864  			{
 29865  				v := v.IssueTimestamp
 29866  				dst = kbin.AppendInt64(dst, v)
 29867  			}
 29868  			{
 29869  				v := v.ExpiryTimestamp
 29870  				dst = kbin.AppendInt64(dst, v)
 29871  			}
 29872  			{
 29873  				v := v.MaxTimestamp
 29874  				dst = kbin.AppendInt64(dst, v)
 29875  			}
 29876  			{
 29877  				v := v.TokenID
 29878  				if isFlexible {
 29879  					dst = kbin.AppendCompactString(dst, v)
 29880  				} else {
 29881  					dst = kbin.AppendString(dst, v)
 29882  				}
 29883  			}
 29884  			{
 29885  				v := v.HMAC
 29886  				if isFlexible {
 29887  					dst = kbin.AppendCompactBytes(dst, v)
 29888  				} else {
 29889  					dst = kbin.AppendBytes(dst, v)
 29890  				}
 29891  			}
 29892  			{
 29893  				v := v.Renewers
 29894  				if isFlexible {
 29895  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 29896  				} else {
 29897  					dst = kbin.AppendArrayLen(dst, len(v))
 29898  				}
 29899  				for i := range v {
 29900  					v := &v[i]
 29901  					{
 29902  						v := v.PrincipalType
 29903  						if isFlexible {
 29904  							dst = kbin.AppendCompactString(dst, v)
 29905  						} else {
 29906  							dst = kbin.AppendString(dst, v)
 29907  						}
 29908  					}
 29909  					{
 29910  						v := v.PrincipalName
 29911  						if isFlexible {
 29912  							dst = kbin.AppendCompactString(dst, v)
 29913  						} else {
 29914  							dst = kbin.AppendString(dst, v)
 29915  						}
 29916  					}
 29917  					if isFlexible {
 29918  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29919  						dst = v.UnknownTags.AppendEach(dst)
 29920  					}
 29921  				}
 29922  			}
 29923  			if isFlexible {
 29924  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29925  				dst = v.UnknownTags.AppendEach(dst)
 29926  			}
 29927  		}
 29928  	}
 29929  	{
 29930  		v := v.ThrottleMillis
 29931  		dst = kbin.AppendInt32(dst, v)
 29932  	}
 29933  	if isFlexible {
 29934  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 29935  		dst = v.UnknownTags.AppendEach(dst)
 29936  	}
 29937  	return dst
 29938  }
 29939  
 29940  func (v *DescribeDelegationTokenResponse) ReadFrom(src []byte) error {
 29941  	return v.readFrom(src, false)
 29942  }
 29943  
 29944  func (v *DescribeDelegationTokenResponse) UnsafeReadFrom(src []byte) error {
 29945  	return v.readFrom(src, true)
 29946  }
 29947  
 29948  func (v *DescribeDelegationTokenResponse) readFrom(src []byte, unsafe bool) error {
 29949  	v.Default()
 29950  	b := kbin.Reader{Src: src}
 29951  	version := v.Version
 29952  	_ = version
 29953  	isFlexible := version >= 2
 29954  	_ = isFlexible
 29955  	s := v
 29956  	{
 29957  		v := b.Int16()
 29958  		s.ErrorCode = v
 29959  	}
 29960  	{
 29961  		v := s.TokenDetails
 29962  		a := v
 29963  		var l int32
 29964  		if isFlexible {
 29965  			l = b.CompactArrayLen()
 29966  		} else {
 29967  			l = b.ArrayLen()
 29968  		}
 29969  		if !b.Ok() {
 29970  			return b.Complete()
 29971  		}
 29972  		a = a[:0]
 29973  		if l > 0 {
 29974  			a = append(a, make([]DescribeDelegationTokenResponseTokenDetail, l)...)
 29975  		}
 29976  		for i := int32(0); i < l; i++ {
 29977  			v := &a[i]
 29978  			v.Default()
 29979  			s := v
 29980  			{
 29981  				var v string
 29982  				if unsafe {
 29983  					if isFlexible {
 29984  						v = b.UnsafeCompactString()
 29985  					} else {
 29986  						v = b.UnsafeString()
 29987  					}
 29988  				} else {
 29989  					if isFlexible {
 29990  						v = b.CompactString()
 29991  					} else {
 29992  						v = b.String()
 29993  					}
 29994  				}
 29995  				s.PrincipalType = v
 29996  			}
 29997  			{
 29998  				var v string
 29999  				if unsafe {
 30000  					if isFlexible {
 30001  						v = b.UnsafeCompactString()
 30002  					} else {
 30003  						v = b.UnsafeString()
 30004  					}
 30005  				} else {
 30006  					if isFlexible {
 30007  						v = b.CompactString()
 30008  					} else {
 30009  						v = b.String()
 30010  					}
 30011  				}
 30012  				s.PrincipalName = v
 30013  			}
 30014  			if version >= 3 {
 30015  				var v string
 30016  				if unsafe {
 30017  					if isFlexible {
 30018  						v = b.UnsafeCompactString()
 30019  					} else {
 30020  						v = b.UnsafeString()
 30021  					}
 30022  				} else {
 30023  					if isFlexible {
 30024  						v = b.CompactString()
 30025  					} else {
 30026  						v = b.String()
 30027  					}
 30028  				}
 30029  				s.TokenRequesterPrincipalType = v
 30030  			}
 30031  			if version >= 3 {
 30032  				var v string
 30033  				if unsafe {
 30034  					if isFlexible {
 30035  						v = b.UnsafeCompactString()
 30036  					} else {
 30037  						v = b.UnsafeString()
 30038  					}
 30039  				} else {
 30040  					if isFlexible {
 30041  						v = b.CompactString()
 30042  					} else {
 30043  						v = b.String()
 30044  					}
 30045  				}
 30046  				s.TokenRequesterPrincipalName = v
 30047  			}
 30048  			{
 30049  				v := b.Int64()
 30050  				s.IssueTimestamp = v
 30051  			}
 30052  			{
 30053  				v := b.Int64()
 30054  				s.ExpiryTimestamp = v
 30055  			}
 30056  			{
 30057  				v := b.Int64()
 30058  				s.MaxTimestamp = v
 30059  			}
 30060  			{
 30061  				var v string
 30062  				if unsafe {
 30063  					if isFlexible {
 30064  						v = b.UnsafeCompactString()
 30065  					} else {
 30066  						v = b.UnsafeString()
 30067  					}
 30068  				} else {
 30069  					if isFlexible {
 30070  						v = b.CompactString()
 30071  					} else {
 30072  						v = b.String()
 30073  					}
 30074  				}
 30075  				s.TokenID = v
 30076  			}
 30077  			{
 30078  				var v []byte
 30079  				if isFlexible {
 30080  					v = b.CompactBytes()
 30081  				} else {
 30082  					v = b.Bytes()
 30083  				}
 30084  				s.HMAC = v
 30085  			}
 30086  			{
 30087  				v := s.Renewers
 30088  				a := v
 30089  				var l int32
 30090  				if isFlexible {
 30091  					l = b.CompactArrayLen()
 30092  				} else {
 30093  					l = b.ArrayLen()
 30094  				}
 30095  				if !b.Ok() {
 30096  					return b.Complete()
 30097  				}
 30098  				a = a[:0]
 30099  				if l > 0 {
 30100  					a = append(a, make([]DescribeDelegationTokenResponseTokenDetailRenewer, l)...)
 30101  				}
 30102  				for i := int32(0); i < l; i++ {
 30103  					v := &a[i]
 30104  					v.Default()
 30105  					s := v
 30106  					{
 30107  						var v string
 30108  						if unsafe {
 30109  							if isFlexible {
 30110  								v = b.UnsafeCompactString()
 30111  							} else {
 30112  								v = b.UnsafeString()
 30113  							}
 30114  						} else {
 30115  							if isFlexible {
 30116  								v = b.CompactString()
 30117  							} else {
 30118  								v = b.String()
 30119  							}
 30120  						}
 30121  						s.PrincipalType = v
 30122  					}
 30123  					{
 30124  						var v string
 30125  						if unsafe {
 30126  							if isFlexible {
 30127  								v = b.UnsafeCompactString()
 30128  							} else {
 30129  								v = b.UnsafeString()
 30130  							}
 30131  						} else {
 30132  							if isFlexible {
 30133  								v = b.CompactString()
 30134  							} else {
 30135  								v = b.String()
 30136  							}
 30137  						}
 30138  						s.PrincipalName = v
 30139  					}
 30140  					if isFlexible {
 30141  						s.UnknownTags = internalReadTags(&b)
 30142  					}
 30143  				}
 30144  				v = a
 30145  				s.Renewers = v
 30146  			}
 30147  			if isFlexible {
 30148  				s.UnknownTags = internalReadTags(&b)
 30149  			}
 30150  		}
 30151  		v = a
 30152  		s.TokenDetails = v
 30153  	}
 30154  	{
 30155  		v := b.Int32()
 30156  		s.ThrottleMillis = v
 30157  	}
 30158  	if isFlexible {
 30159  		s.UnknownTags = internalReadTags(&b)
 30160  	}
 30161  	return b.Complete()
 30162  }
 30163  
 30164  // NewPtrDescribeDelegationTokenResponse returns a pointer to a default DescribeDelegationTokenResponse
 30165  // This is a shortcut for creating a new(struct) and calling Default yourself.
 30166  func NewPtrDescribeDelegationTokenResponse() *DescribeDelegationTokenResponse {
 30167  	var v DescribeDelegationTokenResponse
 30168  	v.Default()
 30169  	return &v
 30170  }
 30171  
 30172  // Default sets any default fields. Calling this allows for future compatibility
 30173  // if new fields are added to DescribeDelegationTokenResponse.
 30174  func (v *DescribeDelegationTokenResponse) Default() {
 30175  }
 30176  
 30177  // NewDescribeDelegationTokenResponse returns a default DescribeDelegationTokenResponse
 30178  // This is a shortcut for creating a struct and calling Default yourself.
 30179  func NewDescribeDelegationTokenResponse() DescribeDelegationTokenResponse {
 30180  	var v DescribeDelegationTokenResponse
 30181  	v.Default()
 30182  	return v
 30183  }
 30184  
 30185  // DeleteGroupsRequest deletes consumer groups. This request was added for
 30186  // Kafka 1.1.0 corresponding to the removal of RetentionTimeMillis from
 30187  // OffsetCommitRequest. See KIP-229 for more details.
 30188  type DeleteGroupsRequest struct {
 30189  	// Version is the version of this message used with a Kafka broker.
 30190  	Version int16
 30191  
 30192  	// Groups is a list of groups to delete.
 30193  	Groups []string
 30194  
 30195  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30196  	UnknownTags Tags // v2+
 30197  }
 30198  
 30199  func (*DeleteGroupsRequest) Key() int16                   { return 42 }
 30200  func (*DeleteGroupsRequest) MaxVersion() int16            { return 2 }
 30201  func (v *DeleteGroupsRequest) SetVersion(version int16)   { v.Version = version }
 30202  func (v *DeleteGroupsRequest) GetVersion() int16          { return v.Version }
 30203  func (v *DeleteGroupsRequest) IsFlexible() bool           { return v.Version >= 2 }
 30204  func (v *DeleteGroupsRequest) IsGroupCoordinatorRequest() {}
 30205  func (v *DeleteGroupsRequest) ResponseKind() Response {
 30206  	r := &DeleteGroupsResponse{Version: v.Version}
 30207  	r.Default()
 30208  	return r
 30209  }
 30210  
 30211  // RequestWith is requests v on r and returns the response or an error.
 30212  // For sharded requests, the response may be merged and still return an error.
 30213  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 30214  func (v *DeleteGroupsRequest) RequestWith(ctx context.Context, r Requestor) (*DeleteGroupsResponse, error) {
 30215  	kresp, err := r.Request(ctx, v)
 30216  	resp, _ := kresp.(*DeleteGroupsResponse)
 30217  	return resp, err
 30218  }
 30219  
 30220  func (v *DeleteGroupsRequest) AppendTo(dst []byte) []byte {
 30221  	version := v.Version
 30222  	_ = version
 30223  	isFlexible := version >= 2
 30224  	_ = isFlexible
 30225  	{
 30226  		v := v.Groups
 30227  		if isFlexible {
 30228  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 30229  		} else {
 30230  			dst = kbin.AppendArrayLen(dst, len(v))
 30231  		}
 30232  		for i := range v {
 30233  			v := v[i]
 30234  			if isFlexible {
 30235  				dst = kbin.AppendCompactString(dst, v)
 30236  			} else {
 30237  				dst = kbin.AppendString(dst, v)
 30238  			}
 30239  		}
 30240  	}
 30241  	if isFlexible {
 30242  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30243  		dst = v.UnknownTags.AppendEach(dst)
 30244  	}
 30245  	return dst
 30246  }
 30247  
 30248  func (v *DeleteGroupsRequest) ReadFrom(src []byte) error {
 30249  	return v.readFrom(src, false)
 30250  }
 30251  
 30252  func (v *DeleteGroupsRequest) UnsafeReadFrom(src []byte) error {
 30253  	return v.readFrom(src, true)
 30254  }
 30255  
 30256  func (v *DeleteGroupsRequest) readFrom(src []byte, unsafe bool) error {
 30257  	v.Default()
 30258  	b := kbin.Reader{Src: src}
 30259  	version := v.Version
 30260  	_ = version
 30261  	isFlexible := version >= 2
 30262  	_ = isFlexible
 30263  	s := v
 30264  	{
 30265  		v := s.Groups
 30266  		a := v
 30267  		var l int32
 30268  		if isFlexible {
 30269  			l = b.CompactArrayLen()
 30270  		} else {
 30271  			l = b.ArrayLen()
 30272  		}
 30273  		if !b.Ok() {
 30274  			return b.Complete()
 30275  		}
 30276  		a = a[:0]
 30277  		if l > 0 {
 30278  			a = append(a, make([]string, l)...)
 30279  		}
 30280  		for i := int32(0); i < l; i++ {
 30281  			var v string
 30282  			if unsafe {
 30283  				if isFlexible {
 30284  					v = b.UnsafeCompactString()
 30285  				} else {
 30286  					v = b.UnsafeString()
 30287  				}
 30288  			} else {
 30289  				if isFlexible {
 30290  					v = b.CompactString()
 30291  				} else {
 30292  					v = b.String()
 30293  				}
 30294  			}
 30295  			a[i] = v
 30296  		}
 30297  		v = a
 30298  		s.Groups = v
 30299  	}
 30300  	if isFlexible {
 30301  		s.UnknownTags = internalReadTags(&b)
 30302  	}
 30303  	return b.Complete()
 30304  }
 30305  
 30306  // NewPtrDeleteGroupsRequest returns a pointer to a default DeleteGroupsRequest
 30307  // This is a shortcut for creating a new(struct) and calling Default yourself.
 30308  func NewPtrDeleteGroupsRequest() *DeleteGroupsRequest {
 30309  	var v DeleteGroupsRequest
 30310  	v.Default()
 30311  	return &v
 30312  }
 30313  
 30314  // Default sets any default fields. Calling this allows for future compatibility
 30315  // if new fields are added to DeleteGroupsRequest.
 30316  func (v *DeleteGroupsRequest) Default() {
 30317  }
 30318  
 30319  // NewDeleteGroupsRequest returns a default DeleteGroupsRequest
 30320  // This is a shortcut for creating a struct and calling Default yourself.
 30321  func NewDeleteGroupsRequest() DeleteGroupsRequest {
 30322  	var v DeleteGroupsRequest
 30323  	v.Default()
 30324  	return v
 30325  }
 30326  
 30327  type DeleteGroupsResponseGroup struct {
 30328  	// Group is a group ID requested for deletion.
 30329  	Group string
 30330  
 30331  	// ErrorCode is the error code returned for this group's deletion request.
 30332  	//
 30333  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 30334  	// to delete a group.
 30335  	//
 30336  	// INVALID_GROUP_ID is returned if the requested group ID is invalid.
 30337  	//
 30338  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator for this
 30339  	// group is not yet active.
 30340  	//
 30341  	// GROUP_ID_NOT_FOUND is returned if the group ID does not exist.
 30342  	//
 30343  	// NON_EMPTY_GROUP is returned if attempting to delete a group that is
 30344  	// not in the empty state.
 30345  	ErrorCode int16
 30346  
 30347  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30348  	UnknownTags Tags // v2+
 30349  }
 30350  
 30351  // Default sets any default fields. Calling this allows for future compatibility
 30352  // if new fields are added to DeleteGroupsResponseGroup.
 30353  func (v *DeleteGroupsResponseGroup) Default() {
 30354  }
 30355  
 30356  // NewDeleteGroupsResponseGroup returns a default DeleteGroupsResponseGroup
 30357  // This is a shortcut for creating a struct and calling Default yourself.
 30358  func NewDeleteGroupsResponseGroup() DeleteGroupsResponseGroup {
 30359  	var v DeleteGroupsResponseGroup
 30360  	v.Default()
 30361  	return v
 30362  }
 30363  
 30364  // DeleteGroupsResponse is returned from a DeleteGroupsRequest.
 30365  type DeleteGroupsResponse struct {
 30366  	// Version is the version of this message used with a Kafka broker.
 30367  	Version int16
 30368  
 30369  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 30370  	// after this request.
 30371  	// For Kafka < 2.0.0, the throttle is applied before issuing a response.
 30372  	// For Kafka >= 2.0.0, the throttle is applied after issuing a response.
 30373  	//
 30374  	// This request switched at version 1.
 30375  	ThrottleMillis int32
 30376  
 30377  	// Groups are the responses to each group requested for deletion.
 30378  	Groups []DeleteGroupsResponseGroup
 30379  
 30380  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30381  	UnknownTags Tags // v2+
 30382  }
 30383  
 30384  func (*DeleteGroupsResponse) Key() int16                         { return 42 }
 30385  func (*DeleteGroupsResponse) MaxVersion() int16                  { return 2 }
 30386  func (v *DeleteGroupsResponse) SetVersion(version int16)         { v.Version = version }
 30387  func (v *DeleteGroupsResponse) GetVersion() int16                { return v.Version }
 30388  func (v *DeleteGroupsResponse) IsFlexible() bool                 { return v.Version >= 2 }
 30389  func (v *DeleteGroupsResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 1 }
 30390  func (v *DeleteGroupsResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 30391  func (v *DeleteGroupsResponse) RequestKind() Request             { return &DeleteGroupsRequest{Version: v.Version} }
 30392  
 30393  func (v *DeleteGroupsResponse) AppendTo(dst []byte) []byte {
 30394  	version := v.Version
 30395  	_ = version
 30396  	isFlexible := version >= 2
 30397  	_ = isFlexible
 30398  	{
 30399  		v := v.ThrottleMillis
 30400  		dst = kbin.AppendInt32(dst, v)
 30401  	}
 30402  	{
 30403  		v := v.Groups
 30404  		if isFlexible {
 30405  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 30406  		} else {
 30407  			dst = kbin.AppendArrayLen(dst, len(v))
 30408  		}
 30409  		for i := range v {
 30410  			v := &v[i]
 30411  			{
 30412  				v := v.Group
 30413  				if isFlexible {
 30414  					dst = kbin.AppendCompactString(dst, v)
 30415  				} else {
 30416  					dst = kbin.AppendString(dst, v)
 30417  				}
 30418  			}
 30419  			{
 30420  				v := v.ErrorCode
 30421  				dst = kbin.AppendInt16(dst, v)
 30422  			}
 30423  			if isFlexible {
 30424  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30425  				dst = v.UnknownTags.AppendEach(dst)
 30426  			}
 30427  		}
 30428  	}
 30429  	if isFlexible {
 30430  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30431  		dst = v.UnknownTags.AppendEach(dst)
 30432  	}
 30433  	return dst
 30434  }
 30435  
 30436  func (v *DeleteGroupsResponse) ReadFrom(src []byte) error {
 30437  	return v.readFrom(src, false)
 30438  }
 30439  
 30440  func (v *DeleteGroupsResponse) UnsafeReadFrom(src []byte) error {
 30441  	return v.readFrom(src, true)
 30442  }
 30443  
 30444  func (v *DeleteGroupsResponse) readFrom(src []byte, unsafe bool) error {
 30445  	v.Default()
 30446  	b := kbin.Reader{Src: src}
 30447  	version := v.Version
 30448  	_ = version
 30449  	isFlexible := version >= 2
 30450  	_ = isFlexible
 30451  	s := v
 30452  	{
 30453  		v := b.Int32()
 30454  		s.ThrottleMillis = v
 30455  	}
 30456  	{
 30457  		v := s.Groups
 30458  		a := v
 30459  		var l int32
 30460  		if isFlexible {
 30461  			l = b.CompactArrayLen()
 30462  		} else {
 30463  			l = b.ArrayLen()
 30464  		}
 30465  		if !b.Ok() {
 30466  			return b.Complete()
 30467  		}
 30468  		a = a[:0]
 30469  		if l > 0 {
 30470  			a = append(a, make([]DeleteGroupsResponseGroup, l)...)
 30471  		}
 30472  		for i := int32(0); i < l; i++ {
 30473  			v := &a[i]
 30474  			v.Default()
 30475  			s := v
 30476  			{
 30477  				var v string
 30478  				if unsafe {
 30479  					if isFlexible {
 30480  						v = b.UnsafeCompactString()
 30481  					} else {
 30482  						v = b.UnsafeString()
 30483  					}
 30484  				} else {
 30485  					if isFlexible {
 30486  						v = b.CompactString()
 30487  					} else {
 30488  						v = b.String()
 30489  					}
 30490  				}
 30491  				s.Group = v
 30492  			}
 30493  			{
 30494  				v := b.Int16()
 30495  				s.ErrorCode = v
 30496  			}
 30497  			if isFlexible {
 30498  				s.UnknownTags = internalReadTags(&b)
 30499  			}
 30500  		}
 30501  		v = a
 30502  		s.Groups = v
 30503  	}
 30504  	if isFlexible {
 30505  		s.UnknownTags = internalReadTags(&b)
 30506  	}
 30507  	return b.Complete()
 30508  }
 30509  
 30510  // NewPtrDeleteGroupsResponse returns a pointer to a default DeleteGroupsResponse
 30511  // This is a shortcut for creating a new(struct) and calling Default yourself.
 30512  func NewPtrDeleteGroupsResponse() *DeleteGroupsResponse {
 30513  	var v DeleteGroupsResponse
 30514  	v.Default()
 30515  	return &v
 30516  }
 30517  
 30518  // Default sets any default fields. Calling this allows for future compatibility
 30519  // if new fields are added to DeleteGroupsResponse.
 30520  func (v *DeleteGroupsResponse) Default() {
 30521  }
 30522  
 30523  // NewDeleteGroupsResponse returns a default DeleteGroupsResponse
 30524  // This is a shortcut for creating a struct and calling Default yourself.
 30525  func NewDeleteGroupsResponse() DeleteGroupsResponse {
 30526  	var v DeleteGroupsResponse
 30527  	v.Default()
 30528  	return v
 30529  }
 30530  
 30531  type ElectLeadersRequestTopic struct {
 30532  	// Topic is a topic to trigger leader elections for (but only for the
 30533  	// partitions below).
 30534  	Topic string
 30535  
 30536  	// Partitions is an array of partitions in a topic to trigger leader
 30537  	// elections for.
 30538  	Partitions []int32
 30539  
 30540  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30541  	UnknownTags Tags // v2+
 30542  }
 30543  
 30544  // Default sets any default fields. Calling this allows for future compatibility
 30545  // if new fields are added to ElectLeadersRequestTopic.
 30546  func (v *ElectLeadersRequestTopic) Default() {
 30547  }
 30548  
 30549  // NewElectLeadersRequestTopic returns a default ElectLeadersRequestTopic
 30550  // This is a shortcut for creating a struct and calling Default yourself.
 30551  func NewElectLeadersRequestTopic() ElectLeadersRequestTopic {
 30552  	var v ElectLeadersRequestTopic
 30553  	v.Default()
 30554  	return v
 30555  }
 30556  
 30557  // ElectLeadersRequest begins a leader election for all given topic
 30558  // partitions. This request was added in Kafka 2.2.0 to replace the zookeeper
 30559  // only option of triggering leader elections before. See KIP-183 for more
 30560  // details. KIP-460 introduced the ElectionType field with Kafka 2.4.0.
 30561  type ElectLeadersRequest struct {
 30562  	// Version is the version of this message used with a Kafka broker.
 30563  	Version int16
 30564  
 30565  	// ElectionType is the type of election to conduct. 0 elects the preferred
 30566  	// replica, 1 elects the first live replica if there are no in-sync replicas
 30567  	// (i.e., unclean leader election).
 30568  	ElectionType int8 // v1+
 30569  
 30570  	// Topics is an array of topics and corresponding partitions to
 30571  	// trigger leader elections for, or null for all.
 30572  	Topics []ElectLeadersRequestTopic
 30573  
 30574  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 30575  	// This field has no effect on Kafka's processing of the request; the request
 30576  	// will continue to be processed if the timeout is reached. If the timeout is
 30577  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 30578  	//
 30579  	// This field has a default of 60000.
 30580  	TimeoutMillis int32
 30581  
 30582  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30583  	UnknownTags Tags // v2+
 30584  }
 30585  
 30586  func (*ElectLeadersRequest) Key() int16                       { return 43 }
 30587  func (*ElectLeadersRequest) MaxVersion() int16                { return 2 }
 30588  func (v *ElectLeadersRequest) SetVersion(version int16)       { v.Version = version }
 30589  func (v *ElectLeadersRequest) GetVersion() int16              { return v.Version }
 30590  func (v *ElectLeadersRequest) IsFlexible() bool               { return v.Version >= 2 }
 30591  func (v *ElectLeadersRequest) Timeout() int32                 { return v.TimeoutMillis }
 30592  func (v *ElectLeadersRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
 30593  func (v *ElectLeadersRequest) IsAdminRequest()                {}
 30594  func (v *ElectLeadersRequest) ResponseKind() Response {
 30595  	r := &ElectLeadersResponse{Version: v.Version}
 30596  	r.Default()
 30597  	return r
 30598  }
 30599  
 30600  // RequestWith is requests v on r and returns the response or an error.
 30601  // For sharded requests, the response may be merged and still return an error.
 30602  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 30603  func (v *ElectLeadersRequest) RequestWith(ctx context.Context, r Requestor) (*ElectLeadersResponse, error) {
 30604  	kresp, err := r.Request(ctx, v)
 30605  	resp, _ := kresp.(*ElectLeadersResponse)
 30606  	return resp, err
 30607  }
 30608  
 30609  func (v *ElectLeadersRequest) AppendTo(dst []byte) []byte {
 30610  	version := v.Version
 30611  	_ = version
 30612  	isFlexible := version >= 2
 30613  	_ = isFlexible
 30614  	if version >= 1 {
 30615  		v := v.ElectionType
 30616  		dst = kbin.AppendInt8(dst, v)
 30617  	}
 30618  	{
 30619  		v := v.Topics
 30620  		if isFlexible {
 30621  			dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 30622  		} else {
 30623  			dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 30624  		}
 30625  		for i := range v {
 30626  			v := &v[i]
 30627  			{
 30628  				v := v.Topic
 30629  				if isFlexible {
 30630  					dst = kbin.AppendCompactString(dst, v)
 30631  				} else {
 30632  					dst = kbin.AppendString(dst, v)
 30633  				}
 30634  			}
 30635  			{
 30636  				v := v.Partitions
 30637  				if isFlexible {
 30638  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 30639  				} else {
 30640  					dst = kbin.AppendArrayLen(dst, len(v))
 30641  				}
 30642  				for i := range v {
 30643  					v := v[i]
 30644  					dst = kbin.AppendInt32(dst, v)
 30645  				}
 30646  			}
 30647  			if isFlexible {
 30648  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30649  				dst = v.UnknownTags.AppendEach(dst)
 30650  			}
 30651  		}
 30652  	}
 30653  	{
 30654  		v := v.TimeoutMillis
 30655  		dst = kbin.AppendInt32(dst, v)
 30656  	}
 30657  	if isFlexible {
 30658  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30659  		dst = v.UnknownTags.AppendEach(dst)
 30660  	}
 30661  	return dst
 30662  }
 30663  
 30664  func (v *ElectLeadersRequest) ReadFrom(src []byte) error {
 30665  	return v.readFrom(src, false)
 30666  }
 30667  
 30668  func (v *ElectLeadersRequest) UnsafeReadFrom(src []byte) error {
 30669  	return v.readFrom(src, true)
 30670  }
 30671  
 30672  func (v *ElectLeadersRequest) readFrom(src []byte, unsafe bool) error {
 30673  	v.Default()
 30674  	b := kbin.Reader{Src: src}
 30675  	version := v.Version
 30676  	_ = version
 30677  	isFlexible := version >= 2
 30678  	_ = isFlexible
 30679  	s := v
 30680  	if version >= 1 {
 30681  		v := b.Int8()
 30682  		s.ElectionType = v
 30683  	}
 30684  	{
 30685  		v := s.Topics
 30686  		a := v
 30687  		var l int32
 30688  		if isFlexible {
 30689  			l = b.CompactArrayLen()
 30690  		} else {
 30691  			l = b.ArrayLen()
 30692  		}
 30693  		if version < 0 || l == 0 {
 30694  			a = []ElectLeadersRequestTopic{}
 30695  		}
 30696  		if !b.Ok() {
 30697  			return b.Complete()
 30698  		}
 30699  		a = a[:0]
 30700  		if l > 0 {
 30701  			a = append(a, make([]ElectLeadersRequestTopic, l)...)
 30702  		}
 30703  		for i := int32(0); i < l; i++ {
 30704  			v := &a[i]
 30705  			v.Default()
 30706  			s := v
 30707  			{
 30708  				var v string
 30709  				if unsafe {
 30710  					if isFlexible {
 30711  						v = b.UnsafeCompactString()
 30712  					} else {
 30713  						v = b.UnsafeString()
 30714  					}
 30715  				} else {
 30716  					if isFlexible {
 30717  						v = b.CompactString()
 30718  					} else {
 30719  						v = b.String()
 30720  					}
 30721  				}
 30722  				s.Topic = v
 30723  			}
 30724  			{
 30725  				v := s.Partitions
 30726  				a := v
 30727  				var l int32
 30728  				if isFlexible {
 30729  					l = b.CompactArrayLen()
 30730  				} else {
 30731  					l = b.ArrayLen()
 30732  				}
 30733  				if !b.Ok() {
 30734  					return b.Complete()
 30735  				}
 30736  				a = a[:0]
 30737  				if l > 0 {
 30738  					a = append(a, make([]int32, l)...)
 30739  				}
 30740  				for i := int32(0); i < l; i++ {
 30741  					v := b.Int32()
 30742  					a[i] = v
 30743  				}
 30744  				v = a
 30745  				s.Partitions = v
 30746  			}
 30747  			if isFlexible {
 30748  				s.UnknownTags = internalReadTags(&b)
 30749  			}
 30750  		}
 30751  		v = a
 30752  		s.Topics = v
 30753  	}
 30754  	{
 30755  		v := b.Int32()
 30756  		s.TimeoutMillis = v
 30757  	}
 30758  	if isFlexible {
 30759  		s.UnknownTags = internalReadTags(&b)
 30760  	}
 30761  	return b.Complete()
 30762  }
 30763  
 30764  // NewPtrElectLeadersRequest returns a pointer to a default ElectLeadersRequest
 30765  // This is a shortcut for creating a new(struct) and calling Default yourself.
 30766  func NewPtrElectLeadersRequest() *ElectLeadersRequest {
 30767  	var v ElectLeadersRequest
 30768  	v.Default()
 30769  	return &v
 30770  }
 30771  
 30772  // Default sets any default fields. Calling this allows for future compatibility
 30773  // if new fields are added to ElectLeadersRequest.
 30774  func (v *ElectLeadersRequest) Default() {
 30775  	v.TimeoutMillis = 60000
 30776  }
 30777  
 30778  // NewElectLeadersRequest returns a default ElectLeadersRequest
 30779  // This is a shortcut for creating a struct and calling Default yourself.
 30780  func NewElectLeadersRequest() ElectLeadersRequest {
 30781  	var v ElectLeadersRequest
 30782  	v.Default()
 30783  	return v
 30784  }
 30785  
 30786  type ElectLeadersResponseTopicPartition struct {
 30787  	// Partition is the partition for this result.
 30788  	Partition int32
 30789  
 30790  	// ErrorCode is the error code returned for this topic/partition leader
 30791  	// election.
 30792  	//
 30793  	// CLUSTER_AUTHORIZATION_FAILED is returned if the client is not
 30794  	// authorized to trigger leader elections.
 30795  	//
 30796  	// NOT_CONTROLLER is returned if the request was not issued to a Kafka
 30797  	// controller.
 30798  	//
 30799  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the topic/partition does
 30800  	// not exist on any broker in the cluster (this is slightly different
 30801  	// from the usual meaning of a single broker not knowing of the topic
 30802  	// partition).
 30803  	//
 30804  	// PREFERRED_LEADER_NOT_AVAILABLE is returned if the preferred leader
 30805  	// could not be elected (for example, the preferred leader was not in
 30806  	// the ISR).
 30807  	ErrorCode int16
 30808  
 30809  	// ErrorMessage is an informative message if the leader election failed.
 30810  	ErrorMessage *string
 30811  
 30812  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30813  	UnknownTags Tags // v2+
 30814  }
 30815  
 30816  // Default sets any default fields. Calling this allows for future compatibility
 30817  // if new fields are added to ElectLeadersResponseTopicPartition.
 30818  func (v *ElectLeadersResponseTopicPartition) Default() {
 30819  }
 30820  
 30821  // NewElectLeadersResponseTopicPartition returns a default ElectLeadersResponseTopicPartition
 30822  // This is a shortcut for creating a struct and calling Default yourself.
 30823  func NewElectLeadersResponseTopicPartition() ElectLeadersResponseTopicPartition {
 30824  	var v ElectLeadersResponseTopicPartition
 30825  	v.Default()
 30826  	return v
 30827  }
 30828  
 30829  type ElectLeadersResponseTopic struct {
 30830  	// Topic is topic for the given partition results below.
 30831  	Topic string
 30832  
 30833  	// Partitions contains election results for a topic's partitions.
 30834  	Partitions []ElectLeadersResponseTopicPartition
 30835  
 30836  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30837  	UnknownTags Tags // v2+
 30838  }
 30839  
 30840  // Default sets any default fields. Calling this allows for future compatibility
 30841  // if new fields are added to ElectLeadersResponseTopic.
 30842  func (v *ElectLeadersResponseTopic) Default() {
 30843  }
 30844  
 30845  // NewElectLeadersResponseTopic returns a default ElectLeadersResponseTopic
 30846  // This is a shortcut for creating a struct and calling Default yourself.
 30847  func NewElectLeadersResponseTopic() ElectLeadersResponseTopic {
 30848  	var v ElectLeadersResponseTopic
 30849  	v.Default()
 30850  	return v
 30851  }
 30852  
 30853  // ElectLeadersResponse is a response for an ElectLeadersRequest.
 30854  type ElectLeadersResponse struct {
 30855  	// Version is the version of this message used with a Kafka broker.
 30856  	Version int16
 30857  
 30858  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 30859  	// after responding to this request.
 30860  	ThrottleMillis int32
 30861  
 30862  	// ErrorCode is any error that applies to all partitions.
 30863  	//
 30864  	// CLUSTER_AUTHORIZATION_FAILED is returned if the client is not
 30865  	// authorized to reassign partitions.
 30866  	ErrorCode int16 // v1+
 30867  
 30868  	// Topics contains leader election results for each requested topic.
 30869  	Topics []ElectLeadersResponseTopic
 30870  
 30871  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 30872  	UnknownTags Tags // v2+
 30873  }
 30874  
 30875  func (*ElectLeadersResponse) Key() int16                         { return 43 }
 30876  func (*ElectLeadersResponse) MaxVersion() int16                  { return 2 }
 30877  func (v *ElectLeadersResponse) SetVersion(version int16)         { v.Version = version }
 30878  func (v *ElectLeadersResponse) GetVersion() int16                { return v.Version }
 30879  func (v *ElectLeadersResponse) IsFlexible() bool                 { return v.Version >= 2 }
 30880  func (v *ElectLeadersResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 0 }
 30881  func (v *ElectLeadersResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 30882  func (v *ElectLeadersResponse) RequestKind() Request             { return &ElectLeadersRequest{Version: v.Version} }
 30883  
 30884  func (v *ElectLeadersResponse) AppendTo(dst []byte) []byte {
 30885  	version := v.Version
 30886  	_ = version
 30887  	isFlexible := version >= 2
 30888  	_ = isFlexible
 30889  	{
 30890  		v := v.ThrottleMillis
 30891  		dst = kbin.AppendInt32(dst, v)
 30892  	}
 30893  	if version >= 1 {
 30894  		v := v.ErrorCode
 30895  		dst = kbin.AppendInt16(dst, v)
 30896  	}
 30897  	{
 30898  		v := v.Topics
 30899  		if isFlexible {
 30900  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 30901  		} else {
 30902  			dst = kbin.AppendArrayLen(dst, len(v))
 30903  		}
 30904  		for i := range v {
 30905  			v := &v[i]
 30906  			{
 30907  				v := v.Topic
 30908  				if isFlexible {
 30909  					dst = kbin.AppendCompactString(dst, v)
 30910  				} else {
 30911  					dst = kbin.AppendString(dst, v)
 30912  				}
 30913  			}
 30914  			{
 30915  				v := v.Partitions
 30916  				if isFlexible {
 30917  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 30918  				} else {
 30919  					dst = kbin.AppendArrayLen(dst, len(v))
 30920  				}
 30921  				for i := range v {
 30922  					v := &v[i]
 30923  					{
 30924  						v := v.Partition
 30925  						dst = kbin.AppendInt32(dst, v)
 30926  					}
 30927  					{
 30928  						v := v.ErrorCode
 30929  						dst = kbin.AppendInt16(dst, v)
 30930  					}
 30931  					{
 30932  						v := v.ErrorMessage
 30933  						if isFlexible {
 30934  							dst = kbin.AppendCompactNullableString(dst, v)
 30935  						} else {
 30936  							dst = kbin.AppendNullableString(dst, v)
 30937  						}
 30938  					}
 30939  					if isFlexible {
 30940  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30941  						dst = v.UnknownTags.AppendEach(dst)
 30942  					}
 30943  				}
 30944  			}
 30945  			if isFlexible {
 30946  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30947  				dst = v.UnknownTags.AppendEach(dst)
 30948  			}
 30949  		}
 30950  	}
 30951  	if isFlexible {
 30952  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 30953  		dst = v.UnknownTags.AppendEach(dst)
 30954  	}
 30955  	return dst
 30956  }
 30957  
 30958  func (v *ElectLeadersResponse) ReadFrom(src []byte) error {
 30959  	return v.readFrom(src, false)
 30960  }
 30961  
 30962  func (v *ElectLeadersResponse) UnsafeReadFrom(src []byte) error {
 30963  	return v.readFrom(src, true)
 30964  }
 30965  
 30966  func (v *ElectLeadersResponse) readFrom(src []byte, unsafe bool) error {
 30967  	v.Default()
 30968  	b := kbin.Reader{Src: src}
 30969  	version := v.Version
 30970  	_ = version
 30971  	isFlexible := version >= 2
 30972  	_ = isFlexible
 30973  	s := v
 30974  	{
 30975  		v := b.Int32()
 30976  		s.ThrottleMillis = v
 30977  	}
 30978  	if version >= 1 {
 30979  		v := b.Int16()
 30980  		s.ErrorCode = v
 30981  	}
 30982  	{
 30983  		v := s.Topics
 30984  		a := v
 30985  		var l int32
 30986  		if isFlexible {
 30987  			l = b.CompactArrayLen()
 30988  		} else {
 30989  			l = b.ArrayLen()
 30990  		}
 30991  		if !b.Ok() {
 30992  			return b.Complete()
 30993  		}
 30994  		a = a[:0]
 30995  		if l > 0 {
 30996  			a = append(a, make([]ElectLeadersResponseTopic, l)...)
 30997  		}
 30998  		for i := int32(0); i < l; i++ {
 30999  			v := &a[i]
 31000  			v.Default()
 31001  			s := v
 31002  			{
 31003  				var v string
 31004  				if unsafe {
 31005  					if isFlexible {
 31006  						v = b.UnsafeCompactString()
 31007  					} else {
 31008  						v = b.UnsafeString()
 31009  					}
 31010  				} else {
 31011  					if isFlexible {
 31012  						v = b.CompactString()
 31013  					} else {
 31014  						v = b.String()
 31015  					}
 31016  				}
 31017  				s.Topic = v
 31018  			}
 31019  			{
 31020  				v := s.Partitions
 31021  				a := v
 31022  				var l int32
 31023  				if isFlexible {
 31024  					l = b.CompactArrayLen()
 31025  				} else {
 31026  					l = b.ArrayLen()
 31027  				}
 31028  				if !b.Ok() {
 31029  					return b.Complete()
 31030  				}
 31031  				a = a[:0]
 31032  				if l > 0 {
 31033  					a = append(a, make([]ElectLeadersResponseTopicPartition, l)...)
 31034  				}
 31035  				for i := int32(0); i < l; i++ {
 31036  					v := &a[i]
 31037  					v.Default()
 31038  					s := v
 31039  					{
 31040  						v := b.Int32()
 31041  						s.Partition = v
 31042  					}
 31043  					{
 31044  						v := b.Int16()
 31045  						s.ErrorCode = v
 31046  					}
 31047  					{
 31048  						var v *string
 31049  						if isFlexible {
 31050  							if unsafe {
 31051  								v = b.UnsafeCompactNullableString()
 31052  							} else {
 31053  								v = b.CompactNullableString()
 31054  							}
 31055  						} else {
 31056  							if unsafe {
 31057  								v = b.UnsafeNullableString()
 31058  							} else {
 31059  								v = b.NullableString()
 31060  							}
 31061  						}
 31062  						s.ErrorMessage = v
 31063  					}
 31064  					if isFlexible {
 31065  						s.UnknownTags = internalReadTags(&b)
 31066  					}
 31067  				}
 31068  				v = a
 31069  				s.Partitions = v
 31070  			}
 31071  			if isFlexible {
 31072  				s.UnknownTags = internalReadTags(&b)
 31073  			}
 31074  		}
 31075  		v = a
 31076  		s.Topics = v
 31077  	}
 31078  	if isFlexible {
 31079  		s.UnknownTags = internalReadTags(&b)
 31080  	}
 31081  	return b.Complete()
 31082  }
 31083  
 31084  // NewPtrElectLeadersResponse returns a pointer to a default ElectLeadersResponse
 31085  // This is a shortcut for creating a new(struct) and calling Default yourself.
 31086  func NewPtrElectLeadersResponse() *ElectLeadersResponse {
 31087  	var v ElectLeadersResponse
 31088  	v.Default()
 31089  	return &v
 31090  }
 31091  
 31092  // Default sets any default fields. Calling this allows for future compatibility
 31093  // if new fields are added to ElectLeadersResponse.
 31094  func (v *ElectLeadersResponse) Default() {
 31095  }
 31096  
 31097  // NewElectLeadersResponse returns a default ElectLeadersResponse
 31098  // This is a shortcut for creating a struct and calling Default yourself.
 31099  func NewElectLeadersResponse() ElectLeadersResponse {
 31100  	var v ElectLeadersResponse
 31101  	v.Default()
 31102  	return v
 31103  }
 31104  
 31105  type IncrementalAlterConfigsRequestResourceConfig struct {
 31106  	// Name is a key to modify (e.g. segment.bytes).
 31107  	//
 31108  	// For broker loggers, see KIP-412 section "Request/Response Overview"
 31109  	// for details on how to change per logger log levels.
 31110  	Name string
 31111  
 31112  	// Op is the type of operation to perform for this config name.
 31113  	//
 31114  	// SET (0) is to set a configuration value; the value must not be null.
 31115  	//
 31116  	// DELETE (1) is to delete a configuration key.
 31117  	//
 31118  	// APPEND (2) is to add a value to the list of values for a key (if the
 31119  	// key is for a list of values).
 31120  	//
 31121  	// SUBTRACT (3) is to remove a value from a list of values (if the key
 31122  	// is for a list of values).
 31123  	Op IncrementalAlterConfigOp
 31124  
 31125  	// Value is a value to set for the key (e.g. 10).
 31126  	Value *string
 31127  
 31128  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31129  	UnknownTags Tags // v1+
 31130  }
 31131  
 31132  // Default sets any default fields. Calling this allows for future compatibility
 31133  // if new fields are added to IncrementalAlterConfigsRequestResourceConfig.
 31134  func (v *IncrementalAlterConfigsRequestResourceConfig) Default() {
 31135  }
 31136  
 31137  // NewIncrementalAlterConfigsRequestResourceConfig returns a default IncrementalAlterConfigsRequestResourceConfig
 31138  // This is a shortcut for creating a struct and calling Default yourself.
 31139  func NewIncrementalAlterConfigsRequestResourceConfig() IncrementalAlterConfigsRequestResourceConfig {
 31140  	var v IncrementalAlterConfigsRequestResourceConfig
 31141  	v.Default()
 31142  	return v
 31143  }
 31144  
 31145  type IncrementalAlterConfigsRequestResource struct {
 31146  	// ResourceType is an enum corresponding to the type of config to alter.
 31147  	ResourceType ConfigResourceType
 31148  
 31149  	// ResourceName is the name of config to alter.
 31150  	//
 31151  	// If the requested type is a topic, this corresponds to a topic name.
 31152  	//
 31153  	// If the requested type if a broker, this should either be empty or be
 31154  	// the ID of the broker this request is issued to. If it is empty, this
 31155  	// updates all broker configs. If a specific ID, this updates just the
 31156  	// broker. Using a specific ID also ensures that brokers reload config
 31157  	// or secret files even if the file path has not changed. Lastly, password
 31158  	// config options can only be defined on a per broker basis.
 31159  	//
 31160  	// If the type is broker logger, this must be a broker ID.
 31161  	ResourceName string
 31162  
 31163  	// Configs contains key/value config pairs to set on the resource.
 31164  	Configs []IncrementalAlterConfigsRequestResourceConfig
 31165  
 31166  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31167  	UnknownTags Tags // v1+
 31168  }
 31169  
 31170  // Default sets any default fields. Calling this allows for future compatibility
 31171  // if new fields are added to IncrementalAlterConfigsRequestResource.
 31172  func (v *IncrementalAlterConfigsRequestResource) Default() {
 31173  }
 31174  
 31175  // NewIncrementalAlterConfigsRequestResource returns a default IncrementalAlterConfigsRequestResource
 31176  // This is a shortcut for creating a struct and calling Default yourself.
 31177  func NewIncrementalAlterConfigsRequestResource() IncrementalAlterConfigsRequestResource {
 31178  	var v IncrementalAlterConfigsRequestResource
 31179  	v.Default()
 31180  	return v
 31181  }
 31182  
 31183  // IncrementalAlterConfigsRequest issues ar equest to alter either topic or
 31184  // broker configs.
 31185  //
 31186  // This API was added in Kafka 2.3.0 to replace AlterConfigs. The key benefit
 31187  // of this API is that consumers do not need to know the full config state
 31188  // to add or remove new config options. See KIP-339 for more details.
 31189  type IncrementalAlterConfigsRequest struct {
 31190  	// Version is the version of this message used with a Kafka broker.
 31191  	Version int16
 31192  
 31193  	// Resources is an array of configs to alter.
 31194  	Resources []IncrementalAlterConfigsRequestResource
 31195  
 31196  	// ValidateOnly validates the request but does not apply it.
 31197  	ValidateOnly bool
 31198  
 31199  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31200  	UnknownTags Tags // v1+
 31201  }
 31202  
 31203  func (*IncrementalAlterConfigsRequest) Key() int16                 { return 44 }
 31204  func (*IncrementalAlterConfigsRequest) MaxVersion() int16          { return 1 }
 31205  func (v *IncrementalAlterConfigsRequest) SetVersion(version int16) { v.Version = version }
 31206  func (v *IncrementalAlterConfigsRequest) GetVersion() int16        { return v.Version }
 31207  func (v *IncrementalAlterConfigsRequest) IsFlexible() bool         { return v.Version >= 1 }
 31208  func (v *IncrementalAlterConfigsRequest) ResponseKind() Response {
 31209  	r := &IncrementalAlterConfigsResponse{Version: v.Version}
 31210  	r.Default()
 31211  	return r
 31212  }
 31213  
 31214  // RequestWith is requests v on r and returns the response or an error.
 31215  // For sharded requests, the response may be merged and still return an error.
 31216  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 31217  func (v *IncrementalAlterConfigsRequest) RequestWith(ctx context.Context, r Requestor) (*IncrementalAlterConfigsResponse, error) {
 31218  	kresp, err := r.Request(ctx, v)
 31219  	resp, _ := kresp.(*IncrementalAlterConfigsResponse)
 31220  	return resp, err
 31221  }
 31222  
 31223  func (v *IncrementalAlterConfigsRequest) AppendTo(dst []byte) []byte {
 31224  	version := v.Version
 31225  	_ = version
 31226  	isFlexible := version >= 1
 31227  	_ = isFlexible
 31228  	{
 31229  		v := v.Resources
 31230  		if isFlexible {
 31231  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 31232  		} else {
 31233  			dst = kbin.AppendArrayLen(dst, len(v))
 31234  		}
 31235  		for i := range v {
 31236  			v := &v[i]
 31237  			{
 31238  				v := v.ResourceType
 31239  				{
 31240  					v := int8(v)
 31241  					dst = kbin.AppendInt8(dst, v)
 31242  				}
 31243  			}
 31244  			{
 31245  				v := v.ResourceName
 31246  				if isFlexible {
 31247  					dst = kbin.AppendCompactString(dst, v)
 31248  				} else {
 31249  					dst = kbin.AppendString(dst, v)
 31250  				}
 31251  			}
 31252  			{
 31253  				v := v.Configs
 31254  				if isFlexible {
 31255  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 31256  				} else {
 31257  					dst = kbin.AppendArrayLen(dst, len(v))
 31258  				}
 31259  				for i := range v {
 31260  					v := &v[i]
 31261  					{
 31262  						v := v.Name
 31263  						if isFlexible {
 31264  							dst = kbin.AppendCompactString(dst, v)
 31265  						} else {
 31266  							dst = kbin.AppendString(dst, v)
 31267  						}
 31268  					}
 31269  					{
 31270  						v := v.Op
 31271  						{
 31272  							v := int8(v)
 31273  							dst = kbin.AppendInt8(dst, v)
 31274  						}
 31275  					}
 31276  					{
 31277  						v := v.Value
 31278  						if isFlexible {
 31279  							dst = kbin.AppendCompactNullableString(dst, v)
 31280  						} else {
 31281  							dst = kbin.AppendNullableString(dst, v)
 31282  						}
 31283  					}
 31284  					if isFlexible {
 31285  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31286  						dst = v.UnknownTags.AppendEach(dst)
 31287  					}
 31288  				}
 31289  			}
 31290  			if isFlexible {
 31291  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31292  				dst = v.UnknownTags.AppendEach(dst)
 31293  			}
 31294  		}
 31295  	}
 31296  	{
 31297  		v := v.ValidateOnly
 31298  		dst = kbin.AppendBool(dst, v)
 31299  	}
 31300  	if isFlexible {
 31301  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31302  		dst = v.UnknownTags.AppendEach(dst)
 31303  	}
 31304  	return dst
 31305  }
 31306  
 31307  func (v *IncrementalAlterConfigsRequest) ReadFrom(src []byte) error {
 31308  	return v.readFrom(src, false)
 31309  }
 31310  
 31311  func (v *IncrementalAlterConfigsRequest) UnsafeReadFrom(src []byte) error {
 31312  	return v.readFrom(src, true)
 31313  }
 31314  
 31315  func (v *IncrementalAlterConfigsRequest) readFrom(src []byte, unsafe bool) error {
 31316  	v.Default()
 31317  	b := kbin.Reader{Src: src}
 31318  	version := v.Version
 31319  	_ = version
 31320  	isFlexible := version >= 1
 31321  	_ = isFlexible
 31322  	s := v
 31323  	{
 31324  		v := s.Resources
 31325  		a := v
 31326  		var l int32
 31327  		if isFlexible {
 31328  			l = b.CompactArrayLen()
 31329  		} else {
 31330  			l = b.ArrayLen()
 31331  		}
 31332  		if !b.Ok() {
 31333  			return b.Complete()
 31334  		}
 31335  		a = a[:0]
 31336  		if l > 0 {
 31337  			a = append(a, make([]IncrementalAlterConfigsRequestResource, l)...)
 31338  		}
 31339  		for i := int32(0); i < l; i++ {
 31340  			v := &a[i]
 31341  			v.Default()
 31342  			s := v
 31343  			{
 31344  				var t ConfigResourceType
 31345  				{
 31346  					v := b.Int8()
 31347  					t = ConfigResourceType(v)
 31348  				}
 31349  				v := t
 31350  				s.ResourceType = v
 31351  			}
 31352  			{
 31353  				var v string
 31354  				if unsafe {
 31355  					if isFlexible {
 31356  						v = b.UnsafeCompactString()
 31357  					} else {
 31358  						v = b.UnsafeString()
 31359  					}
 31360  				} else {
 31361  					if isFlexible {
 31362  						v = b.CompactString()
 31363  					} else {
 31364  						v = b.String()
 31365  					}
 31366  				}
 31367  				s.ResourceName = v
 31368  			}
 31369  			{
 31370  				v := s.Configs
 31371  				a := v
 31372  				var l int32
 31373  				if isFlexible {
 31374  					l = b.CompactArrayLen()
 31375  				} else {
 31376  					l = b.ArrayLen()
 31377  				}
 31378  				if !b.Ok() {
 31379  					return b.Complete()
 31380  				}
 31381  				a = a[:0]
 31382  				if l > 0 {
 31383  					a = append(a, make([]IncrementalAlterConfigsRequestResourceConfig, l)...)
 31384  				}
 31385  				for i := int32(0); i < l; i++ {
 31386  					v := &a[i]
 31387  					v.Default()
 31388  					s := v
 31389  					{
 31390  						var v string
 31391  						if unsafe {
 31392  							if isFlexible {
 31393  								v = b.UnsafeCompactString()
 31394  							} else {
 31395  								v = b.UnsafeString()
 31396  							}
 31397  						} else {
 31398  							if isFlexible {
 31399  								v = b.CompactString()
 31400  							} else {
 31401  								v = b.String()
 31402  							}
 31403  						}
 31404  						s.Name = v
 31405  					}
 31406  					{
 31407  						var t IncrementalAlterConfigOp
 31408  						{
 31409  							v := b.Int8()
 31410  							t = IncrementalAlterConfigOp(v)
 31411  						}
 31412  						v := t
 31413  						s.Op = v
 31414  					}
 31415  					{
 31416  						var v *string
 31417  						if isFlexible {
 31418  							if unsafe {
 31419  								v = b.UnsafeCompactNullableString()
 31420  							} else {
 31421  								v = b.CompactNullableString()
 31422  							}
 31423  						} else {
 31424  							if unsafe {
 31425  								v = b.UnsafeNullableString()
 31426  							} else {
 31427  								v = b.NullableString()
 31428  							}
 31429  						}
 31430  						s.Value = v
 31431  					}
 31432  					if isFlexible {
 31433  						s.UnknownTags = internalReadTags(&b)
 31434  					}
 31435  				}
 31436  				v = a
 31437  				s.Configs = v
 31438  			}
 31439  			if isFlexible {
 31440  				s.UnknownTags = internalReadTags(&b)
 31441  			}
 31442  		}
 31443  		v = a
 31444  		s.Resources = v
 31445  	}
 31446  	{
 31447  		v := b.Bool()
 31448  		s.ValidateOnly = v
 31449  	}
 31450  	if isFlexible {
 31451  		s.UnknownTags = internalReadTags(&b)
 31452  	}
 31453  	return b.Complete()
 31454  }
 31455  
 31456  // NewPtrIncrementalAlterConfigsRequest returns a pointer to a default IncrementalAlterConfigsRequest
 31457  // This is a shortcut for creating a new(struct) and calling Default yourself.
 31458  func NewPtrIncrementalAlterConfigsRequest() *IncrementalAlterConfigsRequest {
 31459  	var v IncrementalAlterConfigsRequest
 31460  	v.Default()
 31461  	return &v
 31462  }
 31463  
 31464  // Default sets any default fields. Calling this allows for future compatibility
 31465  // if new fields are added to IncrementalAlterConfigsRequest.
 31466  func (v *IncrementalAlterConfigsRequest) Default() {
 31467  }
 31468  
 31469  // NewIncrementalAlterConfigsRequest returns a default IncrementalAlterConfigsRequest
 31470  // This is a shortcut for creating a struct and calling Default yourself.
 31471  func NewIncrementalAlterConfigsRequest() IncrementalAlterConfigsRequest {
 31472  	var v IncrementalAlterConfigsRequest
 31473  	v.Default()
 31474  	return v
 31475  }
 31476  
 31477  type IncrementalAlterConfigsResponseResource struct {
 31478  	// ErrorCode is the error code returned for incrementally altering configs.
 31479  	//
 31480  	// CLUSTER_AUTHORIZATION_FAILED is returned if asking to alter broker
 31481  	// configs but the client is not authorized to do so.
 31482  	//
 31483  	// TOPIC_AUTHORIZATION_FAILED is returned if asking to alter topic
 31484  	// configs but the client is not authorized to do so.
 31485  	//
 31486  	// INVALID_TOPIC_EXCEPTION is returned if the requested topic was invalid.
 31487  	//
 31488  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 31489  	// the requested topic.
 31490  	//
 31491  	// INVALID_REQUEST is returned if the requested config is invalid or if
 31492  	// asking Kafka to alter an invalid resource.
 31493  	ErrorCode int16
 31494  
 31495  	// ErrorMessage is an informative message if the incremental alter config failed.
 31496  	ErrorMessage *string
 31497  
 31498  	// ResourceType is the enum corresponding to the type of altered config.
 31499  	ResourceType ConfigResourceType
 31500  
 31501  	// ResourceName is the name corresponding to the incremental alter config
 31502  	// request.
 31503  	ResourceName string
 31504  
 31505  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31506  	UnknownTags Tags // v1+
 31507  }
 31508  
 31509  // Default sets any default fields. Calling this allows for future compatibility
 31510  // if new fields are added to IncrementalAlterConfigsResponseResource.
 31511  func (v *IncrementalAlterConfigsResponseResource) Default() {
 31512  }
 31513  
 31514  // NewIncrementalAlterConfigsResponseResource returns a default IncrementalAlterConfigsResponseResource
 31515  // This is a shortcut for creating a struct and calling Default yourself.
 31516  func NewIncrementalAlterConfigsResponseResource() IncrementalAlterConfigsResponseResource {
 31517  	var v IncrementalAlterConfigsResponseResource
 31518  	v.Default()
 31519  	return v
 31520  }
 31521  
 31522  // IncrementalAlterConfigsResponse is returned from an IncrementalAlterConfigsRequest.
 31523  type IncrementalAlterConfigsResponse struct {
 31524  	// Version is the version of this message used with a Kafka broker.
 31525  	Version int16
 31526  
 31527  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 31528  	// after responding to this request.
 31529  	ThrottleMillis int32
 31530  
 31531  	// Resources are responses for each resources in the alter request.
 31532  	Resources []IncrementalAlterConfigsResponseResource
 31533  
 31534  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31535  	UnknownTags Tags // v1+
 31536  }
 31537  
 31538  func (*IncrementalAlterConfigsResponse) Key() int16                 { return 44 }
 31539  func (*IncrementalAlterConfigsResponse) MaxVersion() int16          { return 1 }
 31540  func (v *IncrementalAlterConfigsResponse) SetVersion(version int16) { v.Version = version }
 31541  func (v *IncrementalAlterConfigsResponse) GetVersion() int16        { return v.Version }
 31542  func (v *IncrementalAlterConfigsResponse) IsFlexible() bool         { return v.Version >= 1 }
 31543  func (v *IncrementalAlterConfigsResponse) Throttle() (int32, bool) {
 31544  	return v.ThrottleMillis, v.Version >= 0
 31545  }
 31546  
 31547  func (v *IncrementalAlterConfigsResponse) SetThrottle(throttleMillis int32) {
 31548  	v.ThrottleMillis = throttleMillis
 31549  }
 31550  
 31551  func (v *IncrementalAlterConfigsResponse) RequestKind() Request {
 31552  	return &IncrementalAlterConfigsRequest{Version: v.Version}
 31553  }
 31554  
 31555  func (v *IncrementalAlterConfigsResponse) AppendTo(dst []byte) []byte {
 31556  	version := v.Version
 31557  	_ = version
 31558  	isFlexible := version >= 1
 31559  	_ = isFlexible
 31560  	{
 31561  		v := v.ThrottleMillis
 31562  		dst = kbin.AppendInt32(dst, v)
 31563  	}
 31564  	{
 31565  		v := v.Resources
 31566  		if isFlexible {
 31567  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 31568  		} else {
 31569  			dst = kbin.AppendArrayLen(dst, len(v))
 31570  		}
 31571  		for i := range v {
 31572  			v := &v[i]
 31573  			{
 31574  				v := v.ErrorCode
 31575  				dst = kbin.AppendInt16(dst, v)
 31576  			}
 31577  			{
 31578  				v := v.ErrorMessage
 31579  				if isFlexible {
 31580  					dst = kbin.AppendCompactNullableString(dst, v)
 31581  				} else {
 31582  					dst = kbin.AppendNullableString(dst, v)
 31583  				}
 31584  			}
 31585  			{
 31586  				v := v.ResourceType
 31587  				{
 31588  					v := int8(v)
 31589  					dst = kbin.AppendInt8(dst, v)
 31590  				}
 31591  			}
 31592  			{
 31593  				v := v.ResourceName
 31594  				if isFlexible {
 31595  					dst = kbin.AppendCompactString(dst, v)
 31596  				} else {
 31597  					dst = kbin.AppendString(dst, v)
 31598  				}
 31599  			}
 31600  			if isFlexible {
 31601  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31602  				dst = v.UnknownTags.AppendEach(dst)
 31603  			}
 31604  		}
 31605  	}
 31606  	if isFlexible {
 31607  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31608  		dst = v.UnknownTags.AppendEach(dst)
 31609  	}
 31610  	return dst
 31611  }
 31612  
 31613  func (v *IncrementalAlterConfigsResponse) ReadFrom(src []byte) error {
 31614  	return v.readFrom(src, false)
 31615  }
 31616  
 31617  func (v *IncrementalAlterConfigsResponse) UnsafeReadFrom(src []byte) error {
 31618  	return v.readFrom(src, true)
 31619  }
 31620  
 31621  func (v *IncrementalAlterConfigsResponse) readFrom(src []byte, unsafe bool) error {
 31622  	v.Default()
 31623  	b := kbin.Reader{Src: src}
 31624  	version := v.Version
 31625  	_ = version
 31626  	isFlexible := version >= 1
 31627  	_ = isFlexible
 31628  	s := v
 31629  	{
 31630  		v := b.Int32()
 31631  		s.ThrottleMillis = v
 31632  	}
 31633  	{
 31634  		v := s.Resources
 31635  		a := v
 31636  		var l int32
 31637  		if isFlexible {
 31638  			l = b.CompactArrayLen()
 31639  		} else {
 31640  			l = b.ArrayLen()
 31641  		}
 31642  		if !b.Ok() {
 31643  			return b.Complete()
 31644  		}
 31645  		a = a[:0]
 31646  		if l > 0 {
 31647  			a = append(a, make([]IncrementalAlterConfigsResponseResource, l)...)
 31648  		}
 31649  		for i := int32(0); i < l; i++ {
 31650  			v := &a[i]
 31651  			v.Default()
 31652  			s := v
 31653  			{
 31654  				v := b.Int16()
 31655  				s.ErrorCode = v
 31656  			}
 31657  			{
 31658  				var v *string
 31659  				if isFlexible {
 31660  					if unsafe {
 31661  						v = b.UnsafeCompactNullableString()
 31662  					} else {
 31663  						v = b.CompactNullableString()
 31664  					}
 31665  				} else {
 31666  					if unsafe {
 31667  						v = b.UnsafeNullableString()
 31668  					} else {
 31669  						v = b.NullableString()
 31670  					}
 31671  				}
 31672  				s.ErrorMessage = v
 31673  			}
 31674  			{
 31675  				var t ConfigResourceType
 31676  				{
 31677  					v := b.Int8()
 31678  					t = ConfigResourceType(v)
 31679  				}
 31680  				v := t
 31681  				s.ResourceType = v
 31682  			}
 31683  			{
 31684  				var v string
 31685  				if unsafe {
 31686  					if isFlexible {
 31687  						v = b.UnsafeCompactString()
 31688  					} else {
 31689  						v = b.UnsafeString()
 31690  					}
 31691  				} else {
 31692  					if isFlexible {
 31693  						v = b.CompactString()
 31694  					} else {
 31695  						v = b.String()
 31696  					}
 31697  				}
 31698  				s.ResourceName = v
 31699  			}
 31700  			if isFlexible {
 31701  				s.UnknownTags = internalReadTags(&b)
 31702  			}
 31703  		}
 31704  		v = a
 31705  		s.Resources = v
 31706  	}
 31707  	if isFlexible {
 31708  		s.UnknownTags = internalReadTags(&b)
 31709  	}
 31710  	return b.Complete()
 31711  }
 31712  
 31713  // NewPtrIncrementalAlterConfigsResponse returns a pointer to a default IncrementalAlterConfigsResponse
 31714  // This is a shortcut for creating a new(struct) and calling Default yourself.
 31715  func NewPtrIncrementalAlterConfigsResponse() *IncrementalAlterConfigsResponse {
 31716  	var v IncrementalAlterConfigsResponse
 31717  	v.Default()
 31718  	return &v
 31719  }
 31720  
 31721  // Default sets any default fields. Calling this allows for future compatibility
 31722  // if new fields are added to IncrementalAlterConfigsResponse.
 31723  func (v *IncrementalAlterConfigsResponse) Default() {
 31724  }
 31725  
 31726  // NewIncrementalAlterConfigsResponse returns a default IncrementalAlterConfigsResponse
 31727  // This is a shortcut for creating a struct and calling Default yourself.
 31728  func NewIncrementalAlterConfigsResponse() IncrementalAlterConfigsResponse {
 31729  	var v IncrementalAlterConfigsResponse
 31730  	v.Default()
 31731  	return v
 31732  }
 31733  
 31734  type AlterPartitionAssignmentsRequestTopicPartition struct {
 31735  	// Partition is a partition to reassign.
 31736  	Partition int32
 31737  
 31738  	// Replicas are replicas to place the partition on, or null to
 31739  	// cancel a pending reassignment of this partition.
 31740  	Replicas []int32
 31741  
 31742  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31743  	UnknownTags Tags
 31744  }
 31745  
 31746  // Default sets any default fields. Calling this allows for future compatibility
 31747  // if new fields are added to AlterPartitionAssignmentsRequestTopicPartition.
 31748  func (v *AlterPartitionAssignmentsRequestTopicPartition) Default() {
 31749  }
 31750  
 31751  // NewAlterPartitionAssignmentsRequestTopicPartition returns a default AlterPartitionAssignmentsRequestTopicPartition
 31752  // This is a shortcut for creating a struct and calling Default yourself.
 31753  func NewAlterPartitionAssignmentsRequestTopicPartition() AlterPartitionAssignmentsRequestTopicPartition {
 31754  	var v AlterPartitionAssignmentsRequestTopicPartition
 31755  	v.Default()
 31756  	return v
 31757  }
 31758  
 31759  type AlterPartitionAssignmentsRequestTopic struct {
 31760  	// Topic is a topic to reassign the partitions of.
 31761  	Topic string
 31762  
 31763  	// Partitions contains partitions to reassign.
 31764  	Partitions []AlterPartitionAssignmentsRequestTopicPartition
 31765  
 31766  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31767  	UnknownTags Tags
 31768  }
 31769  
 31770  // Default sets any default fields. Calling this allows for future compatibility
 31771  // if new fields are added to AlterPartitionAssignmentsRequestTopic.
 31772  func (v *AlterPartitionAssignmentsRequestTopic) Default() {
 31773  }
 31774  
 31775  // NewAlterPartitionAssignmentsRequestTopic returns a default AlterPartitionAssignmentsRequestTopic
 31776  // This is a shortcut for creating a struct and calling Default yourself.
 31777  func NewAlterPartitionAssignmentsRequestTopic() AlterPartitionAssignmentsRequestTopic {
 31778  	var v AlterPartitionAssignmentsRequestTopic
 31779  	v.Default()
 31780  	return v
 31781  }
 31782  
 31783  // AlterPartitionAssignmentsRequest, proposed in KIP-455 and implemented in
 31784  // Kafka 2.4.0, is a request to reassign partitions to certain brokers.
 31785  //
 31786  // ACL wise, this requires ALTER on CLUSTER.
 31787  type AlterPartitionAssignmentsRequest struct {
 31788  	// Version is the version of this message used with a Kafka broker.
 31789  	Version int16
 31790  
 31791  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 31792  	// This field has no effect on Kafka's processing of the request; the request
 31793  	// will continue to be processed if the timeout is reached. If the timeout is
 31794  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 31795  	//
 31796  	// This field has a default of 60000.
 31797  	TimeoutMillis int32
 31798  
 31799  	// Topics are topics for which to reassign partitions of.
 31800  	Topics []AlterPartitionAssignmentsRequestTopic
 31801  
 31802  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 31803  	UnknownTags Tags
 31804  }
 31805  
 31806  func (*AlterPartitionAssignmentsRequest) Key() int16                 { return 45 }
 31807  func (*AlterPartitionAssignmentsRequest) MaxVersion() int16          { return 0 }
 31808  func (v *AlterPartitionAssignmentsRequest) SetVersion(version int16) { v.Version = version }
 31809  func (v *AlterPartitionAssignmentsRequest) GetVersion() int16        { return v.Version }
 31810  func (v *AlterPartitionAssignmentsRequest) IsFlexible() bool         { return v.Version >= 0 }
 31811  func (v *AlterPartitionAssignmentsRequest) Timeout() int32           { return v.TimeoutMillis }
 31812  func (v *AlterPartitionAssignmentsRequest) SetTimeout(timeoutMillis int32) {
 31813  	v.TimeoutMillis = timeoutMillis
 31814  }
 31815  func (v *AlterPartitionAssignmentsRequest) IsAdminRequest() {}
 31816  func (v *AlterPartitionAssignmentsRequest) ResponseKind() Response {
 31817  	r := &AlterPartitionAssignmentsResponse{Version: v.Version}
 31818  	r.Default()
 31819  	return r
 31820  }
 31821  
 31822  // RequestWith is requests v on r and returns the response or an error.
 31823  // For sharded requests, the response may be merged and still return an error.
 31824  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 31825  func (v *AlterPartitionAssignmentsRequest) RequestWith(ctx context.Context, r Requestor) (*AlterPartitionAssignmentsResponse, error) {
 31826  	kresp, err := r.Request(ctx, v)
 31827  	resp, _ := kresp.(*AlterPartitionAssignmentsResponse)
 31828  	return resp, err
 31829  }
 31830  
 31831  func (v *AlterPartitionAssignmentsRequest) AppendTo(dst []byte) []byte {
 31832  	version := v.Version
 31833  	_ = version
 31834  	isFlexible := version >= 0
 31835  	_ = isFlexible
 31836  	{
 31837  		v := v.TimeoutMillis
 31838  		dst = kbin.AppendInt32(dst, v)
 31839  	}
 31840  	{
 31841  		v := v.Topics
 31842  		if isFlexible {
 31843  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 31844  		} else {
 31845  			dst = kbin.AppendArrayLen(dst, len(v))
 31846  		}
 31847  		for i := range v {
 31848  			v := &v[i]
 31849  			{
 31850  				v := v.Topic
 31851  				if isFlexible {
 31852  					dst = kbin.AppendCompactString(dst, v)
 31853  				} else {
 31854  					dst = kbin.AppendString(dst, v)
 31855  				}
 31856  			}
 31857  			{
 31858  				v := v.Partitions
 31859  				if isFlexible {
 31860  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 31861  				} else {
 31862  					dst = kbin.AppendArrayLen(dst, len(v))
 31863  				}
 31864  				for i := range v {
 31865  					v := &v[i]
 31866  					{
 31867  						v := v.Partition
 31868  						dst = kbin.AppendInt32(dst, v)
 31869  					}
 31870  					{
 31871  						v := v.Replicas
 31872  						if isFlexible {
 31873  							dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 31874  						} else {
 31875  							dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 31876  						}
 31877  						for i := range v {
 31878  							v := v[i]
 31879  							dst = kbin.AppendInt32(dst, v)
 31880  						}
 31881  					}
 31882  					if isFlexible {
 31883  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31884  						dst = v.UnknownTags.AppendEach(dst)
 31885  					}
 31886  				}
 31887  			}
 31888  			if isFlexible {
 31889  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31890  				dst = v.UnknownTags.AppendEach(dst)
 31891  			}
 31892  		}
 31893  	}
 31894  	if isFlexible {
 31895  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 31896  		dst = v.UnknownTags.AppendEach(dst)
 31897  	}
 31898  	return dst
 31899  }
 31900  
 31901  func (v *AlterPartitionAssignmentsRequest) ReadFrom(src []byte) error {
 31902  	return v.readFrom(src, false)
 31903  }
 31904  
 31905  func (v *AlterPartitionAssignmentsRequest) UnsafeReadFrom(src []byte) error {
 31906  	return v.readFrom(src, true)
 31907  }
 31908  
 31909  func (v *AlterPartitionAssignmentsRequest) readFrom(src []byte, unsafe bool) error {
 31910  	v.Default()
 31911  	b := kbin.Reader{Src: src}
 31912  	version := v.Version
 31913  	_ = version
 31914  	isFlexible := version >= 0
 31915  	_ = isFlexible
 31916  	s := v
 31917  	{
 31918  		v := b.Int32()
 31919  		s.TimeoutMillis = v
 31920  	}
 31921  	{
 31922  		v := s.Topics
 31923  		a := v
 31924  		var l int32
 31925  		if isFlexible {
 31926  			l = b.CompactArrayLen()
 31927  		} else {
 31928  			l = b.ArrayLen()
 31929  		}
 31930  		if !b.Ok() {
 31931  			return b.Complete()
 31932  		}
 31933  		a = a[:0]
 31934  		if l > 0 {
 31935  			a = append(a, make([]AlterPartitionAssignmentsRequestTopic, l)...)
 31936  		}
 31937  		for i := int32(0); i < l; i++ {
 31938  			v := &a[i]
 31939  			v.Default()
 31940  			s := v
 31941  			{
 31942  				var v string
 31943  				if unsafe {
 31944  					if isFlexible {
 31945  						v = b.UnsafeCompactString()
 31946  					} else {
 31947  						v = b.UnsafeString()
 31948  					}
 31949  				} else {
 31950  					if isFlexible {
 31951  						v = b.CompactString()
 31952  					} else {
 31953  						v = b.String()
 31954  					}
 31955  				}
 31956  				s.Topic = v
 31957  			}
 31958  			{
 31959  				v := s.Partitions
 31960  				a := v
 31961  				var l int32
 31962  				if isFlexible {
 31963  					l = b.CompactArrayLen()
 31964  				} else {
 31965  					l = b.ArrayLen()
 31966  				}
 31967  				if !b.Ok() {
 31968  					return b.Complete()
 31969  				}
 31970  				a = a[:0]
 31971  				if l > 0 {
 31972  					a = append(a, make([]AlterPartitionAssignmentsRequestTopicPartition, l)...)
 31973  				}
 31974  				for i := int32(0); i < l; i++ {
 31975  					v := &a[i]
 31976  					v.Default()
 31977  					s := v
 31978  					{
 31979  						v := b.Int32()
 31980  						s.Partition = v
 31981  					}
 31982  					{
 31983  						v := s.Replicas
 31984  						a := v
 31985  						var l int32
 31986  						if isFlexible {
 31987  							l = b.CompactArrayLen()
 31988  						} else {
 31989  							l = b.ArrayLen()
 31990  						}
 31991  						if version < 0 || l == 0 {
 31992  							a = []int32{}
 31993  						}
 31994  						if !b.Ok() {
 31995  							return b.Complete()
 31996  						}
 31997  						a = a[:0]
 31998  						if l > 0 {
 31999  							a = append(a, make([]int32, l)...)
 32000  						}
 32001  						for i := int32(0); i < l; i++ {
 32002  							v := b.Int32()
 32003  							a[i] = v
 32004  						}
 32005  						v = a
 32006  						s.Replicas = v
 32007  					}
 32008  					if isFlexible {
 32009  						s.UnknownTags = internalReadTags(&b)
 32010  					}
 32011  				}
 32012  				v = a
 32013  				s.Partitions = v
 32014  			}
 32015  			if isFlexible {
 32016  				s.UnknownTags = internalReadTags(&b)
 32017  			}
 32018  		}
 32019  		v = a
 32020  		s.Topics = v
 32021  	}
 32022  	if isFlexible {
 32023  		s.UnknownTags = internalReadTags(&b)
 32024  	}
 32025  	return b.Complete()
 32026  }
 32027  
 32028  // NewPtrAlterPartitionAssignmentsRequest returns a pointer to a default AlterPartitionAssignmentsRequest
 32029  // This is a shortcut for creating a new(struct) and calling Default yourself.
 32030  func NewPtrAlterPartitionAssignmentsRequest() *AlterPartitionAssignmentsRequest {
 32031  	var v AlterPartitionAssignmentsRequest
 32032  	v.Default()
 32033  	return &v
 32034  }
 32035  
 32036  // Default sets any default fields. Calling this allows for future compatibility
 32037  // if new fields are added to AlterPartitionAssignmentsRequest.
 32038  func (v *AlterPartitionAssignmentsRequest) Default() {
 32039  	v.TimeoutMillis = 60000
 32040  }
 32041  
 32042  // NewAlterPartitionAssignmentsRequest returns a default AlterPartitionAssignmentsRequest
 32043  // This is a shortcut for creating a struct and calling Default yourself.
 32044  func NewAlterPartitionAssignmentsRequest() AlterPartitionAssignmentsRequest {
 32045  	var v AlterPartitionAssignmentsRequest
 32046  	v.Default()
 32047  	return v
 32048  }
 32049  
 32050  type AlterPartitionAssignmentsResponseTopicPartition struct {
 32051  	// Partition is the partition being responded to.
 32052  	Partition int32
 32053  
 32054  	// ErrorCode is the error code returned for partition reassignments.
 32055  	//
 32056  	// REQUEST_TIMED_OUT is returned if the request timed out.
 32057  	//
 32058  	// NOT_CONTROLLER is returned if the request was not issued to a Kafka
 32059  	// controller.
 32060  	//
 32061  	// CLUSTER_AUTHORIZATION_FAILED is returned if the client is not
 32062  	// authorized to reassign partitions.
 32063  	//
 32064  	// NO_REASSIGNMENT_IN_PROGRESS is returned for partition reassignment
 32065  	// cancellations when the partition was not being reassigned.
 32066  	//
 32067  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 32068  	// the requested topic or the topic is being deleted.
 32069  	ErrorCode int16
 32070  
 32071  	// ErrorMessage is an informative message if the partition reassignment failed.
 32072  	ErrorMessage *string
 32073  
 32074  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32075  	UnknownTags Tags
 32076  }
 32077  
 32078  // Default sets any default fields. Calling this allows for future compatibility
 32079  // if new fields are added to AlterPartitionAssignmentsResponseTopicPartition.
 32080  func (v *AlterPartitionAssignmentsResponseTopicPartition) Default() {
 32081  }
 32082  
 32083  // NewAlterPartitionAssignmentsResponseTopicPartition returns a default AlterPartitionAssignmentsResponseTopicPartition
 32084  // This is a shortcut for creating a struct and calling Default yourself.
 32085  func NewAlterPartitionAssignmentsResponseTopicPartition() AlterPartitionAssignmentsResponseTopicPartition {
 32086  	var v AlterPartitionAssignmentsResponseTopicPartition
 32087  	v.Default()
 32088  	return v
 32089  }
 32090  
 32091  type AlterPartitionAssignmentsResponseTopic struct {
 32092  	// Topic is the topic being responded to.
 32093  	Topic string
 32094  
 32095  	// Partitions contains responses for partitions.
 32096  	Partitions []AlterPartitionAssignmentsResponseTopicPartition
 32097  
 32098  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32099  	UnknownTags Tags
 32100  }
 32101  
 32102  // Default sets any default fields. Calling this allows for future compatibility
 32103  // if new fields are added to AlterPartitionAssignmentsResponseTopic.
 32104  func (v *AlterPartitionAssignmentsResponseTopic) Default() {
 32105  }
 32106  
 32107  // NewAlterPartitionAssignmentsResponseTopic returns a default AlterPartitionAssignmentsResponseTopic
 32108  // This is a shortcut for creating a struct and calling Default yourself.
 32109  func NewAlterPartitionAssignmentsResponseTopic() AlterPartitionAssignmentsResponseTopic {
 32110  	var v AlterPartitionAssignmentsResponseTopic
 32111  	v.Default()
 32112  	return v
 32113  }
 32114  
 32115  // AlterPartitionAssignmentsResponse is returned for an AlterPartitionAssignmentsRequest.
 32116  type AlterPartitionAssignmentsResponse struct {
 32117  	// Version is the version of this message used with a Kafka broker.
 32118  	Version int16
 32119  
 32120  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 32121  	// after responding to this request.
 32122  	ThrottleMillis int32
 32123  
 32124  	// ErrorCode is any global (applied to all partitions) error code.
 32125  	ErrorCode int16
 32126  
 32127  	// ErrorMessage is any global (applied to all partitions) error message.
 32128  	ErrorMessage *string
 32129  
 32130  	// Topics contains responses for each topic requested.
 32131  	Topics []AlterPartitionAssignmentsResponseTopic
 32132  
 32133  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32134  	UnknownTags Tags
 32135  }
 32136  
 32137  func (*AlterPartitionAssignmentsResponse) Key() int16                 { return 45 }
 32138  func (*AlterPartitionAssignmentsResponse) MaxVersion() int16          { return 0 }
 32139  func (v *AlterPartitionAssignmentsResponse) SetVersion(version int16) { v.Version = version }
 32140  func (v *AlterPartitionAssignmentsResponse) GetVersion() int16        { return v.Version }
 32141  func (v *AlterPartitionAssignmentsResponse) IsFlexible() bool         { return v.Version >= 0 }
 32142  func (v *AlterPartitionAssignmentsResponse) Throttle() (int32, bool) {
 32143  	return v.ThrottleMillis, v.Version >= 0
 32144  }
 32145  
 32146  func (v *AlterPartitionAssignmentsResponse) SetThrottle(throttleMillis int32) {
 32147  	v.ThrottleMillis = throttleMillis
 32148  }
 32149  
 32150  func (v *AlterPartitionAssignmentsResponse) RequestKind() Request {
 32151  	return &AlterPartitionAssignmentsRequest{Version: v.Version}
 32152  }
 32153  
 32154  func (v *AlterPartitionAssignmentsResponse) AppendTo(dst []byte) []byte {
 32155  	version := v.Version
 32156  	_ = version
 32157  	isFlexible := version >= 0
 32158  	_ = isFlexible
 32159  	{
 32160  		v := v.ThrottleMillis
 32161  		dst = kbin.AppendInt32(dst, v)
 32162  	}
 32163  	{
 32164  		v := v.ErrorCode
 32165  		dst = kbin.AppendInt16(dst, v)
 32166  	}
 32167  	{
 32168  		v := v.ErrorMessage
 32169  		if isFlexible {
 32170  			dst = kbin.AppendCompactNullableString(dst, v)
 32171  		} else {
 32172  			dst = kbin.AppendNullableString(dst, v)
 32173  		}
 32174  	}
 32175  	{
 32176  		v := v.Topics
 32177  		if isFlexible {
 32178  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 32179  		} else {
 32180  			dst = kbin.AppendArrayLen(dst, len(v))
 32181  		}
 32182  		for i := range v {
 32183  			v := &v[i]
 32184  			{
 32185  				v := v.Topic
 32186  				if isFlexible {
 32187  					dst = kbin.AppendCompactString(dst, v)
 32188  				} else {
 32189  					dst = kbin.AppendString(dst, v)
 32190  				}
 32191  			}
 32192  			{
 32193  				v := v.Partitions
 32194  				if isFlexible {
 32195  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 32196  				} else {
 32197  					dst = kbin.AppendArrayLen(dst, len(v))
 32198  				}
 32199  				for i := range v {
 32200  					v := &v[i]
 32201  					{
 32202  						v := v.Partition
 32203  						dst = kbin.AppendInt32(dst, v)
 32204  					}
 32205  					{
 32206  						v := v.ErrorCode
 32207  						dst = kbin.AppendInt16(dst, v)
 32208  					}
 32209  					{
 32210  						v := v.ErrorMessage
 32211  						if isFlexible {
 32212  							dst = kbin.AppendCompactNullableString(dst, v)
 32213  						} else {
 32214  							dst = kbin.AppendNullableString(dst, v)
 32215  						}
 32216  					}
 32217  					if isFlexible {
 32218  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32219  						dst = v.UnknownTags.AppendEach(dst)
 32220  					}
 32221  				}
 32222  			}
 32223  			if isFlexible {
 32224  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32225  				dst = v.UnknownTags.AppendEach(dst)
 32226  			}
 32227  		}
 32228  	}
 32229  	if isFlexible {
 32230  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32231  		dst = v.UnknownTags.AppendEach(dst)
 32232  	}
 32233  	return dst
 32234  }
 32235  
 32236  func (v *AlterPartitionAssignmentsResponse) ReadFrom(src []byte) error {
 32237  	return v.readFrom(src, false)
 32238  }
 32239  
 32240  func (v *AlterPartitionAssignmentsResponse) UnsafeReadFrom(src []byte) error {
 32241  	return v.readFrom(src, true)
 32242  }
 32243  
 32244  func (v *AlterPartitionAssignmentsResponse) readFrom(src []byte, unsafe bool) error {
 32245  	v.Default()
 32246  	b := kbin.Reader{Src: src}
 32247  	version := v.Version
 32248  	_ = version
 32249  	isFlexible := version >= 0
 32250  	_ = isFlexible
 32251  	s := v
 32252  	{
 32253  		v := b.Int32()
 32254  		s.ThrottleMillis = v
 32255  	}
 32256  	{
 32257  		v := b.Int16()
 32258  		s.ErrorCode = v
 32259  	}
 32260  	{
 32261  		var v *string
 32262  		if isFlexible {
 32263  			if unsafe {
 32264  				v = b.UnsafeCompactNullableString()
 32265  			} else {
 32266  				v = b.CompactNullableString()
 32267  			}
 32268  		} else {
 32269  			if unsafe {
 32270  				v = b.UnsafeNullableString()
 32271  			} else {
 32272  				v = b.NullableString()
 32273  			}
 32274  		}
 32275  		s.ErrorMessage = v
 32276  	}
 32277  	{
 32278  		v := s.Topics
 32279  		a := v
 32280  		var l int32
 32281  		if isFlexible {
 32282  			l = b.CompactArrayLen()
 32283  		} else {
 32284  			l = b.ArrayLen()
 32285  		}
 32286  		if !b.Ok() {
 32287  			return b.Complete()
 32288  		}
 32289  		a = a[:0]
 32290  		if l > 0 {
 32291  			a = append(a, make([]AlterPartitionAssignmentsResponseTopic, l)...)
 32292  		}
 32293  		for i := int32(0); i < l; i++ {
 32294  			v := &a[i]
 32295  			v.Default()
 32296  			s := v
 32297  			{
 32298  				var v string
 32299  				if unsafe {
 32300  					if isFlexible {
 32301  						v = b.UnsafeCompactString()
 32302  					} else {
 32303  						v = b.UnsafeString()
 32304  					}
 32305  				} else {
 32306  					if isFlexible {
 32307  						v = b.CompactString()
 32308  					} else {
 32309  						v = b.String()
 32310  					}
 32311  				}
 32312  				s.Topic = v
 32313  			}
 32314  			{
 32315  				v := s.Partitions
 32316  				a := v
 32317  				var l int32
 32318  				if isFlexible {
 32319  					l = b.CompactArrayLen()
 32320  				} else {
 32321  					l = b.ArrayLen()
 32322  				}
 32323  				if !b.Ok() {
 32324  					return b.Complete()
 32325  				}
 32326  				a = a[:0]
 32327  				if l > 0 {
 32328  					a = append(a, make([]AlterPartitionAssignmentsResponseTopicPartition, l)...)
 32329  				}
 32330  				for i := int32(0); i < l; i++ {
 32331  					v := &a[i]
 32332  					v.Default()
 32333  					s := v
 32334  					{
 32335  						v := b.Int32()
 32336  						s.Partition = v
 32337  					}
 32338  					{
 32339  						v := b.Int16()
 32340  						s.ErrorCode = v
 32341  					}
 32342  					{
 32343  						var v *string
 32344  						if isFlexible {
 32345  							if unsafe {
 32346  								v = b.UnsafeCompactNullableString()
 32347  							} else {
 32348  								v = b.CompactNullableString()
 32349  							}
 32350  						} else {
 32351  							if unsafe {
 32352  								v = b.UnsafeNullableString()
 32353  							} else {
 32354  								v = b.NullableString()
 32355  							}
 32356  						}
 32357  						s.ErrorMessage = v
 32358  					}
 32359  					if isFlexible {
 32360  						s.UnknownTags = internalReadTags(&b)
 32361  					}
 32362  				}
 32363  				v = a
 32364  				s.Partitions = v
 32365  			}
 32366  			if isFlexible {
 32367  				s.UnknownTags = internalReadTags(&b)
 32368  			}
 32369  		}
 32370  		v = a
 32371  		s.Topics = v
 32372  	}
 32373  	if isFlexible {
 32374  		s.UnknownTags = internalReadTags(&b)
 32375  	}
 32376  	return b.Complete()
 32377  }
 32378  
 32379  // NewPtrAlterPartitionAssignmentsResponse returns a pointer to a default AlterPartitionAssignmentsResponse
 32380  // This is a shortcut for creating a new(struct) and calling Default yourself.
 32381  func NewPtrAlterPartitionAssignmentsResponse() *AlterPartitionAssignmentsResponse {
 32382  	var v AlterPartitionAssignmentsResponse
 32383  	v.Default()
 32384  	return &v
 32385  }
 32386  
 32387  // Default sets any default fields. Calling this allows for future compatibility
 32388  // if new fields are added to AlterPartitionAssignmentsResponse.
 32389  func (v *AlterPartitionAssignmentsResponse) Default() {
 32390  }
 32391  
 32392  // NewAlterPartitionAssignmentsResponse returns a default AlterPartitionAssignmentsResponse
 32393  // This is a shortcut for creating a struct and calling Default yourself.
 32394  func NewAlterPartitionAssignmentsResponse() AlterPartitionAssignmentsResponse {
 32395  	var v AlterPartitionAssignmentsResponse
 32396  	v.Default()
 32397  	return v
 32398  }
 32399  
 32400  type ListPartitionReassignmentsRequestTopic struct {
 32401  	// Topic is a topic to list in progress partition reassingments of.
 32402  	Topic string
 32403  
 32404  	// Partitions are partitions to list in progress reassignments of.
 32405  	Partitions []int32
 32406  
 32407  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32408  	UnknownTags Tags
 32409  }
 32410  
 32411  // Default sets any default fields. Calling this allows for future compatibility
 32412  // if new fields are added to ListPartitionReassignmentsRequestTopic.
 32413  func (v *ListPartitionReassignmentsRequestTopic) Default() {
 32414  }
 32415  
 32416  // NewListPartitionReassignmentsRequestTopic returns a default ListPartitionReassignmentsRequestTopic
 32417  // This is a shortcut for creating a struct and calling Default yourself.
 32418  func NewListPartitionReassignmentsRequestTopic() ListPartitionReassignmentsRequestTopic {
 32419  	var v ListPartitionReassignmentsRequestTopic
 32420  	v.Default()
 32421  	return v
 32422  }
 32423  
 32424  // ListPartitionReassignmentsRequest, proposed in KIP-455 and implemented in
 32425  // Kafka 2.4.0, is a request to list in progress partition reassignments.
 32426  //
 32427  // ACL wise, this requires DESCRIBE on CLUSTER.
 32428  type ListPartitionReassignmentsRequest struct {
 32429  	// Version is the version of this message used with a Kafka broker.
 32430  	Version int16
 32431  
 32432  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 32433  	// This field has no effect on Kafka's processing of the request; the request
 32434  	// will continue to be processed if the timeout is reached. If the timeout is
 32435  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 32436  	//
 32437  	// This field has a default of 60000.
 32438  	TimeoutMillis int32
 32439  
 32440  	// Topics are topics to list in progress partition reassignments of, or null
 32441  	// to list everything.
 32442  	Topics []ListPartitionReassignmentsRequestTopic
 32443  
 32444  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32445  	UnknownTags Tags
 32446  }
 32447  
 32448  func (*ListPartitionReassignmentsRequest) Key() int16                 { return 46 }
 32449  func (*ListPartitionReassignmentsRequest) MaxVersion() int16          { return 0 }
 32450  func (v *ListPartitionReassignmentsRequest) SetVersion(version int16) { v.Version = version }
 32451  func (v *ListPartitionReassignmentsRequest) GetVersion() int16        { return v.Version }
 32452  func (v *ListPartitionReassignmentsRequest) IsFlexible() bool         { return v.Version >= 0 }
 32453  func (v *ListPartitionReassignmentsRequest) Timeout() int32           { return v.TimeoutMillis }
 32454  func (v *ListPartitionReassignmentsRequest) SetTimeout(timeoutMillis int32) {
 32455  	v.TimeoutMillis = timeoutMillis
 32456  }
 32457  func (v *ListPartitionReassignmentsRequest) IsAdminRequest() {}
 32458  func (v *ListPartitionReassignmentsRequest) ResponseKind() Response {
 32459  	r := &ListPartitionReassignmentsResponse{Version: v.Version}
 32460  	r.Default()
 32461  	return r
 32462  }
 32463  
 32464  // RequestWith is requests v on r and returns the response or an error.
 32465  // For sharded requests, the response may be merged and still return an error.
 32466  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 32467  func (v *ListPartitionReassignmentsRequest) RequestWith(ctx context.Context, r Requestor) (*ListPartitionReassignmentsResponse, error) {
 32468  	kresp, err := r.Request(ctx, v)
 32469  	resp, _ := kresp.(*ListPartitionReassignmentsResponse)
 32470  	return resp, err
 32471  }
 32472  
 32473  func (v *ListPartitionReassignmentsRequest) AppendTo(dst []byte) []byte {
 32474  	version := v.Version
 32475  	_ = version
 32476  	isFlexible := version >= 0
 32477  	_ = isFlexible
 32478  	{
 32479  		v := v.TimeoutMillis
 32480  		dst = kbin.AppendInt32(dst, v)
 32481  	}
 32482  	{
 32483  		v := v.Topics
 32484  		if isFlexible {
 32485  			dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 32486  		} else {
 32487  			dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 32488  		}
 32489  		for i := range v {
 32490  			v := &v[i]
 32491  			{
 32492  				v := v.Topic
 32493  				if isFlexible {
 32494  					dst = kbin.AppendCompactString(dst, v)
 32495  				} else {
 32496  					dst = kbin.AppendString(dst, v)
 32497  				}
 32498  			}
 32499  			{
 32500  				v := v.Partitions
 32501  				if isFlexible {
 32502  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 32503  				} else {
 32504  					dst = kbin.AppendArrayLen(dst, len(v))
 32505  				}
 32506  				for i := range v {
 32507  					v := v[i]
 32508  					dst = kbin.AppendInt32(dst, v)
 32509  				}
 32510  			}
 32511  			if isFlexible {
 32512  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32513  				dst = v.UnknownTags.AppendEach(dst)
 32514  			}
 32515  		}
 32516  	}
 32517  	if isFlexible {
 32518  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32519  		dst = v.UnknownTags.AppendEach(dst)
 32520  	}
 32521  	return dst
 32522  }
 32523  
 32524  func (v *ListPartitionReassignmentsRequest) ReadFrom(src []byte) error {
 32525  	return v.readFrom(src, false)
 32526  }
 32527  
 32528  func (v *ListPartitionReassignmentsRequest) UnsafeReadFrom(src []byte) error {
 32529  	return v.readFrom(src, true)
 32530  }
 32531  
 32532  func (v *ListPartitionReassignmentsRequest) readFrom(src []byte, unsafe bool) error {
 32533  	v.Default()
 32534  	b := kbin.Reader{Src: src}
 32535  	version := v.Version
 32536  	_ = version
 32537  	isFlexible := version >= 0
 32538  	_ = isFlexible
 32539  	s := v
 32540  	{
 32541  		v := b.Int32()
 32542  		s.TimeoutMillis = v
 32543  	}
 32544  	{
 32545  		v := s.Topics
 32546  		a := v
 32547  		var l int32
 32548  		if isFlexible {
 32549  			l = b.CompactArrayLen()
 32550  		} else {
 32551  			l = b.ArrayLen()
 32552  		}
 32553  		if version < 0 || l == 0 {
 32554  			a = []ListPartitionReassignmentsRequestTopic{}
 32555  		}
 32556  		if !b.Ok() {
 32557  			return b.Complete()
 32558  		}
 32559  		a = a[:0]
 32560  		if l > 0 {
 32561  			a = append(a, make([]ListPartitionReassignmentsRequestTopic, l)...)
 32562  		}
 32563  		for i := int32(0); i < l; i++ {
 32564  			v := &a[i]
 32565  			v.Default()
 32566  			s := v
 32567  			{
 32568  				var v string
 32569  				if unsafe {
 32570  					if isFlexible {
 32571  						v = b.UnsafeCompactString()
 32572  					} else {
 32573  						v = b.UnsafeString()
 32574  					}
 32575  				} else {
 32576  					if isFlexible {
 32577  						v = b.CompactString()
 32578  					} else {
 32579  						v = b.String()
 32580  					}
 32581  				}
 32582  				s.Topic = v
 32583  			}
 32584  			{
 32585  				v := s.Partitions
 32586  				a := v
 32587  				var l int32
 32588  				if isFlexible {
 32589  					l = b.CompactArrayLen()
 32590  				} else {
 32591  					l = b.ArrayLen()
 32592  				}
 32593  				if !b.Ok() {
 32594  					return b.Complete()
 32595  				}
 32596  				a = a[:0]
 32597  				if l > 0 {
 32598  					a = append(a, make([]int32, l)...)
 32599  				}
 32600  				for i := int32(0); i < l; i++ {
 32601  					v := b.Int32()
 32602  					a[i] = v
 32603  				}
 32604  				v = a
 32605  				s.Partitions = v
 32606  			}
 32607  			if isFlexible {
 32608  				s.UnknownTags = internalReadTags(&b)
 32609  			}
 32610  		}
 32611  		v = a
 32612  		s.Topics = v
 32613  	}
 32614  	if isFlexible {
 32615  		s.UnknownTags = internalReadTags(&b)
 32616  	}
 32617  	return b.Complete()
 32618  }
 32619  
 32620  // NewPtrListPartitionReassignmentsRequest returns a pointer to a default ListPartitionReassignmentsRequest
 32621  // This is a shortcut for creating a new(struct) and calling Default yourself.
 32622  func NewPtrListPartitionReassignmentsRequest() *ListPartitionReassignmentsRequest {
 32623  	var v ListPartitionReassignmentsRequest
 32624  	v.Default()
 32625  	return &v
 32626  }
 32627  
 32628  // Default sets any default fields. Calling this allows for future compatibility
 32629  // if new fields are added to ListPartitionReassignmentsRequest.
 32630  func (v *ListPartitionReassignmentsRequest) Default() {
 32631  	v.TimeoutMillis = 60000
 32632  }
 32633  
 32634  // NewListPartitionReassignmentsRequest returns a default ListPartitionReassignmentsRequest
 32635  // This is a shortcut for creating a struct and calling Default yourself.
 32636  func NewListPartitionReassignmentsRequest() ListPartitionReassignmentsRequest {
 32637  	var v ListPartitionReassignmentsRequest
 32638  	v.Default()
 32639  	return v
 32640  }
 32641  
 32642  type ListPartitionReassignmentsResponseTopicPartition struct {
 32643  	// Partition is the partition being responded to.
 32644  	Partition int32
 32645  
 32646  	// Replicas is the partition's current replicas.
 32647  	Replicas []int32
 32648  
 32649  	// AddingReplicas are replicas currently being added to the partition.
 32650  	AddingReplicas []int32
 32651  
 32652  	// RemovingReplicas are replicas currently being removed from the partition.
 32653  	RemovingReplicas []int32
 32654  
 32655  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32656  	UnknownTags Tags
 32657  }
 32658  
 32659  // Default sets any default fields. Calling this allows for future compatibility
 32660  // if new fields are added to ListPartitionReassignmentsResponseTopicPartition.
 32661  func (v *ListPartitionReassignmentsResponseTopicPartition) Default() {
 32662  }
 32663  
 32664  // NewListPartitionReassignmentsResponseTopicPartition returns a default ListPartitionReassignmentsResponseTopicPartition
 32665  // This is a shortcut for creating a struct and calling Default yourself.
 32666  func NewListPartitionReassignmentsResponseTopicPartition() ListPartitionReassignmentsResponseTopicPartition {
 32667  	var v ListPartitionReassignmentsResponseTopicPartition
 32668  	v.Default()
 32669  	return v
 32670  }
 32671  
 32672  type ListPartitionReassignmentsResponseTopic struct {
 32673  	// Topic is the topic being responded to.
 32674  	Topic string
 32675  
 32676  	// Partitions contains responses for partitions.
 32677  	Partitions []ListPartitionReassignmentsResponseTopicPartition
 32678  
 32679  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32680  	UnknownTags Tags
 32681  }
 32682  
 32683  // Default sets any default fields. Calling this allows for future compatibility
 32684  // if new fields are added to ListPartitionReassignmentsResponseTopic.
 32685  func (v *ListPartitionReassignmentsResponseTopic) Default() {
 32686  }
 32687  
 32688  // NewListPartitionReassignmentsResponseTopic returns a default ListPartitionReassignmentsResponseTopic
 32689  // This is a shortcut for creating a struct and calling Default yourself.
 32690  func NewListPartitionReassignmentsResponseTopic() ListPartitionReassignmentsResponseTopic {
 32691  	var v ListPartitionReassignmentsResponseTopic
 32692  	v.Default()
 32693  	return v
 32694  }
 32695  
 32696  // ListPartitionReassignmentsResponse is returned for a ListPartitionReassignmentsRequest.
 32697  type ListPartitionReassignmentsResponse struct {
 32698  	// Version is the version of this message used with a Kafka broker.
 32699  	Version int16
 32700  
 32701  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 32702  	// after responding to this request.
 32703  	ThrottleMillis int32
 32704  
 32705  	// ErrorCode is the error code returned for listing reassignments.
 32706  	//
 32707  	// REQUEST_TIMED_OUT is returned if the request timed out.
 32708  	//
 32709  	// NOT_CONTROLLER is returned if the request was not issued to a Kafka
 32710  	// controller.
 32711  	//
 32712  	// CLUSTER_AUTHORIZATION_FAILED is returned if the client is not
 32713  	// authorized to reassign partitions.
 32714  	ErrorCode int16
 32715  
 32716  	// ErrorMessage is any global (applied to all partitions) error message.
 32717  	ErrorMessage *string
 32718  
 32719  	// Topics contains responses for each topic requested.
 32720  	Topics []ListPartitionReassignmentsResponseTopic
 32721  
 32722  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 32723  	UnknownTags Tags
 32724  }
 32725  
 32726  func (*ListPartitionReassignmentsResponse) Key() int16                 { return 46 }
 32727  func (*ListPartitionReassignmentsResponse) MaxVersion() int16          { return 0 }
 32728  func (v *ListPartitionReassignmentsResponse) SetVersion(version int16) { v.Version = version }
 32729  func (v *ListPartitionReassignmentsResponse) GetVersion() int16        { return v.Version }
 32730  func (v *ListPartitionReassignmentsResponse) IsFlexible() bool         { return v.Version >= 0 }
 32731  func (v *ListPartitionReassignmentsResponse) Throttle() (int32, bool) {
 32732  	return v.ThrottleMillis, v.Version >= 0
 32733  }
 32734  
 32735  func (v *ListPartitionReassignmentsResponse) SetThrottle(throttleMillis int32) {
 32736  	v.ThrottleMillis = throttleMillis
 32737  }
 32738  
 32739  func (v *ListPartitionReassignmentsResponse) RequestKind() Request {
 32740  	return &ListPartitionReassignmentsRequest{Version: v.Version}
 32741  }
 32742  
 32743  func (v *ListPartitionReassignmentsResponse) AppendTo(dst []byte) []byte {
 32744  	version := v.Version
 32745  	_ = version
 32746  	isFlexible := version >= 0
 32747  	_ = isFlexible
 32748  	{
 32749  		v := v.ThrottleMillis
 32750  		dst = kbin.AppendInt32(dst, v)
 32751  	}
 32752  	{
 32753  		v := v.ErrorCode
 32754  		dst = kbin.AppendInt16(dst, v)
 32755  	}
 32756  	{
 32757  		v := v.ErrorMessage
 32758  		if isFlexible {
 32759  			dst = kbin.AppendCompactNullableString(dst, v)
 32760  		} else {
 32761  			dst = kbin.AppendNullableString(dst, v)
 32762  		}
 32763  	}
 32764  	{
 32765  		v := v.Topics
 32766  		if isFlexible {
 32767  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 32768  		} else {
 32769  			dst = kbin.AppendArrayLen(dst, len(v))
 32770  		}
 32771  		for i := range v {
 32772  			v := &v[i]
 32773  			{
 32774  				v := v.Topic
 32775  				if isFlexible {
 32776  					dst = kbin.AppendCompactString(dst, v)
 32777  				} else {
 32778  					dst = kbin.AppendString(dst, v)
 32779  				}
 32780  			}
 32781  			{
 32782  				v := v.Partitions
 32783  				if isFlexible {
 32784  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 32785  				} else {
 32786  					dst = kbin.AppendArrayLen(dst, len(v))
 32787  				}
 32788  				for i := range v {
 32789  					v := &v[i]
 32790  					{
 32791  						v := v.Partition
 32792  						dst = kbin.AppendInt32(dst, v)
 32793  					}
 32794  					{
 32795  						v := v.Replicas
 32796  						if isFlexible {
 32797  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 32798  						} else {
 32799  							dst = kbin.AppendArrayLen(dst, len(v))
 32800  						}
 32801  						for i := range v {
 32802  							v := v[i]
 32803  							dst = kbin.AppendInt32(dst, v)
 32804  						}
 32805  					}
 32806  					{
 32807  						v := v.AddingReplicas
 32808  						if isFlexible {
 32809  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 32810  						} else {
 32811  							dst = kbin.AppendArrayLen(dst, len(v))
 32812  						}
 32813  						for i := range v {
 32814  							v := v[i]
 32815  							dst = kbin.AppendInt32(dst, v)
 32816  						}
 32817  					}
 32818  					{
 32819  						v := v.RemovingReplicas
 32820  						if isFlexible {
 32821  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 32822  						} else {
 32823  							dst = kbin.AppendArrayLen(dst, len(v))
 32824  						}
 32825  						for i := range v {
 32826  							v := v[i]
 32827  							dst = kbin.AppendInt32(dst, v)
 32828  						}
 32829  					}
 32830  					if isFlexible {
 32831  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32832  						dst = v.UnknownTags.AppendEach(dst)
 32833  					}
 32834  				}
 32835  			}
 32836  			if isFlexible {
 32837  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32838  				dst = v.UnknownTags.AppendEach(dst)
 32839  			}
 32840  		}
 32841  	}
 32842  	if isFlexible {
 32843  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 32844  		dst = v.UnknownTags.AppendEach(dst)
 32845  	}
 32846  	return dst
 32847  }
 32848  
 32849  func (v *ListPartitionReassignmentsResponse) ReadFrom(src []byte) error {
 32850  	return v.readFrom(src, false)
 32851  }
 32852  
 32853  func (v *ListPartitionReassignmentsResponse) UnsafeReadFrom(src []byte) error {
 32854  	return v.readFrom(src, true)
 32855  }
 32856  
 32857  func (v *ListPartitionReassignmentsResponse) readFrom(src []byte, unsafe bool) error {
 32858  	v.Default()
 32859  	b := kbin.Reader{Src: src}
 32860  	version := v.Version
 32861  	_ = version
 32862  	isFlexible := version >= 0
 32863  	_ = isFlexible
 32864  	s := v
 32865  	{
 32866  		v := b.Int32()
 32867  		s.ThrottleMillis = v
 32868  	}
 32869  	{
 32870  		v := b.Int16()
 32871  		s.ErrorCode = v
 32872  	}
 32873  	{
 32874  		var v *string
 32875  		if isFlexible {
 32876  			if unsafe {
 32877  				v = b.UnsafeCompactNullableString()
 32878  			} else {
 32879  				v = b.CompactNullableString()
 32880  			}
 32881  		} else {
 32882  			if unsafe {
 32883  				v = b.UnsafeNullableString()
 32884  			} else {
 32885  				v = b.NullableString()
 32886  			}
 32887  		}
 32888  		s.ErrorMessage = v
 32889  	}
 32890  	{
 32891  		v := s.Topics
 32892  		a := v
 32893  		var l int32
 32894  		if isFlexible {
 32895  			l = b.CompactArrayLen()
 32896  		} else {
 32897  			l = b.ArrayLen()
 32898  		}
 32899  		if !b.Ok() {
 32900  			return b.Complete()
 32901  		}
 32902  		a = a[:0]
 32903  		if l > 0 {
 32904  			a = append(a, make([]ListPartitionReassignmentsResponseTopic, l)...)
 32905  		}
 32906  		for i := int32(0); i < l; i++ {
 32907  			v := &a[i]
 32908  			v.Default()
 32909  			s := v
 32910  			{
 32911  				var v string
 32912  				if unsafe {
 32913  					if isFlexible {
 32914  						v = b.UnsafeCompactString()
 32915  					} else {
 32916  						v = b.UnsafeString()
 32917  					}
 32918  				} else {
 32919  					if isFlexible {
 32920  						v = b.CompactString()
 32921  					} else {
 32922  						v = b.String()
 32923  					}
 32924  				}
 32925  				s.Topic = v
 32926  			}
 32927  			{
 32928  				v := s.Partitions
 32929  				a := v
 32930  				var l int32
 32931  				if isFlexible {
 32932  					l = b.CompactArrayLen()
 32933  				} else {
 32934  					l = b.ArrayLen()
 32935  				}
 32936  				if !b.Ok() {
 32937  					return b.Complete()
 32938  				}
 32939  				a = a[:0]
 32940  				if l > 0 {
 32941  					a = append(a, make([]ListPartitionReassignmentsResponseTopicPartition, l)...)
 32942  				}
 32943  				for i := int32(0); i < l; i++ {
 32944  					v := &a[i]
 32945  					v.Default()
 32946  					s := v
 32947  					{
 32948  						v := b.Int32()
 32949  						s.Partition = v
 32950  					}
 32951  					{
 32952  						v := s.Replicas
 32953  						a := v
 32954  						var l int32
 32955  						if isFlexible {
 32956  							l = b.CompactArrayLen()
 32957  						} else {
 32958  							l = b.ArrayLen()
 32959  						}
 32960  						if !b.Ok() {
 32961  							return b.Complete()
 32962  						}
 32963  						a = a[:0]
 32964  						if l > 0 {
 32965  							a = append(a, make([]int32, l)...)
 32966  						}
 32967  						for i := int32(0); i < l; i++ {
 32968  							v := b.Int32()
 32969  							a[i] = v
 32970  						}
 32971  						v = a
 32972  						s.Replicas = v
 32973  					}
 32974  					{
 32975  						v := s.AddingReplicas
 32976  						a := v
 32977  						var l int32
 32978  						if isFlexible {
 32979  							l = b.CompactArrayLen()
 32980  						} else {
 32981  							l = b.ArrayLen()
 32982  						}
 32983  						if !b.Ok() {
 32984  							return b.Complete()
 32985  						}
 32986  						a = a[:0]
 32987  						if l > 0 {
 32988  							a = append(a, make([]int32, l)...)
 32989  						}
 32990  						for i := int32(0); i < l; i++ {
 32991  							v := b.Int32()
 32992  							a[i] = v
 32993  						}
 32994  						v = a
 32995  						s.AddingReplicas = v
 32996  					}
 32997  					{
 32998  						v := s.RemovingReplicas
 32999  						a := v
 33000  						var l int32
 33001  						if isFlexible {
 33002  							l = b.CompactArrayLen()
 33003  						} else {
 33004  							l = b.ArrayLen()
 33005  						}
 33006  						if !b.Ok() {
 33007  							return b.Complete()
 33008  						}
 33009  						a = a[:0]
 33010  						if l > 0 {
 33011  							a = append(a, make([]int32, l)...)
 33012  						}
 33013  						for i := int32(0); i < l; i++ {
 33014  							v := b.Int32()
 33015  							a[i] = v
 33016  						}
 33017  						v = a
 33018  						s.RemovingReplicas = v
 33019  					}
 33020  					if isFlexible {
 33021  						s.UnknownTags = internalReadTags(&b)
 33022  					}
 33023  				}
 33024  				v = a
 33025  				s.Partitions = v
 33026  			}
 33027  			if isFlexible {
 33028  				s.UnknownTags = internalReadTags(&b)
 33029  			}
 33030  		}
 33031  		v = a
 33032  		s.Topics = v
 33033  	}
 33034  	if isFlexible {
 33035  		s.UnknownTags = internalReadTags(&b)
 33036  	}
 33037  	return b.Complete()
 33038  }
 33039  
 33040  // NewPtrListPartitionReassignmentsResponse returns a pointer to a default ListPartitionReassignmentsResponse
 33041  // This is a shortcut for creating a new(struct) and calling Default yourself.
 33042  func NewPtrListPartitionReassignmentsResponse() *ListPartitionReassignmentsResponse {
 33043  	var v ListPartitionReassignmentsResponse
 33044  	v.Default()
 33045  	return &v
 33046  }
 33047  
 33048  // Default sets any default fields. Calling this allows for future compatibility
 33049  // if new fields are added to ListPartitionReassignmentsResponse.
 33050  func (v *ListPartitionReassignmentsResponse) Default() {
 33051  }
 33052  
 33053  // NewListPartitionReassignmentsResponse returns a default ListPartitionReassignmentsResponse
 33054  // This is a shortcut for creating a struct and calling Default yourself.
 33055  func NewListPartitionReassignmentsResponse() ListPartitionReassignmentsResponse {
 33056  	var v ListPartitionReassignmentsResponse
 33057  	v.Default()
 33058  	return v
 33059  }
 33060  
 33061  type OffsetDeleteRequestTopicPartition struct {
 33062  	// Partition is a partition to delete offsets for.
 33063  	Partition int32
 33064  }
 33065  
 33066  // Default sets any default fields. Calling this allows for future compatibility
 33067  // if new fields are added to OffsetDeleteRequestTopicPartition.
 33068  func (v *OffsetDeleteRequestTopicPartition) Default() {
 33069  }
 33070  
 33071  // NewOffsetDeleteRequestTopicPartition returns a default OffsetDeleteRequestTopicPartition
 33072  // This is a shortcut for creating a struct and calling Default yourself.
 33073  func NewOffsetDeleteRequestTopicPartition() OffsetDeleteRequestTopicPartition {
 33074  	var v OffsetDeleteRequestTopicPartition
 33075  	v.Default()
 33076  	return v
 33077  }
 33078  
 33079  type OffsetDeleteRequestTopic struct {
 33080  	// Topic is a topic to delete offsets in.
 33081  	Topic string
 33082  
 33083  	// Partitions are partitions to delete offsets for.
 33084  	Partitions []OffsetDeleteRequestTopicPartition
 33085  }
 33086  
 33087  // Default sets any default fields. Calling this allows for future compatibility
 33088  // if new fields are added to OffsetDeleteRequestTopic.
 33089  func (v *OffsetDeleteRequestTopic) Default() {
 33090  }
 33091  
 33092  // NewOffsetDeleteRequestTopic returns a default OffsetDeleteRequestTopic
 33093  // This is a shortcut for creating a struct and calling Default yourself.
 33094  func NewOffsetDeleteRequestTopic() OffsetDeleteRequestTopic {
 33095  	var v OffsetDeleteRequestTopic
 33096  	v.Default()
 33097  	return v
 33098  }
 33099  
 33100  // OffsetDeleteRequest, proposed in KIP-496 and implemented in Kafka 2.4.0, is
 33101  // a request to delete group offsets.
 33102  //
 33103  // ACL wise, this requires DELETE on GROUP for the group and READ on TOPIC for
 33104  // each topic.
 33105  type OffsetDeleteRequest struct {
 33106  	// Version is the version of this message used with a Kafka broker.
 33107  	Version int16
 33108  
 33109  	// Group is the group to delete offsets in.
 33110  	Group string
 33111  
 33112  	// Topics are topics to delete offsets in.
 33113  	Topics []OffsetDeleteRequestTopic
 33114  }
 33115  
 33116  func (*OffsetDeleteRequest) Key() int16                   { return 47 }
 33117  func (*OffsetDeleteRequest) MaxVersion() int16            { return 0 }
 33118  func (v *OffsetDeleteRequest) SetVersion(version int16)   { v.Version = version }
 33119  func (v *OffsetDeleteRequest) GetVersion() int16          { return v.Version }
 33120  func (v *OffsetDeleteRequest) IsFlexible() bool           { return false }
 33121  func (v *OffsetDeleteRequest) IsGroupCoordinatorRequest() {}
 33122  func (v *OffsetDeleteRequest) ResponseKind() Response {
 33123  	r := &OffsetDeleteResponse{Version: v.Version}
 33124  	r.Default()
 33125  	return r
 33126  }
 33127  
 33128  // RequestWith is requests v on r and returns the response or an error.
 33129  // For sharded requests, the response may be merged and still return an error.
 33130  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 33131  func (v *OffsetDeleteRequest) RequestWith(ctx context.Context, r Requestor) (*OffsetDeleteResponse, error) {
 33132  	kresp, err := r.Request(ctx, v)
 33133  	resp, _ := kresp.(*OffsetDeleteResponse)
 33134  	return resp, err
 33135  }
 33136  
 33137  func (v *OffsetDeleteRequest) AppendTo(dst []byte) []byte {
 33138  	version := v.Version
 33139  	_ = version
 33140  	{
 33141  		v := v.Group
 33142  		dst = kbin.AppendString(dst, v)
 33143  	}
 33144  	{
 33145  		v := v.Topics
 33146  		dst = kbin.AppendArrayLen(dst, len(v))
 33147  		for i := range v {
 33148  			v := &v[i]
 33149  			{
 33150  				v := v.Topic
 33151  				dst = kbin.AppendString(dst, v)
 33152  			}
 33153  			{
 33154  				v := v.Partitions
 33155  				dst = kbin.AppendArrayLen(dst, len(v))
 33156  				for i := range v {
 33157  					v := &v[i]
 33158  					{
 33159  						v := v.Partition
 33160  						dst = kbin.AppendInt32(dst, v)
 33161  					}
 33162  				}
 33163  			}
 33164  		}
 33165  	}
 33166  	return dst
 33167  }
 33168  
 33169  func (v *OffsetDeleteRequest) ReadFrom(src []byte) error {
 33170  	return v.readFrom(src, false)
 33171  }
 33172  
 33173  func (v *OffsetDeleteRequest) UnsafeReadFrom(src []byte) error {
 33174  	return v.readFrom(src, true)
 33175  }
 33176  
 33177  func (v *OffsetDeleteRequest) readFrom(src []byte, unsafe bool) error {
 33178  	v.Default()
 33179  	b := kbin.Reader{Src: src}
 33180  	version := v.Version
 33181  	_ = version
 33182  	s := v
 33183  	{
 33184  		var v string
 33185  		if unsafe {
 33186  			v = b.UnsafeString()
 33187  		} else {
 33188  			v = b.String()
 33189  		}
 33190  		s.Group = v
 33191  	}
 33192  	{
 33193  		v := s.Topics
 33194  		a := v
 33195  		var l int32
 33196  		l = b.ArrayLen()
 33197  		if !b.Ok() {
 33198  			return b.Complete()
 33199  		}
 33200  		a = a[:0]
 33201  		if l > 0 {
 33202  			a = append(a, make([]OffsetDeleteRequestTopic, l)...)
 33203  		}
 33204  		for i := int32(0); i < l; i++ {
 33205  			v := &a[i]
 33206  			v.Default()
 33207  			s := v
 33208  			{
 33209  				var v string
 33210  				if unsafe {
 33211  					v = b.UnsafeString()
 33212  				} else {
 33213  					v = b.String()
 33214  				}
 33215  				s.Topic = v
 33216  			}
 33217  			{
 33218  				v := s.Partitions
 33219  				a := v
 33220  				var l int32
 33221  				l = b.ArrayLen()
 33222  				if !b.Ok() {
 33223  					return b.Complete()
 33224  				}
 33225  				a = a[:0]
 33226  				if l > 0 {
 33227  					a = append(a, make([]OffsetDeleteRequestTopicPartition, l)...)
 33228  				}
 33229  				for i := int32(0); i < l; i++ {
 33230  					v := &a[i]
 33231  					v.Default()
 33232  					s := v
 33233  					{
 33234  						v := b.Int32()
 33235  						s.Partition = v
 33236  					}
 33237  				}
 33238  				v = a
 33239  				s.Partitions = v
 33240  			}
 33241  		}
 33242  		v = a
 33243  		s.Topics = v
 33244  	}
 33245  	return b.Complete()
 33246  }
 33247  
 33248  // NewPtrOffsetDeleteRequest returns a pointer to a default OffsetDeleteRequest
 33249  // This is a shortcut for creating a new(struct) and calling Default yourself.
 33250  func NewPtrOffsetDeleteRequest() *OffsetDeleteRequest {
 33251  	var v OffsetDeleteRequest
 33252  	v.Default()
 33253  	return &v
 33254  }
 33255  
 33256  // Default sets any default fields. Calling this allows for future compatibility
 33257  // if new fields are added to OffsetDeleteRequest.
 33258  func (v *OffsetDeleteRequest) Default() {
 33259  }
 33260  
 33261  // NewOffsetDeleteRequest returns a default OffsetDeleteRequest
 33262  // This is a shortcut for creating a struct and calling Default yourself.
 33263  func NewOffsetDeleteRequest() OffsetDeleteRequest {
 33264  	var v OffsetDeleteRequest
 33265  	v.Default()
 33266  	return v
 33267  }
 33268  
 33269  type OffsetDeleteResponseTopicPartition struct {
 33270  	// Partition is the partition being responded to.
 33271  	Partition int32
 33272  
 33273  	// ErrorCode is any per partition error code.
 33274  	//
 33275  	// TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized
 33276  	// for the topic / partition.
 33277  	//
 33278  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the broker does not know of
 33279  	// the requested topic.
 33280  	//
 33281  	// GROUP_SUBSCRIBED_TO_TOPIC is returned if the topic is still subscribed to.
 33282  	ErrorCode int16
 33283  }
 33284  
 33285  // Default sets any default fields. Calling this allows for future compatibility
 33286  // if new fields are added to OffsetDeleteResponseTopicPartition.
 33287  func (v *OffsetDeleteResponseTopicPartition) Default() {
 33288  }
 33289  
 33290  // NewOffsetDeleteResponseTopicPartition returns a default OffsetDeleteResponseTopicPartition
 33291  // This is a shortcut for creating a struct and calling Default yourself.
 33292  func NewOffsetDeleteResponseTopicPartition() OffsetDeleteResponseTopicPartition {
 33293  	var v OffsetDeleteResponseTopicPartition
 33294  	v.Default()
 33295  	return v
 33296  }
 33297  
 33298  type OffsetDeleteResponseTopic struct {
 33299  	// Topic is the topic being responded to.
 33300  	Topic string
 33301  
 33302  	// Partitions are partitions being responded to.
 33303  	Partitions []OffsetDeleteResponseTopicPartition
 33304  }
 33305  
 33306  // Default sets any default fields. Calling this allows for future compatibility
 33307  // if new fields are added to OffsetDeleteResponseTopic.
 33308  func (v *OffsetDeleteResponseTopic) Default() {
 33309  }
 33310  
 33311  // NewOffsetDeleteResponseTopic returns a default OffsetDeleteResponseTopic
 33312  // This is a shortcut for creating a struct and calling Default yourself.
 33313  func NewOffsetDeleteResponseTopic() OffsetDeleteResponseTopic {
 33314  	var v OffsetDeleteResponseTopic
 33315  	v.Default()
 33316  	return v
 33317  }
 33318  
 33319  // OffsetDeleteResponse is a response to an offset delete request.
 33320  type OffsetDeleteResponse struct {
 33321  	// Version is the version of this message used with a Kafka broker.
 33322  	Version int16
 33323  
 33324  	// ErrorCode is any group wide error.
 33325  	//
 33326  	// GROUP_AUTHORIZATION_FAILED is returned if the client is not authorized
 33327  	// for the group.
 33328  	//
 33329  	// INVALID_GROUP_ID is returned in the requested group ID is invalid.
 33330  	//
 33331  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is not available.
 33332  	//
 33333  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the group is loading.
 33334  	//
 33335  	// NOT_COORDINATOR is returned if the requested broker is not the coordinator
 33336  	// for the requested group.
 33337  	//
 33338  	// GROUP_ID_NOT_FOUND is returned if the group ID does not exist.
 33339  	ErrorCode int16
 33340  
 33341  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 33342  	// after responding to this request.
 33343  	ThrottleMillis int32
 33344  
 33345  	// Topics are responses to requested topics.
 33346  	Topics []OffsetDeleteResponseTopic
 33347  }
 33348  
 33349  func (*OffsetDeleteResponse) Key() int16                         { return 47 }
 33350  func (*OffsetDeleteResponse) MaxVersion() int16                  { return 0 }
 33351  func (v *OffsetDeleteResponse) SetVersion(version int16)         { v.Version = version }
 33352  func (v *OffsetDeleteResponse) GetVersion() int16                { return v.Version }
 33353  func (v *OffsetDeleteResponse) IsFlexible() bool                 { return false }
 33354  func (v *OffsetDeleteResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 0 }
 33355  func (v *OffsetDeleteResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 33356  func (v *OffsetDeleteResponse) RequestKind() Request             { return &OffsetDeleteRequest{Version: v.Version} }
 33357  
 33358  func (v *OffsetDeleteResponse) AppendTo(dst []byte) []byte {
 33359  	version := v.Version
 33360  	_ = version
 33361  	{
 33362  		v := v.ErrorCode
 33363  		dst = kbin.AppendInt16(dst, v)
 33364  	}
 33365  	{
 33366  		v := v.ThrottleMillis
 33367  		dst = kbin.AppendInt32(dst, v)
 33368  	}
 33369  	{
 33370  		v := v.Topics
 33371  		dst = kbin.AppendArrayLen(dst, len(v))
 33372  		for i := range v {
 33373  			v := &v[i]
 33374  			{
 33375  				v := v.Topic
 33376  				dst = kbin.AppendString(dst, v)
 33377  			}
 33378  			{
 33379  				v := v.Partitions
 33380  				dst = kbin.AppendArrayLen(dst, len(v))
 33381  				for i := range v {
 33382  					v := &v[i]
 33383  					{
 33384  						v := v.Partition
 33385  						dst = kbin.AppendInt32(dst, v)
 33386  					}
 33387  					{
 33388  						v := v.ErrorCode
 33389  						dst = kbin.AppendInt16(dst, v)
 33390  					}
 33391  				}
 33392  			}
 33393  		}
 33394  	}
 33395  	return dst
 33396  }
 33397  
 33398  func (v *OffsetDeleteResponse) ReadFrom(src []byte) error {
 33399  	return v.readFrom(src, false)
 33400  }
 33401  
 33402  func (v *OffsetDeleteResponse) UnsafeReadFrom(src []byte) error {
 33403  	return v.readFrom(src, true)
 33404  }
 33405  
 33406  func (v *OffsetDeleteResponse) readFrom(src []byte, unsafe bool) error {
 33407  	v.Default()
 33408  	b := kbin.Reader{Src: src}
 33409  	version := v.Version
 33410  	_ = version
 33411  	s := v
 33412  	{
 33413  		v := b.Int16()
 33414  		s.ErrorCode = v
 33415  	}
 33416  	{
 33417  		v := b.Int32()
 33418  		s.ThrottleMillis = v
 33419  	}
 33420  	{
 33421  		v := s.Topics
 33422  		a := v
 33423  		var l int32
 33424  		l = b.ArrayLen()
 33425  		if !b.Ok() {
 33426  			return b.Complete()
 33427  		}
 33428  		a = a[:0]
 33429  		if l > 0 {
 33430  			a = append(a, make([]OffsetDeleteResponseTopic, l)...)
 33431  		}
 33432  		for i := int32(0); i < l; i++ {
 33433  			v := &a[i]
 33434  			v.Default()
 33435  			s := v
 33436  			{
 33437  				var v string
 33438  				if unsafe {
 33439  					v = b.UnsafeString()
 33440  				} else {
 33441  					v = b.String()
 33442  				}
 33443  				s.Topic = v
 33444  			}
 33445  			{
 33446  				v := s.Partitions
 33447  				a := v
 33448  				var l int32
 33449  				l = b.ArrayLen()
 33450  				if !b.Ok() {
 33451  					return b.Complete()
 33452  				}
 33453  				a = a[:0]
 33454  				if l > 0 {
 33455  					a = append(a, make([]OffsetDeleteResponseTopicPartition, l)...)
 33456  				}
 33457  				for i := int32(0); i < l; i++ {
 33458  					v := &a[i]
 33459  					v.Default()
 33460  					s := v
 33461  					{
 33462  						v := b.Int32()
 33463  						s.Partition = v
 33464  					}
 33465  					{
 33466  						v := b.Int16()
 33467  						s.ErrorCode = v
 33468  					}
 33469  				}
 33470  				v = a
 33471  				s.Partitions = v
 33472  			}
 33473  		}
 33474  		v = a
 33475  		s.Topics = v
 33476  	}
 33477  	return b.Complete()
 33478  }
 33479  
 33480  // NewPtrOffsetDeleteResponse returns a pointer to a default OffsetDeleteResponse
 33481  // This is a shortcut for creating a new(struct) and calling Default yourself.
 33482  func NewPtrOffsetDeleteResponse() *OffsetDeleteResponse {
 33483  	var v OffsetDeleteResponse
 33484  	v.Default()
 33485  	return &v
 33486  }
 33487  
 33488  // Default sets any default fields. Calling this allows for future compatibility
 33489  // if new fields are added to OffsetDeleteResponse.
 33490  func (v *OffsetDeleteResponse) Default() {
 33491  }
 33492  
 33493  // NewOffsetDeleteResponse returns a default OffsetDeleteResponse
 33494  // This is a shortcut for creating a struct and calling Default yourself.
 33495  func NewOffsetDeleteResponse() OffsetDeleteResponse {
 33496  	var v OffsetDeleteResponse
 33497  	v.Default()
 33498  	return v
 33499  }
 33500  
 33501  type DescribeClientQuotasRequestComponent struct {
 33502  	// EntityType is the entity component type that this filter component
 33503  	// applies to; some possible values are "user" or "client-id".
 33504  	EntityType string
 33505  
 33506  	// MatchType specifies how to match an entity,
 33507  	// with 0 meaning match on the name exactly,
 33508  	// 1 meaning match on the default name,
 33509  	// and 2 meaning any specified name.
 33510  	MatchType QuotasMatchType
 33511  
 33512  	// Match is the string to match against, or null if unused for the given
 33513  	// match type.
 33514  	Match *string
 33515  
 33516  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 33517  	UnknownTags Tags // v1+
 33518  }
 33519  
 33520  // Default sets any default fields. Calling this allows for future compatibility
 33521  // if new fields are added to DescribeClientQuotasRequestComponent.
 33522  func (v *DescribeClientQuotasRequestComponent) Default() {
 33523  }
 33524  
 33525  // NewDescribeClientQuotasRequestComponent returns a default DescribeClientQuotasRequestComponent
 33526  // This is a shortcut for creating a struct and calling Default yourself.
 33527  func NewDescribeClientQuotasRequestComponent() DescribeClientQuotasRequestComponent {
 33528  	var v DescribeClientQuotasRequestComponent
 33529  	v.Default()
 33530  	return v
 33531  }
 33532  
 33533  // DescribeClientQuotasRequest, proposed in KIP-546 and introduced with Kafka 2.6.0,
 33534  // provides a way to describe client quotas.
 33535  type DescribeClientQuotasRequest struct {
 33536  	// Version is the version of this message used with a Kafka broker.
 33537  	Version int16
 33538  
 33539  	// Components is a list of match filters to apply for describing quota entities.
 33540  	Components []DescribeClientQuotasRequestComponent
 33541  
 33542  	// Strict signifies whether matches are strict; if true, the response
 33543  	// excludes entities with unspecified entity types.
 33544  	Strict bool
 33545  
 33546  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 33547  	UnknownTags Tags // v1+
 33548  }
 33549  
 33550  func (*DescribeClientQuotasRequest) Key() int16                 { return 48 }
 33551  func (*DescribeClientQuotasRequest) MaxVersion() int16          { return 1 }
 33552  func (v *DescribeClientQuotasRequest) SetVersion(version int16) { v.Version = version }
 33553  func (v *DescribeClientQuotasRequest) GetVersion() int16        { return v.Version }
 33554  func (v *DescribeClientQuotasRequest) IsFlexible() bool         { return v.Version >= 1 }
 33555  func (v *DescribeClientQuotasRequest) ResponseKind() Response {
 33556  	r := &DescribeClientQuotasResponse{Version: v.Version}
 33557  	r.Default()
 33558  	return r
 33559  }
 33560  
 33561  // RequestWith is requests v on r and returns the response or an error.
 33562  // For sharded requests, the response may be merged and still return an error.
 33563  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 33564  func (v *DescribeClientQuotasRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeClientQuotasResponse, error) {
 33565  	kresp, err := r.Request(ctx, v)
 33566  	resp, _ := kresp.(*DescribeClientQuotasResponse)
 33567  	return resp, err
 33568  }
 33569  
 33570  func (v *DescribeClientQuotasRequest) AppendTo(dst []byte) []byte {
 33571  	version := v.Version
 33572  	_ = version
 33573  	isFlexible := version >= 1
 33574  	_ = isFlexible
 33575  	{
 33576  		v := v.Components
 33577  		if isFlexible {
 33578  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 33579  		} else {
 33580  			dst = kbin.AppendArrayLen(dst, len(v))
 33581  		}
 33582  		for i := range v {
 33583  			v := &v[i]
 33584  			{
 33585  				v := v.EntityType
 33586  				if isFlexible {
 33587  					dst = kbin.AppendCompactString(dst, v)
 33588  				} else {
 33589  					dst = kbin.AppendString(dst, v)
 33590  				}
 33591  			}
 33592  			{
 33593  				v := v.MatchType
 33594  				{
 33595  					v := int8(v)
 33596  					dst = kbin.AppendInt8(dst, v)
 33597  				}
 33598  			}
 33599  			{
 33600  				v := v.Match
 33601  				if isFlexible {
 33602  					dst = kbin.AppendCompactNullableString(dst, v)
 33603  				} else {
 33604  					dst = kbin.AppendNullableString(dst, v)
 33605  				}
 33606  			}
 33607  			if isFlexible {
 33608  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 33609  				dst = v.UnknownTags.AppendEach(dst)
 33610  			}
 33611  		}
 33612  	}
 33613  	{
 33614  		v := v.Strict
 33615  		dst = kbin.AppendBool(dst, v)
 33616  	}
 33617  	if isFlexible {
 33618  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 33619  		dst = v.UnknownTags.AppendEach(dst)
 33620  	}
 33621  	return dst
 33622  }
 33623  
 33624  func (v *DescribeClientQuotasRequest) ReadFrom(src []byte) error {
 33625  	return v.readFrom(src, false)
 33626  }
 33627  
 33628  func (v *DescribeClientQuotasRequest) UnsafeReadFrom(src []byte) error {
 33629  	return v.readFrom(src, true)
 33630  }
 33631  
 33632  func (v *DescribeClientQuotasRequest) readFrom(src []byte, unsafe bool) error {
 33633  	v.Default()
 33634  	b := kbin.Reader{Src: src}
 33635  	version := v.Version
 33636  	_ = version
 33637  	isFlexible := version >= 1
 33638  	_ = isFlexible
 33639  	s := v
 33640  	{
 33641  		v := s.Components
 33642  		a := v
 33643  		var l int32
 33644  		if isFlexible {
 33645  			l = b.CompactArrayLen()
 33646  		} else {
 33647  			l = b.ArrayLen()
 33648  		}
 33649  		if !b.Ok() {
 33650  			return b.Complete()
 33651  		}
 33652  		a = a[:0]
 33653  		if l > 0 {
 33654  			a = append(a, make([]DescribeClientQuotasRequestComponent, l)...)
 33655  		}
 33656  		for i := int32(0); i < l; i++ {
 33657  			v := &a[i]
 33658  			v.Default()
 33659  			s := v
 33660  			{
 33661  				var v string
 33662  				if unsafe {
 33663  					if isFlexible {
 33664  						v = b.UnsafeCompactString()
 33665  					} else {
 33666  						v = b.UnsafeString()
 33667  					}
 33668  				} else {
 33669  					if isFlexible {
 33670  						v = b.CompactString()
 33671  					} else {
 33672  						v = b.String()
 33673  					}
 33674  				}
 33675  				s.EntityType = v
 33676  			}
 33677  			{
 33678  				var t QuotasMatchType
 33679  				{
 33680  					v := b.Int8()
 33681  					t = QuotasMatchType(v)
 33682  				}
 33683  				v := t
 33684  				s.MatchType = v
 33685  			}
 33686  			{
 33687  				var v *string
 33688  				if isFlexible {
 33689  					if unsafe {
 33690  						v = b.UnsafeCompactNullableString()
 33691  					} else {
 33692  						v = b.CompactNullableString()
 33693  					}
 33694  				} else {
 33695  					if unsafe {
 33696  						v = b.UnsafeNullableString()
 33697  					} else {
 33698  						v = b.NullableString()
 33699  					}
 33700  				}
 33701  				s.Match = v
 33702  			}
 33703  			if isFlexible {
 33704  				s.UnknownTags = internalReadTags(&b)
 33705  			}
 33706  		}
 33707  		v = a
 33708  		s.Components = v
 33709  	}
 33710  	{
 33711  		v := b.Bool()
 33712  		s.Strict = v
 33713  	}
 33714  	if isFlexible {
 33715  		s.UnknownTags = internalReadTags(&b)
 33716  	}
 33717  	return b.Complete()
 33718  }
 33719  
 33720  // NewPtrDescribeClientQuotasRequest returns a pointer to a default DescribeClientQuotasRequest
 33721  // This is a shortcut for creating a new(struct) and calling Default yourself.
 33722  func NewPtrDescribeClientQuotasRequest() *DescribeClientQuotasRequest {
 33723  	var v DescribeClientQuotasRequest
 33724  	v.Default()
 33725  	return &v
 33726  }
 33727  
 33728  // Default sets any default fields. Calling this allows for future compatibility
 33729  // if new fields are added to DescribeClientQuotasRequest.
 33730  func (v *DescribeClientQuotasRequest) Default() {
 33731  }
 33732  
 33733  // NewDescribeClientQuotasRequest returns a default DescribeClientQuotasRequest
 33734  // This is a shortcut for creating a struct and calling Default yourself.
 33735  func NewDescribeClientQuotasRequest() DescribeClientQuotasRequest {
 33736  	var v DescribeClientQuotasRequest
 33737  	v.Default()
 33738  	return v
 33739  }
 33740  
 33741  type DescribeClientQuotasResponseEntryEntity struct {
 33742  	// Type is the entity type.
 33743  	Type string
 33744  
 33745  	// Name is the entity name, or null if the default.
 33746  	Name *string
 33747  
 33748  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 33749  	UnknownTags Tags // v1+
 33750  }
 33751  
 33752  // Default sets any default fields. Calling this allows for future compatibility
 33753  // if new fields are added to DescribeClientQuotasResponseEntryEntity.
 33754  func (v *DescribeClientQuotasResponseEntryEntity) Default() {
 33755  }
 33756  
 33757  // NewDescribeClientQuotasResponseEntryEntity returns a default DescribeClientQuotasResponseEntryEntity
 33758  // This is a shortcut for creating a struct and calling Default yourself.
 33759  func NewDescribeClientQuotasResponseEntryEntity() DescribeClientQuotasResponseEntryEntity {
 33760  	var v DescribeClientQuotasResponseEntryEntity
 33761  	v.Default()
 33762  	return v
 33763  }
 33764  
 33765  type DescribeClientQuotasResponseEntryValue struct {
 33766  	// Key is the quota configuration key.
 33767  	Key string
 33768  
 33769  	// Value is the quota configuration value.
 33770  	Value float64
 33771  
 33772  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 33773  	UnknownTags Tags // v1+
 33774  }
 33775  
 33776  // Default sets any default fields. Calling this allows for future compatibility
 33777  // if new fields are added to DescribeClientQuotasResponseEntryValue.
 33778  func (v *DescribeClientQuotasResponseEntryValue) Default() {
 33779  }
 33780  
 33781  // NewDescribeClientQuotasResponseEntryValue returns a default DescribeClientQuotasResponseEntryValue
 33782  // This is a shortcut for creating a struct and calling Default yourself.
 33783  func NewDescribeClientQuotasResponseEntryValue() DescribeClientQuotasResponseEntryValue {
 33784  	var v DescribeClientQuotasResponseEntryValue
 33785  	v.Default()
 33786  	return v
 33787  }
 33788  
 33789  type DescribeClientQuotasResponseEntry struct {
 33790  	// Entity contains the quota entity components being described.
 33791  	Entity []DescribeClientQuotasResponseEntryEntity
 33792  
 33793  	// Values are quota values for the entity.
 33794  	Values []DescribeClientQuotasResponseEntryValue
 33795  
 33796  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 33797  	UnknownTags Tags // v1+
 33798  }
 33799  
 33800  // Default sets any default fields. Calling this allows for future compatibility
 33801  // if new fields are added to DescribeClientQuotasResponseEntry.
 33802  func (v *DescribeClientQuotasResponseEntry) Default() {
 33803  }
 33804  
 33805  // NewDescribeClientQuotasResponseEntry returns a default DescribeClientQuotasResponseEntry
 33806  // This is a shortcut for creating a struct and calling Default yourself.
 33807  func NewDescribeClientQuotasResponseEntry() DescribeClientQuotasResponseEntry {
 33808  	var v DescribeClientQuotasResponseEntry
 33809  	v.Default()
 33810  	return v
 33811  }
 33812  
 33813  // DescribeClientQuotasResponse is a response for a DescribeClientQuotasRequest.
 33814  type DescribeClientQuotasResponse struct {
 33815  	// Version is the version of this message used with a Kafka broker.
 33816  	Version int16
 33817  
 33818  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 33819  	// after responding to this request.
 33820  	ThrottleMillis int32
 33821  
 33822  	// ErrorCode is any error for the request.
 33823  	ErrorCode int16
 33824  
 33825  	// ErrorMessage is an error message for the request, or null if the request succeeded.
 33826  	ErrorMessage *string
 33827  
 33828  	// Entries contains entities that were matched.
 33829  	Entries []DescribeClientQuotasResponseEntry
 33830  
 33831  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 33832  	UnknownTags Tags // v1+
 33833  }
 33834  
 33835  func (*DescribeClientQuotasResponse) Key() int16                 { return 48 }
 33836  func (*DescribeClientQuotasResponse) MaxVersion() int16          { return 1 }
 33837  func (v *DescribeClientQuotasResponse) SetVersion(version int16) { v.Version = version }
 33838  func (v *DescribeClientQuotasResponse) GetVersion() int16        { return v.Version }
 33839  func (v *DescribeClientQuotasResponse) IsFlexible() bool         { return v.Version >= 1 }
 33840  func (v *DescribeClientQuotasResponse) Throttle() (int32, bool) {
 33841  	return v.ThrottleMillis, v.Version >= 0
 33842  }
 33843  
 33844  func (v *DescribeClientQuotasResponse) SetThrottle(throttleMillis int32) {
 33845  	v.ThrottleMillis = throttleMillis
 33846  }
 33847  
 33848  func (v *DescribeClientQuotasResponse) RequestKind() Request {
 33849  	return &DescribeClientQuotasRequest{Version: v.Version}
 33850  }
 33851  
 33852  func (v *DescribeClientQuotasResponse) AppendTo(dst []byte) []byte {
 33853  	version := v.Version
 33854  	_ = version
 33855  	isFlexible := version >= 1
 33856  	_ = isFlexible
 33857  	{
 33858  		v := v.ThrottleMillis
 33859  		dst = kbin.AppendInt32(dst, v)
 33860  	}
 33861  	{
 33862  		v := v.ErrorCode
 33863  		dst = kbin.AppendInt16(dst, v)
 33864  	}
 33865  	{
 33866  		v := v.ErrorMessage
 33867  		if isFlexible {
 33868  			dst = kbin.AppendCompactNullableString(dst, v)
 33869  		} else {
 33870  			dst = kbin.AppendNullableString(dst, v)
 33871  		}
 33872  	}
 33873  	{
 33874  		v := v.Entries
 33875  		if isFlexible {
 33876  			dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 33877  		} else {
 33878  			dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 33879  		}
 33880  		for i := range v {
 33881  			v := &v[i]
 33882  			{
 33883  				v := v.Entity
 33884  				if isFlexible {
 33885  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 33886  				} else {
 33887  					dst = kbin.AppendArrayLen(dst, len(v))
 33888  				}
 33889  				for i := range v {
 33890  					v := &v[i]
 33891  					{
 33892  						v := v.Type
 33893  						if isFlexible {
 33894  							dst = kbin.AppendCompactString(dst, v)
 33895  						} else {
 33896  							dst = kbin.AppendString(dst, v)
 33897  						}
 33898  					}
 33899  					{
 33900  						v := v.Name
 33901  						if isFlexible {
 33902  							dst = kbin.AppendCompactNullableString(dst, v)
 33903  						} else {
 33904  							dst = kbin.AppendNullableString(dst, v)
 33905  						}
 33906  					}
 33907  					if isFlexible {
 33908  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 33909  						dst = v.UnknownTags.AppendEach(dst)
 33910  					}
 33911  				}
 33912  			}
 33913  			{
 33914  				v := v.Values
 33915  				if isFlexible {
 33916  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 33917  				} else {
 33918  					dst = kbin.AppendArrayLen(dst, len(v))
 33919  				}
 33920  				for i := range v {
 33921  					v := &v[i]
 33922  					{
 33923  						v := v.Key
 33924  						if isFlexible {
 33925  							dst = kbin.AppendCompactString(dst, v)
 33926  						} else {
 33927  							dst = kbin.AppendString(dst, v)
 33928  						}
 33929  					}
 33930  					{
 33931  						v := v.Value
 33932  						dst = kbin.AppendFloat64(dst, v)
 33933  					}
 33934  					if isFlexible {
 33935  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 33936  						dst = v.UnknownTags.AppendEach(dst)
 33937  					}
 33938  				}
 33939  			}
 33940  			if isFlexible {
 33941  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 33942  				dst = v.UnknownTags.AppendEach(dst)
 33943  			}
 33944  		}
 33945  	}
 33946  	if isFlexible {
 33947  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 33948  		dst = v.UnknownTags.AppendEach(dst)
 33949  	}
 33950  	return dst
 33951  }
 33952  
 33953  func (v *DescribeClientQuotasResponse) ReadFrom(src []byte) error {
 33954  	return v.readFrom(src, false)
 33955  }
 33956  
 33957  func (v *DescribeClientQuotasResponse) UnsafeReadFrom(src []byte) error {
 33958  	return v.readFrom(src, true)
 33959  }
 33960  
 33961  func (v *DescribeClientQuotasResponse) readFrom(src []byte, unsafe bool) error {
 33962  	v.Default()
 33963  	b := kbin.Reader{Src: src}
 33964  	version := v.Version
 33965  	_ = version
 33966  	isFlexible := version >= 1
 33967  	_ = isFlexible
 33968  	s := v
 33969  	{
 33970  		v := b.Int32()
 33971  		s.ThrottleMillis = v
 33972  	}
 33973  	{
 33974  		v := b.Int16()
 33975  		s.ErrorCode = v
 33976  	}
 33977  	{
 33978  		var v *string
 33979  		if isFlexible {
 33980  			if unsafe {
 33981  				v = b.UnsafeCompactNullableString()
 33982  			} else {
 33983  				v = b.CompactNullableString()
 33984  			}
 33985  		} else {
 33986  			if unsafe {
 33987  				v = b.UnsafeNullableString()
 33988  			} else {
 33989  				v = b.NullableString()
 33990  			}
 33991  		}
 33992  		s.ErrorMessage = v
 33993  	}
 33994  	{
 33995  		v := s.Entries
 33996  		a := v
 33997  		var l int32
 33998  		if isFlexible {
 33999  			l = b.CompactArrayLen()
 34000  		} else {
 34001  			l = b.ArrayLen()
 34002  		}
 34003  		if version < 0 || l == 0 {
 34004  			a = []DescribeClientQuotasResponseEntry{}
 34005  		}
 34006  		if !b.Ok() {
 34007  			return b.Complete()
 34008  		}
 34009  		a = a[:0]
 34010  		if l > 0 {
 34011  			a = append(a, make([]DescribeClientQuotasResponseEntry, l)...)
 34012  		}
 34013  		for i := int32(0); i < l; i++ {
 34014  			v := &a[i]
 34015  			v.Default()
 34016  			s := v
 34017  			{
 34018  				v := s.Entity
 34019  				a := v
 34020  				var l int32
 34021  				if isFlexible {
 34022  					l = b.CompactArrayLen()
 34023  				} else {
 34024  					l = b.ArrayLen()
 34025  				}
 34026  				if !b.Ok() {
 34027  					return b.Complete()
 34028  				}
 34029  				a = a[:0]
 34030  				if l > 0 {
 34031  					a = append(a, make([]DescribeClientQuotasResponseEntryEntity, l)...)
 34032  				}
 34033  				for i := int32(0); i < l; i++ {
 34034  					v := &a[i]
 34035  					v.Default()
 34036  					s := v
 34037  					{
 34038  						var v string
 34039  						if unsafe {
 34040  							if isFlexible {
 34041  								v = b.UnsafeCompactString()
 34042  							} else {
 34043  								v = b.UnsafeString()
 34044  							}
 34045  						} else {
 34046  							if isFlexible {
 34047  								v = b.CompactString()
 34048  							} else {
 34049  								v = b.String()
 34050  							}
 34051  						}
 34052  						s.Type = v
 34053  					}
 34054  					{
 34055  						var v *string
 34056  						if isFlexible {
 34057  							if unsafe {
 34058  								v = b.UnsafeCompactNullableString()
 34059  							} else {
 34060  								v = b.CompactNullableString()
 34061  							}
 34062  						} else {
 34063  							if unsafe {
 34064  								v = b.UnsafeNullableString()
 34065  							} else {
 34066  								v = b.NullableString()
 34067  							}
 34068  						}
 34069  						s.Name = v
 34070  					}
 34071  					if isFlexible {
 34072  						s.UnknownTags = internalReadTags(&b)
 34073  					}
 34074  				}
 34075  				v = a
 34076  				s.Entity = v
 34077  			}
 34078  			{
 34079  				v := s.Values
 34080  				a := v
 34081  				var l int32
 34082  				if isFlexible {
 34083  					l = b.CompactArrayLen()
 34084  				} else {
 34085  					l = b.ArrayLen()
 34086  				}
 34087  				if !b.Ok() {
 34088  					return b.Complete()
 34089  				}
 34090  				a = a[:0]
 34091  				if l > 0 {
 34092  					a = append(a, make([]DescribeClientQuotasResponseEntryValue, l)...)
 34093  				}
 34094  				for i := int32(0); i < l; i++ {
 34095  					v := &a[i]
 34096  					v.Default()
 34097  					s := v
 34098  					{
 34099  						var v string
 34100  						if unsafe {
 34101  							if isFlexible {
 34102  								v = b.UnsafeCompactString()
 34103  							} else {
 34104  								v = b.UnsafeString()
 34105  							}
 34106  						} else {
 34107  							if isFlexible {
 34108  								v = b.CompactString()
 34109  							} else {
 34110  								v = b.String()
 34111  							}
 34112  						}
 34113  						s.Key = v
 34114  					}
 34115  					{
 34116  						v := b.Float64()
 34117  						s.Value = v
 34118  					}
 34119  					if isFlexible {
 34120  						s.UnknownTags = internalReadTags(&b)
 34121  					}
 34122  				}
 34123  				v = a
 34124  				s.Values = v
 34125  			}
 34126  			if isFlexible {
 34127  				s.UnknownTags = internalReadTags(&b)
 34128  			}
 34129  		}
 34130  		v = a
 34131  		s.Entries = v
 34132  	}
 34133  	if isFlexible {
 34134  		s.UnknownTags = internalReadTags(&b)
 34135  	}
 34136  	return b.Complete()
 34137  }
 34138  
 34139  // NewPtrDescribeClientQuotasResponse returns a pointer to a default DescribeClientQuotasResponse
 34140  // This is a shortcut for creating a new(struct) and calling Default yourself.
 34141  func NewPtrDescribeClientQuotasResponse() *DescribeClientQuotasResponse {
 34142  	var v DescribeClientQuotasResponse
 34143  	v.Default()
 34144  	return &v
 34145  }
 34146  
 34147  // Default sets any default fields. Calling this allows for future compatibility
 34148  // if new fields are added to DescribeClientQuotasResponse.
 34149  func (v *DescribeClientQuotasResponse) Default() {
 34150  }
 34151  
 34152  // NewDescribeClientQuotasResponse returns a default DescribeClientQuotasResponse
 34153  // This is a shortcut for creating a struct and calling Default yourself.
 34154  func NewDescribeClientQuotasResponse() DescribeClientQuotasResponse {
 34155  	var v DescribeClientQuotasResponse
 34156  	v.Default()
 34157  	return v
 34158  }
 34159  
 34160  type AlterClientQuotasRequestEntryEntity struct {
 34161  	// Type is the entity component's type; e.g. "client-id", "user" or "ip".
 34162  	Type string
 34163  
 34164  	// Name is the name of the entity, or null for the default.
 34165  	Name *string
 34166  
 34167  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34168  	UnknownTags Tags // v1+
 34169  }
 34170  
 34171  // Default sets any default fields. Calling this allows for future compatibility
 34172  // if new fields are added to AlterClientQuotasRequestEntryEntity.
 34173  func (v *AlterClientQuotasRequestEntryEntity) Default() {
 34174  }
 34175  
 34176  // NewAlterClientQuotasRequestEntryEntity returns a default AlterClientQuotasRequestEntryEntity
 34177  // This is a shortcut for creating a struct and calling Default yourself.
 34178  func NewAlterClientQuotasRequestEntryEntity() AlterClientQuotasRequestEntryEntity {
 34179  	var v AlterClientQuotasRequestEntryEntity
 34180  	v.Default()
 34181  	return v
 34182  }
 34183  
 34184  type AlterClientQuotasRequestEntryOp struct {
 34185  	// Key is the quota configuration key to alter.
 34186  	Key string
 34187  
 34188  	// Value is the value to set; ignored if remove is true.
 34189  	Value float64
 34190  
 34191  	// Remove is whether the quota configuration value should be removed or set.
 34192  	Remove bool
 34193  
 34194  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34195  	UnknownTags Tags // v1+
 34196  }
 34197  
 34198  // Default sets any default fields. Calling this allows for future compatibility
 34199  // if new fields are added to AlterClientQuotasRequestEntryOp.
 34200  func (v *AlterClientQuotasRequestEntryOp) Default() {
 34201  }
 34202  
 34203  // NewAlterClientQuotasRequestEntryOp returns a default AlterClientQuotasRequestEntryOp
 34204  // This is a shortcut for creating a struct and calling Default yourself.
 34205  func NewAlterClientQuotasRequestEntryOp() AlterClientQuotasRequestEntryOp {
 34206  	var v AlterClientQuotasRequestEntryOp
 34207  	v.Default()
 34208  	return v
 34209  }
 34210  
 34211  type AlterClientQuotasRequestEntry struct {
 34212  	// Entity contains the components of a quota entity to alter.
 34213  	Entity []AlterClientQuotasRequestEntryEntity
 34214  
 34215  	// Ops contains quota configuration entries to alter.
 34216  	Ops []AlterClientQuotasRequestEntryOp
 34217  
 34218  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34219  	UnknownTags Tags // v1+
 34220  }
 34221  
 34222  // Default sets any default fields. Calling this allows for future compatibility
 34223  // if new fields are added to AlterClientQuotasRequestEntry.
 34224  func (v *AlterClientQuotasRequestEntry) Default() {
 34225  }
 34226  
 34227  // NewAlterClientQuotasRequestEntry returns a default AlterClientQuotasRequestEntry
 34228  // This is a shortcut for creating a struct and calling Default yourself.
 34229  func NewAlterClientQuotasRequestEntry() AlterClientQuotasRequestEntry {
 34230  	var v AlterClientQuotasRequestEntry
 34231  	v.Default()
 34232  	return v
 34233  }
 34234  
 34235  // AlterClientQuotaRequest, proposed in KIP-546 and introduced with Kafka 2.6.0,
 34236  // provides a way to alter client quotas.
 34237  type AlterClientQuotasRequest struct {
 34238  	// Version is the version of this message used with a Kafka broker.
 34239  	Version int16
 34240  
 34241  	// Entries are quota configuration entries to alter.
 34242  	Entries []AlterClientQuotasRequestEntry
 34243  
 34244  	// ValidateOnly is makes this request a dry-run; the alteration is validated
 34245  	// but not performed.
 34246  	ValidateOnly bool
 34247  
 34248  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34249  	UnknownTags Tags // v1+
 34250  }
 34251  
 34252  func (*AlterClientQuotasRequest) Key() int16                 { return 49 }
 34253  func (*AlterClientQuotasRequest) MaxVersion() int16          { return 1 }
 34254  func (v *AlterClientQuotasRequest) SetVersion(version int16) { v.Version = version }
 34255  func (v *AlterClientQuotasRequest) GetVersion() int16        { return v.Version }
 34256  func (v *AlterClientQuotasRequest) IsFlexible() bool         { return v.Version >= 1 }
 34257  func (v *AlterClientQuotasRequest) ResponseKind() Response {
 34258  	r := &AlterClientQuotasResponse{Version: v.Version}
 34259  	r.Default()
 34260  	return r
 34261  }
 34262  
 34263  // RequestWith is requests v on r and returns the response or an error.
 34264  // For sharded requests, the response may be merged and still return an error.
 34265  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 34266  func (v *AlterClientQuotasRequest) RequestWith(ctx context.Context, r Requestor) (*AlterClientQuotasResponse, error) {
 34267  	kresp, err := r.Request(ctx, v)
 34268  	resp, _ := kresp.(*AlterClientQuotasResponse)
 34269  	return resp, err
 34270  }
 34271  
 34272  func (v *AlterClientQuotasRequest) AppendTo(dst []byte) []byte {
 34273  	version := v.Version
 34274  	_ = version
 34275  	isFlexible := version >= 1
 34276  	_ = isFlexible
 34277  	{
 34278  		v := v.Entries
 34279  		if isFlexible {
 34280  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 34281  		} else {
 34282  			dst = kbin.AppendArrayLen(dst, len(v))
 34283  		}
 34284  		for i := range v {
 34285  			v := &v[i]
 34286  			{
 34287  				v := v.Entity
 34288  				if isFlexible {
 34289  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 34290  				} else {
 34291  					dst = kbin.AppendArrayLen(dst, len(v))
 34292  				}
 34293  				for i := range v {
 34294  					v := &v[i]
 34295  					{
 34296  						v := v.Type
 34297  						if isFlexible {
 34298  							dst = kbin.AppendCompactString(dst, v)
 34299  						} else {
 34300  							dst = kbin.AppendString(dst, v)
 34301  						}
 34302  					}
 34303  					{
 34304  						v := v.Name
 34305  						if isFlexible {
 34306  							dst = kbin.AppendCompactNullableString(dst, v)
 34307  						} else {
 34308  							dst = kbin.AppendNullableString(dst, v)
 34309  						}
 34310  					}
 34311  					if isFlexible {
 34312  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34313  						dst = v.UnknownTags.AppendEach(dst)
 34314  					}
 34315  				}
 34316  			}
 34317  			{
 34318  				v := v.Ops
 34319  				if isFlexible {
 34320  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 34321  				} else {
 34322  					dst = kbin.AppendArrayLen(dst, len(v))
 34323  				}
 34324  				for i := range v {
 34325  					v := &v[i]
 34326  					{
 34327  						v := v.Key
 34328  						if isFlexible {
 34329  							dst = kbin.AppendCompactString(dst, v)
 34330  						} else {
 34331  							dst = kbin.AppendString(dst, v)
 34332  						}
 34333  					}
 34334  					{
 34335  						v := v.Value
 34336  						dst = kbin.AppendFloat64(dst, v)
 34337  					}
 34338  					{
 34339  						v := v.Remove
 34340  						dst = kbin.AppendBool(dst, v)
 34341  					}
 34342  					if isFlexible {
 34343  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34344  						dst = v.UnknownTags.AppendEach(dst)
 34345  					}
 34346  				}
 34347  			}
 34348  			if isFlexible {
 34349  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34350  				dst = v.UnknownTags.AppendEach(dst)
 34351  			}
 34352  		}
 34353  	}
 34354  	{
 34355  		v := v.ValidateOnly
 34356  		dst = kbin.AppendBool(dst, v)
 34357  	}
 34358  	if isFlexible {
 34359  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34360  		dst = v.UnknownTags.AppendEach(dst)
 34361  	}
 34362  	return dst
 34363  }
 34364  
 34365  func (v *AlterClientQuotasRequest) ReadFrom(src []byte) error {
 34366  	return v.readFrom(src, false)
 34367  }
 34368  
 34369  func (v *AlterClientQuotasRequest) UnsafeReadFrom(src []byte) error {
 34370  	return v.readFrom(src, true)
 34371  }
 34372  
 34373  func (v *AlterClientQuotasRequest) readFrom(src []byte, unsafe bool) error {
 34374  	v.Default()
 34375  	b := kbin.Reader{Src: src}
 34376  	version := v.Version
 34377  	_ = version
 34378  	isFlexible := version >= 1
 34379  	_ = isFlexible
 34380  	s := v
 34381  	{
 34382  		v := s.Entries
 34383  		a := v
 34384  		var l int32
 34385  		if isFlexible {
 34386  			l = b.CompactArrayLen()
 34387  		} else {
 34388  			l = b.ArrayLen()
 34389  		}
 34390  		if !b.Ok() {
 34391  			return b.Complete()
 34392  		}
 34393  		a = a[:0]
 34394  		if l > 0 {
 34395  			a = append(a, make([]AlterClientQuotasRequestEntry, l)...)
 34396  		}
 34397  		for i := int32(0); i < l; i++ {
 34398  			v := &a[i]
 34399  			v.Default()
 34400  			s := v
 34401  			{
 34402  				v := s.Entity
 34403  				a := v
 34404  				var l int32
 34405  				if isFlexible {
 34406  					l = b.CompactArrayLen()
 34407  				} else {
 34408  					l = b.ArrayLen()
 34409  				}
 34410  				if !b.Ok() {
 34411  					return b.Complete()
 34412  				}
 34413  				a = a[:0]
 34414  				if l > 0 {
 34415  					a = append(a, make([]AlterClientQuotasRequestEntryEntity, l)...)
 34416  				}
 34417  				for i := int32(0); i < l; i++ {
 34418  					v := &a[i]
 34419  					v.Default()
 34420  					s := v
 34421  					{
 34422  						var v string
 34423  						if unsafe {
 34424  							if isFlexible {
 34425  								v = b.UnsafeCompactString()
 34426  							} else {
 34427  								v = b.UnsafeString()
 34428  							}
 34429  						} else {
 34430  							if isFlexible {
 34431  								v = b.CompactString()
 34432  							} else {
 34433  								v = b.String()
 34434  							}
 34435  						}
 34436  						s.Type = v
 34437  					}
 34438  					{
 34439  						var v *string
 34440  						if isFlexible {
 34441  							if unsafe {
 34442  								v = b.UnsafeCompactNullableString()
 34443  							} else {
 34444  								v = b.CompactNullableString()
 34445  							}
 34446  						} else {
 34447  							if unsafe {
 34448  								v = b.UnsafeNullableString()
 34449  							} else {
 34450  								v = b.NullableString()
 34451  							}
 34452  						}
 34453  						s.Name = v
 34454  					}
 34455  					if isFlexible {
 34456  						s.UnknownTags = internalReadTags(&b)
 34457  					}
 34458  				}
 34459  				v = a
 34460  				s.Entity = v
 34461  			}
 34462  			{
 34463  				v := s.Ops
 34464  				a := v
 34465  				var l int32
 34466  				if isFlexible {
 34467  					l = b.CompactArrayLen()
 34468  				} else {
 34469  					l = b.ArrayLen()
 34470  				}
 34471  				if !b.Ok() {
 34472  					return b.Complete()
 34473  				}
 34474  				a = a[:0]
 34475  				if l > 0 {
 34476  					a = append(a, make([]AlterClientQuotasRequestEntryOp, l)...)
 34477  				}
 34478  				for i := int32(0); i < l; i++ {
 34479  					v := &a[i]
 34480  					v.Default()
 34481  					s := v
 34482  					{
 34483  						var v string
 34484  						if unsafe {
 34485  							if isFlexible {
 34486  								v = b.UnsafeCompactString()
 34487  							} else {
 34488  								v = b.UnsafeString()
 34489  							}
 34490  						} else {
 34491  							if isFlexible {
 34492  								v = b.CompactString()
 34493  							} else {
 34494  								v = b.String()
 34495  							}
 34496  						}
 34497  						s.Key = v
 34498  					}
 34499  					{
 34500  						v := b.Float64()
 34501  						s.Value = v
 34502  					}
 34503  					{
 34504  						v := b.Bool()
 34505  						s.Remove = v
 34506  					}
 34507  					if isFlexible {
 34508  						s.UnknownTags = internalReadTags(&b)
 34509  					}
 34510  				}
 34511  				v = a
 34512  				s.Ops = v
 34513  			}
 34514  			if isFlexible {
 34515  				s.UnknownTags = internalReadTags(&b)
 34516  			}
 34517  		}
 34518  		v = a
 34519  		s.Entries = v
 34520  	}
 34521  	{
 34522  		v := b.Bool()
 34523  		s.ValidateOnly = v
 34524  	}
 34525  	if isFlexible {
 34526  		s.UnknownTags = internalReadTags(&b)
 34527  	}
 34528  	return b.Complete()
 34529  }
 34530  
 34531  // NewPtrAlterClientQuotasRequest returns a pointer to a default AlterClientQuotasRequest
 34532  // This is a shortcut for creating a new(struct) and calling Default yourself.
 34533  func NewPtrAlterClientQuotasRequest() *AlterClientQuotasRequest {
 34534  	var v AlterClientQuotasRequest
 34535  	v.Default()
 34536  	return &v
 34537  }
 34538  
 34539  // Default sets any default fields. Calling this allows for future compatibility
 34540  // if new fields are added to AlterClientQuotasRequest.
 34541  func (v *AlterClientQuotasRequest) Default() {
 34542  }
 34543  
 34544  // NewAlterClientQuotasRequest returns a default AlterClientQuotasRequest
 34545  // This is a shortcut for creating a struct and calling Default yourself.
 34546  func NewAlterClientQuotasRequest() AlterClientQuotasRequest {
 34547  	var v AlterClientQuotasRequest
 34548  	v.Default()
 34549  	return v
 34550  }
 34551  
 34552  type AlterClientQuotasResponseEntryEntity struct {
 34553  	// Type is the entity component's type; e.g. "client-id" or "user".
 34554  	Type string
 34555  
 34556  	// Name is the name of the entity, or null for the default.
 34557  	Name *string
 34558  
 34559  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34560  	UnknownTags Tags // v1+
 34561  }
 34562  
 34563  // Default sets any default fields. Calling this allows for future compatibility
 34564  // if new fields are added to AlterClientQuotasResponseEntryEntity.
 34565  func (v *AlterClientQuotasResponseEntryEntity) Default() {
 34566  }
 34567  
 34568  // NewAlterClientQuotasResponseEntryEntity returns a default AlterClientQuotasResponseEntryEntity
 34569  // This is a shortcut for creating a struct and calling Default yourself.
 34570  func NewAlterClientQuotasResponseEntryEntity() AlterClientQuotasResponseEntryEntity {
 34571  	var v AlterClientQuotasResponseEntryEntity
 34572  	v.Default()
 34573  	return v
 34574  }
 34575  
 34576  type AlterClientQuotasResponseEntry struct {
 34577  	// ErrorCode is the error code for an alter on a matched entity.
 34578  	ErrorCode int16
 34579  
 34580  	// ErrorMessage is an informative message if the alter on this entity failed.
 34581  	ErrorMessage *string
 34582  
 34583  	// Entity contains the components of a matched entity.
 34584  	Entity []AlterClientQuotasResponseEntryEntity
 34585  
 34586  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34587  	UnknownTags Tags // v1+
 34588  }
 34589  
 34590  // Default sets any default fields. Calling this allows for future compatibility
 34591  // if new fields are added to AlterClientQuotasResponseEntry.
 34592  func (v *AlterClientQuotasResponseEntry) Default() {
 34593  }
 34594  
 34595  // NewAlterClientQuotasResponseEntry returns a default AlterClientQuotasResponseEntry
 34596  // This is a shortcut for creating a struct and calling Default yourself.
 34597  func NewAlterClientQuotasResponseEntry() AlterClientQuotasResponseEntry {
 34598  	var v AlterClientQuotasResponseEntry
 34599  	v.Default()
 34600  	return v
 34601  }
 34602  
 34603  // AlterClientQuotasResponse is a response to an AlterClientQuotasRequest.
 34604  type AlterClientQuotasResponse struct {
 34605  	// Version is the version of this message used with a Kafka broker.
 34606  	Version int16
 34607  
 34608  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 34609  	// after responding to this request.
 34610  	ThrottleMillis int32
 34611  
 34612  	// Entries contains results for the alter request.
 34613  	Entries []AlterClientQuotasResponseEntry
 34614  
 34615  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34616  	UnknownTags Tags // v1+
 34617  }
 34618  
 34619  func (*AlterClientQuotasResponse) Key() int16                 { return 49 }
 34620  func (*AlterClientQuotasResponse) MaxVersion() int16          { return 1 }
 34621  func (v *AlterClientQuotasResponse) SetVersion(version int16) { v.Version = version }
 34622  func (v *AlterClientQuotasResponse) GetVersion() int16        { return v.Version }
 34623  func (v *AlterClientQuotasResponse) IsFlexible() bool         { return v.Version >= 1 }
 34624  func (v *AlterClientQuotasResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 0 }
 34625  func (v *AlterClientQuotasResponse) SetThrottle(throttleMillis int32) {
 34626  	v.ThrottleMillis = throttleMillis
 34627  }
 34628  
 34629  func (v *AlterClientQuotasResponse) RequestKind() Request {
 34630  	return &AlterClientQuotasRequest{Version: v.Version}
 34631  }
 34632  
 34633  func (v *AlterClientQuotasResponse) AppendTo(dst []byte) []byte {
 34634  	version := v.Version
 34635  	_ = version
 34636  	isFlexible := version >= 1
 34637  	_ = isFlexible
 34638  	{
 34639  		v := v.ThrottleMillis
 34640  		dst = kbin.AppendInt32(dst, v)
 34641  	}
 34642  	{
 34643  		v := v.Entries
 34644  		if isFlexible {
 34645  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 34646  		} else {
 34647  			dst = kbin.AppendArrayLen(dst, len(v))
 34648  		}
 34649  		for i := range v {
 34650  			v := &v[i]
 34651  			{
 34652  				v := v.ErrorCode
 34653  				dst = kbin.AppendInt16(dst, v)
 34654  			}
 34655  			{
 34656  				v := v.ErrorMessage
 34657  				if isFlexible {
 34658  					dst = kbin.AppendCompactNullableString(dst, v)
 34659  				} else {
 34660  					dst = kbin.AppendNullableString(dst, v)
 34661  				}
 34662  			}
 34663  			{
 34664  				v := v.Entity
 34665  				if isFlexible {
 34666  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 34667  				} else {
 34668  					dst = kbin.AppendArrayLen(dst, len(v))
 34669  				}
 34670  				for i := range v {
 34671  					v := &v[i]
 34672  					{
 34673  						v := v.Type
 34674  						if isFlexible {
 34675  							dst = kbin.AppendCompactString(dst, v)
 34676  						} else {
 34677  							dst = kbin.AppendString(dst, v)
 34678  						}
 34679  					}
 34680  					{
 34681  						v := v.Name
 34682  						if isFlexible {
 34683  							dst = kbin.AppendCompactNullableString(dst, v)
 34684  						} else {
 34685  							dst = kbin.AppendNullableString(dst, v)
 34686  						}
 34687  					}
 34688  					if isFlexible {
 34689  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34690  						dst = v.UnknownTags.AppendEach(dst)
 34691  					}
 34692  				}
 34693  			}
 34694  			if isFlexible {
 34695  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34696  				dst = v.UnknownTags.AppendEach(dst)
 34697  			}
 34698  		}
 34699  	}
 34700  	if isFlexible {
 34701  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34702  		dst = v.UnknownTags.AppendEach(dst)
 34703  	}
 34704  	return dst
 34705  }
 34706  
 34707  func (v *AlterClientQuotasResponse) ReadFrom(src []byte) error {
 34708  	return v.readFrom(src, false)
 34709  }
 34710  
 34711  func (v *AlterClientQuotasResponse) UnsafeReadFrom(src []byte) error {
 34712  	return v.readFrom(src, true)
 34713  }
 34714  
 34715  func (v *AlterClientQuotasResponse) readFrom(src []byte, unsafe bool) error {
 34716  	v.Default()
 34717  	b := kbin.Reader{Src: src}
 34718  	version := v.Version
 34719  	_ = version
 34720  	isFlexible := version >= 1
 34721  	_ = isFlexible
 34722  	s := v
 34723  	{
 34724  		v := b.Int32()
 34725  		s.ThrottleMillis = v
 34726  	}
 34727  	{
 34728  		v := s.Entries
 34729  		a := v
 34730  		var l int32
 34731  		if isFlexible {
 34732  			l = b.CompactArrayLen()
 34733  		} else {
 34734  			l = b.ArrayLen()
 34735  		}
 34736  		if !b.Ok() {
 34737  			return b.Complete()
 34738  		}
 34739  		a = a[:0]
 34740  		if l > 0 {
 34741  			a = append(a, make([]AlterClientQuotasResponseEntry, l)...)
 34742  		}
 34743  		for i := int32(0); i < l; i++ {
 34744  			v := &a[i]
 34745  			v.Default()
 34746  			s := v
 34747  			{
 34748  				v := b.Int16()
 34749  				s.ErrorCode = v
 34750  			}
 34751  			{
 34752  				var v *string
 34753  				if isFlexible {
 34754  					if unsafe {
 34755  						v = b.UnsafeCompactNullableString()
 34756  					} else {
 34757  						v = b.CompactNullableString()
 34758  					}
 34759  				} else {
 34760  					if unsafe {
 34761  						v = b.UnsafeNullableString()
 34762  					} else {
 34763  						v = b.NullableString()
 34764  					}
 34765  				}
 34766  				s.ErrorMessage = v
 34767  			}
 34768  			{
 34769  				v := s.Entity
 34770  				a := v
 34771  				var l int32
 34772  				if isFlexible {
 34773  					l = b.CompactArrayLen()
 34774  				} else {
 34775  					l = b.ArrayLen()
 34776  				}
 34777  				if !b.Ok() {
 34778  					return b.Complete()
 34779  				}
 34780  				a = a[:0]
 34781  				if l > 0 {
 34782  					a = append(a, make([]AlterClientQuotasResponseEntryEntity, l)...)
 34783  				}
 34784  				for i := int32(0); i < l; i++ {
 34785  					v := &a[i]
 34786  					v.Default()
 34787  					s := v
 34788  					{
 34789  						var v string
 34790  						if unsafe {
 34791  							if isFlexible {
 34792  								v = b.UnsafeCompactString()
 34793  							} else {
 34794  								v = b.UnsafeString()
 34795  							}
 34796  						} else {
 34797  							if isFlexible {
 34798  								v = b.CompactString()
 34799  							} else {
 34800  								v = b.String()
 34801  							}
 34802  						}
 34803  						s.Type = v
 34804  					}
 34805  					{
 34806  						var v *string
 34807  						if isFlexible {
 34808  							if unsafe {
 34809  								v = b.UnsafeCompactNullableString()
 34810  							} else {
 34811  								v = b.CompactNullableString()
 34812  							}
 34813  						} else {
 34814  							if unsafe {
 34815  								v = b.UnsafeNullableString()
 34816  							} else {
 34817  								v = b.NullableString()
 34818  							}
 34819  						}
 34820  						s.Name = v
 34821  					}
 34822  					if isFlexible {
 34823  						s.UnknownTags = internalReadTags(&b)
 34824  					}
 34825  				}
 34826  				v = a
 34827  				s.Entity = v
 34828  			}
 34829  			if isFlexible {
 34830  				s.UnknownTags = internalReadTags(&b)
 34831  			}
 34832  		}
 34833  		v = a
 34834  		s.Entries = v
 34835  	}
 34836  	if isFlexible {
 34837  		s.UnknownTags = internalReadTags(&b)
 34838  	}
 34839  	return b.Complete()
 34840  }
 34841  
 34842  // NewPtrAlterClientQuotasResponse returns a pointer to a default AlterClientQuotasResponse
 34843  // This is a shortcut for creating a new(struct) and calling Default yourself.
 34844  func NewPtrAlterClientQuotasResponse() *AlterClientQuotasResponse {
 34845  	var v AlterClientQuotasResponse
 34846  	v.Default()
 34847  	return &v
 34848  }
 34849  
 34850  // Default sets any default fields. Calling this allows for future compatibility
 34851  // if new fields are added to AlterClientQuotasResponse.
 34852  func (v *AlterClientQuotasResponse) Default() {
 34853  }
 34854  
 34855  // NewAlterClientQuotasResponse returns a default AlterClientQuotasResponse
 34856  // This is a shortcut for creating a struct and calling Default yourself.
 34857  func NewAlterClientQuotasResponse() AlterClientQuotasResponse {
 34858  	var v AlterClientQuotasResponse
 34859  	v.Default()
 34860  	return v
 34861  }
 34862  
 34863  type DescribeUserSCRAMCredentialsRequestUser struct {
 34864  	// The user name.
 34865  	Name string
 34866  
 34867  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34868  	UnknownTags Tags
 34869  }
 34870  
 34871  // Default sets any default fields. Calling this allows for future compatibility
 34872  // if new fields are added to DescribeUserSCRAMCredentialsRequestUser.
 34873  func (v *DescribeUserSCRAMCredentialsRequestUser) Default() {
 34874  }
 34875  
 34876  // NewDescribeUserSCRAMCredentialsRequestUser returns a default DescribeUserSCRAMCredentialsRequestUser
 34877  // This is a shortcut for creating a struct and calling Default yourself.
 34878  func NewDescribeUserSCRAMCredentialsRequestUser() DescribeUserSCRAMCredentialsRequestUser {
 34879  	var v DescribeUserSCRAMCredentialsRequestUser
 34880  	v.Default()
 34881  	return v
 34882  }
 34883  
 34884  // DescribeUserSCRAMCredentialsRequest, proposed in KIP-554 and introduced
 34885  // with Kafka 2.7.0, describes user SCRAM credentials.
 34886  //
 34887  // This request was introduced as part of the overarching KIP-500 initiative,
 34888  // which is to remove Zookeeper as a dependency.
 34889  //
 34890  // This request requires DESCRIBE on CLUSTER.
 34891  type DescribeUserSCRAMCredentialsRequest struct {
 34892  	// Version is the version of this message used with a Kafka broker.
 34893  	Version int16
 34894  
 34895  	// The users to describe, or null to describe all.
 34896  	Users []DescribeUserSCRAMCredentialsRequestUser
 34897  
 34898  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 34899  	UnknownTags Tags
 34900  }
 34901  
 34902  func (*DescribeUserSCRAMCredentialsRequest) Key() int16                 { return 50 }
 34903  func (*DescribeUserSCRAMCredentialsRequest) MaxVersion() int16          { return 0 }
 34904  func (v *DescribeUserSCRAMCredentialsRequest) SetVersion(version int16) { v.Version = version }
 34905  func (v *DescribeUserSCRAMCredentialsRequest) GetVersion() int16        { return v.Version }
 34906  func (v *DescribeUserSCRAMCredentialsRequest) IsFlexible() bool         { return v.Version >= 0 }
 34907  func (v *DescribeUserSCRAMCredentialsRequest) ResponseKind() Response {
 34908  	r := &DescribeUserSCRAMCredentialsResponse{Version: v.Version}
 34909  	r.Default()
 34910  	return r
 34911  }
 34912  
 34913  // RequestWith is requests v on r and returns the response or an error.
 34914  // For sharded requests, the response may be merged and still return an error.
 34915  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 34916  func (v *DescribeUserSCRAMCredentialsRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeUserSCRAMCredentialsResponse, error) {
 34917  	kresp, err := r.Request(ctx, v)
 34918  	resp, _ := kresp.(*DescribeUserSCRAMCredentialsResponse)
 34919  	return resp, err
 34920  }
 34921  
 34922  func (v *DescribeUserSCRAMCredentialsRequest) AppendTo(dst []byte) []byte {
 34923  	version := v.Version
 34924  	_ = version
 34925  	isFlexible := version >= 0
 34926  	_ = isFlexible
 34927  	{
 34928  		v := v.Users
 34929  		if isFlexible {
 34930  			dst = kbin.AppendCompactNullableArrayLen(dst, len(v), v == nil)
 34931  		} else {
 34932  			dst = kbin.AppendNullableArrayLen(dst, len(v), v == nil)
 34933  		}
 34934  		for i := range v {
 34935  			v := &v[i]
 34936  			{
 34937  				v := v.Name
 34938  				if isFlexible {
 34939  					dst = kbin.AppendCompactString(dst, v)
 34940  				} else {
 34941  					dst = kbin.AppendString(dst, v)
 34942  				}
 34943  			}
 34944  			if isFlexible {
 34945  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34946  				dst = v.UnknownTags.AppendEach(dst)
 34947  			}
 34948  		}
 34949  	}
 34950  	if isFlexible {
 34951  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 34952  		dst = v.UnknownTags.AppendEach(dst)
 34953  	}
 34954  	return dst
 34955  }
 34956  
 34957  func (v *DescribeUserSCRAMCredentialsRequest) ReadFrom(src []byte) error {
 34958  	return v.readFrom(src, false)
 34959  }
 34960  
 34961  func (v *DescribeUserSCRAMCredentialsRequest) UnsafeReadFrom(src []byte) error {
 34962  	return v.readFrom(src, true)
 34963  }
 34964  
 34965  func (v *DescribeUserSCRAMCredentialsRequest) readFrom(src []byte, unsafe bool) error {
 34966  	v.Default()
 34967  	b := kbin.Reader{Src: src}
 34968  	version := v.Version
 34969  	_ = version
 34970  	isFlexible := version >= 0
 34971  	_ = isFlexible
 34972  	s := v
 34973  	{
 34974  		v := s.Users
 34975  		a := v
 34976  		var l int32
 34977  		if isFlexible {
 34978  			l = b.CompactArrayLen()
 34979  		} else {
 34980  			l = b.ArrayLen()
 34981  		}
 34982  		if version < 0 || l == 0 {
 34983  			a = []DescribeUserSCRAMCredentialsRequestUser{}
 34984  		}
 34985  		if !b.Ok() {
 34986  			return b.Complete()
 34987  		}
 34988  		a = a[:0]
 34989  		if l > 0 {
 34990  			a = append(a, make([]DescribeUserSCRAMCredentialsRequestUser, l)...)
 34991  		}
 34992  		for i := int32(0); i < l; i++ {
 34993  			v := &a[i]
 34994  			v.Default()
 34995  			s := v
 34996  			{
 34997  				var v string
 34998  				if unsafe {
 34999  					if isFlexible {
 35000  						v = b.UnsafeCompactString()
 35001  					} else {
 35002  						v = b.UnsafeString()
 35003  					}
 35004  				} else {
 35005  					if isFlexible {
 35006  						v = b.CompactString()
 35007  					} else {
 35008  						v = b.String()
 35009  					}
 35010  				}
 35011  				s.Name = v
 35012  			}
 35013  			if isFlexible {
 35014  				s.UnknownTags = internalReadTags(&b)
 35015  			}
 35016  		}
 35017  		v = a
 35018  		s.Users = v
 35019  	}
 35020  	if isFlexible {
 35021  		s.UnknownTags = internalReadTags(&b)
 35022  	}
 35023  	return b.Complete()
 35024  }
 35025  
 35026  // NewPtrDescribeUserSCRAMCredentialsRequest returns a pointer to a default DescribeUserSCRAMCredentialsRequest
 35027  // This is a shortcut for creating a new(struct) and calling Default yourself.
 35028  func NewPtrDescribeUserSCRAMCredentialsRequest() *DescribeUserSCRAMCredentialsRequest {
 35029  	var v DescribeUserSCRAMCredentialsRequest
 35030  	v.Default()
 35031  	return &v
 35032  }
 35033  
 35034  // Default sets any default fields. Calling this allows for future compatibility
 35035  // if new fields are added to DescribeUserSCRAMCredentialsRequest.
 35036  func (v *DescribeUserSCRAMCredentialsRequest) Default() {
 35037  }
 35038  
 35039  // NewDescribeUserSCRAMCredentialsRequest returns a default DescribeUserSCRAMCredentialsRequest
 35040  // This is a shortcut for creating a struct and calling Default yourself.
 35041  func NewDescribeUserSCRAMCredentialsRequest() DescribeUserSCRAMCredentialsRequest {
 35042  	var v DescribeUserSCRAMCredentialsRequest
 35043  	v.Default()
 35044  	return v
 35045  }
 35046  
 35047  type DescribeUserSCRAMCredentialsResponseResultCredentialInfo struct {
 35048  	// The SCRAM mechanism for this user, where 0 is UNKNOWN, 1 is SCRAM-SHA-256,
 35049  	// and 2 is SCRAM-SHA-512.
 35050  	Mechanism int8
 35051  
 35052  	// The number of iterations used in the SCRAM credential.
 35053  	Iterations int32
 35054  
 35055  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35056  	UnknownTags Tags
 35057  }
 35058  
 35059  // Default sets any default fields. Calling this allows for future compatibility
 35060  // if new fields are added to DescribeUserSCRAMCredentialsResponseResultCredentialInfo.
 35061  func (v *DescribeUserSCRAMCredentialsResponseResultCredentialInfo) Default() {
 35062  }
 35063  
 35064  // NewDescribeUserSCRAMCredentialsResponseResultCredentialInfo returns a default DescribeUserSCRAMCredentialsResponseResultCredentialInfo
 35065  // This is a shortcut for creating a struct and calling Default yourself.
 35066  func NewDescribeUserSCRAMCredentialsResponseResultCredentialInfo() DescribeUserSCRAMCredentialsResponseResultCredentialInfo {
 35067  	var v DescribeUserSCRAMCredentialsResponseResultCredentialInfo
 35068  	v.Default()
 35069  	return v
 35070  }
 35071  
 35072  type DescribeUserSCRAMCredentialsResponseResult struct {
 35073  	// The name this result corresponds to.
 35074  	User string
 35075  
 35076  	// The user-level error code.
 35077  	//
 35078  	// RESOURCE_NOT_FOUND if the user does not exist or has no credentials.
 35079  	//
 35080  	// DUPLICATE_RESOURCE if the user is requested twice+.
 35081  	ErrorCode int16
 35082  
 35083  	// The user-level error message, if any.
 35084  	ErrorMessage *string
 35085  
 35086  	// Information about the SCRAM credentials for this user.
 35087  	CredentialInfos []DescribeUserSCRAMCredentialsResponseResultCredentialInfo
 35088  
 35089  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35090  	UnknownTags Tags
 35091  }
 35092  
 35093  // Default sets any default fields. Calling this allows for future compatibility
 35094  // if new fields are added to DescribeUserSCRAMCredentialsResponseResult.
 35095  func (v *DescribeUserSCRAMCredentialsResponseResult) Default() {
 35096  }
 35097  
 35098  // NewDescribeUserSCRAMCredentialsResponseResult returns a default DescribeUserSCRAMCredentialsResponseResult
 35099  // This is a shortcut for creating a struct and calling Default yourself.
 35100  func NewDescribeUserSCRAMCredentialsResponseResult() DescribeUserSCRAMCredentialsResponseResult {
 35101  	var v DescribeUserSCRAMCredentialsResponseResult
 35102  	v.Default()
 35103  	return v
 35104  }
 35105  
 35106  // DescribeUserSCRAMCredentialsResponse is a response for a
 35107  // DescribeUserSCRAMCredentialsRequest.
 35108  type DescribeUserSCRAMCredentialsResponse struct {
 35109  	// Version is the version of this message used with a Kafka broker.
 35110  	Version int16
 35111  
 35112  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 35113  	// after responding to this request.
 35114  	ThrottleMillis int32
 35115  
 35116  	// The request-level error code. This is 0 except for auth or infra issues.
 35117  	//
 35118  	// CLUSTER_AUTHORIZATION_FAILED if you do not have DESCRIBE on CLUSTER.
 35119  	ErrorCode int16
 35120  
 35121  	// The request-level error message, if any.
 35122  	ErrorMessage *string
 35123  
 35124  	// Results for descriptions, one per user.
 35125  	Results []DescribeUserSCRAMCredentialsResponseResult
 35126  
 35127  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35128  	UnknownTags Tags
 35129  }
 35130  
 35131  func (*DescribeUserSCRAMCredentialsResponse) Key() int16                 { return 50 }
 35132  func (*DescribeUserSCRAMCredentialsResponse) MaxVersion() int16          { return 0 }
 35133  func (v *DescribeUserSCRAMCredentialsResponse) SetVersion(version int16) { v.Version = version }
 35134  func (v *DescribeUserSCRAMCredentialsResponse) GetVersion() int16        { return v.Version }
 35135  func (v *DescribeUserSCRAMCredentialsResponse) IsFlexible() bool         { return v.Version >= 0 }
 35136  func (v *DescribeUserSCRAMCredentialsResponse) Throttle() (int32, bool) {
 35137  	return v.ThrottleMillis, v.Version >= 0
 35138  }
 35139  
 35140  func (v *DescribeUserSCRAMCredentialsResponse) SetThrottle(throttleMillis int32) {
 35141  	v.ThrottleMillis = throttleMillis
 35142  }
 35143  
 35144  func (v *DescribeUserSCRAMCredentialsResponse) RequestKind() Request {
 35145  	return &DescribeUserSCRAMCredentialsRequest{Version: v.Version}
 35146  }
 35147  
 35148  func (v *DescribeUserSCRAMCredentialsResponse) AppendTo(dst []byte) []byte {
 35149  	version := v.Version
 35150  	_ = version
 35151  	isFlexible := version >= 0
 35152  	_ = isFlexible
 35153  	{
 35154  		v := v.ThrottleMillis
 35155  		dst = kbin.AppendInt32(dst, v)
 35156  	}
 35157  	{
 35158  		v := v.ErrorCode
 35159  		dst = kbin.AppendInt16(dst, v)
 35160  	}
 35161  	{
 35162  		v := v.ErrorMessage
 35163  		if isFlexible {
 35164  			dst = kbin.AppendCompactNullableString(dst, v)
 35165  		} else {
 35166  			dst = kbin.AppendNullableString(dst, v)
 35167  		}
 35168  	}
 35169  	{
 35170  		v := v.Results
 35171  		if isFlexible {
 35172  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 35173  		} else {
 35174  			dst = kbin.AppendArrayLen(dst, len(v))
 35175  		}
 35176  		for i := range v {
 35177  			v := &v[i]
 35178  			{
 35179  				v := v.User
 35180  				if isFlexible {
 35181  					dst = kbin.AppendCompactString(dst, v)
 35182  				} else {
 35183  					dst = kbin.AppendString(dst, v)
 35184  				}
 35185  			}
 35186  			{
 35187  				v := v.ErrorCode
 35188  				dst = kbin.AppendInt16(dst, v)
 35189  			}
 35190  			{
 35191  				v := v.ErrorMessage
 35192  				if isFlexible {
 35193  					dst = kbin.AppendCompactNullableString(dst, v)
 35194  				} else {
 35195  					dst = kbin.AppendNullableString(dst, v)
 35196  				}
 35197  			}
 35198  			{
 35199  				v := v.CredentialInfos
 35200  				if isFlexible {
 35201  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 35202  				} else {
 35203  					dst = kbin.AppendArrayLen(dst, len(v))
 35204  				}
 35205  				for i := range v {
 35206  					v := &v[i]
 35207  					{
 35208  						v := v.Mechanism
 35209  						dst = kbin.AppendInt8(dst, v)
 35210  					}
 35211  					{
 35212  						v := v.Iterations
 35213  						dst = kbin.AppendInt32(dst, v)
 35214  					}
 35215  					if isFlexible {
 35216  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35217  						dst = v.UnknownTags.AppendEach(dst)
 35218  					}
 35219  				}
 35220  			}
 35221  			if isFlexible {
 35222  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35223  				dst = v.UnknownTags.AppendEach(dst)
 35224  			}
 35225  		}
 35226  	}
 35227  	if isFlexible {
 35228  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35229  		dst = v.UnknownTags.AppendEach(dst)
 35230  	}
 35231  	return dst
 35232  }
 35233  
 35234  func (v *DescribeUserSCRAMCredentialsResponse) ReadFrom(src []byte) error {
 35235  	return v.readFrom(src, false)
 35236  }
 35237  
 35238  func (v *DescribeUserSCRAMCredentialsResponse) UnsafeReadFrom(src []byte) error {
 35239  	return v.readFrom(src, true)
 35240  }
 35241  
 35242  func (v *DescribeUserSCRAMCredentialsResponse) readFrom(src []byte, unsafe bool) error {
 35243  	v.Default()
 35244  	b := kbin.Reader{Src: src}
 35245  	version := v.Version
 35246  	_ = version
 35247  	isFlexible := version >= 0
 35248  	_ = isFlexible
 35249  	s := v
 35250  	{
 35251  		v := b.Int32()
 35252  		s.ThrottleMillis = v
 35253  	}
 35254  	{
 35255  		v := b.Int16()
 35256  		s.ErrorCode = v
 35257  	}
 35258  	{
 35259  		var v *string
 35260  		if isFlexible {
 35261  			if unsafe {
 35262  				v = b.UnsafeCompactNullableString()
 35263  			} else {
 35264  				v = b.CompactNullableString()
 35265  			}
 35266  		} else {
 35267  			if unsafe {
 35268  				v = b.UnsafeNullableString()
 35269  			} else {
 35270  				v = b.NullableString()
 35271  			}
 35272  		}
 35273  		s.ErrorMessage = v
 35274  	}
 35275  	{
 35276  		v := s.Results
 35277  		a := v
 35278  		var l int32
 35279  		if isFlexible {
 35280  			l = b.CompactArrayLen()
 35281  		} else {
 35282  			l = b.ArrayLen()
 35283  		}
 35284  		if !b.Ok() {
 35285  			return b.Complete()
 35286  		}
 35287  		a = a[:0]
 35288  		if l > 0 {
 35289  			a = append(a, make([]DescribeUserSCRAMCredentialsResponseResult, l)...)
 35290  		}
 35291  		for i := int32(0); i < l; i++ {
 35292  			v := &a[i]
 35293  			v.Default()
 35294  			s := v
 35295  			{
 35296  				var v string
 35297  				if unsafe {
 35298  					if isFlexible {
 35299  						v = b.UnsafeCompactString()
 35300  					} else {
 35301  						v = b.UnsafeString()
 35302  					}
 35303  				} else {
 35304  					if isFlexible {
 35305  						v = b.CompactString()
 35306  					} else {
 35307  						v = b.String()
 35308  					}
 35309  				}
 35310  				s.User = v
 35311  			}
 35312  			{
 35313  				v := b.Int16()
 35314  				s.ErrorCode = v
 35315  			}
 35316  			{
 35317  				var v *string
 35318  				if isFlexible {
 35319  					if unsafe {
 35320  						v = b.UnsafeCompactNullableString()
 35321  					} else {
 35322  						v = b.CompactNullableString()
 35323  					}
 35324  				} else {
 35325  					if unsafe {
 35326  						v = b.UnsafeNullableString()
 35327  					} else {
 35328  						v = b.NullableString()
 35329  					}
 35330  				}
 35331  				s.ErrorMessage = v
 35332  			}
 35333  			{
 35334  				v := s.CredentialInfos
 35335  				a := v
 35336  				var l int32
 35337  				if isFlexible {
 35338  					l = b.CompactArrayLen()
 35339  				} else {
 35340  					l = b.ArrayLen()
 35341  				}
 35342  				if !b.Ok() {
 35343  					return b.Complete()
 35344  				}
 35345  				a = a[:0]
 35346  				if l > 0 {
 35347  					a = append(a, make([]DescribeUserSCRAMCredentialsResponseResultCredentialInfo, l)...)
 35348  				}
 35349  				for i := int32(0); i < l; i++ {
 35350  					v := &a[i]
 35351  					v.Default()
 35352  					s := v
 35353  					{
 35354  						v := b.Int8()
 35355  						s.Mechanism = v
 35356  					}
 35357  					{
 35358  						v := b.Int32()
 35359  						s.Iterations = v
 35360  					}
 35361  					if isFlexible {
 35362  						s.UnknownTags = internalReadTags(&b)
 35363  					}
 35364  				}
 35365  				v = a
 35366  				s.CredentialInfos = v
 35367  			}
 35368  			if isFlexible {
 35369  				s.UnknownTags = internalReadTags(&b)
 35370  			}
 35371  		}
 35372  		v = a
 35373  		s.Results = v
 35374  	}
 35375  	if isFlexible {
 35376  		s.UnknownTags = internalReadTags(&b)
 35377  	}
 35378  	return b.Complete()
 35379  }
 35380  
 35381  // NewPtrDescribeUserSCRAMCredentialsResponse returns a pointer to a default DescribeUserSCRAMCredentialsResponse
 35382  // This is a shortcut for creating a new(struct) and calling Default yourself.
 35383  func NewPtrDescribeUserSCRAMCredentialsResponse() *DescribeUserSCRAMCredentialsResponse {
 35384  	var v DescribeUserSCRAMCredentialsResponse
 35385  	v.Default()
 35386  	return &v
 35387  }
 35388  
 35389  // Default sets any default fields. Calling this allows for future compatibility
 35390  // if new fields are added to DescribeUserSCRAMCredentialsResponse.
 35391  func (v *DescribeUserSCRAMCredentialsResponse) Default() {
 35392  }
 35393  
 35394  // NewDescribeUserSCRAMCredentialsResponse returns a default DescribeUserSCRAMCredentialsResponse
 35395  // This is a shortcut for creating a struct and calling Default yourself.
 35396  func NewDescribeUserSCRAMCredentialsResponse() DescribeUserSCRAMCredentialsResponse {
 35397  	var v DescribeUserSCRAMCredentialsResponse
 35398  	v.Default()
 35399  	return v
 35400  }
 35401  
 35402  type AlterUserSCRAMCredentialsRequestDeletion struct {
 35403  	// The user name to match for removal.
 35404  	Name string
 35405  
 35406  	// The mechanism for the user name to remove.
 35407  	Mechanism int8
 35408  
 35409  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35410  	UnknownTags Tags
 35411  }
 35412  
 35413  // Default sets any default fields. Calling this allows for future compatibility
 35414  // if new fields are added to AlterUserSCRAMCredentialsRequestDeletion.
 35415  func (v *AlterUserSCRAMCredentialsRequestDeletion) Default() {
 35416  }
 35417  
 35418  // NewAlterUserSCRAMCredentialsRequestDeletion returns a default AlterUserSCRAMCredentialsRequestDeletion
 35419  // This is a shortcut for creating a struct and calling Default yourself.
 35420  func NewAlterUserSCRAMCredentialsRequestDeletion() AlterUserSCRAMCredentialsRequestDeletion {
 35421  	var v AlterUserSCRAMCredentialsRequestDeletion
 35422  	v.Default()
 35423  	return v
 35424  }
 35425  
 35426  type AlterUserSCRAMCredentialsRequestUpsertion struct {
 35427  	// The user name to use.
 35428  	Name string
 35429  
 35430  	// The mechanism to use for creating, where 1 is SCRAM-SHA-256 and 2 is
 35431  	// SCRAM-SHA-512.
 35432  	Mechanism int8
 35433  
 35434  	// The number of iterations to use. This must be more than the minimum for
 35435  	// the mechanism and cannot be more than 16384.
 35436  	Iterations int32
 35437  
 35438  	// A random salt generated by the client.
 35439  	Salt []byte
 35440  
 35441  	// The salted password to use.
 35442  	SaltedPassword []byte
 35443  
 35444  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35445  	UnknownTags Tags
 35446  }
 35447  
 35448  // Default sets any default fields. Calling this allows for future compatibility
 35449  // if new fields are added to AlterUserSCRAMCredentialsRequestUpsertion.
 35450  func (v *AlterUserSCRAMCredentialsRequestUpsertion) Default() {
 35451  }
 35452  
 35453  // NewAlterUserSCRAMCredentialsRequestUpsertion returns a default AlterUserSCRAMCredentialsRequestUpsertion
 35454  // This is a shortcut for creating a struct and calling Default yourself.
 35455  func NewAlterUserSCRAMCredentialsRequestUpsertion() AlterUserSCRAMCredentialsRequestUpsertion {
 35456  	var v AlterUserSCRAMCredentialsRequestUpsertion
 35457  	v.Default()
 35458  	return v
 35459  }
 35460  
 35461  // AlterUserSCRAMCredentialsRequest, proposed in KIP-554 and introduced
 35462  // with Kafka 2.7.0, alters or deletes user SCRAM credentials.
 35463  //
 35464  // This request was introduced as part of the overarching KIP-500 initiative,
 35465  // which is to remove Zookeeper as a dependency.
 35466  //
 35467  // This request requires ALTER on CLUSTER.
 35468  type AlterUserSCRAMCredentialsRequest struct {
 35469  	// Version is the version of this message used with a Kafka broker.
 35470  	Version int16
 35471  
 35472  	// The SCRAM credentials to remove.
 35473  	Deletions []AlterUserSCRAMCredentialsRequestDeletion
 35474  
 35475  	// The SCRAM credentials to update or insert.
 35476  	Upsertions []AlterUserSCRAMCredentialsRequestUpsertion
 35477  
 35478  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35479  	UnknownTags Tags
 35480  }
 35481  
 35482  func (*AlterUserSCRAMCredentialsRequest) Key() int16                 { return 51 }
 35483  func (*AlterUserSCRAMCredentialsRequest) MaxVersion() int16          { return 0 }
 35484  func (v *AlterUserSCRAMCredentialsRequest) SetVersion(version int16) { v.Version = version }
 35485  func (v *AlterUserSCRAMCredentialsRequest) GetVersion() int16        { return v.Version }
 35486  func (v *AlterUserSCRAMCredentialsRequest) IsFlexible() bool         { return v.Version >= 0 }
 35487  func (v *AlterUserSCRAMCredentialsRequest) IsAdminRequest()          {}
 35488  func (v *AlterUserSCRAMCredentialsRequest) ResponseKind() Response {
 35489  	r := &AlterUserSCRAMCredentialsResponse{Version: v.Version}
 35490  	r.Default()
 35491  	return r
 35492  }
 35493  
 35494  // RequestWith is requests v on r and returns the response or an error.
 35495  // For sharded requests, the response may be merged and still return an error.
 35496  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 35497  func (v *AlterUserSCRAMCredentialsRequest) RequestWith(ctx context.Context, r Requestor) (*AlterUserSCRAMCredentialsResponse, error) {
 35498  	kresp, err := r.Request(ctx, v)
 35499  	resp, _ := kresp.(*AlterUserSCRAMCredentialsResponse)
 35500  	return resp, err
 35501  }
 35502  
 35503  func (v *AlterUserSCRAMCredentialsRequest) AppendTo(dst []byte) []byte {
 35504  	version := v.Version
 35505  	_ = version
 35506  	isFlexible := version >= 0
 35507  	_ = isFlexible
 35508  	{
 35509  		v := v.Deletions
 35510  		if isFlexible {
 35511  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 35512  		} else {
 35513  			dst = kbin.AppendArrayLen(dst, len(v))
 35514  		}
 35515  		for i := range v {
 35516  			v := &v[i]
 35517  			{
 35518  				v := v.Name
 35519  				if isFlexible {
 35520  					dst = kbin.AppendCompactString(dst, v)
 35521  				} else {
 35522  					dst = kbin.AppendString(dst, v)
 35523  				}
 35524  			}
 35525  			{
 35526  				v := v.Mechanism
 35527  				dst = kbin.AppendInt8(dst, v)
 35528  			}
 35529  			if isFlexible {
 35530  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35531  				dst = v.UnknownTags.AppendEach(dst)
 35532  			}
 35533  		}
 35534  	}
 35535  	{
 35536  		v := v.Upsertions
 35537  		if isFlexible {
 35538  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 35539  		} else {
 35540  			dst = kbin.AppendArrayLen(dst, len(v))
 35541  		}
 35542  		for i := range v {
 35543  			v := &v[i]
 35544  			{
 35545  				v := v.Name
 35546  				if isFlexible {
 35547  					dst = kbin.AppendCompactString(dst, v)
 35548  				} else {
 35549  					dst = kbin.AppendString(dst, v)
 35550  				}
 35551  			}
 35552  			{
 35553  				v := v.Mechanism
 35554  				dst = kbin.AppendInt8(dst, v)
 35555  			}
 35556  			{
 35557  				v := v.Iterations
 35558  				dst = kbin.AppendInt32(dst, v)
 35559  			}
 35560  			{
 35561  				v := v.Salt
 35562  				if isFlexible {
 35563  					dst = kbin.AppendCompactBytes(dst, v)
 35564  				} else {
 35565  					dst = kbin.AppendBytes(dst, v)
 35566  				}
 35567  			}
 35568  			{
 35569  				v := v.SaltedPassword
 35570  				if isFlexible {
 35571  					dst = kbin.AppendCompactBytes(dst, v)
 35572  				} else {
 35573  					dst = kbin.AppendBytes(dst, v)
 35574  				}
 35575  			}
 35576  			if isFlexible {
 35577  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35578  				dst = v.UnknownTags.AppendEach(dst)
 35579  			}
 35580  		}
 35581  	}
 35582  	if isFlexible {
 35583  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35584  		dst = v.UnknownTags.AppendEach(dst)
 35585  	}
 35586  	return dst
 35587  }
 35588  
 35589  func (v *AlterUserSCRAMCredentialsRequest) ReadFrom(src []byte) error {
 35590  	return v.readFrom(src, false)
 35591  }
 35592  
 35593  func (v *AlterUserSCRAMCredentialsRequest) UnsafeReadFrom(src []byte) error {
 35594  	return v.readFrom(src, true)
 35595  }
 35596  
 35597  func (v *AlterUserSCRAMCredentialsRequest) readFrom(src []byte, unsafe bool) error {
 35598  	v.Default()
 35599  	b := kbin.Reader{Src: src}
 35600  	version := v.Version
 35601  	_ = version
 35602  	isFlexible := version >= 0
 35603  	_ = isFlexible
 35604  	s := v
 35605  	{
 35606  		v := s.Deletions
 35607  		a := v
 35608  		var l int32
 35609  		if isFlexible {
 35610  			l = b.CompactArrayLen()
 35611  		} else {
 35612  			l = b.ArrayLen()
 35613  		}
 35614  		if !b.Ok() {
 35615  			return b.Complete()
 35616  		}
 35617  		a = a[:0]
 35618  		if l > 0 {
 35619  			a = append(a, make([]AlterUserSCRAMCredentialsRequestDeletion, l)...)
 35620  		}
 35621  		for i := int32(0); i < l; i++ {
 35622  			v := &a[i]
 35623  			v.Default()
 35624  			s := v
 35625  			{
 35626  				var v string
 35627  				if unsafe {
 35628  					if isFlexible {
 35629  						v = b.UnsafeCompactString()
 35630  					} else {
 35631  						v = b.UnsafeString()
 35632  					}
 35633  				} else {
 35634  					if isFlexible {
 35635  						v = b.CompactString()
 35636  					} else {
 35637  						v = b.String()
 35638  					}
 35639  				}
 35640  				s.Name = v
 35641  			}
 35642  			{
 35643  				v := b.Int8()
 35644  				s.Mechanism = v
 35645  			}
 35646  			if isFlexible {
 35647  				s.UnknownTags = internalReadTags(&b)
 35648  			}
 35649  		}
 35650  		v = a
 35651  		s.Deletions = v
 35652  	}
 35653  	{
 35654  		v := s.Upsertions
 35655  		a := v
 35656  		var l int32
 35657  		if isFlexible {
 35658  			l = b.CompactArrayLen()
 35659  		} else {
 35660  			l = b.ArrayLen()
 35661  		}
 35662  		if !b.Ok() {
 35663  			return b.Complete()
 35664  		}
 35665  		a = a[:0]
 35666  		if l > 0 {
 35667  			a = append(a, make([]AlterUserSCRAMCredentialsRequestUpsertion, l)...)
 35668  		}
 35669  		for i := int32(0); i < l; i++ {
 35670  			v := &a[i]
 35671  			v.Default()
 35672  			s := v
 35673  			{
 35674  				var v string
 35675  				if unsafe {
 35676  					if isFlexible {
 35677  						v = b.UnsafeCompactString()
 35678  					} else {
 35679  						v = b.UnsafeString()
 35680  					}
 35681  				} else {
 35682  					if isFlexible {
 35683  						v = b.CompactString()
 35684  					} else {
 35685  						v = b.String()
 35686  					}
 35687  				}
 35688  				s.Name = v
 35689  			}
 35690  			{
 35691  				v := b.Int8()
 35692  				s.Mechanism = v
 35693  			}
 35694  			{
 35695  				v := b.Int32()
 35696  				s.Iterations = v
 35697  			}
 35698  			{
 35699  				var v []byte
 35700  				if isFlexible {
 35701  					v = b.CompactBytes()
 35702  				} else {
 35703  					v = b.Bytes()
 35704  				}
 35705  				s.Salt = v
 35706  			}
 35707  			{
 35708  				var v []byte
 35709  				if isFlexible {
 35710  					v = b.CompactBytes()
 35711  				} else {
 35712  					v = b.Bytes()
 35713  				}
 35714  				s.SaltedPassword = v
 35715  			}
 35716  			if isFlexible {
 35717  				s.UnknownTags = internalReadTags(&b)
 35718  			}
 35719  		}
 35720  		v = a
 35721  		s.Upsertions = v
 35722  	}
 35723  	if isFlexible {
 35724  		s.UnknownTags = internalReadTags(&b)
 35725  	}
 35726  	return b.Complete()
 35727  }
 35728  
 35729  // NewPtrAlterUserSCRAMCredentialsRequest returns a pointer to a default AlterUserSCRAMCredentialsRequest
 35730  // This is a shortcut for creating a new(struct) and calling Default yourself.
 35731  func NewPtrAlterUserSCRAMCredentialsRequest() *AlterUserSCRAMCredentialsRequest {
 35732  	var v AlterUserSCRAMCredentialsRequest
 35733  	v.Default()
 35734  	return &v
 35735  }
 35736  
 35737  // Default sets any default fields. Calling this allows for future compatibility
 35738  // if new fields are added to AlterUserSCRAMCredentialsRequest.
 35739  func (v *AlterUserSCRAMCredentialsRequest) Default() {
 35740  }
 35741  
 35742  // NewAlterUserSCRAMCredentialsRequest returns a default AlterUserSCRAMCredentialsRequest
 35743  // This is a shortcut for creating a struct and calling Default yourself.
 35744  func NewAlterUserSCRAMCredentialsRequest() AlterUserSCRAMCredentialsRequest {
 35745  	var v AlterUserSCRAMCredentialsRequest
 35746  	v.Default()
 35747  	return v
 35748  }
 35749  
 35750  type AlterUserSCRAMCredentialsResponseResult struct {
 35751  	// The name this result corresponds to.
 35752  	User string
 35753  
 35754  	// The user-level error code.
 35755  	ErrorCode int16
 35756  
 35757  	// The user-level error message, if any.
 35758  	ErrorMessage *string
 35759  
 35760  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35761  	UnknownTags Tags
 35762  }
 35763  
 35764  // Default sets any default fields. Calling this allows for future compatibility
 35765  // if new fields are added to AlterUserSCRAMCredentialsResponseResult.
 35766  func (v *AlterUserSCRAMCredentialsResponseResult) Default() {
 35767  }
 35768  
 35769  // NewAlterUserSCRAMCredentialsResponseResult returns a default AlterUserSCRAMCredentialsResponseResult
 35770  // This is a shortcut for creating a struct and calling Default yourself.
 35771  func NewAlterUserSCRAMCredentialsResponseResult() AlterUserSCRAMCredentialsResponseResult {
 35772  	var v AlterUserSCRAMCredentialsResponseResult
 35773  	v.Default()
 35774  	return v
 35775  }
 35776  
 35777  // AlterUserSCRAMCredentialsResponse is a response for an
 35778  // AlterUserSCRAMCredentialsRequest.
 35779  type AlterUserSCRAMCredentialsResponse struct {
 35780  	// Version is the version of this message used with a Kafka broker.
 35781  	Version int16
 35782  
 35783  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 35784  	// after responding to this request.
 35785  	ThrottleMillis int32
 35786  
 35787  	// The results for deletions and upsertions.
 35788  	Results []AlterUserSCRAMCredentialsResponseResult
 35789  
 35790  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35791  	UnknownTags Tags
 35792  }
 35793  
 35794  func (*AlterUserSCRAMCredentialsResponse) Key() int16                 { return 51 }
 35795  func (*AlterUserSCRAMCredentialsResponse) MaxVersion() int16          { return 0 }
 35796  func (v *AlterUserSCRAMCredentialsResponse) SetVersion(version int16) { v.Version = version }
 35797  func (v *AlterUserSCRAMCredentialsResponse) GetVersion() int16        { return v.Version }
 35798  func (v *AlterUserSCRAMCredentialsResponse) IsFlexible() bool         { return v.Version >= 0 }
 35799  func (v *AlterUserSCRAMCredentialsResponse) Throttle() (int32, bool) {
 35800  	return v.ThrottleMillis, v.Version >= 0
 35801  }
 35802  
 35803  func (v *AlterUserSCRAMCredentialsResponse) SetThrottle(throttleMillis int32) {
 35804  	v.ThrottleMillis = throttleMillis
 35805  }
 35806  
 35807  func (v *AlterUserSCRAMCredentialsResponse) RequestKind() Request {
 35808  	return &AlterUserSCRAMCredentialsRequest{Version: v.Version}
 35809  }
 35810  
 35811  func (v *AlterUserSCRAMCredentialsResponse) AppendTo(dst []byte) []byte {
 35812  	version := v.Version
 35813  	_ = version
 35814  	isFlexible := version >= 0
 35815  	_ = isFlexible
 35816  	{
 35817  		v := v.ThrottleMillis
 35818  		dst = kbin.AppendInt32(dst, v)
 35819  	}
 35820  	{
 35821  		v := v.Results
 35822  		if isFlexible {
 35823  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 35824  		} else {
 35825  			dst = kbin.AppendArrayLen(dst, len(v))
 35826  		}
 35827  		for i := range v {
 35828  			v := &v[i]
 35829  			{
 35830  				v := v.User
 35831  				if isFlexible {
 35832  					dst = kbin.AppendCompactString(dst, v)
 35833  				} else {
 35834  					dst = kbin.AppendString(dst, v)
 35835  				}
 35836  			}
 35837  			{
 35838  				v := v.ErrorCode
 35839  				dst = kbin.AppendInt16(dst, v)
 35840  			}
 35841  			{
 35842  				v := v.ErrorMessage
 35843  				if isFlexible {
 35844  					dst = kbin.AppendCompactNullableString(dst, v)
 35845  				} else {
 35846  					dst = kbin.AppendNullableString(dst, v)
 35847  				}
 35848  			}
 35849  			if isFlexible {
 35850  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35851  				dst = v.UnknownTags.AppendEach(dst)
 35852  			}
 35853  		}
 35854  	}
 35855  	if isFlexible {
 35856  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 35857  		dst = v.UnknownTags.AppendEach(dst)
 35858  	}
 35859  	return dst
 35860  }
 35861  
 35862  func (v *AlterUserSCRAMCredentialsResponse) ReadFrom(src []byte) error {
 35863  	return v.readFrom(src, false)
 35864  }
 35865  
 35866  func (v *AlterUserSCRAMCredentialsResponse) UnsafeReadFrom(src []byte) error {
 35867  	return v.readFrom(src, true)
 35868  }
 35869  
 35870  func (v *AlterUserSCRAMCredentialsResponse) readFrom(src []byte, unsafe bool) error {
 35871  	v.Default()
 35872  	b := kbin.Reader{Src: src}
 35873  	version := v.Version
 35874  	_ = version
 35875  	isFlexible := version >= 0
 35876  	_ = isFlexible
 35877  	s := v
 35878  	{
 35879  		v := b.Int32()
 35880  		s.ThrottleMillis = v
 35881  	}
 35882  	{
 35883  		v := s.Results
 35884  		a := v
 35885  		var l int32
 35886  		if isFlexible {
 35887  			l = b.CompactArrayLen()
 35888  		} else {
 35889  			l = b.ArrayLen()
 35890  		}
 35891  		if !b.Ok() {
 35892  			return b.Complete()
 35893  		}
 35894  		a = a[:0]
 35895  		if l > 0 {
 35896  			a = append(a, make([]AlterUserSCRAMCredentialsResponseResult, l)...)
 35897  		}
 35898  		for i := int32(0); i < l; i++ {
 35899  			v := &a[i]
 35900  			v.Default()
 35901  			s := v
 35902  			{
 35903  				var v string
 35904  				if unsafe {
 35905  					if isFlexible {
 35906  						v = b.UnsafeCompactString()
 35907  					} else {
 35908  						v = b.UnsafeString()
 35909  					}
 35910  				} else {
 35911  					if isFlexible {
 35912  						v = b.CompactString()
 35913  					} else {
 35914  						v = b.String()
 35915  					}
 35916  				}
 35917  				s.User = v
 35918  			}
 35919  			{
 35920  				v := b.Int16()
 35921  				s.ErrorCode = v
 35922  			}
 35923  			{
 35924  				var v *string
 35925  				if isFlexible {
 35926  					if unsafe {
 35927  						v = b.UnsafeCompactNullableString()
 35928  					} else {
 35929  						v = b.CompactNullableString()
 35930  					}
 35931  				} else {
 35932  					if unsafe {
 35933  						v = b.UnsafeNullableString()
 35934  					} else {
 35935  						v = b.NullableString()
 35936  					}
 35937  				}
 35938  				s.ErrorMessage = v
 35939  			}
 35940  			if isFlexible {
 35941  				s.UnknownTags = internalReadTags(&b)
 35942  			}
 35943  		}
 35944  		v = a
 35945  		s.Results = v
 35946  	}
 35947  	if isFlexible {
 35948  		s.UnknownTags = internalReadTags(&b)
 35949  	}
 35950  	return b.Complete()
 35951  }
 35952  
 35953  // NewPtrAlterUserSCRAMCredentialsResponse returns a pointer to a default AlterUserSCRAMCredentialsResponse
 35954  // This is a shortcut for creating a new(struct) and calling Default yourself.
 35955  func NewPtrAlterUserSCRAMCredentialsResponse() *AlterUserSCRAMCredentialsResponse {
 35956  	var v AlterUserSCRAMCredentialsResponse
 35957  	v.Default()
 35958  	return &v
 35959  }
 35960  
 35961  // Default sets any default fields. Calling this allows for future compatibility
 35962  // if new fields are added to AlterUserSCRAMCredentialsResponse.
 35963  func (v *AlterUserSCRAMCredentialsResponse) Default() {
 35964  }
 35965  
 35966  // NewAlterUserSCRAMCredentialsResponse returns a default AlterUserSCRAMCredentialsResponse
 35967  // This is a shortcut for creating a struct and calling Default yourself.
 35968  func NewAlterUserSCRAMCredentialsResponse() AlterUserSCRAMCredentialsResponse {
 35969  	var v AlterUserSCRAMCredentialsResponse
 35970  	v.Default()
 35971  	return v
 35972  }
 35973  
 35974  type VoteRequestTopicPartition struct {
 35975  	Partition int32
 35976  
 35977  	// The bumped epoch of the candidate sending the request.
 35978  	CandidateEpoch int32
 35979  
 35980  	// The ID of the voter sending the request.
 35981  	CandidateID int32
 35982  
 35983  	// The epoch of the last record written to the metadata log.
 35984  	LastOffsetEpoch int32
 35985  
 35986  	// The offset of the last record written to the metadata log.
 35987  	LastOffset int64
 35988  
 35989  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 35990  	UnknownTags Tags
 35991  }
 35992  
 35993  // Default sets any default fields. Calling this allows for future compatibility
 35994  // if new fields are added to VoteRequestTopicPartition.
 35995  func (v *VoteRequestTopicPartition) Default() {
 35996  }
 35997  
 35998  // NewVoteRequestTopicPartition returns a default VoteRequestTopicPartition
 35999  // This is a shortcut for creating a struct and calling Default yourself.
 36000  func NewVoteRequestTopicPartition() VoteRequestTopicPartition {
 36001  	var v VoteRequestTopicPartition
 36002  	v.Default()
 36003  	return v
 36004  }
 36005  
 36006  type VoteRequestTopic struct {
 36007  	Topic string
 36008  
 36009  	Partitions []VoteRequestTopicPartition
 36010  
 36011  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 36012  	UnknownTags Tags
 36013  }
 36014  
 36015  // Default sets any default fields. Calling this allows for future compatibility
 36016  // if new fields are added to VoteRequestTopic.
 36017  func (v *VoteRequestTopic) Default() {
 36018  }
 36019  
 36020  // NewVoteRequestTopic returns a default VoteRequestTopic
 36021  // This is a shortcut for creating a struct and calling Default yourself.
 36022  func NewVoteRequestTopic() VoteRequestTopic {
 36023  	var v VoteRequestTopic
 36024  	v.Default()
 36025  	return v
 36026  }
 36027  
 36028  // Part of KIP-595 to replace Kafka's dependence on Zookeeper with a
 36029  // Kafka-only raft protocol,
 36030  // VoteRequest is used by voters to hold a leader election.
 36031  //
 36032  // Since this is relatively Kafka internal, most fields are left undocumented.
 36033  type VoteRequest struct {
 36034  	// Version is the version of this message used with a Kafka broker.
 36035  	Version int16
 36036  
 36037  	ClusterID *string
 36038  
 36039  	Topics []VoteRequestTopic
 36040  
 36041  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 36042  	UnknownTags Tags
 36043  }
 36044  
 36045  func (*VoteRequest) Key() int16                 { return 52 }
 36046  func (*VoteRequest) MaxVersion() int16          { return 0 }
 36047  func (v *VoteRequest) SetVersion(version int16) { v.Version = version }
 36048  func (v *VoteRequest) GetVersion() int16        { return v.Version }
 36049  func (v *VoteRequest) IsFlexible() bool         { return v.Version >= 0 }
 36050  func (v *VoteRequest) IsAdminRequest()          {}
 36051  func (v *VoteRequest) ResponseKind() Response {
 36052  	r := &VoteResponse{Version: v.Version}
 36053  	r.Default()
 36054  	return r
 36055  }
 36056  
 36057  // RequestWith is requests v on r and returns the response or an error.
 36058  // For sharded requests, the response may be merged and still return an error.
 36059  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 36060  func (v *VoteRequest) RequestWith(ctx context.Context, r Requestor) (*VoteResponse, error) {
 36061  	kresp, err := r.Request(ctx, v)
 36062  	resp, _ := kresp.(*VoteResponse)
 36063  	return resp, err
 36064  }
 36065  
 36066  func (v *VoteRequest) AppendTo(dst []byte) []byte {
 36067  	version := v.Version
 36068  	_ = version
 36069  	isFlexible := version >= 0
 36070  	_ = isFlexible
 36071  	{
 36072  		v := v.ClusterID
 36073  		if isFlexible {
 36074  			dst = kbin.AppendCompactNullableString(dst, v)
 36075  		} else {
 36076  			dst = kbin.AppendNullableString(dst, v)
 36077  		}
 36078  	}
 36079  	{
 36080  		v := v.Topics
 36081  		if isFlexible {
 36082  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 36083  		} else {
 36084  			dst = kbin.AppendArrayLen(dst, len(v))
 36085  		}
 36086  		for i := range v {
 36087  			v := &v[i]
 36088  			{
 36089  				v := v.Topic
 36090  				if isFlexible {
 36091  					dst = kbin.AppendCompactString(dst, v)
 36092  				} else {
 36093  					dst = kbin.AppendString(dst, v)
 36094  				}
 36095  			}
 36096  			{
 36097  				v := v.Partitions
 36098  				if isFlexible {
 36099  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 36100  				} else {
 36101  					dst = kbin.AppendArrayLen(dst, len(v))
 36102  				}
 36103  				for i := range v {
 36104  					v := &v[i]
 36105  					{
 36106  						v := v.Partition
 36107  						dst = kbin.AppendInt32(dst, v)
 36108  					}
 36109  					{
 36110  						v := v.CandidateEpoch
 36111  						dst = kbin.AppendInt32(dst, v)
 36112  					}
 36113  					{
 36114  						v := v.CandidateID
 36115  						dst = kbin.AppendInt32(dst, v)
 36116  					}
 36117  					{
 36118  						v := v.LastOffsetEpoch
 36119  						dst = kbin.AppendInt32(dst, v)
 36120  					}
 36121  					{
 36122  						v := v.LastOffset
 36123  						dst = kbin.AppendInt64(dst, v)
 36124  					}
 36125  					if isFlexible {
 36126  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 36127  						dst = v.UnknownTags.AppendEach(dst)
 36128  					}
 36129  				}
 36130  			}
 36131  			if isFlexible {
 36132  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 36133  				dst = v.UnknownTags.AppendEach(dst)
 36134  			}
 36135  		}
 36136  	}
 36137  	if isFlexible {
 36138  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 36139  		dst = v.UnknownTags.AppendEach(dst)
 36140  	}
 36141  	return dst
 36142  }
 36143  
 36144  func (v *VoteRequest) ReadFrom(src []byte) error {
 36145  	return v.readFrom(src, false)
 36146  }
 36147  
 36148  func (v *VoteRequest) UnsafeReadFrom(src []byte) error {
 36149  	return v.readFrom(src, true)
 36150  }
 36151  
 36152  func (v *VoteRequest) readFrom(src []byte, unsafe bool) error {
 36153  	v.Default()
 36154  	b := kbin.Reader{Src: src}
 36155  	version := v.Version
 36156  	_ = version
 36157  	isFlexible := version >= 0
 36158  	_ = isFlexible
 36159  	s := v
 36160  	{
 36161  		var v *string
 36162  		if isFlexible {
 36163  			if unsafe {
 36164  				v = b.UnsafeCompactNullableString()
 36165  			} else {
 36166  				v = b.CompactNullableString()
 36167  			}
 36168  		} else {
 36169  			if unsafe {
 36170  				v = b.UnsafeNullableString()
 36171  			} else {
 36172  				v = b.NullableString()
 36173  			}
 36174  		}
 36175  		s.ClusterID = v
 36176  	}
 36177  	{
 36178  		v := s.Topics
 36179  		a := v
 36180  		var l int32
 36181  		if isFlexible {
 36182  			l = b.CompactArrayLen()
 36183  		} else {
 36184  			l = b.ArrayLen()
 36185  		}
 36186  		if !b.Ok() {
 36187  			return b.Complete()
 36188  		}
 36189  		a = a[:0]
 36190  		if l > 0 {
 36191  			a = append(a, make([]VoteRequestTopic, l)...)
 36192  		}
 36193  		for i := int32(0); i < l; i++ {
 36194  			v := &a[i]
 36195  			v.Default()
 36196  			s := v
 36197  			{
 36198  				var v string
 36199  				if unsafe {
 36200  					if isFlexible {
 36201  						v = b.UnsafeCompactString()
 36202  					} else {
 36203  						v = b.UnsafeString()
 36204  					}
 36205  				} else {
 36206  					if isFlexible {
 36207  						v = b.CompactString()
 36208  					} else {
 36209  						v = b.String()
 36210  					}
 36211  				}
 36212  				s.Topic = v
 36213  			}
 36214  			{
 36215  				v := s.Partitions
 36216  				a := v
 36217  				var l int32
 36218  				if isFlexible {
 36219  					l = b.CompactArrayLen()
 36220  				} else {
 36221  					l = b.ArrayLen()
 36222  				}
 36223  				if !b.Ok() {
 36224  					return b.Complete()
 36225  				}
 36226  				a = a[:0]
 36227  				if l > 0 {
 36228  					a = append(a, make([]VoteRequestTopicPartition, l)...)
 36229  				}
 36230  				for i := int32(0); i < l; i++ {
 36231  					v := &a[i]
 36232  					v.Default()
 36233  					s := v
 36234  					{
 36235  						v := b.Int32()
 36236  						s.Partition = v
 36237  					}
 36238  					{
 36239  						v := b.Int32()
 36240  						s.CandidateEpoch = v
 36241  					}
 36242  					{
 36243  						v := b.Int32()
 36244  						s.CandidateID = v
 36245  					}
 36246  					{
 36247  						v := b.Int32()
 36248  						s.LastOffsetEpoch = v
 36249  					}
 36250  					{
 36251  						v := b.Int64()
 36252  						s.LastOffset = v
 36253  					}
 36254  					if isFlexible {
 36255  						s.UnknownTags = internalReadTags(&b)
 36256  					}
 36257  				}
 36258  				v = a
 36259  				s.Partitions = v
 36260  			}
 36261  			if isFlexible {
 36262  				s.UnknownTags = internalReadTags(&b)
 36263  			}
 36264  		}
 36265  		v = a
 36266  		s.Topics = v
 36267  	}
 36268  	if isFlexible {
 36269  		s.UnknownTags = internalReadTags(&b)
 36270  	}
 36271  	return b.Complete()
 36272  }
 36273  
 36274  // NewPtrVoteRequest returns a pointer to a default VoteRequest
 36275  // This is a shortcut for creating a new(struct) and calling Default yourself.
 36276  func NewPtrVoteRequest() *VoteRequest {
 36277  	var v VoteRequest
 36278  	v.Default()
 36279  	return &v
 36280  }
 36281  
 36282  // Default sets any default fields. Calling this allows for future compatibility
 36283  // if new fields are added to VoteRequest.
 36284  func (v *VoteRequest) Default() {
 36285  }
 36286  
 36287  // NewVoteRequest returns a default VoteRequest
 36288  // This is a shortcut for creating a struct and calling Default yourself.
 36289  func NewVoteRequest() VoteRequest {
 36290  	var v VoteRequest
 36291  	v.Default()
 36292  	return v
 36293  }
 36294  
 36295  type VoteResponseTopicPartition struct {
 36296  	Partition int32
 36297  
 36298  	ErrorCode int16
 36299  
 36300  	// The ID of the current leader, or -1 if the leader is unknown.
 36301  	LeaderID int32
 36302  
 36303  	// The latest known leader epoch.
 36304  	LeaderEpoch int32
 36305  
 36306  	// Whether the vote was granted.
 36307  	VoteGranted bool
 36308  
 36309  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 36310  	UnknownTags Tags
 36311  }
 36312  
 36313  // Default sets any default fields. Calling this allows for future compatibility
 36314  // if new fields are added to VoteResponseTopicPartition.
 36315  func (v *VoteResponseTopicPartition) Default() {
 36316  }
 36317  
 36318  // NewVoteResponseTopicPartition returns a default VoteResponseTopicPartition
 36319  // This is a shortcut for creating a struct and calling Default yourself.
 36320  func NewVoteResponseTopicPartition() VoteResponseTopicPartition {
 36321  	var v VoteResponseTopicPartition
 36322  	v.Default()
 36323  	return v
 36324  }
 36325  
 36326  type VoteResponseTopic struct {
 36327  	Topic string
 36328  
 36329  	Partitions []VoteResponseTopicPartition
 36330  
 36331  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 36332  	UnknownTags Tags
 36333  }
 36334  
 36335  // Default sets any default fields. Calling this allows for future compatibility
 36336  // if new fields are added to VoteResponseTopic.
 36337  func (v *VoteResponseTopic) Default() {
 36338  }
 36339  
 36340  // NewVoteResponseTopic returns a default VoteResponseTopic
 36341  // This is a shortcut for creating a struct and calling Default yourself.
 36342  func NewVoteResponseTopic() VoteResponseTopic {
 36343  	var v VoteResponseTopic
 36344  	v.Default()
 36345  	return v
 36346  }
 36347  
 36348  type VoteResponse struct {
 36349  	// Version is the version of this message used with a Kafka broker.
 36350  	Version int16
 36351  
 36352  	ErrorCode int16
 36353  
 36354  	Topics []VoteResponseTopic
 36355  
 36356  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 36357  	UnknownTags Tags
 36358  }
 36359  
 36360  func (*VoteResponse) Key() int16                 { return 52 }
 36361  func (*VoteResponse) MaxVersion() int16          { return 0 }
 36362  func (v *VoteResponse) SetVersion(version int16) { v.Version = version }
 36363  func (v *VoteResponse) GetVersion() int16        { return v.Version }
 36364  func (v *VoteResponse) IsFlexible() bool         { return v.Version >= 0 }
 36365  func (v *VoteResponse) RequestKind() Request     { return &VoteRequest{Version: v.Version} }
 36366  
 36367  func (v *VoteResponse) AppendTo(dst []byte) []byte {
 36368  	version := v.Version
 36369  	_ = version
 36370  	isFlexible := version >= 0
 36371  	_ = isFlexible
 36372  	{
 36373  		v := v.ErrorCode
 36374  		dst = kbin.AppendInt16(dst, v)
 36375  	}
 36376  	{
 36377  		v := v.Topics
 36378  		if isFlexible {
 36379  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 36380  		} else {
 36381  			dst = kbin.AppendArrayLen(dst, len(v))
 36382  		}
 36383  		for i := range v {
 36384  			v := &v[i]
 36385  			{
 36386  				v := v.Topic
 36387  				if isFlexible {
 36388  					dst = kbin.AppendCompactString(dst, v)
 36389  				} else {
 36390  					dst = kbin.AppendString(dst, v)
 36391  				}
 36392  			}
 36393  			{
 36394  				v := v.Partitions
 36395  				if isFlexible {
 36396  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 36397  				} else {
 36398  					dst = kbin.AppendArrayLen(dst, len(v))
 36399  				}
 36400  				for i := range v {
 36401  					v := &v[i]
 36402  					{
 36403  						v := v.Partition
 36404  						dst = kbin.AppendInt32(dst, v)
 36405  					}
 36406  					{
 36407  						v := v.ErrorCode
 36408  						dst = kbin.AppendInt16(dst, v)
 36409  					}
 36410  					{
 36411  						v := v.LeaderID
 36412  						dst = kbin.AppendInt32(dst, v)
 36413  					}
 36414  					{
 36415  						v := v.LeaderEpoch
 36416  						dst = kbin.AppendInt32(dst, v)
 36417  					}
 36418  					{
 36419  						v := v.VoteGranted
 36420  						dst = kbin.AppendBool(dst, v)
 36421  					}
 36422  					if isFlexible {
 36423  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 36424  						dst = v.UnknownTags.AppendEach(dst)
 36425  					}
 36426  				}
 36427  			}
 36428  			if isFlexible {
 36429  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 36430  				dst = v.UnknownTags.AppendEach(dst)
 36431  			}
 36432  		}
 36433  	}
 36434  	if isFlexible {
 36435  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 36436  		dst = v.UnknownTags.AppendEach(dst)
 36437  	}
 36438  	return dst
 36439  }
 36440  
 36441  func (v *VoteResponse) ReadFrom(src []byte) error {
 36442  	return v.readFrom(src, false)
 36443  }
 36444  
 36445  func (v *VoteResponse) UnsafeReadFrom(src []byte) error {
 36446  	return v.readFrom(src, true)
 36447  }
 36448  
 36449  func (v *VoteResponse) readFrom(src []byte, unsafe bool) error {
 36450  	v.Default()
 36451  	b := kbin.Reader{Src: src}
 36452  	version := v.Version
 36453  	_ = version
 36454  	isFlexible := version >= 0
 36455  	_ = isFlexible
 36456  	s := v
 36457  	{
 36458  		v := b.Int16()
 36459  		s.ErrorCode = v
 36460  	}
 36461  	{
 36462  		v := s.Topics
 36463  		a := v
 36464  		var l int32
 36465  		if isFlexible {
 36466  			l = b.CompactArrayLen()
 36467  		} else {
 36468  			l = b.ArrayLen()
 36469  		}
 36470  		if !b.Ok() {
 36471  			return b.Complete()
 36472  		}
 36473  		a = a[:0]
 36474  		if l > 0 {
 36475  			a = append(a, make([]VoteResponseTopic, l)...)
 36476  		}
 36477  		for i := int32(0); i < l; i++ {
 36478  			v := &a[i]
 36479  			v.Default()
 36480  			s := v
 36481  			{
 36482  				var v string
 36483  				if unsafe {
 36484  					if isFlexible {
 36485  						v = b.UnsafeCompactString()
 36486  					} else {
 36487  						v = b.UnsafeString()
 36488  					}
 36489  				} else {
 36490  					if isFlexible {
 36491  						v = b.CompactString()
 36492  					} else {
 36493  						v = b.String()
 36494  					}
 36495  				}
 36496  				s.Topic = v
 36497  			}
 36498  			{
 36499  				v := s.Partitions
 36500  				a := v
 36501  				var l int32
 36502  				if isFlexible {
 36503  					l = b.CompactArrayLen()
 36504  				} else {
 36505  					l = b.ArrayLen()
 36506  				}
 36507  				if !b.Ok() {
 36508  					return b.Complete()
 36509  				}
 36510  				a = a[:0]
 36511  				if l > 0 {
 36512  					a = append(a, make([]VoteResponseTopicPartition, l)...)
 36513  				}
 36514  				for i := int32(0); i < l; i++ {
 36515  					v := &a[i]
 36516  					v.Default()
 36517  					s := v
 36518  					{
 36519  						v := b.Int32()
 36520  						s.Partition = v
 36521  					}
 36522  					{
 36523  						v := b.Int16()
 36524  						s.ErrorCode = v
 36525  					}
 36526  					{
 36527  						v := b.Int32()
 36528  						s.LeaderID = v
 36529  					}
 36530  					{
 36531  						v := b.Int32()
 36532  						s.LeaderEpoch = v
 36533  					}
 36534  					{
 36535  						v := b.Bool()
 36536  						s.VoteGranted = v
 36537  					}
 36538  					if isFlexible {
 36539  						s.UnknownTags = internalReadTags(&b)
 36540  					}
 36541  				}
 36542  				v = a
 36543  				s.Partitions = v
 36544  			}
 36545  			if isFlexible {
 36546  				s.UnknownTags = internalReadTags(&b)
 36547  			}
 36548  		}
 36549  		v = a
 36550  		s.Topics = v
 36551  	}
 36552  	if isFlexible {
 36553  		s.UnknownTags = internalReadTags(&b)
 36554  	}
 36555  	return b.Complete()
 36556  }
 36557  
 36558  // NewPtrVoteResponse returns a pointer to a default VoteResponse
 36559  // This is a shortcut for creating a new(struct) and calling Default yourself.
 36560  func NewPtrVoteResponse() *VoteResponse {
 36561  	var v VoteResponse
 36562  	v.Default()
 36563  	return &v
 36564  }
 36565  
 36566  // Default sets any default fields. Calling this allows for future compatibility
 36567  // if new fields are added to VoteResponse.
 36568  func (v *VoteResponse) Default() {
 36569  }
 36570  
 36571  // NewVoteResponse returns a default VoteResponse
 36572  // This is a shortcut for creating a struct and calling Default yourself.
 36573  func NewVoteResponse() VoteResponse {
 36574  	var v VoteResponse
 36575  	v.Default()
 36576  	return v
 36577  }
 36578  
 36579  type BeginQuorumEpochRequestTopicPartition struct {
 36580  	Partition int32
 36581  
 36582  	// The ID of the newly elected leader.
 36583  	LeaderID int32
 36584  
 36585  	// The epoch of the newly elected leader.
 36586  	LeaderEpoch int32
 36587  }
 36588  
 36589  // Default sets any default fields. Calling this allows for future compatibility
 36590  // if new fields are added to BeginQuorumEpochRequestTopicPartition.
 36591  func (v *BeginQuorumEpochRequestTopicPartition) Default() {
 36592  }
 36593  
 36594  // NewBeginQuorumEpochRequestTopicPartition returns a default BeginQuorumEpochRequestTopicPartition
 36595  // This is a shortcut for creating a struct and calling Default yourself.
 36596  func NewBeginQuorumEpochRequestTopicPartition() BeginQuorumEpochRequestTopicPartition {
 36597  	var v BeginQuorumEpochRequestTopicPartition
 36598  	v.Default()
 36599  	return v
 36600  }
 36601  
 36602  type BeginQuorumEpochRequestTopic struct {
 36603  	Topic string
 36604  
 36605  	Partitions []BeginQuorumEpochRequestTopicPartition
 36606  }
 36607  
 36608  // Default sets any default fields. Calling this allows for future compatibility
 36609  // if new fields are added to BeginQuorumEpochRequestTopic.
 36610  func (v *BeginQuorumEpochRequestTopic) Default() {
 36611  }
 36612  
 36613  // NewBeginQuorumEpochRequestTopic returns a default BeginQuorumEpochRequestTopic
 36614  // This is a shortcut for creating a struct and calling Default yourself.
 36615  func NewBeginQuorumEpochRequestTopic() BeginQuorumEpochRequestTopic {
 36616  	var v BeginQuorumEpochRequestTopic
 36617  	v.Default()
 36618  	return v
 36619  }
 36620  
 36621  // Part of KIP-595 to replace Kafka's dependence on Zookeeper with a
 36622  // Kafka-only raft protocol,
 36623  // BeginQuorumEpochRequest is sent by a leader (once it has enough votes)
 36624  // to all voters in the election.
 36625  //
 36626  // Since this is relatively Kafka internal, most fields are left undocumented.
 36627  type BeginQuorumEpochRequest struct {
 36628  	// Version is the version of this message used with a Kafka broker.
 36629  	Version int16
 36630  
 36631  	ClusterID *string
 36632  
 36633  	Topics []BeginQuorumEpochRequestTopic
 36634  }
 36635  
 36636  func (*BeginQuorumEpochRequest) Key() int16                 { return 53 }
 36637  func (*BeginQuorumEpochRequest) MaxVersion() int16          { return 0 }
 36638  func (v *BeginQuorumEpochRequest) SetVersion(version int16) { v.Version = version }
 36639  func (v *BeginQuorumEpochRequest) GetVersion() int16        { return v.Version }
 36640  func (v *BeginQuorumEpochRequest) IsFlexible() bool         { return false }
 36641  func (v *BeginQuorumEpochRequest) IsAdminRequest()          {}
 36642  func (v *BeginQuorumEpochRequest) ResponseKind() Response {
 36643  	r := &BeginQuorumEpochResponse{Version: v.Version}
 36644  	r.Default()
 36645  	return r
 36646  }
 36647  
 36648  // RequestWith is requests v on r and returns the response or an error.
 36649  // For sharded requests, the response may be merged and still return an error.
 36650  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 36651  func (v *BeginQuorumEpochRequest) RequestWith(ctx context.Context, r Requestor) (*BeginQuorumEpochResponse, error) {
 36652  	kresp, err := r.Request(ctx, v)
 36653  	resp, _ := kresp.(*BeginQuorumEpochResponse)
 36654  	return resp, err
 36655  }
 36656  
 36657  func (v *BeginQuorumEpochRequest) AppendTo(dst []byte) []byte {
 36658  	version := v.Version
 36659  	_ = version
 36660  	{
 36661  		v := v.ClusterID
 36662  		dst = kbin.AppendNullableString(dst, v)
 36663  	}
 36664  	{
 36665  		v := v.Topics
 36666  		dst = kbin.AppendArrayLen(dst, len(v))
 36667  		for i := range v {
 36668  			v := &v[i]
 36669  			{
 36670  				v := v.Topic
 36671  				dst = kbin.AppendString(dst, v)
 36672  			}
 36673  			{
 36674  				v := v.Partitions
 36675  				dst = kbin.AppendArrayLen(dst, len(v))
 36676  				for i := range v {
 36677  					v := &v[i]
 36678  					{
 36679  						v := v.Partition
 36680  						dst = kbin.AppendInt32(dst, v)
 36681  					}
 36682  					{
 36683  						v := v.LeaderID
 36684  						dst = kbin.AppendInt32(dst, v)
 36685  					}
 36686  					{
 36687  						v := v.LeaderEpoch
 36688  						dst = kbin.AppendInt32(dst, v)
 36689  					}
 36690  				}
 36691  			}
 36692  		}
 36693  	}
 36694  	return dst
 36695  }
 36696  
 36697  func (v *BeginQuorumEpochRequest) ReadFrom(src []byte) error {
 36698  	return v.readFrom(src, false)
 36699  }
 36700  
 36701  func (v *BeginQuorumEpochRequest) UnsafeReadFrom(src []byte) error {
 36702  	return v.readFrom(src, true)
 36703  }
 36704  
 36705  func (v *BeginQuorumEpochRequest) readFrom(src []byte, unsafe bool) error {
 36706  	v.Default()
 36707  	b := kbin.Reader{Src: src}
 36708  	version := v.Version
 36709  	_ = version
 36710  	s := v
 36711  	{
 36712  		var v *string
 36713  		if unsafe {
 36714  			v = b.UnsafeNullableString()
 36715  		} else {
 36716  			v = b.NullableString()
 36717  		}
 36718  		s.ClusterID = v
 36719  	}
 36720  	{
 36721  		v := s.Topics
 36722  		a := v
 36723  		var l int32
 36724  		l = b.ArrayLen()
 36725  		if !b.Ok() {
 36726  			return b.Complete()
 36727  		}
 36728  		a = a[:0]
 36729  		if l > 0 {
 36730  			a = append(a, make([]BeginQuorumEpochRequestTopic, l)...)
 36731  		}
 36732  		for i := int32(0); i < l; i++ {
 36733  			v := &a[i]
 36734  			v.Default()
 36735  			s := v
 36736  			{
 36737  				var v string
 36738  				if unsafe {
 36739  					v = b.UnsafeString()
 36740  				} else {
 36741  					v = b.String()
 36742  				}
 36743  				s.Topic = v
 36744  			}
 36745  			{
 36746  				v := s.Partitions
 36747  				a := v
 36748  				var l int32
 36749  				l = b.ArrayLen()
 36750  				if !b.Ok() {
 36751  					return b.Complete()
 36752  				}
 36753  				a = a[:0]
 36754  				if l > 0 {
 36755  					a = append(a, make([]BeginQuorumEpochRequestTopicPartition, l)...)
 36756  				}
 36757  				for i := int32(0); i < l; i++ {
 36758  					v := &a[i]
 36759  					v.Default()
 36760  					s := v
 36761  					{
 36762  						v := b.Int32()
 36763  						s.Partition = v
 36764  					}
 36765  					{
 36766  						v := b.Int32()
 36767  						s.LeaderID = v
 36768  					}
 36769  					{
 36770  						v := b.Int32()
 36771  						s.LeaderEpoch = v
 36772  					}
 36773  				}
 36774  				v = a
 36775  				s.Partitions = v
 36776  			}
 36777  		}
 36778  		v = a
 36779  		s.Topics = v
 36780  	}
 36781  	return b.Complete()
 36782  }
 36783  
 36784  // NewPtrBeginQuorumEpochRequest returns a pointer to a default BeginQuorumEpochRequest
 36785  // This is a shortcut for creating a new(struct) and calling Default yourself.
 36786  func NewPtrBeginQuorumEpochRequest() *BeginQuorumEpochRequest {
 36787  	var v BeginQuorumEpochRequest
 36788  	v.Default()
 36789  	return &v
 36790  }
 36791  
 36792  // Default sets any default fields. Calling this allows for future compatibility
 36793  // if new fields are added to BeginQuorumEpochRequest.
 36794  func (v *BeginQuorumEpochRequest) Default() {
 36795  }
 36796  
 36797  // NewBeginQuorumEpochRequest returns a default BeginQuorumEpochRequest
 36798  // This is a shortcut for creating a struct and calling Default yourself.
 36799  func NewBeginQuorumEpochRequest() BeginQuorumEpochRequest {
 36800  	var v BeginQuorumEpochRequest
 36801  	v.Default()
 36802  	return v
 36803  }
 36804  
 36805  type BeginQuorumEpochResponseTopicPartition struct {
 36806  	Partition int32
 36807  
 36808  	ErrorCode int16
 36809  
 36810  	// The ID of the current leader, or -1 if the leader is unknown.
 36811  	LeaderID int32
 36812  
 36813  	// The latest known leader epoch.
 36814  	LeaderEpoch int32
 36815  }
 36816  
 36817  // Default sets any default fields. Calling this allows for future compatibility
 36818  // if new fields are added to BeginQuorumEpochResponseTopicPartition.
 36819  func (v *BeginQuorumEpochResponseTopicPartition) Default() {
 36820  }
 36821  
 36822  // NewBeginQuorumEpochResponseTopicPartition returns a default BeginQuorumEpochResponseTopicPartition
 36823  // This is a shortcut for creating a struct and calling Default yourself.
 36824  func NewBeginQuorumEpochResponseTopicPartition() BeginQuorumEpochResponseTopicPartition {
 36825  	var v BeginQuorumEpochResponseTopicPartition
 36826  	v.Default()
 36827  	return v
 36828  }
 36829  
 36830  type BeginQuorumEpochResponseTopic struct {
 36831  	Topic string
 36832  
 36833  	Partitions []BeginQuorumEpochResponseTopicPartition
 36834  }
 36835  
 36836  // Default sets any default fields. Calling this allows for future compatibility
 36837  // if new fields are added to BeginQuorumEpochResponseTopic.
 36838  func (v *BeginQuorumEpochResponseTopic) Default() {
 36839  }
 36840  
 36841  // NewBeginQuorumEpochResponseTopic returns a default BeginQuorumEpochResponseTopic
 36842  // This is a shortcut for creating a struct and calling Default yourself.
 36843  func NewBeginQuorumEpochResponseTopic() BeginQuorumEpochResponseTopic {
 36844  	var v BeginQuorumEpochResponseTopic
 36845  	v.Default()
 36846  	return v
 36847  }
 36848  
 36849  type BeginQuorumEpochResponse struct {
 36850  	// Version is the version of this message used with a Kafka broker.
 36851  	Version int16
 36852  
 36853  	ErrorCode int16
 36854  
 36855  	Topics []BeginQuorumEpochResponseTopic
 36856  }
 36857  
 36858  func (*BeginQuorumEpochResponse) Key() int16                 { return 53 }
 36859  func (*BeginQuorumEpochResponse) MaxVersion() int16          { return 0 }
 36860  func (v *BeginQuorumEpochResponse) SetVersion(version int16) { v.Version = version }
 36861  func (v *BeginQuorumEpochResponse) GetVersion() int16        { return v.Version }
 36862  func (v *BeginQuorumEpochResponse) IsFlexible() bool         { return false }
 36863  func (v *BeginQuorumEpochResponse) RequestKind() Request {
 36864  	return &BeginQuorumEpochRequest{Version: v.Version}
 36865  }
 36866  
 36867  func (v *BeginQuorumEpochResponse) AppendTo(dst []byte) []byte {
 36868  	version := v.Version
 36869  	_ = version
 36870  	{
 36871  		v := v.ErrorCode
 36872  		dst = kbin.AppendInt16(dst, v)
 36873  	}
 36874  	{
 36875  		v := v.Topics
 36876  		dst = kbin.AppendArrayLen(dst, len(v))
 36877  		for i := range v {
 36878  			v := &v[i]
 36879  			{
 36880  				v := v.Topic
 36881  				dst = kbin.AppendString(dst, v)
 36882  			}
 36883  			{
 36884  				v := v.Partitions
 36885  				dst = kbin.AppendArrayLen(dst, len(v))
 36886  				for i := range v {
 36887  					v := &v[i]
 36888  					{
 36889  						v := v.Partition
 36890  						dst = kbin.AppendInt32(dst, v)
 36891  					}
 36892  					{
 36893  						v := v.ErrorCode
 36894  						dst = kbin.AppendInt16(dst, v)
 36895  					}
 36896  					{
 36897  						v := v.LeaderID
 36898  						dst = kbin.AppendInt32(dst, v)
 36899  					}
 36900  					{
 36901  						v := v.LeaderEpoch
 36902  						dst = kbin.AppendInt32(dst, v)
 36903  					}
 36904  				}
 36905  			}
 36906  		}
 36907  	}
 36908  	return dst
 36909  }
 36910  
 36911  func (v *BeginQuorumEpochResponse) ReadFrom(src []byte) error {
 36912  	return v.readFrom(src, false)
 36913  }
 36914  
 36915  func (v *BeginQuorumEpochResponse) UnsafeReadFrom(src []byte) error {
 36916  	return v.readFrom(src, true)
 36917  }
 36918  
 36919  func (v *BeginQuorumEpochResponse) readFrom(src []byte, unsafe bool) error {
 36920  	v.Default()
 36921  	b := kbin.Reader{Src: src}
 36922  	version := v.Version
 36923  	_ = version
 36924  	s := v
 36925  	{
 36926  		v := b.Int16()
 36927  		s.ErrorCode = v
 36928  	}
 36929  	{
 36930  		v := s.Topics
 36931  		a := v
 36932  		var l int32
 36933  		l = b.ArrayLen()
 36934  		if !b.Ok() {
 36935  			return b.Complete()
 36936  		}
 36937  		a = a[:0]
 36938  		if l > 0 {
 36939  			a = append(a, make([]BeginQuorumEpochResponseTopic, l)...)
 36940  		}
 36941  		for i := int32(0); i < l; i++ {
 36942  			v := &a[i]
 36943  			v.Default()
 36944  			s := v
 36945  			{
 36946  				var v string
 36947  				if unsafe {
 36948  					v = b.UnsafeString()
 36949  				} else {
 36950  					v = b.String()
 36951  				}
 36952  				s.Topic = v
 36953  			}
 36954  			{
 36955  				v := s.Partitions
 36956  				a := v
 36957  				var l int32
 36958  				l = b.ArrayLen()
 36959  				if !b.Ok() {
 36960  					return b.Complete()
 36961  				}
 36962  				a = a[:0]
 36963  				if l > 0 {
 36964  					a = append(a, make([]BeginQuorumEpochResponseTopicPartition, l)...)
 36965  				}
 36966  				for i := int32(0); i < l; i++ {
 36967  					v := &a[i]
 36968  					v.Default()
 36969  					s := v
 36970  					{
 36971  						v := b.Int32()
 36972  						s.Partition = v
 36973  					}
 36974  					{
 36975  						v := b.Int16()
 36976  						s.ErrorCode = v
 36977  					}
 36978  					{
 36979  						v := b.Int32()
 36980  						s.LeaderID = v
 36981  					}
 36982  					{
 36983  						v := b.Int32()
 36984  						s.LeaderEpoch = v
 36985  					}
 36986  				}
 36987  				v = a
 36988  				s.Partitions = v
 36989  			}
 36990  		}
 36991  		v = a
 36992  		s.Topics = v
 36993  	}
 36994  	return b.Complete()
 36995  }
 36996  
 36997  // NewPtrBeginQuorumEpochResponse returns a pointer to a default BeginQuorumEpochResponse
 36998  // This is a shortcut for creating a new(struct) and calling Default yourself.
 36999  func NewPtrBeginQuorumEpochResponse() *BeginQuorumEpochResponse {
 37000  	var v BeginQuorumEpochResponse
 37001  	v.Default()
 37002  	return &v
 37003  }
 37004  
 37005  // Default sets any default fields. Calling this allows for future compatibility
 37006  // if new fields are added to BeginQuorumEpochResponse.
 37007  func (v *BeginQuorumEpochResponse) Default() {
 37008  }
 37009  
 37010  // NewBeginQuorumEpochResponse returns a default BeginQuorumEpochResponse
 37011  // This is a shortcut for creating a struct and calling Default yourself.
 37012  func NewBeginQuorumEpochResponse() BeginQuorumEpochResponse {
 37013  	var v BeginQuorumEpochResponse
 37014  	v.Default()
 37015  	return v
 37016  }
 37017  
 37018  type EndQuorumEpochRequestTopicPartition struct {
 37019  	Partition int32
 37020  
 37021  	// The current leader ID that is resigning.
 37022  	LeaderID int32
 37023  
 37024  	// The current epoch.
 37025  	LeaderEpoch int32
 37026  
 37027  	// A sorted list of preferred successors to start the election.
 37028  	PreferredSuccessors []int32
 37029  }
 37030  
 37031  // Default sets any default fields. Calling this allows for future compatibility
 37032  // if new fields are added to EndQuorumEpochRequestTopicPartition.
 37033  func (v *EndQuorumEpochRequestTopicPartition) Default() {
 37034  }
 37035  
 37036  // NewEndQuorumEpochRequestTopicPartition returns a default EndQuorumEpochRequestTopicPartition
 37037  // This is a shortcut for creating a struct and calling Default yourself.
 37038  func NewEndQuorumEpochRequestTopicPartition() EndQuorumEpochRequestTopicPartition {
 37039  	var v EndQuorumEpochRequestTopicPartition
 37040  	v.Default()
 37041  	return v
 37042  }
 37043  
 37044  type EndQuorumEpochRequestTopic struct {
 37045  	Topic string
 37046  
 37047  	Partitions []EndQuorumEpochRequestTopicPartition
 37048  }
 37049  
 37050  // Default sets any default fields. Calling this allows for future compatibility
 37051  // if new fields are added to EndQuorumEpochRequestTopic.
 37052  func (v *EndQuorumEpochRequestTopic) Default() {
 37053  }
 37054  
 37055  // NewEndQuorumEpochRequestTopic returns a default EndQuorumEpochRequestTopic
 37056  // This is a shortcut for creating a struct and calling Default yourself.
 37057  func NewEndQuorumEpochRequestTopic() EndQuorumEpochRequestTopic {
 37058  	var v EndQuorumEpochRequestTopic
 37059  	v.Default()
 37060  	return v
 37061  }
 37062  
 37063  // Part of KIP-595 to replace Kafka's dependence on Zookeeper with a
 37064  // Kafka-only raft protocol,
 37065  // EndQuorumEpochRequest is sent by a leader to gracefully step down as leader
 37066  // (i.e. on shutdown). Stepping down begins a new election.
 37067  //
 37068  // Since this is relatively Kafka internal, most fields are left undocumented.
 37069  type EndQuorumEpochRequest struct {
 37070  	// Version is the version of this message used with a Kafka broker.
 37071  	Version int16
 37072  
 37073  	ClusterID *string
 37074  
 37075  	Topics []EndQuorumEpochRequestTopic
 37076  }
 37077  
 37078  func (*EndQuorumEpochRequest) Key() int16                 { return 54 }
 37079  func (*EndQuorumEpochRequest) MaxVersion() int16          { return 0 }
 37080  func (v *EndQuorumEpochRequest) SetVersion(version int16) { v.Version = version }
 37081  func (v *EndQuorumEpochRequest) GetVersion() int16        { return v.Version }
 37082  func (v *EndQuorumEpochRequest) IsFlexible() bool         { return false }
 37083  func (v *EndQuorumEpochRequest) IsAdminRequest()          {}
 37084  func (v *EndQuorumEpochRequest) ResponseKind() Response {
 37085  	r := &EndQuorumEpochResponse{Version: v.Version}
 37086  	r.Default()
 37087  	return r
 37088  }
 37089  
 37090  // RequestWith is requests v on r and returns the response or an error.
 37091  // For sharded requests, the response may be merged and still return an error.
 37092  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 37093  func (v *EndQuorumEpochRequest) RequestWith(ctx context.Context, r Requestor) (*EndQuorumEpochResponse, error) {
 37094  	kresp, err := r.Request(ctx, v)
 37095  	resp, _ := kresp.(*EndQuorumEpochResponse)
 37096  	return resp, err
 37097  }
 37098  
 37099  func (v *EndQuorumEpochRequest) AppendTo(dst []byte) []byte {
 37100  	version := v.Version
 37101  	_ = version
 37102  	{
 37103  		v := v.ClusterID
 37104  		dst = kbin.AppendNullableString(dst, v)
 37105  	}
 37106  	{
 37107  		v := v.Topics
 37108  		dst = kbin.AppendArrayLen(dst, len(v))
 37109  		for i := range v {
 37110  			v := &v[i]
 37111  			{
 37112  				v := v.Topic
 37113  				dst = kbin.AppendString(dst, v)
 37114  			}
 37115  			{
 37116  				v := v.Partitions
 37117  				dst = kbin.AppendArrayLen(dst, len(v))
 37118  				for i := range v {
 37119  					v := &v[i]
 37120  					{
 37121  						v := v.Partition
 37122  						dst = kbin.AppendInt32(dst, v)
 37123  					}
 37124  					{
 37125  						v := v.LeaderID
 37126  						dst = kbin.AppendInt32(dst, v)
 37127  					}
 37128  					{
 37129  						v := v.LeaderEpoch
 37130  						dst = kbin.AppendInt32(dst, v)
 37131  					}
 37132  					{
 37133  						v := v.PreferredSuccessors
 37134  						dst = kbin.AppendArrayLen(dst, len(v))
 37135  						for i := range v {
 37136  							v := v[i]
 37137  							dst = kbin.AppendInt32(dst, v)
 37138  						}
 37139  					}
 37140  				}
 37141  			}
 37142  		}
 37143  	}
 37144  	return dst
 37145  }
 37146  
 37147  func (v *EndQuorumEpochRequest) ReadFrom(src []byte) error {
 37148  	return v.readFrom(src, false)
 37149  }
 37150  
 37151  func (v *EndQuorumEpochRequest) UnsafeReadFrom(src []byte) error {
 37152  	return v.readFrom(src, true)
 37153  }
 37154  
 37155  func (v *EndQuorumEpochRequest) readFrom(src []byte, unsafe bool) error {
 37156  	v.Default()
 37157  	b := kbin.Reader{Src: src}
 37158  	version := v.Version
 37159  	_ = version
 37160  	s := v
 37161  	{
 37162  		var v *string
 37163  		if unsafe {
 37164  			v = b.UnsafeNullableString()
 37165  		} else {
 37166  			v = b.NullableString()
 37167  		}
 37168  		s.ClusterID = v
 37169  	}
 37170  	{
 37171  		v := s.Topics
 37172  		a := v
 37173  		var l int32
 37174  		l = b.ArrayLen()
 37175  		if !b.Ok() {
 37176  			return b.Complete()
 37177  		}
 37178  		a = a[:0]
 37179  		if l > 0 {
 37180  			a = append(a, make([]EndQuorumEpochRequestTopic, l)...)
 37181  		}
 37182  		for i := int32(0); i < l; i++ {
 37183  			v := &a[i]
 37184  			v.Default()
 37185  			s := v
 37186  			{
 37187  				var v string
 37188  				if unsafe {
 37189  					v = b.UnsafeString()
 37190  				} else {
 37191  					v = b.String()
 37192  				}
 37193  				s.Topic = v
 37194  			}
 37195  			{
 37196  				v := s.Partitions
 37197  				a := v
 37198  				var l int32
 37199  				l = b.ArrayLen()
 37200  				if !b.Ok() {
 37201  					return b.Complete()
 37202  				}
 37203  				a = a[:0]
 37204  				if l > 0 {
 37205  					a = append(a, make([]EndQuorumEpochRequestTopicPartition, l)...)
 37206  				}
 37207  				for i := int32(0); i < l; i++ {
 37208  					v := &a[i]
 37209  					v.Default()
 37210  					s := v
 37211  					{
 37212  						v := b.Int32()
 37213  						s.Partition = v
 37214  					}
 37215  					{
 37216  						v := b.Int32()
 37217  						s.LeaderID = v
 37218  					}
 37219  					{
 37220  						v := b.Int32()
 37221  						s.LeaderEpoch = v
 37222  					}
 37223  					{
 37224  						v := s.PreferredSuccessors
 37225  						a := v
 37226  						var l int32
 37227  						l = b.ArrayLen()
 37228  						if !b.Ok() {
 37229  							return b.Complete()
 37230  						}
 37231  						a = a[:0]
 37232  						if l > 0 {
 37233  							a = append(a, make([]int32, l)...)
 37234  						}
 37235  						for i := int32(0); i < l; i++ {
 37236  							v := b.Int32()
 37237  							a[i] = v
 37238  						}
 37239  						v = a
 37240  						s.PreferredSuccessors = v
 37241  					}
 37242  				}
 37243  				v = a
 37244  				s.Partitions = v
 37245  			}
 37246  		}
 37247  		v = a
 37248  		s.Topics = v
 37249  	}
 37250  	return b.Complete()
 37251  }
 37252  
 37253  // NewPtrEndQuorumEpochRequest returns a pointer to a default EndQuorumEpochRequest
 37254  // This is a shortcut for creating a new(struct) and calling Default yourself.
 37255  func NewPtrEndQuorumEpochRequest() *EndQuorumEpochRequest {
 37256  	var v EndQuorumEpochRequest
 37257  	v.Default()
 37258  	return &v
 37259  }
 37260  
 37261  // Default sets any default fields. Calling this allows for future compatibility
 37262  // if new fields are added to EndQuorumEpochRequest.
 37263  func (v *EndQuorumEpochRequest) Default() {
 37264  }
 37265  
 37266  // NewEndQuorumEpochRequest returns a default EndQuorumEpochRequest
 37267  // This is a shortcut for creating a struct and calling Default yourself.
 37268  func NewEndQuorumEpochRequest() EndQuorumEpochRequest {
 37269  	var v EndQuorumEpochRequest
 37270  	v.Default()
 37271  	return v
 37272  }
 37273  
 37274  type EndQuorumEpochResponseTopicPartition struct {
 37275  	Partition int32
 37276  
 37277  	ErrorCode int16
 37278  
 37279  	// The ID of the current leader, or -1 if the leader is unknown.
 37280  	LeaderID int32
 37281  
 37282  	// The latest known leader epoch.
 37283  	LeaderEpoch int32
 37284  }
 37285  
 37286  // Default sets any default fields. Calling this allows for future compatibility
 37287  // if new fields are added to EndQuorumEpochResponseTopicPartition.
 37288  func (v *EndQuorumEpochResponseTopicPartition) Default() {
 37289  }
 37290  
 37291  // NewEndQuorumEpochResponseTopicPartition returns a default EndQuorumEpochResponseTopicPartition
 37292  // This is a shortcut for creating a struct and calling Default yourself.
 37293  func NewEndQuorumEpochResponseTopicPartition() EndQuorumEpochResponseTopicPartition {
 37294  	var v EndQuorumEpochResponseTopicPartition
 37295  	v.Default()
 37296  	return v
 37297  }
 37298  
 37299  type EndQuorumEpochResponseTopic struct {
 37300  	Topic string
 37301  
 37302  	Partitions []EndQuorumEpochResponseTopicPartition
 37303  }
 37304  
 37305  // Default sets any default fields. Calling this allows for future compatibility
 37306  // if new fields are added to EndQuorumEpochResponseTopic.
 37307  func (v *EndQuorumEpochResponseTopic) Default() {
 37308  }
 37309  
 37310  // NewEndQuorumEpochResponseTopic returns a default EndQuorumEpochResponseTopic
 37311  // This is a shortcut for creating a struct and calling Default yourself.
 37312  func NewEndQuorumEpochResponseTopic() EndQuorumEpochResponseTopic {
 37313  	var v EndQuorumEpochResponseTopic
 37314  	v.Default()
 37315  	return v
 37316  }
 37317  
 37318  type EndQuorumEpochResponse struct {
 37319  	// Version is the version of this message used with a Kafka broker.
 37320  	Version int16
 37321  
 37322  	ErrorCode int16
 37323  
 37324  	Topics []EndQuorumEpochResponseTopic
 37325  }
 37326  
 37327  func (*EndQuorumEpochResponse) Key() int16                 { return 54 }
 37328  func (*EndQuorumEpochResponse) MaxVersion() int16          { return 0 }
 37329  func (v *EndQuorumEpochResponse) SetVersion(version int16) { v.Version = version }
 37330  func (v *EndQuorumEpochResponse) GetVersion() int16        { return v.Version }
 37331  func (v *EndQuorumEpochResponse) IsFlexible() bool         { return false }
 37332  func (v *EndQuorumEpochResponse) RequestKind() Request {
 37333  	return &EndQuorumEpochRequest{Version: v.Version}
 37334  }
 37335  
 37336  func (v *EndQuorumEpochResponse) AppendTo(dst []byte) []byte {
 37337  	version := v.Version
 37338  	_ = version
 37339  	{
 37340  		v := v.ErrorCode
 37341  		dst = kbin.AppendInt16(dst, v)
 37342  	}
 37343  	{
 37344  		v := v.Topics
 37345  		dst = kbin.AppendArrayLen(dst, len(v))
 37346  		for i := range v {
 37347  			v := &v[i]
 37348  			{
 37349  				v := v.Topic
 37350  				dst = kbin.AppendString(dst, v)
 37351  			}
 37352  			{
 37353  				v := v.Partitions
 37354  				dst = kbin.AppendArrayLen(dst, len(v))
 37355  				for i := range v {
 37356  					v := &v[i]
 37357  					{
 37358  						v := v.Partition
 37359  						dst = kbin.AppendInt32(dst, v)
 37360  					}
 37361  					{
 37362  						v := v.ErrorCode
 37363  						dst = kbin.AppendInt16(dst, v)
 37364  					}
 37365  					{
 37366  						v := v.LeaderID
 37367  						dst = kbin.AppendInt32(dst, v)
 37368  					}
 37369  					{
 37370  						v := v.LeaderEpoch
 37371  						dst = kbin.AppendInt32(dst, v)
 37372  					}
 37373  				}
 37374  			}
 37375  		}
 37376  	}
 37377  	return dst
 37378  }
 37379  
 37380  func (v *EndQuorumEpochResponse) ReadFrom(src []byte) error {
 37381  	return v.readFrom(src, false)
 37382  }
 37383  
 37384  func (v *EndQuorumEpochResponse) UnsafeReadFrom(src []byte) error {
 37385  	return v.readFrom(src, true)
 37386  }
 37387  
 37388  func (v *EndQuorumEpochResponse) readFrom(src []byte, unsafe bool) error {
 37389  	v.Default()
 37390  	b := kbin.Reader{Src: src}
 37391  	version := v.Version
 37392  	_ = version
 37393  	s := v
 37394  	{
 37395  		v := b.Int16()
 37396  		s.ErrorCode = v
 37397  	}
 37398  	{
 37399  		v := s.Topics
 37400  		a := v
 37401  		var l int32
 37402  		l = b.ArrayLen()
 37403  		if !b.Ok() {
 37404  			return b.Complete()
 37405  		}
 37406  		a = a[:0]
 37407  		if l > 0 {
 37408  			a = append(a, make([]EndQuorumEpochResponseTopic, l)...)
 37409  		}
 37410  		for i := int32(0); i < l; i++ {
 37411  			v := &a[i]
 37412  			v.Default()
 37413  			s := v
 37414  			{
 37415  				var v string
 37416  				if unsafe {
 37417  					v = b.UnsafeString()
 37418  				} else {
 37419  					v = b.String()
 37420  				}
 37421  				s.Topic = v
 37422  			}
 37423  			{
 37424  				v := s.Partitions
 37425  				a := v
 37426  				var l int32
 37427  				l = b.ArrayLen()
 37428  				if !b.Ok() {
 37429  					return b.Complete()
 37430  				}
 37431  				a = a[:0]
 37432  				if l > 0 {
 37433  					a = append(a, make([]EndQuorumEpochResponseTopicPartition, l)...)
 37434  				}
 37435  				for i := int32(0); i < l; i++ {
 37436  					v := &a[i]
 37437  					v.Default()
 37438  					s := v
 37439  					{
 37440  						v := b.Int32()
 37441  						s.Partition = v
 37442  					}
 37443  					{
 37444  						v := b.Int16()
 37445  						s.ErrorCode = v
 37446  					}
 37447  					{
 37448  						v := b.Int32()
 37449  						s.LeaderID = v
 37450  					}
 37451  					{
 37452  						v := b.Int32()
 37453  						s.LeaderEpoch = v
 37454  					}
 37455  				}
 37456  				v = a
 37457  				s.Partitions = v
 37458  			}
 37459  		}
 37460  		v = a
 37461  		s.Topics = v
 37462  	}
 37463  	return b.Complete()
 37464  }
 37465  
 37466  // NewPtrEndQuorumEpochResponse returns a pointer to a default EndQuorumEpochResponse
 37467  // This is a shortcut for creating a new(struct) and calling Default yourself.
 37468  func NewPtrEndQuorumEpochResponse() *EndQuorumEpochResponse {
 37469  	var v EndQuorumEpochResponse
 37470  	v.Default()
 37471  	return &v
 37472  }
 37473  
 37474  // Default sets any default fields. Calling this allows for future compatibility
 37475  // if new fields are added to EndQuorumEpochResponse.
 37476  func (v *EndQuorumEpochResponse) Default() {
 37477  }
 37478  
 37479  // NewEndQuorumEpochResponse returns a default EndQuorumEpochResponse
 37480  // This is a shortcut for creating a struct and calling Default yourself.
 37481  func NewEndQuorumEpochResponse() EndQuorumEpochResponse {
 37482  	var v EndQuorumEpochResponse
 37483  	v.Default()
 37484  	return v
 37485  }
 37486  
 37487  // A common struct used in DescribeQuorumResponse.
 37488  type DescribeQuorumResponseTopicPartitionReplicaState struct {
 37489  	ReplicaID int32
 37490  
 37491  	// The last known log end offset of the follower, or -1 if it is unknown.
 37492  	LogEndOffset int64
 37493  
 37494  	// The last known leader wall clock time when a follower fetched from the
 37495  	// leader, or -1 for the current leader or if unknown for a voter.
 37496  	//
 37497  	// This field has a default of -1.
 37498  	LastFetchTimestamp int64 // v1+
 37499  
 37500  	// The leader wall clock append time of the offset for which the follower
 37501  	// made the most recent fetch request, or -1 for the current leader or if
 37502  	// unknown for a voter.
 37503  	//
 37504  	// This field has a default of -1.
 37505  	LastCaughtUpTimestamp int64 // v1+
 37506  
 37507  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37508  	UnknownTags Tags
 37509  }
 37510  
 37511  // Default sets any default fields. Calling this allows for future compatibility
 37512  // if new fields are added to DescribeQuorumResponseTopicPartitionReplicaState.
 37513  func (v *DescribeQuorumResponseTopicPartitionReplicaState) Default() {
 37514  	v.LastFetchTimestamp = -1
 37515  	v.LastCaughtUpTimestamp = -1
 37516  }
 37517  
 37518  // NewDescribeQuorumResponseTopicPartitionReplicaState returns a default DescribeQuorumResponseTopicPartitionReplicaState
 37519  // This is a shortcut for creating a struct and calling Default yourself.
 37520  func NewDescribeQuorumResponseTopicPartitionReplicaState() DescribeQuorumResponseTopicPartitionReplicaState {
 37521  	var v DescribeQuorumResponseTopicPartitionReplicaState
 37522  	v.Default()
 37523  	return v
 37524  }
 37525  
 37526  type DescribeQuorumRequestTopicPartition struct {
 37527  	Partition int32
 37528  
 37529  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37530  	UnknownTags Tags
 37531  }
 37532  
 37533  // Default sets any default fields. Calling this allows for future compatibility
 37534  // if new fields are added to DescribeQuorumRequestTopicPartition.
 37535  func (v *DescribeQuorumRequestTopicPartition) Default() {
 37536  }
 37537  
 37538  // NewDescribeQuorumRequestTopicPartition returns a default DescribeQuorumRequestTopicPartition
 37539  // This is a shortcut for creating a struct and calling Default yourself.
 37540  func NewDescribeQuorumRequestTopicPartition() DescribeQuorumRequestTopicPartition {
 37541  	var v DescribeQuorumRequestTopicPartition
 37542  	v.Default()
 37543  	return v
 37544  }
 37545  
 37546  type DescribeQuorumRequestTopic struct {
 37547  	Topic string
 37548  
 37549  	Partitions []DescribeQuorumRequestTopicPartition
 37550  
 37551  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37552  	UnknownTags Tags
 37553  }
 37554  
 37555  // Default sets any default fields. Calling this allows for future compatibility
 37556  // if new fields are added to DescribeQuorumRequestTopic.
 37557  func (v *DescribeQuorumRequestTopic) Default() {
 37558  }
 37559  
 37560  // NewDescribeQuorumRequestTopic returns a default DescribeQuorumRequestTopic
 37561  // This is a shortcut for creating a struct and calling Default yourself.
 37562  func NewDescribeQuorumRequestTopic() DescribeQuorumRequestTopic {
 37563  	var v DescribeQuorumRequestTopic
 37564  	v.Default()
 37565  	return v
 37566  }
 37567  
 37568  // Part of KIP-642 (and KIP-595) to replace Kafka's dependence on Zookeeper with a
 37569  // Kafka-only raft protocol,
 37570  // DescribeQuorumRequest is sent by a leader to describe the quorum.
 37571  type DescribeQuorumRequest struct {
 37572  	// Version is the version of this message used with a Kafka broker.
 37573  	Version int16
 37574  
 37575  	Topics []DescribeQuorumRequestTopic
 37576  
 37577  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37578  	UnknownTags Tags
 37579  }
 37580  
 37581  func (*DescribeQuorumRequest) Key() int16                 { return 55 }
 37582  func (*DescribeQuorumRequest) MaxVersion() int16          { return 1 }
 37583  func (v *DescribeQuorumRequest) SetVersion(version int16) { v.Version = version }
 37584  func (v *DescribeQuorumRequest) GetVersion() int16        { return v.Version }
 37585  func (v *DescribeQuorumRequest) IsFlexible() bool         { return v.Version >= 0 }
 37586  func (v *DescribeQuorumRequest) IsAdminRequest()          {}
 37587  func (v *DescribeQuorumRequest) ResponseKind() Response {
 37588  	r := &DescribeQuorumResponse{Version: v.Version}
 37589  	r.Default()
 37590  	return r
 37591  }
 37592  
 37593  // RequestWith is requests v on r and returns the response or an error.
 37594  // For sharded requests, the response may be merged and still return an error.
 37595  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 37596  func (v *DescribeQuorumRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeQuorumResponse, error) {
 37597  	kresp, err := r.Request(ctx, v)
 37598  	resp, _ := kresp.(*DescribeQuorumResponse)
 37599  	return resp, err
 37600  }
 37601  
 37602  func (v *DescribeQuorumRequest) AppendTo(dst []byte) []byte {
 37603  	version := v.Version
 37604  	_ = version
 37605  	isFlexible := version >= 0
 37606  	_ = isFlexible
 37607  	{
 37608  		v := v.Topics
 37609  		if isFlexible {
 37610  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 37611  		} else {
 37612  			dst = kbin.AppendArrayLen(dst, len(v))
 37613  		}
 37614  		for i := range v {
 37615  			v := &v[i]
 37616  			{
 37617  				v := v.Topic
 37618  				if isFlexible {
 37619  					dst = kbin.AppendCompactString(dst, v)
 37620  				} else {
 37621  					dst = kbin.AppendString(dst, v)
 37622  				}
 37623  			}
 37624  			{
 37625  				v := v.Partitions
 37626  				if isFlexible {
 37627  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 37628  				} else {
 37629  					dst = kbin.AppendArrayLen(dst, len(v))
 37630  				}
 37631  				for i := range v {
 37632  					v := &v[i]
 37633  					{
 37634  						v := v.Partition
 37635  						dst = kbin.AppendInt32(dst, v)
 37636  					}
 37637  					if isFlexible {
 37638  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37639  						dst = v.UnknownTags.AppendEach(dst)
 37640  					}
 37641  				}
 37642  			}
 37643  			if isFlexible {
 37644  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37645  				dst = v.UnknownTags.AppendEach(dst)
 37646  			}
 37647  		}
 37648  	}
 37649  	if isFlexible {
 37650  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37651  		dst = v.UnknownTags.AppendEach(dst)
 37652  	}
 37653  	return dst
 37654  }
 37655  
 37656  func (v *DescribeQuorumRequest) ReadFrom(src []byte) error {
 37657  	return v.readFrom(src, false)
 37658  }
 37659  
 37660  func (v *DescribeQuorumRequest) UnsafeReadFrom(src []byte) error {
 37661  	return v.readFrom(src, true)
 37662  }
 37663  
 37664  func (v *DescribeQuorumRequest) readFrom(src []byte, unsafe bool) error {
 37665  	v.Default()
 37666  	b := kbin.Reader{Src: src}
 37667  	version := v.Version
 37668  	_ = version
 37669  	isFlexible := version >= 0
 37670  	_ = isFlexible
 37671  	s := v
 37672  	{
 37673  		v := s.Topics
 37674  		a := v
 37675  		var l int32
 37676  		if isFlexible {
 37677  			l = b.CompactArrayLen()
 37678  		} else {
 37679  			l = b.ArrayLen()
 37680  		}
 37681  		if !b.Ok() {
 37682  			return b.Complete()
 37683  		}
 37684  		a = a[:0]
 37685  		if l > 0 {
 37686  			a = append(a, make([]DescribeQuorumRequestTopic, l)...)
 37687  		}
 37688  		for i := int32(0); i < l; i++ {
 37689  			v := &a[i]
 37690  			v.Default()
 37691  			s := v
 37692  			{
 37693  				var v string
 37694  				if unsafe {
 37695  					if isFlexible {
 37696  						v = b.UnsafeCompactString()
 37697  					} else {
 37698  						v = b.UnsafeString()
 37699  					}
 37700  				} else {
 37701  					if isFlexible {
 37702  						v = b.CompactString()
 37703  					} else {
 37704  						v = b.String()
 37705  					}
 37706  				}
 37707  				s.Topic = v
 37708  			}
 37709  			{
 37710  				v := s.Partitions
 37711  				a := v
 37712  				var l int32
 37713  				if isFlexible {
 37714  					l = b.CompactArrayLen()
 37715  				} else {
 37716  					l = b.ArrayLen()
 37717  				}
 37718  				if !b.Ok() {
 37719  					return b.Complete()
 37720  				}
 37721  				a = a[:0]
 37722  				if l > 0 {
 37723  					a = append(a, make([]DescribeQuorumRequestTopicPartition, l)...)
 37724  				}
 37725  				for i := int32(0); i < l; i++ {
 37726  					v := &a[i]
 37727  					v.Default()
 37728  					s := v
 37729  					{
 37730  						v := b.Int32()
 37731  						s.Partition = v
 37732  					}
 37733  					if isFlexible {
 37734  						s.UnknownTags = internalReadTags(&b)
 37735  					}
 37736  				}
 37737  				v = a
 37738  				s.Partitions = v
 37739  			}
 37740  			if isFlexible {
 37741  				s.UnknownTags = internalReadTags(&b)
 37742  			}
 37743  		}
 37744  		v = a
 37745  		s.Topics = v
 37746  	}
 37747  	if isFlexible {
 37748  		s.UnknownTags = internalReadTags(&b)
 37749  	}
 37750  	return b.Complete()
 37751  }
 37752  
 37753  // NewPtrDescribeQuorumRequest returns a pointer to a default DescribeQuorumRequest
 37754  // This is a shortcut for creating a new(struct) and calling Default yourself.
 37755  func NewPtrDescribeQuorumRequest() *DescribeQuorumRequest {
 37756  	var v DescribeQuorumRequest
 37757  	v.Default()
 37758  	return &v
 37759  }
 37760  
 37761  // Default sets any default fields. Calling this allows for future compatibility
 37762  // if new fields are added to DescribeQuorumRequest.
 37763  func (v *DescribeQuorumRequest) Default() {
 37764  }
 37765  
 37766  // NewDescribeQuorumRequest returns a default DescribeQuorumRequest
 37767  // This is a shortcut for creating a struct and calling Default yourself.
 37768  func NewDescribeQuorumRequest() DescribeQuorumRequest {
 37769  	var v DescribeQuorumRequest
 37770  	v.Default()
 37771  	return v
 37772  }
 37773  
 37774  type DescribeQuorumResponseTopicPartition struct {
 37775  	Partition int32
 37776  
 37777  	ErrorCode int16
 37778  
 37779  	// The ID of the current leader, or -1 if the leader is unknown.
 37780  	LeaderID int32
 37781  
 37782  	// The latest known leader epoch.
 37783  	LeaderEpoch int32
 37784  
 37785  	HighWatermark int64
 37786  
 37787  	CurrentVoters []DescribeQuorumResponseTopicPartitionReplicaState
 37788  
 37789  	Observers []DescribeQuorumResponseTopicPartitionReplicaState
 37790  
 37791  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37792  	UnknownTags Tags
 37793  }
 37794  
 37795  // Default sets any default fields. Calling this allows for future compatibility
 37796  // if new fields are added to DescribeQuorumResponseTopicPartition.
 37797  func (v *DescribeQuorumResponseTopicPartition) Default() {
 37798  }
 37799  
 37800  // NewDescribeQuorumResponseTopicPartition returns a default DescribeQuorumResponseTopicPartition
 37801  // This is a shortcut for creating a struct and calling Default yourself.
 37802  func NewDescribeQuorumResponseTopicPartition() DescribeQuorumResponseTopicPartition {
 37803  	var v DescribeQuorumResponseTopicPartition
 37804  	v.Default()
 37805  	return v
 37806  }
 37807  
 37808  type DescribeQuorumResponseTopic struct {
 37809  	Topic string
 37810  
 37811  	Partitions []DescribeQuorumResponseTopicPartition
 37812  
 37813  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37814  	UnknownTags Tags
 37815  }
 37816  
 37817  // Default sets any default fields. Calling this allows for future compatibility
 37818  // if new fields are added to DescribeQuorumResponseTopic.
 37819  func (v *DescribeQuorumResponseTopic) Default() {
 37820  }
 37821  
 37822  // NewDescribeQuorumResponseTopic returns a default DescribeQuorumResponseTopic
 37823  // This is a shortcut for creating a struct and calling Default yourself.
 37824  func NewDescribeQuorumResponseTopic() DescribeQuorumResponseTopic {
 37825  	var v DescribeQuorumResponseTopic
 37826  	v.Default()
 37827  	return v
 37828  }
 37829  
 37830  type DescribeQuorumResponse struct {
 37831  	// Version is the version of this message used with a Kafka broker.
 37832  	Version int16
 37833  
 37834  	ErrorCode int16
 37835  
 37836  	Topics []DescribeQuorumResponseTopic
 37837  
 37838  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 37839  	UnknownTags Tags
 37840  }
 37841  
 37842  func (*DescribeQuorumResponse) Key() int16                 { return 55 }
 37843  func (*DescribeQuorumResponse) MaxVersion() int16          { return 1 }
 37844  func (v *DescribeQuorumResponse) SetVersion(version int16) { v.Version = version }
 37845  func (v *DescribeQuorumResponse) GetVersion() int16        { return v.Version }
 37846  func (v *DescribeQuorumResponse) IsFlexible() bool         { return v.Version >= 0 }
 37847  func (v *DescribeQuorumResponse) RequestKind() Request {
 37848  	return &DescribeQuorumRequest{Version: v.Version}
 37849  }
 37850  
 37851  func (v *DescribeQuorumResponse) AppendTo(dst []byte) []byte {
 37852  	version := v.Version
 37853  	_ = version
 37854  	isFlexible := version >= 0
 37855  	_ = isFlexible
 37856  	{
 37857  		v := v.ErrorCode
 37858  		dst = kbin.AppendInt16(dst, v)
 37859  	}
 37860  	{
 37861  		v := v.Topics
 37862  		if isFlexible {
 37863  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 37864  		} else {
 37865  			dst = kbin.AppendArrayLen(dst, len(v))
 37866  		}
 37867  		for i := range v {
 37868  			v := &v[i]
 37869  			{
 37870  				v := v.Topic
 37871  				if isFlexible {
 37872  					dst = kbin.AppendCompactString(dst, v)
 37873  				} else {
 37874  					dst = kbin.AppendString(dst, v)
 37875  				}
 37876  			}
 37877  			{
 37878  				v := v.Partitions
 37879  				if isFlexible {
 37880  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 37881  				} else {
 37882  					dst = kbin.AppendArrayLen(dst, len(v))
 37883  				}
 37884  				for i := range v {
 37885  					v := &v[i]
 37886  					{
 37887  						v := v.Partition
 37888  						dst = kbin.AppendInt32(dst, v)
 37889  					}
 37890  					{
 37891  						v := v.ErrorCode
 37892  						dst = kbin.AppendInt16(dst, v)
 37893  					}
 37894  					{
 37895  						v := v.LeaderID
 37896  						dst = kbin.AppendInt32(dst, v)
 37897  					}
 37898  					{
 37899  						v := v.LeaderEpoch
 37900  						dst = kbin.AppendInt32(dst, v)
 37901  					}
 37902  					{
 37903  						v := v.HighWatermark
 37904  						dst = kbin.AppendInt64(dst, v)
 37905  					}
 37906  					{
 37907  						v := v.CurrentVoters
 37908  						if isFlexible {
 37909  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 37910  						} else {
 37911  							dst = kbin.AppendArrayLen(dst, len(v))
 37912  						}
 37913  						for i := range v {
 37914  							v := &v[i]
 37915  							{
 37916  								v := v.ReplicaID
 37917  								dst = kbin.AppendInt32(dst, v)
 37918  							}
 37919  							{
 37920  								v := v.LogEndOffset
 37921  								dst = kbin.AppendInt64(dst, v)
 37922  							}
 37923  							if version >= 1 {
 37924  								v := v.LastFetchTimestamp
 37925  								dst = kbin.AppendInt64(dst, v)
 37926  							}
 37927  							if version >= 1 {
 37928  								v := v.LastCaughtUpTimestamp
 37929  								dst = kbin.AppendInt64(dst, v)
 37930  							}
 37931  							if isFlexible {
 37932  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37933  								dst = v.UnknownTags.AppendEach(dst)
 37934  							}
 37935  						}
 37936  					}
 37937  					{
 37938  						v := v.Observers
 37939  						if isFlexible {
 37940  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 37941  						} else {
 37942  							dst = kbin.AppendArrayLen(dst, len(v))
 37943  						}
 37944  						for i := range v {
 37945  							v := &v[i]
 37946  							{
 37947  								v := v.ReplicaID
 37948  								dst = kbin.AppendInt32(dst, v)
 37949  							}
 37950  							{
 37951  								v := v.LogEndOffset
 37952  								dst = kbin.AppendInt64(dst, v)
 37953  							}
 37954  							if version >= 1 {
 37955  								v := v.LastFetchTimestamp
 37956  								dst = kbin.AppendInt64(dst, v)
 37957  							}
 37958  							if version >= 1 {
 37959  								v := v.LastCaughtUpTimestamp
 37960  								dst = kbin.AppendInt64(dst, v)
 37961  							}
 37962  							if isFlexible {
 37963  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37964  								dst = v.UnknownTags.AppendEach(dst)
 37965  							}
 37966  						}
 37967  					}
 37968  					if isFlexible {
 37969  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37970  						dst = v.UnknownTags.AppendEach(dst)
 37971  					}
 37972  				}
 37973  			}
 37974  			if isFlexible {
 37975  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37976  				dst = v.UnknownTags.AppendEach(dst)
 37977  			}
 37978  		}
 37979  	}
 37980  	if isFlexible {
 37981  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 37982  		dst = v.UnknownTags.AppendEach(dst)
 37983  	}
 37984  	return dst
 37985  }
 37986  
 37987  func (v *DescribeQuorumResponse) ReadFrom(src []byte) error {
 37988  	return v.readFrom(src, false)
 37989  }
 37990  
 37991  func (v *DescribeQuorumResponse) UnsafeReadFrom(src []byte) error {
 37992  	return v.readFrom(src, true)
 37993  }
 37994  
 37995  func (v *DescribeQuorumResponse) readFrom(src []byte, unsafe bool) error {
 37996  	v.Default()
 37997  	b := kbin.Reader{Src: src}
 37998  	version := v.Version
 37999  	_ = version
 38000  	isFlexible := version >= 0
 38001  	_ = isFlexible
 38002  	s := v
 38003  	{
 38004  		v := b.Int16()
 38005  		s.ErrorCode = v
 38006  	}
 38007  	{
 38008  		v := s.Topics
 38009  		a := v
 38010  		var l int32
 38011  		if isFlexible {
 38012  			l = b.CompactArrayLen()
 38013  		} else {
 38014  			l = b.ArrayLen()
 38015  		}
 38016  		if !b.Ok() {
 38017  			return b.Complete()
 38018  		}
 38019  		a = a[:0]
 38020  		if l > 0 {
 38021  			a = append(a, make([]DescribeQuorumResponseTopic, l)...)
 38022  		}
 38023  		for i := int32(0); i < l; i++ {
 38024  			v := &a[i]
 38025  			v.Default()
 38026  			s := v
 38027  			{
 38028  				var v string
 38029  				if unsafe {
 38030  					if isFlexible {
 38031  						v = b.UnsafeCompactString()
 38032  					} else {
 38033  						v = b.UnsafeString()
 38034  					}
 38035  				} else {
 38036  					if isFlexible {
 38037  						v = b.CompactString()
 38038  					} else {
 38039  						v = b.String()
 38040  					}
 38041  				}
 38042  				s.Topic = v
 38043  			}
 38044  			{
 38045  				v := s.Partitions
 38046  				a := v
 38047  				var l int32
 38048  				if isFlexible {
 38049  					l = b.CompactArrayLen()
 38050  				} else {
 38051  					l = b.ArrayLen()
 38052  				}
 38053  				if !b.Ok() {
 38054  					return b.Complete()
 38055  				}
 38056  				a = a[:0]
 38057  				if l > 0 {
 38058  					a = append(a, make([]DescribeQuorumResponseTopicPartition, l)...)
 38059  				}
 38060  				for i := int32(0); i < l; i++ {
 38061  					v := &a[i]
 38062  					v.Default()
 38063  					s := v
 38064  					{
 38065  						v := b.Int32()
 38066  						s.Partition = v
 38067  					}
 38068  					{
 38069  						v := b.Int16()
 38070  						s.ErrorCode = v
 38071  					}
 38072  					{
 38073  						v := b.Int32()
 38074  						s.LeaderID = v
 38075  					}
 38076  					{
 38077  						v := b.Int32()
 38078  						s.LeaderEpoch = v
 38079  					}
 38080  					{
 38081  						v := b.Int64()
 38082  						s.HighWatermark = v
 38083  					}
 38084  					{
 38085  						v := s.CurrentVoters
 38086  						a := v
 38087  						var l int32
 38088  						if isFlexible {
 38089  							l = b.CompactArrayLen()
 38090  						} else {
 38091  							l = b.ArrayLen()
 38092  						}
 38093  						if !b.Ok() {
 38094  							return b.Complete()
 38095  						}
 38096  						a = a[:0]
 38097  						if l > 0 {
 38098  							a = append(a, make([]DescribeQuorumResponseTopicPartitionReplicaState, l)...)
 38099  						}
 38100  						for i := int32(0); i < l; i++ {
 38101  							v := &a[i]
 38102  							v.Default()
 38103  							s := v
 38104  							{
 38105  								v := b.Int32()
 38106  								s.ReplicaID = v
 38107  							}
 38108  							{
 38109  								v := b.Int64()
 38110  								s.LogEndOffset = v
 38111  							}
 38112  							if version >= 1 {
 38113  								v := b.Int64()
 38114  								s.LastFetchTimestamp = v
 38115  							}
 38116  							if version >= 1 {
 38117  								v := b.Int64()
 38118  								s.LastCaughtUpTimestamp = v
 38119  							}
 38120  							if isFlexible {
 38121  								s.UnknownTags = internalReadTags(&b)
 38122  							}
 38123  						}
 38124  						v = a
 38125  						s.CurrentVoters = v
 38126  					}
 38127  					{
 38128  						v := s.Observers
 38129  						a := v
 38130  						var l int32
 38131  						if isFlexible {
 38132  							l = b.CompactArrayLen()
 38133  						} else {
 38134  							l = b.ArrayLen()
 38135  						}
 38136  						if !b.Ok() {
 38137  							return b.Complete()
 38138  						}
 38139  						a = a[:0]
 38140  						if l > 0 {
 38141  							a = append(a, make([]DescribeQuorumResponseTopicPartitionReplicaState, l)...)
 38142  						}
 38143  						for i := int32(0); i < l; i++ {
 38144  							v := &a[i]
 38145  							v.Default()
 38146  							s := v
 38147  							{
 38148  								v := b.Int32()
 38149  								s.ReplicaID = v
 38150  							}
 38151  							{
 38152  								v := b.Int64()
 38153  								s.LogEndOffset = v
 38154  							}
 38155  							if version >= 1 {
 38156  								v := b.Int64()
 38157  								s.LastFetchTimestamp = v
 38158  							}
 38159  							if version >= 1 {
 38160  								v := b.Int64()
 38161  								s.LastCaughtUpTimestamp = v
 38162  							}
 38163  							if isFlexible {
 38164  								s.UnknownTags = internalReadTags(&b)
 38165  							}
 38166  						}
 38167  						v = a
 38168  						s.Observers = v
 38169  					}
 38170  					if isFlexible {
 38171  						s.UnknownTags = internalReadTags(&b)
 38172  					}
 38173  				}
 38174  				v = a
 38175  				s.Partitions = v
 38176  			}
 38177  			if isFlexible {
 38178  				s.UnknownTags = internalReadTags(&b)
 38179  			}
 38180  		}
 38181  		v = a
 38182  		s.Topics = v
 38183  	}
 38184  	if isFlexible {
 38185  		s.UnknownTags = internalReadTags(&b)
 38186  	}
 38187  	return b.Complete()
 38188  }
 38189  
 38190  // NewPtrDescribeQuorumResponse returns a pointer to a default DescribeQuorumResponse
 38191  // This is a shortcut for creating a new(struct) and calling Default yourself.
 38192  func NewPtrDescribeQuorumResponse() *DescribeQuorumResponse {
 38193  	var v DescribeQuorumResponse
 38194  	v.Default()
 38195  	return &v
 38196  }
 38197  
 38198  // Default sets any default fields. Calling this allows for future compatibility
 38199  // if new fields are added to DescribeQuorumResponse.
 38200  func (v *DescribeQuorumResponse) Default() {
 38201  }
 38202  
 38203  // NewDescribeQuorumResponse returns a default DescribeQuorumResponse
 38204  // This is a shortcut for creating a struct and calling Default yourself.
 38205  func NewDescribeQuorumResponse() DescribeQuorumResponse {
 38206  	var v DescribeQuorumResponse
 38207  	v.Default()
 38208  	return v
 38209  }
 38210  
 38211  type AlterPartitionRequestTopicPartitionNewEpochISR struct {
 38212  	// The broker ID .
 38213  	BrokerID int32
 38214  
 38215  	// The broker's epoch; -1 if the epoch check is not supported.
 38216  	//
 38217  	// This field has a default of -1.
 38218  	BrokerEpoch int32
 38219  
 38220  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38221  	UnknownTags Tags
 38222  }
 38223  
 38224  // Default sets any default fields. Calling this allows for future compatibility
 38225  // if new fields are added to AlterPartitionRequestTopicPartitionNewEpochISR.
 38226  func (v *AlterPartitionRequestTopicPartitionNewEpochISR) Default() {
 38227  	v.BrokerEpoch = -1
 38228  }
 38229  
 38230  // NewAlterPartitionRequestTopicPartitionNewEpochISR returns a default AlterPartitionRequestTopicPartitionNewEpochISR
 38231  // This is a shortcut for creating a struct and calling Default yourself.
 38232  func NewAlterPartitionRequestTopicPartitionNewEpochISR() AlterPartitionRequestTopicPartitionNewEpochISR {
 38233  	var v AlterPartitionRequestTopicPartitionNewEpochISR
 38234  	v.Default()
 38235  	return v
 38236  }
 38237  
 38238  type AlterPartitionRequestTopicPartition struct {
 38239  	Partition int32
 38240  
 38241  	// The leader epoch of this partition.
 38242  	LeaderEpoch int32
 38243  
 38244  	// The ISR for this partition.
 38245  	NewISR []int32 // v0-v2
 38246  
 38247  	NewEpochISR []AlterPartitionRequestTopicPartitionNewEpochISR // v3+
 38248  
 38249  	// 1 if the partition is recovering from unclean leader election; 0 otherwise
 38250  	LeaderRecoveryState int8 // v1+
 38251  
 38252  	// The expected epoch of the partition which is being updated.
 38253  	// For a legacy cluster, this is the ZkVersion in the LeaderAndISR request.
 38254  	PartitionEpoch int32
 38255  
 38256  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38257  	UnknownTags Tags
 38258  }
 38259  
 38260  // Default sets any default fields. Calling this allows for future compatibility
 38261  // if new fields are added to AlterPartitionRequestTopicPartition.
 38262  func (v *AlterPartitionRequestTopicPartition) Default() {
 38263  }
 38264  
 38265  // NewAlterPartitionRequestTopicPartition returns a default AlterPartitionRequestTopicPartition
 38266  // This is a shortcut for creating a struct and calling Default yourself.
 38267  func NewAlterPartitionRequestTopicPartition() AlterPartitionRequestTopicPartition {
 38268  	var v AlterPartitionRequestTopicPartition
 38269  	v.Default()
 38270  	return v
 38271  }
 38272  
 38273  type AlterPartitionRequestTopic struct {
 38274  	Topic string // v0-v1
 38275  
 38276  	TopicID [16]byte // v2+
 38277  
 38278  	Partitions []AlterPartitionRequestTopicPartition
 38279  
 38280  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38281  	UnknownTags Tags
 38282  }
 38283  
 38284  // Default sets any default fields. Calling this allows for future compatibility
 38285  // if new fields are added to AlterPartitionRequestTopic.
 38286  func (v *AlterPartitionRequestTopic) Default() {
 38287  }
 38288  
 38289  // NewAlterPartitionRequestTopic returns a default AlterPartitionRequestTopic
 38290  // This is a shortcut for creating a struct and calling Default yourself.
 38291  func NewAlterPartitionRequestTopic() AlterPartitionRequestTopic {
 38292  	var v AlterPartitionRequestTopic
 38293  	v.Default()
 38294  	return v
 38295  }
 38296  
 38297  // AlterPartitionRequest, proposed in KIP-497 and introduced in Kafka 2.7.0,
 38298  // is an admin request to modify ISR.
 38299  //
 38300  // Version 3 was added for KIP-903 and replaced NewISR.
 38301  type AlterPartitionRequest struct {
 38302  	// Version is the version of this message used with a Kafka broker.
 38303  	Version int16
 38304  
 38305  	// The ID of the requesting broker.
 38306  	BrokerID int32
 38307  
 38308  	// The epoch of the requesting broker.
 38309  	//
 38310  	// This field has a default of -1.
 38311  	BrokerEpoch int64
 38312  
 38313  	Topics []AlterPartitionRequestTopic
 38314  
 38315  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38316  	UnknownTags Tags
 38317  }
 38318  
 38319  func (*AlterPartitionRequest) Key() int16                 { return 56 }
 38320  func (*AlterPartitionRequest) MaxVersion() int16          { return 3 }
 38321  func (v *AlterPartitionRequest) SetVersion(version int16) { v.Version = version }
 38322  func (v *AlterPartitionRequest) GetVersion() int16        { return v.Version }
 38323  func (v *AlterPartitionRequest) IsFlexible() bool         { return v.Version >= 0 }
 38324  func (v *AlterPartitionRequest) IsAdminRequest()          {}
 38325  func (v *AlterPartitionRequest) ResponseKind() Response {
 38326  	r := &AlterPartitionResponse{Version: v.Version}
 38327  	r.Default()
 38328  	return r
 38329  }
 38330  
 38331  // RequestWith is requests v on r and returns the response or an error.
 38332  // For sharded requests, the response may be merged and still return an error.
 38333  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 38334  func (v *AlterPartitionRequest) RequestWith(ctx context.Context, r Requestor) (*AlterPartitionResponse, error) {
 38335  	kresp, err := r.Request(ctx, v)
 38336  	resp, _ := kresp.(*AlterPartitionResponse)
 38337  	return resp, err
 38338  }
 38339  
 38340  func (v *AlterPartitionRequest) AppendTo(dst []byte) []byte {
 38341  	version := v.Version
 38342  	_ = version
 38343  	isFlexible := version >= 0
 38344  	_ = isFlexible
 38345  	{
 38346  		v := v.BrokerID
 38347  		dst = kbin.AppendInt32(dst, v)
 38348  	}
 38349  	{
 38350  		v := v.BrokerEpoch
 38351  		dst = kbin.AppendInt64(dst, v)
 38352  	}
 38353  	{
 38354  		v := v.Topics
 38355  		if isFlexible {
 38356  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 38357  		} else {
 38358  			dst = kbin.AppendArrayLen(dst, len(v))
 38359  		}
 38360  		for i := range v {
 38361  			v := &v[i]
 38362  			if version >= 0 && version <= 1 {
 38363  				v := v.Topic
 38364  				if isFlexible {
 38365  					dst = kbin.AppendCompactString(dst, v)
 38366  				} else {
 38367  					dst = kbin.AppendString(dst, v)
 38368  				}
 38369  			}
 38370  			if version >= 2 {
 38371  				v := v.TopicID
 38372  				dst = kbin.AppendUuid(dst, v)
 38373  			}
 38374  			{
 38375  				v := v.Partitions
 38376  				if isFlexible {
 38377  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 38378  				} else {
 38379  					dst = kbin.AppendArrayLen(dst, len(v))
 38380  				}
 38381  				for i := range v {
 38382  					v := &v[i]
 38383  					{
 38384  						v := v.Partition
 38385  						dst = kbin.AppendInt32(dst, v)
 38386  					}
 38387  					{
 38388  						v := v.LeaderEpoch
 38389  						dst = kbin.AppendInt32(dst, v)
 38390  					}
 38391  					if version >= 0 && version <= 2 {
 38392  						v := v.NewISR
 38393  						if isFlexible {
 38394  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 38395  						} else {
 38396  							dst = kbin.AppendArrayLen(dst, len(v))
 38397  						}
 38398  						for i := range v {
 38399  							v := v[i]
 38400  							dst = kbin.AppendInt32(dst, v)
 38401  						}
 38402  					}
 38403  					if version >= 3 {
 38404  						v := v.NewEpochISR
 38405  						if isFlexible {
 38406  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 38407  						} else {
 38408  							dst = kbin.AppendArrayLen(dst, len(v))
 38409  						}
 38410  						for i := range v {
 38411  							v := &v[i]
 38412  							{
 38413  								v := v.BrokerID
 38414  								dst = kbin.AppendInt32(dst, v)
 38415  							}
 38416  							{
 38417  								v := v.BrokerEpoch
 38418  								dst = kbin.AppendInt32(dst, v)
 38419  							}
 38420  							if isFlexible {
 38421  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38422  								dst = v.UnknownTags.AppendEach(dst)
 38423  							}
 38424  						}
 38425  					}
 38426  					if version >= 1 {
 38427  						v := v.LeaderRecoveryState
 38428  						dst = kbin.AppendInt8(dst, v)
 38429  					}
 38430  					{
 38431  						v := v.PartitionEpoch
 38432  						dst = kbin.AppendInt32(dst, v)
 38433  					}
 38434  					if isFlexible {
 38435  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38436  						dst = v.UnknownTags.AppendEach(dst)
 38437  					}
 38438  				}
 38439  			}
 38440  			if isFlexible {
 38441  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38442  				dst = v.UnknownTags.AppendEach(dst)
 38443  			}
 38444  		}
 38445  	}
 38446  	if isFlexible {
 38447  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38448  		dst = v.UnknownTags.AppendEach(dst)
 38449  	}
 38450  	return dst
 38451  }
 38452  
 38453  func (v *AlterPartitionRequest) ReadFrom(src []byte) error {
 38454  	return v.readFrom(src, false)
 38455  }
 38456  
 38457  func (v *AlterPartitionRequest) UnsafeReadFrom(src []byte) error {
 38458  	return v.readFrom(src, true)
 38459  }
 38460  
 38461  func (v *AlterPartitionRequest) readFrom(src []byte, unsafe bool) error {
 38462  	v.Default()
 38463  	b := kbin.Reader{Src: src}
 38464  	version := v.Version
 38465  	_ = version
 38466  	isFlexible := version >= 0
 38467  	_ = isFlexible
 38468  	s := v
 38469  	{
 38470  		v := b.Int32()
 38471  		s.BrokerID = v
 38472  	}
 38473  	{
 38474  		v := b.Int64()
 38475  		s.BrokerEpoch = v
 38476  	}
 38477  	{
 38478  		v := s.Topics
 38479  		a := v
 38480  		var l int32
 38481  		if isFlexible {
 38482  			l = b.CompactArrayLen()
 38483  		} else {
 38484  			l = b.ArrayLen()
 38485  		}
 38486  		if !b.Ok() {
 38487  			return b.Complete()
 38488  		}
 38489  		a = a[:0]
 38490  		if l > 0 {
 38491  			a = append(a, make([]AlterPartitionRequestTopic, l)...)
 38492  		}
 38493  		for i := int32(0); i < l; i++ {
 38494  			v := &a[i]
 38495  			v.Default()
 38496  			s := v
 38497  			if version >= 0 && version <= 1 {
 38498  				var v string
 38499  				if unsafe {
 38500  					if isFlexible {
 38501  						v = b.UnsafeCompactString()
 38502  					} else {
 38503  						v = b.UnsafeString()
 38504  					}
 38505  				} else {
 38506  					if isFlexible {
 38507  						v = b.CompactString()
 38508  					} else {
 38509  						v = b.String()
 38510  					}
 38511  				}
 38512  				s.Topic = v
 38513  			}
 38514  			if version >= 2 {
 38515  				v := b.Uuid()
 38516  				s.TopicID = v
 38517  			}
 38518  			{
 38519  				v := s.Partitions
 38520  				a := v
 38521  				var l int32
 38522  				if isFlexible {
 38523  					l = b.CompactArrayLen()
 38524  				} else {
 38525  					l = b.ArrayLen()
 38526  				}
 38527  				if !b.Ok() {
 38528  					return b.Complete()
 38529  				}
 38530  				a = a[:0]
 38531  				if l > 0 {
 38532  					a = append(a, make([]AlterPartitionRequestTopicPartition, l)...)
 38533  				}
 38534  				for i := int32(0); i < l; i++ {
 38535  					v := &a[i]
 38536  					v.Default()
 38537  					s := v
 38538  					{
 38539  						v := b.Int32()
 38540  						s.Partition = v
 38541  					}
 38542  					{
 38543  						v := b.Int32()
 38544  						s.LeaderEpoch = v
 38545  					}
 38546  					if version >= 0 && version <= 2 {
 38547  						v := s.NewISR
 38548  						a := v
 38549  						var l int32
 38550  						if isFlexible {
 38551  							l = b.CompactArrayLen()
 38552  						} else {
 38553  							l = b.ArrayLen()
 38554  						}
 38555  						if !b.Ok() {
 38556  							return b.Complete()
 38557  						}
 38558  						a = a[:0]
 38559  						if l > 0 {
 38560  							a = append(a, make([]int32, l)...)
 38561  						}
 38562  						for i := int32(0); i < l; i++ {
 38563  							v := b.Int32()
 38564  							a[i] = v
 38565  						}
 38566  						v = a
 38567  						s.NewISR = v
 38568  					}
 38569  					if version >= 3 {
 38570  						v := s.NewEpochISR
 38571  						a := v
 38572  						var l int32
 38573  						if isFlexible {
 38574  							l = b.CompactArrayLen()
 38575  						} else {
 38576  							l = b.ArrayLen()
 38577  						}
 38578  						if !b.Ok() {
 38579  							return b.Complete()
 38580  						}
 38581  						a = a[:0]
 38582  						if l > 0 {
 38583  							a = append(a, make([]AlterPartitionRequestTopicPartitionNewEpochISR, l)...)
 38584  						}
 38585  						for i := int32(0); i < l; i++ {
 38586  							v := &a[i]
 38587  							v.Default()
 38588  							s := v
 38589  							{
 38590  								v := b.Int32()
 38591  								s.BrokerID = v
 38592  							}
 38593  							{
 38594  								v := b.Int32()
 38595  								s.BrokerEpoch = v
 38596  							}
 38597  							if isFlexible {
 38598  								s.UnknownTags = internalReadTags(&b)
 38599  							}
 38600  						}
 38601  						v = a
 38602  						s.NewEpochISR = v
 38603  					}
 38604  					if version >= 1 {
 38605  						v := b.Int8()
 38606  						s.LeaderRecoveryState = v
 38607  					}
 38608  					{
 38609  						v := b.Int32()
 38610  						s.PartitionEpoch = v
 38611  					}
 38612  					if isFlexible {
 38613  						s.UnknownTags = internalReadTags(&b)
 38614  					}
 38615  				}
 38616  				v = a
 38617  				s.Partitions = v
 38618  			}
 38619  			if isFlexible {
 38620  				s.UnknownTags = internalReadTags(&b)
 38621  			}
 38622  		}
 38623  		v = a
 38624  		s.Topics = v
 38625  	}
 38626  	if isFlexible {
 38627  		s.UnknownTags = internalReadTags(&b)
 38628  	}
 38629  	return b.Complete()
 38630  }
 38631  
 38632  // NewPtrAlterPartitionRequest returns a pointer to a default AlterPartitionRequest
 38633  // This is a shortcut for creating a new(struct) and calling Default yourself.
 38634  func NewPtrAlterPartitionRequest() *AlterPartitionRequest {
 38635  	var v AlterPartitionRequest
 38636  	v.Default()
 38637  	return &v
 38638  }
 38639  
 38640  // Default sets any default fields. Calling this allows for future compatibility
 38641  // if new fields are added to AlterPartitionRequest.
 38642  func (v *AlterPartitionRequest) Default() {
 38643  	v.BrokerEpoch = -1
 38644  }
 38645  
 38646  // NewAlterPartitionRequest returns a default AlterPartitionRequest
 38647  // This is a shortcut for creating a struct and calling Default yourself.
 38648  func NewAlterPartitionRequest() AlterPartitionRequest {
 38649  	var v AlterPartitionRequest
 38650  	v.Default()
 38651  	return v
 38652  }
 38653  
 38654  type AlterPartitionResponseTopicPartition struct {
 38655  	Partition int32
 38656  
 38657  	ErrorCode int16
 38658  
 38659  	// The broker ID of the leader.
 38660  	LeaderID int32
 38661  
 38662  	// The leader epoch of this partition.
 38663  	LeaderEpoch int32
 38664  
 38665  	// The in-sync replica ids.
 38666  	ISR []int32
 38667  
 38668  	// 1 if the partition is recovering from unclean leader election; 0 otherwise
 38669  	LeaderRecoveryState int8 // v1+
 38670  
 38671  	// The current epoch of the partition for KRaft controllers.
 38672  	// The current ZK version for legacy controllers.
 38673  	PartitionEpoch int32
 38674  
 38675  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38676  	UnknownTags Tags
 38677  }
 38678  
 38679  // Default sets any default fields. Calling this allows for future compatibility
 38680  // if new fields are added to AlterPartitionResponseTopicPartition.
 38681  func (v *AlterPartitionResponseTopicPartition) Default() {
 38682  }
 38683  
 38684  // NewAlterPartitionResponseTopicPartition returns a default AlterPartitionResponseTopicPartition
 38685  // This is a shortcut for creating a struct and calling Default yourself.
 38686  func NewAlterPartitionResponseTopicPartition() AlterPartitionResponseTopicPartition {
 38687  	var v AlterPartitionResponseTopicPartition
 38688  	v.Default()
 38689  	return v
 38690  }
 38691  
 38692  type AlterPartitionResponseTopic struct {
 38693  	Topic string // v0-v1
 38694  
 38695  	TopidID [16]byte // v2+
 38696  
 38697  	Partitions []AlterPartitionResponseTopicPartition
 38698  
 38699  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38700  	UnknownTags Tags
 38701  }
 38702  
 38703  // Default sets any default fields. Calling this allows for future compatibility
 38704  // if new fields are added to AlterPartitionResponseTopic.
 38705  func (v *AlterPartitionResponseTopic) Default() {
 38706  }
 38707  
 38708  // NewAlterPartitionResponseTopic returns a default AlterPartitionResponseTopic
 38709  // This is a shortcut for creating a struct and calling Default yourself.
 38710  func NewAlterPartitionResponseTopic() AlterPartitionResponseTopic {
 38711  	var v AlterPartitionResponseTopic
 38712  	v.Default()
 38713  	return v
 38714  }
 38715  
 38716  type AlterPartitionResponse struct {
 38717  	// Version is the version of this message used with a Kafka broker.
 38718  	Version int16
 38719  
 38720  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 38721  	// after responding to this request.
 38722  	ThrottleMillis int32
 38723  
 38724  	ErrorCode int16
 38725  
 38726  	Topics []AlterPartitionResponseTopic
 38727  
 38728  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 38729  	UnknownTags Tags
 38730  }
 38731  
 38732  func (*AlterPartitionResponse) Key() int16                         { return 56 }
 38733  func (*AlterPartitionResponse) MaxVersion() int16                  { return 3 }
 38734  func (v *AlterPartitionResponse) SetVersion(version int16)         { v.Version = version }
 38735  func (v *AlterPartitionResponse) GetVersion() int16                { return v.Version }
 38736  func (v *AlterPartitionResponse) IsFlexible() bool                 { return v.Version >= 0 }
 38737  func (v *AlterPartitionResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 0 }
 38738  func (v *AlterPartitionResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 38739  func (v *AlterPartitionResponse) RequestKind() Request {
 38740  	return &AlterPartitionRequest{Version: v.Version}
 38741  }
 38742  
 38743  func (v *AlterPartitionResponse) AppendTo(dst []byte) []byte {
 38744  	version := v.Version
 38745  	_ = version
 38746  	isFlexible := version >= 0
 38747  	_ = isFlexible
 38748  	{
 38749  		v := v.ThrottleMillis
 38750  		dst = kbin.AppendInt32(dst, v)
 38751  	}
 38752  	{
 38753  		v := v.ErrorCode
 38754  		dst = kbin.AppendInt16(dst, v)
 38755  	}
 38756  	{
 38757  		v := v.Topics
 38758  		if isFlexible {
 38759  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 38760  		} else {
 38761  			dst = kbin.AppendArrayLen(dst, len(v))
 38762  		}
 38763  		for i := range v {
 38764  			v := &v[i]
 38765  			if version >= 0 && version <= 1 {
 38766  				v := v.Topic
 38767  				if isFlexible {
 38768  					dst = kbin.AppendCompactString(dst, v)
 38769  				} else {
 38770  					dst = kbin.AppendString(dst, v)
 38771  				}
 38772  			}
 38773  			if version >= 2 {
 38774  				v := v.TopidID
 38775  				dst = kbin.AppendUuid(dst, v)
 38776  			}
 38777  			{
 38778  				v := v.Partitions
 38779  				if isFlexible {
 38780  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 38781  				} else {
 38782  					dst = kbin.AppendArrayLen(dst, len(v))
 38783  				}
 38784  				for i := range v {
 38785  					v := &v[i]
 38786  					{
 38787  						v := v.Partition
 38788  						dst = kbin.AppendInt32(dst, v)
 38789  					}
 38790  					{
 38791  						v := v.ErrorCode
 38792  						dst = kbin.AppendInt16(dst, v)
 38793  					}
 38794  					{
 38795  						v := v.LeaderID
 38796  						dst = kbin.AppendInt32(dst, v)
 38797  					}
 38798  					{
 38799  						v := v.LeaderEpoch
 38800  						dst = kbin.AppendInt32(dst, v)
 38801  					}
 38802  					{
 38803  						v := v.ISR
 38804  						if isFlexible {
 38805  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 38806  						} else {
 38807  							dst = kbin.AppendArrayLen(dst, len(v))
 38808  						}
 38809  						for i := range v {
 38810  							v := v[i]
 38811  							dst = kbin.AppendInt32(dst, v)
 38812  						}
 38813  					}
 38814  					if version >= 1 {
 38815  						v := v.LeaderRecoveryState
 38816  						dst = kbin.AppendInt8(dst, v)
 38817  					}
 38818  					{
 38819  						v := v.PartitionEpoch
 38820  						dst = kbin.AppendInt32(dst, v)
 38821  					}
 38822  					if isFlexible {
 38823  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38824  						dst = v.UnknownTags.AppendEach(dst)
 38825  					}
 38826  				}
 38827  			}
 38828  			if isFlexible {
 38829  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38830  				dst = v.UnknownTags.AppendEach(dst)
 38831  			}
 38832  		}
 38833  	}
 38834  	if isFlexible {
 38835  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 38836  		dst = v.UnknownTags.AppendEach(dst)
 38837  	}
 38838  	return dst
 38839  }
 38840  
 38841  func (v *AlterPartitionResponse) ReadFrom(src []byte) error {
 38842  	return v.readFrom(src, false)
 38843  }
 38844  
 38845  func (v *AlterPartitionResponse) UnsafeReadFrom(src []byte) error {
 38846  	return v.readFrom(src, true)
 38847  }
 38848  
 38849  func (v *AlterPartitionResponse) readFrom(src []byte, unsafe bool) error {
 38850  	v.Default()
 38851  	b := kbin.Reader{Src: src}
 38852  	version := v.Version
 38853  	_ = version
 38854  	isFlexible := version >= 0
 38855  	_ = isFlexible
 38856  	s := v
 38857  	{
 38858  		v := b.Int32()
 38859  		s.ThrottleMillis = v
 38860  	}
 38861  	{
 38862  		v := b.Int16()
 38863  		s.ErrorCode = v
 38864  	}
 38865  	{
 38866  		v := s.Topics
 38867  		a := v
 38868  		var l int32
 38869  		if isFlexible {
 38870  			l = b.CompactArrayLen()
 38871  		} else {
 38872  			l = b.ArrayLen()
 38873  		}
 38874  		if !b.Ok() {
 38875  			return b.Complete()
 38876  		}
 38877  		a = a[:0]
 38878  		if l > 0 {
 38879  			a = append(a, make([]AlterPartitionResponseTopic, l)...)
 38880  		}
 38881  		for i := int32(0); i < l; i++ {
 38882  			v := &a[i]
 38883  			v.Default()
 38884  			s := v
 38885  			if version >= 0 && version <= 1 {
 38886  				var v string
 38887  				if unsafe {
 38888  					if isFlexible {
 38889  						v = b.UnsafeCompactString()
 38890  					} else {
 38891  						v = b.UnsafeString()
 38892  					}
 38893  				} else {
 38894  					if isFlexible {
 38895  						v = b.CompactString()
 38896  					} else {
 38897  						v = b.String()
 38898  					}
 38899  				}
 38900  				s.Topic = v
 38901  			}
 38902  			if version >= 2 {
 38903  				v := b.Uuid()
 38904  				s.TopidID = v
 38905  			}
 38906  			{
 38907  				v := s.Partitions
 38908  				a := v
 38909  				var l int32
 38910  				if isFlexible {
 38911  					l = b.CompactArrayLen()
 38912  				} else {
 38913  					l = b.ArrayLen()
 38914  				}
 38915  				if !b.Ok() {
 38916  					return b.Complete()
 38917  				}
 38918  				a = a[:0]
 38919  				if l > 0 {
 38920  					a = append(a, make([]AlterPartitionResponseTopicPartition, l)...)
 38921  				}
 38922  				for i := int32(0); i < l; i++ {
 38923  					v := &a[i]
 38924  					v.Default()
 38925  					s := v
 38926  					{
 38927  						v := b.Int32()
 38928  						s.Partition = v
 38929  					}
 38930  					{
 38931  						v := b.Int16()
 38932  						s.ErrorCode = v
 38933  					}
 38934  					{
 38935  						v := b.Int32()
 38936  						s.LeaderID = v
 38937  					}
 38938  					{
 38939  						v := b.Int32()
 38940  						s.LeaderEpoch = v
 38941  					}
 38942  					{
 38943  						v := s.ISR
 38944  						a := v
 38945  						var l int32
 38946  						if isFlexible {
 38947  							l = b.CompactArrayLen()
 38948  						} else {
 38949  							l = b.ArrayLen()
 38950  						}
 38951  						if !b.Ok() {
 38952  							return b.Complete()
 38953  						}
 38954  						a = a[:0]
 38955  						if l > 0 {
 38956  							a = append(a, make([]int32, l)...)
 38957  						}
 38958  						for i := int32(0); i < l; i++ {
 38959  							v := b.Int32()
 38960  							a[i] = v
 38961  						}
 38962  						v = a
 38963  						s.ISR = v
 38964  					}
 38965  					if version >= 1 {
 38966  						v := b.Int8()
 38967  						s.LeaderRecoveryState = v
 38968  					}
 38969  					{
 38970  						v := b.Int32()
 38971  						s.PartitionEpoch = v
 38972  					}
 38973  					if isFlexible {
 38974  						s.UnknownTags = internalReadTags(&b)
 38975  					}
 38976  				}
 38977  				v = a
 38978  				s.Partitions = v
 38979  			}
 38980  			if isFlexible {
 38981  				s.UnknownTags = internalReadTags(&b)
 38982  			}
 38983  		}
 38984  		v = a
 38985  		s.Topics = v
 38986  	}
 38987  	if isFlexible {
 38988  		s.UnknownTags = internalReadTags(&b)
 38989  	}
 38990  	return b.Complete()
 38991  }
 38992  
 38993  // NewPtrAlterPartitionResponse returns a pointer to a default AlterPartitionResponse
 38994  // This is a shortcut for creating a new(struct) and calling Default yourself.
 38995  func NewPtrAlterPartitionResponse() *AlterPartitionResponse {
 38996  	var v AlterPartitionResponse
 38997  	v.Default()
 38998  	return &v
 38999  }
 39000  
 39001  // Default sets any default fields. Calling this allows for future compatibility
 39002  // if new fields are added to AlterPartitionResponse.
 39003  func (v *AlterPartitionResponse) Default() {
 39004  }
 39005  
 39006  // NewAlterPartitionResponse returns a default AlterPartitionResponse
 39007  // This is a shortcut for creating a struct and calling Default yourself.
 39008  func NewAlterPartitionResponse() AlterPartitionResponse {
 39009  	var v AlterPartitionResponse
 39010  	v.Default()
 39011  	return v
 39012  }
 39013  
 39014  type UpdateFeaturesRequestFeatureUpdate struct {
 39015  	// The name of the finalized feature to update.
 39016  	Feature string
 39017  
 39018  	// The new maximum version level for the finalized feature. A value >= 1 is
 39019  	// valid. A value < 1, is special, and can be used to request the deletion
 39020  	// of the finalized feature.
 39021  	MaxVersionLevel int16
 39022  
 39023  	// When set to true, the finalized feature version level is allowed to be
 39024  	// downgraded/deleted. The downgrade request will fail if the new maximum
 39025  	// version level is a value that's not lower than the existing maximum
 39026  	// finalized version level.
 39027  	//
 39028  	// Replaced in v1 with ValidateOnly.
 39029  	AllowDowngrade bool
 39030  
 39031  	// Determine which type of upgrade will be performed: 1 will perform an
 39032  	// upgrade only (default), 2 is safe downgrades only (lossless), 3 is
 39033  	// unsafe downgrades (lossy).
 39034  	UpgradeType int8 // v1+
 39035  
 39036  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39037  	UnknownTags Tags
 39038  }
 39039  
 39040  // Default sets any default fields. Calling this allows for future compatibility
 39041  // if new fields are added to UpdateFeaturesRequestFeatureUpdate.
 39042  func (v *UpdateFeaturesRequestFeatureUpdate) Default() {
 39043  }
 39044  
 39045  // NewUpdateFeaturesRequestFeatureUpdate returns a default UpdateFeaturesRequestFeatureUpdate
 39046  // This is a shortcut for creating a struct and calling Default yourself.
 39047  func NewUpdateFeaturesRequestFeatureUpdate() UpdateFeaturesRequestFeatureUpdate {
 39048  	var v UpdateFeaturesRequestFeatureUpdate
 39049  	v.Default()
 39050  	return v
 39051  }
 39052  
 39053  // From KIP-584 and introduced in 2.7.0, this request updates broker-wide features.
 39054  type UpdateFeaturesRequest struct {
 39055  	// Version is the version of this message used with a Kafka broker.
 39056  	Version int16
 39057  
 39058  	// TimeoutMillis is how long Kafka can wait before responding to this request.
 39059  	// This field has no effect on Kafka's processing of the request; the request
 39060  	// will continue to be processed if the timeout is reached. If the timeout is
 39061  	// reached, Kafka will reply with a REQUEST_TIMED_OUT error.
 39062  	//
 39063  	// This field has a default of 60000.
 39064  	TimeoutMillis int32
 39065  
 39066  	// The list of updates to finalized features.
 39067  	FeatureUpdates []UpdateFeaturesRequestFeatureUpdate
 39068  
 39069  	// True if we should validate the request, but not perform the upgrade or
 39070  	// downgrade.
 39071  	ValidateOnly bool // v1+
 39072  
 39073  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39074  	UnknownTags Tags
 39075  }
 39076  
 39077  func (*UpdateFeaturesRequest) Key() int16                       { return 57 }
 39078  func (*UpdateFeaturesRequest) MaxVersion() int16                { return 1 }
 39079  func (v *UpdateFeaturesRequest) SetVersion(version int16)       { v.Version = version }
 39080  func (v *UpdateFeaturesRequest) GetVersion() int16              { return v.Version }
 39081  func (v *UpdateFeaturesRequest) IsFlexible() bool               { return v.Version >= 0 }
 39082  func (v *UpdateFeaturesRequest) Timeout() int32                 { return v.TimeoutMillis }
 39083  func (v *UpdateFeaturesRequest) SetTimeout(timeoutMillis int32) { v.TimeoutMillis = timeoutMillis }
 39084  func (v *UpdateFeaturesRequest) IsAdminRequest()                {}
 39085  func (v *UpdateFeaturesRequest) ResponseKind() Response {
 39086  	r := &UpdateFeaturesResponse{Version: v.Version}
 39087  	r.Default()
 39088  	return r
 39089  }
 39090  
 39091  // RequestWith is requests v on r and returns the response or an error.
 39092  // For sharded requests, the response may be merged and still return an error.
 39093  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 39094  func (v *UpdateFeaturesRequest) RequestWith(ctx context.Context, r Requestor) (*UpdateFeaturesResponse, error) {
 39095  	kresp, err := r.Request(ctx, v)
 39096  	resp, _ := kresp.(*UpdateFeaturesResponse)
 39097  	return resp, err
 39098  }
 39099  
 39100  func (v *UpdateFeaturesRequest) AppendTo(dst []byte) []byte {
 39101  	version := v.Version
 39102  	_ = version
 39103  	isFlexible := version >= 0
 39104  	_ = isFlexible
 39105  	{
 39106  		v := v.TimeoutMillis
 39107  		dst = kbin.AppendInt32(dst, v)
 39108  	}
 39109  	{
 39110  		v := v.FeatureUpdates
 39111  		if isFlexible {
 39112  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 39113  		} else {
 39114  			dst = kbin.AppendArrayLen(dst, len(v))
 39115  		}
 39116  		for i := range v {
 39117  			v := &v[i]
 39118  			{
 39119  				v := v.Feature
 39120  				if isFlexible {
 39121  					dst = kbin.AppendCompactString(dst, v)
 39122  				} else {
 39123  					dst = kbin.AppendString(dst, v)
 39124  				}
 39125  			}
 39126  			{
 39127  				v := v.MaxVersionLevel
 39128  				dst = kbin.AppendInt16(dst, v)
 39129  			}
 39130  			if version >= 0 && version <= 0 {
 39131  				v := v.AllowDowngrade
 39132  				dst = kbin.AppendBool(dst, v)
 39133  			}
 39134  			if version >= 1 {
 39135  				v := v.UpgradeType
 39136  				dst = kbin.AppendInt8(dst, v)
 39137  			}
 39138  			if isFlexible {
 39139  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39140  				dst = v.UnknownTags.AppendEach(dst)
 39141  			}
 39142  		}
 39143  	}
 39144  	if version >= 1 {
 39145  		v := v.ValidateOnly
 39146  		dst = kbin.AppendBool(dst, v)
 39147  	}
 39148  	if isFlexible {
 39149  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39150  		dst = v.UnknownTags.AppendEach(dst)
 39151  	}
 39152  	return dst
 39153  }
 39154  
 39155  func (v *UpdateFeaturesRequest) ReadFrom(src []byte) error {
 39156  	return v.readFrom(src, false)
 39157  }
 39158  
 39159  func (v *UpdateFeaturesRequest) UnsafeReadFrom(src []byte) error {
 39160  	return v.readFrom(src, true)
 39161  }
 39162  
 39163  func (v *UpdateFeaturesRequest) readFrom(src []byte, unsafe bool) error {
 39164  	v.Default()
 39165  	b := kbin.Reader{Src: src}
 39166  	version := v.Version
 39167  	_ = version
 39168  	isFlexible := version >= 0
 39169  	_ = isFlexible
 39170  	s := v
 39171  	{
 39172  		v := b.Int32()
 39173  		s.TimeoutMillis = v
 39174  	}
 39175  	{
 39176  		v := s.FeatureUpdates
 39177  		a := v
 39178  		var l int32
 39179  		if isFlexible {
 39180  			l = b.CompactArrayLen()
 39181  		} else {
 39182  			l = b.ArrayLen()
 39183  		}
 39184  		if !b.Ok() {
 39185  			return b.Complete()
 39186  		}
 39187  		a = a[:0]
 39188  		if l > 0 {
 39189  			a = append(a, make([]UpdateFeaturesRequestFeatureUpdate, l)...)
 39190  		}
 39191  		for i := int32(0); i < l; i++ {
 39192  			v := &a[i]
 39193  			v.Default()
 39194  			s := v
 39195  			{
 39196  				var v string
 39197  				if unsafe {
 39198  					if isFlexible {
 39199  						v = b.UnsafeCompactString()
 39200  					} else {
 39201  						v = b.UnsafeString()
 39202  					}
 39203  				} else {
 39204  					if isFlexible {
 39205  						v = b.CompactString()
 39206  					} else {
 39207  						v = b.String()
 39208  					}
 39209  				}
 39210  				s.Feature = v
 39211  			}
 39212  			{
 39213  				v := b.Int16()
 39214  				s.MaxVersionLevel = v
 39215  			}
 39216  			if version >= 0 && version <= 0 {
 39217  				v := b.Bool()
 39218  				s.AllowDowngrade = v
 39219  			}
 39220  			if version >= 1 {
 39221  				v := b.Int8()
 39222  				s.UpgradeType = v
 39223  			}
 39224  			if isFlexible {
 39225  				s.UnknownTags = internalReadTags(&b)
 39226  			}
 39227  		}
 39228  		v = a
 39229  		s.FeatureUpdates = v
 39230  	}
 39231  	if version >= 1 {
 39232  		v := b.Bool()
 39233  		s.ValidateOnly = v
 39234  	}
 39235  	if isFlexible {
 39236  		s.UnknownTags = internalReadTags(&b)
 39237  	}
 39238  	return b.Complete()
 39239  }
 39240  
 39241  // NewPtrUpdateFeaturesRequest returns a pointer to a default UpdateFeaturesRequest
 39242  // This is a shortcut for creating a new(struct) and calling Default yourself.
 39243  func NewPtrUpdateFeaturesRequest() *UpdateFeaturesRequest {
 39244  	var v UpdateFeaturesRequest
 39245  	v.Default()
 39246  	return &v
 39247  }
 39248  
 39249  // Default sets any default fields. Calling this allows for future compatibility
 39250  // if new fields are added to UpdateFeaturesRequest.
 39251  func (v *UpdateFeaturesRequest) Default() {
 39252  	v.TimeoutMillis = 60000
 39253  }
 39254  
 39255  // NewUpdateFeaturesRequest returns a default UpdateFeaturesRequest
 39256  // This is a shortcut for creating a struct and calling Default yourself.
 39257  func NewUpdateFeaturesRequest() UpdateFeaturesRequest {
 39258  	var v UpdateFeaturesRequest
 39259  	v.Default()
 39260  	return v
 39261  }
 39262  
 39263  type UpdateFeaturesResponseResult struct {
 39264  	// The name of the finalized feature.
 39265  	Feature string
 39266  
 39267  	// The feature update error code, if any.
 39268  	ErrorCode int16
 39269  
 39270  	// The feature update error, if any.
 39271  	ErrorMessage *string
 39272  
 39273  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39274  	UnknownTags Tags
 39275  }
 39276  
 39277  // Default sets any default fields. Calling this allows for future compatibility
 39278  // if new fields are added to UpdateFeaturesResponseResult.
 39279  func (v *UpdateFeaturesResponseResult) Default() {
 39280  }
 39281  
 39282  // NewUpdateFeaturesResponseResult returns a default UpdateFeaturesResponseResult
 39283  // This is a shortcut for creating a struct and calling Default yourself.
 39284  func NewUpdateFeaturesResponseResult() UpdateFeaturesResponseResult {
 39285  	var v UpdateFeaturesResponseResult
 39286  	v.Default()
 39287  	return v
 39288  }
 39289  
 39290  type UpdateFeaturesResponse struct {
 39291  	// Version is the version of this message used with a Kafka broker.
 39292  	Version int16
 39293  
 39294  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 39295  	// after responding to this request.
 39296  	ThrottleMillis int32
 39297  
 39298  	// The top level error code, if any.
 39299  	ErrorCode int16
 39300  
 39301  	// An informative message if the request errored, if any.
 39302  	ErrorMessage *string
 39303  
 39304  	// The results for each feature update request.
 39305  	Results []UpdateFeaturesResponseResult
 39306  
 39307  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39308  	UnknownTags Tags
 39309  }
 39310  
 39311  func (*UpdateFeaturesResponse) Key() int16                         { return 57 }
 39312  func (*UpdateFeaturesResponse) MaxVersion() int16                  { return 1 }
 39313  func (v *UpdateFeaturesResponse) SetVersion(version int16)         { v.Version = version }
 39314  func (v *UpdateFeaturesResponse) GetVersion() int16                { return v.Version }
 39315  func (v *UpdateFeaturesResponse) IsFlexible() bool                 { return v.Version >= 0 }
 39316  func (v *UpdateFeaturesResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 0 }
 39317  func (v *UpdateFeaturesResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 39318  func (v *UpdateFeaturesResponse) RequestKind() Request {
 39319  	return &UpdateFeaturesRequest{Version: v.Version}
 39320  }
 39321  
 39322  func (v *UpdateFeaturesResponse) AppendTo(dst []byte) []byte {
 39323  	version := v.Version
 39324  	_ = version
 39325  	isFlexible := version >= 0
 39326  	_ = isFlexible
 39327  	{
 39328  		v := v.ThrottleMillis
 39329  		dst = kbin.AppendInt32(dst, v)
 39330  	}
 39331  	{
 39332  		v := v.ErrorCode
 39333  		dst = kbin.AppendInt16(dst, v)
 39334  	}
 39335  	{
 39336  		v := v.ErrorMessage
 39337  		if isFlexible {
 39338  			dst = kbin.AppendCompactNullableString(dst, v)
 39339  		} else {
 39340  			dst = kbin.AppendNullableString(dst, v)
 39341  		}
 39342  	}
 39343  	{
 39344  		v := v.Results
 39345  		if isFlexible {
 39346  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 39347  		} else {
 39348  			dst = kbin.AppendArrayLen(dst, len(v))
 39349  		}
 39350  		for i := range v {
 39351  			v := &v[i]
 39352  			{
 39353  				v := v.Feature
 39354  				if isFlexible {
 39355  					dst = kbin.AppendCompactString(dst, v)
 39356  				} else {
 39357  					dst = kbin.AppendString(dst, v)
 39358  				}
 39359  			}
 39360  			{
 39361  				v := v.ErrorCode
 39362  				dst = kbin.AppendInt16(dst, v)
 39363  			}
 39364  			{
 39365  				v := v.ErrorMessage
 39366  				if isFlexible {
 39367  					dst = kbin.AppendCompactNullableString(dst, v)
 39368  				} else {
 39369  					dst = kbin.AppendNullableString(dst, v)
 39370  				}
 39371  			}
 39372  			if isFlexible {
 39373  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39374  				dst = v.UnknownTags.AppendEach(dst)
 39375  			}
 39376  		}
 39377  	}
 39378  	if isFlexible {
 39379  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39380  		dst = v.UnknownTags.AppendEach(dst)
 39381  	}
 39382  	return dst
 39383  }
 39384  
 39385  func (v *UpdateFeaturesResponse) ReadFrom(src []byte) error {
 39386  	return v.readFrom(src, false)
 39387  }
 39388  
 39389  func (v *UpdateFeaturesResponse) UnsafeReadFrom(src []byte) error {
 39390  	return v.readFrom(src, true)
 39391  }
 39392  
 39393  func (v *UpdateFeaturesResponse) readFrom(src []byte, unsafe bool) error {
 39394  	v.Default()
 39395  	b := kbin.Reader{Src: src}
 39396  	version := v.Version
 39397  	_ = version
 39398  	isFlexible := version >= 0
 39399  	_ = isFlexible
 39400  	s := v
 39401  	{
 39402  		v := b.Int32()
 39403  		s.ThrottleMillis = v
 39404  	}
 39405  	{
 39406  		v := b.Int16()
 39407  		s.ErrorCode = v
 39408  	}
 39409  	{
 39410  		var v *string
 39411  		if isFlexible {
 39412  			if unsafe {
 39413  				v = b.UnsafeCompactNullableString()
 39414  			} else {
 39415  				v = b.CompactNullableString()
 39416  			}
 39417  		} else {
 39418  			if unsafe {
 39419  				v = b.UnsafeNullableString()
 39420  			} else {
 39421  				v = b.NullableString()
 39422  			}
 39423  		}
 39424  		s.ErrorMessage = v
 39425  	}
 39426  	{
 39427  		v := s.Results
 39428  		a := v
 39429  		var l int32
 39430  		if isFlexible {
 39431  			l = b.CompactArrayLen()
 39432  		} else {
 39433  			l = b.ArrayLen()
 39434  		}
 39435  		if !b.Ok() {
 39436  			return b.Complete()
 39437  		}
 39438  		a = a[:0]
 39439  		if l > 0 {
 39440  			a = append(a, make([]UpdateFeaturesResponseResult, l)...)
 39441  		}
 39442  		for i := int32(0); i < l; i++ {
 39443  			v := &a[i]
 39444  			v.Default()
 39445  			s := v
 39446  			{
 39447  				var v string
 39448  				if unsafe {
 39449  					if isFlexible {
 39450  						v = b.UnsafeCompactString()
 39451  					} else {
 39452  						v = b.UnsafeString()
 39453  					}
 39454  				} else {
 39455  					if isFlexible {
 39456  						v = b.CompactString()
 39457  					} else {
 39458  						v = b.String()
 39459  					}
 39460  				}
 39461  				s.Feature = v
 39462  			}
 39463  			{
 39464  				v := b.Int16()
 39465  				s.ErrorCode = v
 39466  			}
 39467  			{
 39468  				var v *string
 39469  				if isFlexible {
 39470  					if unsafe {
 39471  						v = b.UnsafeCompactNullableString()
 39472  					} else {
 39473  						v = b.CompactNullableString()
 39474  					}
 39475  				} else {
 39476  					if unsafe {
 39477  						v = b.UnsafeNullableString()
 39478  					} else {
 39479  						v = b.NullableString()
 39480  					}
 39481  				}
 39482  				s.ErrorMessage = v
 39483  			}
 39484  			if isFlexible {
 39485  				s.UnknownTags = internalReadTags(&b)
 39486  			}
 39487  		}
 39488  		v = a
 39489  		s.Results = v
 39490  	}
 39491  	if isFlexible {
 39492  		s.UnknownTags = internalReadTags(&b)
 39493  	}
 39494  	return b.Complete()
 39495  }
 39496  
 39497  // NewPtrUpdateFeaturesResponse returns a pointer to a default UpdateFeaturesResponse
 39498  // This is a shortcut for creating a new(struct) and calling Default yourself.
 39499  func NewPtrUpdateFeaturesResponse() *UpdateFeaturesResponse {
 39500  	var v UpdateFeaturesResponse
 39501  	v.Default()
 39502  	return &v
 39503  }
 39504  
 39505  // Default sets any default fields. Calling this allows for future compatibility
 39506  // if new fields are added to UpdateFeaturesResponse.
 39507  func (v *UpdateFeaturesResponse) Default() {
 39508  }
 39509  
 39510  // NewUpdateFeaturesResponse returns a default UpdateFeaturesResponse
 39511  // This is a shortcut for creating a struct and calling Default yourself.
 39512  func NewUpdateFeaturesResponse() UpdateFeaturesResponse {
 39513  	var v UpdateFeaturesResponse
 39514  	v.Default()
 39515  	return v
 39516  }
 39517  
 39518  // Introduced for KIP-590, EnvelopeRequest is what brokers use to wrap an
 39519  // incoming request before forwarding it to another broker.
 39520  type EnvelopeRequest struct {
 39521  	// Version is the version of this message used with a Kafka broker.
 39522  	Version int16
 39523  
 39524  	// The embedded request header and data.
 39525  	RequestData []byte
 39526  
 39527  	// Value of the initial client principal when the request is redirected by a broker.
 39528  	RequestPrincipal []byte
 39529  
 39530  	// The original client's address in bytes.
 39531  	ClientHostAddress []byte
 39532  
 39533  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39534  	UnknownTags Tags
 39535  }
 39536  
 39537  func (*EnvelopeRequest) Key() int16                 { return 58 }
 39538  func (*EnvelopeRequest) MaxVersion() int16          { return 0 }
 39539  func (v *EnvelopeRequest) SetVersion(version int16) { v.Version = version }
 39540  func (v *EnvelopeRequest) GetVersion() int16        { return v.Version }
 39541  func (v *EnvelopeRequest) IsFlexible() bool         { return v.Version >= 0 }
 39542  func (v *EnvelopeRequest) IsAdminRequest()          {}
 39543  func (v *EnvelopeRequest) ResponseKind() Response {
 39544  	r := &EnvelopeResponse{Version: v.Version}
 39545  	r.Default()
 39546  	return r
 39547  }
 39548  
 39549  // RequestWith is requests v on r and returns the response or an error.
 39550  // For sharded requests, the response may be merged and still return an error.
 39551  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 39552  func (v *EnvelopeRequest) RequestWith(ctx context.Context, r Requestor) (*EnvelopeResponse, error) {
 39553  	kresp, err := r.Request(ctx, v)
 39554  	resp, _ := kresp.(*EnvelopeResponse)
 39555  	return resp, err
 39556  }
 39557  
 39558  func (v *EnvelopeRequest) AppendTo(dst []byte) []byte {
 39559  	version := v.Version
 39560  	_ = version
 39561  	isFlexible := version >= 0
 39562  	_ = isFlexible
 39563  	{
 39564  		v := v.RequestData
 39565  		if isFlexible {
 39566  			dst = kbin.AppendCompactBytes(dst, v)
 39567  		} else {
 39568  			dst = kbin.AppendBytes(dst, v)
 39569  		}
 39570  	}
 39571  	{
 39572  		v := v.RequestPrincipal
 39573  		if isFlexible {
 39574  			dst = kbin.AppendCompactNullableBytes(dst, v)
 39575  		} else {
 39576  			dst = kbin.AppendNullableBytes(dst, v)
 39577  		}
 39578  	}
 39579  	{
 39580  		v := v.ClientHostAddress
 39581  		if isFlexible {
 39582  			dst = kbin.AppendCompactBytes(dst, v)
 39583  		} else {
 39584  			dst = kbin.AppendBytes(dst, v)
 39585  		}
 39586  	}
 39587  	if isFlexible {
 39588  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39589  		dst = v.UnknownTags.AppendEach(dst)
 39590  	}
 39591  	return dst
 39592  }
 39593  
 39594  func (v *EnvelopeRequest) ReadFrom(src []byte) error {
 39595  	return v.readFrom(src, false)
 39596  }
 39597  
 39598  func (v *EnvelopeRequest) UnsafeReadFrom(src []byte) error {
 39599  	return v.readFrom(src, true)
 39600  }
 39601  
 39602  func (v *EnvelopeRequest) readFrom(src []byte, unsafe bool) error {
 39603  	v.Default()
 39604  	b := kbin.Reader{Src: src}
 39605  	version := v.Version
 39606  	_ = version
 39607  	isFlexible := version >= 0
 39608  	_ = isFlexible
 39609  	s := v
 39610  	{
 39611  		var v []byte
 39612  		if isFlexible {
 39613  			v = b.CompactBytes()
 39614  		} else {
 39615  			v = b.Bytes()
 39616  		}
 39617  		s.RequestData = v
 39618  	}
 39619  	{
 39620  		var v []byte
 39621  		if isFlexible {
 39622  			v = b.CompactNullableBytes()
 39623  		} else {
 39624  			v = b.NullableBytes()
 39625  		}
 39626  		s.RequestPrincipal = v
 39627  	}
 39628  	{
 39629  		var v []byte
 39630  		if isFlexible {
 39631  			v = b.CompactBytes()
 39632  		} else {
 39633  			v = b.Bytes()
 39634  		}
 39635  		s.ClientHostAddress = v
 39636  	}
 39637  	if isFlexible {
 39638  		s.UnknownTags = internalReadTags(&b)
 39639  	}
 39640  	return b.Complete()
 39641  }
 39642  
 39643  // NewPtrEnvelopeRequest returns a pointer to a default EnvelopeRequest
 39644  // This is a shortcut for creating a new(struct) and calling Default yourself.
 39645  func NewPtrEnvelopeRequest() *EnvelopeRequest {
 39646  	var v EnvelopeRequest
 39647  	v.Default()
 39648  	return &v
 39649  }
 39650  
 39651  // Default sets any default fields. Calling this allows for future compatibility
 39652  // if new fields are added to EnvelopeRequest.
 39653  func (v *EnvelopeRequest) Default() {
 39654  }
 39655  
 39656  // NewEnvelopeRequest returns a default EnvelopeRequest
 39657  // This is a shortcut for creating a struct and calling Default yourself.
 39658  func NewEnvelopeRequest() EnvelopeRequest {
 39659  	var v EnvelopeRequest
 39660  	v.Default()
 39661  	return v
 39662  }
 39663  
 39664  type EnvelopeResponse struct {
 39665  	// Version is the version of this message used with a Kafka broker.
 39666  	Version int16
 39667  
 39668  	// The embedded response header and data.
 39669  	ResponseData []byte
 39670  
 39671  	// The error code, or 0 if there was no error.
 39672  	//
 39673  	// NOT_CONTROLLER is returned when the request is not sent to the controller.
 39674  	//
 39675  	// CLUSTER_AUTHORIZATION_FAILED is returned if inter-broker authorization failed.
 39676  	ErrorCode int16
 39677  
 39678  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39679  	UnknownTags Tags
 39680  }
 39681  
 39682  func (*EnvelopeResponse) Key() int16                 { return 58 }
 39683  func (*EnvelopeResponse) MaxVersion() int16          { return 0 }
 39684  func (v *EnvelopeResponse) SetVersion(version int16) { v.Version = version }
 39685  func (v *EnvelopeResponse) GetVersion() int16        { return v.Version }
 39686  func (v *EnvelopeResponse) IsFlexible() bool         { return v.Version >= 0 }
 39687  func (v *EnvelopeResponse) RequestKind() Request     { return &EnvelopeRequest{Version: v.Version} }
 39688  
 39689  func (v *EnvelopeResponse) AppendTo(dst []byte) []byte {
 39690  	version := v.Version
 39691  	_ = version
 39692  	isFlexible := version >= 0
 39693  	_ = isFlexible
 39694  	{
 39695  		v := v.ResponseData
 39696  		if isFlexible {
 39697  			dst = kbin.AppendCompactNullableBytes(dst, v)
 39698  		} else {
 39699  			dst = kbin.AppendNullableBytes(dst, v)
 39700  		}
 39701  	}
 39702  	{
 39703  		v := v.ErrorCode
 39704  		dst = kbin.AppendInt16(dst, v)
 39705  	}
 39706  	if isFlexible {
 39707  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39708  		dst = v.UnknownTags.AppendEach(dst)
 39709  	}
 39710  	return dst
 39711  }
 39712  
 39713  func (v *EnvelopeResponse) ReadFrom(src []byte) error {
 39714  	return v.readFrom(src, false)
 39715  }
 39716  
 39717  func (v *EnvelopeResponse) UnsafeReadFrom(src []byte) error {
 39718  	return v.readFrom(src, true)
 39719  }
 39720  
 39721  func (v *EnvelopeResponse) readFrom(src []byte, unsafe bool) error {
 39722  	v.Default()
 39723  	b := kbin.Reader{Src: src}
 39724  	version := v.Version
 39725  	_ = version
 39726  	isFlexible := version >= 0
 39727  	_ = isFlexible
 39728  	s := v
 39729  	{
 39730  		var v []byte
 39731  		if isFlexible {
 39732  			v = b.CompactNullableBytes()
 39733  		} else {
 39734  			v = b.NullableBytes()
 39735  		}
 39736  		s.ResponseData = v
 39737  	}
 39738  	{
 39739  		v := b.Int16()
 39740  		s.ErrorCode = v
 39741  	}
 39742  	if isFlexible {
 39743  		s.UnknownTags = internalReadTags(&b)
 39744  	}
 39745  	return b.Complete()
 39746  }
 39747  
 39748  // NewPtrEnvelopeResponse returns a pointer to a default EnvelopeResponse
 39749  // This is a shortcut for creating a new(struct) and calling Default yourself.
 39750  func NewPtrEnvelopeResponse() *EnvelopeResponse {
 39751  	var v EnvelopeResponse
 39752  	v.Default()
 39753  	return &v
 39754  }
 39755  
 39756  // Default sets any default fields. Calling this allows for future compatibility
 39757  // if new fields are added to EnvelopeResponse.
 39758  func (v *EnvelopeResponse) Default() {
 39759  }
 39760  
 39761  // NewEnvelopeResponse returns a default EnvelopeResponse
 39762  // This is a shortcut for creating a struct and calling Default yourself.
 39763  func NewEnvelopeResponse() EnvelopeResponse {
 39764  	var v EnvelopeResponse
 39765  	v.Default()
 39766  	return v
 39767  }
 39768  
 39769  type FetchSnapshotRequestTopicPartitionSnapshotID struct {
 39770  	EndOffset int64
 39771  
 39772  	Epoch int32
 39773  
 39774  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39775  	UnknownTags Tags
 39776  }
 39777  
 39778  // Default sets any default fields. Calling this allows for future compatibility
 39779  // if new fields are added to FetchSnapshotRequestTopicPartitionSnapshotID.
 39780  func (v *FetchSnapshotRequestTopicPartitionSnapshotID) Default() {
 39781  }
 39782  
 39783  // NewFetchSnapshotRequestTopicPartitionSnapshotID returns a default FetchSnapshotRequestTopicPartitionSnapshotID
 39784  // This is a shortcut for creating a struct and calling Default yourself.
 39785  func NewFetchSnapshotRequestTopicPartitionSnapshotID() FetchSnapshotRequestTopicPartitionSnapshotID {
 39786  	var v FetchSnapshotRequestTopicPartitionSnapshotID
 39787  	v.Default()
 39788  	return v
 39789  }
 39790  
 39791  type FetchSnapshotRequestTopicPartition struct {
 39792  	// The partition to fetch.
 39793  	Partition int32
 39794  
 39795  	// The current leader epoch of the partition, or -1 for an unknown leader epoch.
 39796  	CurrentLeaderEpoch int32
 39797  
 39798  	// The snapshot end offset and epoch to fetch.
 39799  	SnapshotID FetchSnapshotRequestTopicPartitionSnapshotID
 39800  
 39801  	// The byte position within the snapshot to start fetching from.
 39802  	Position int64
 39803  
 39804  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39805  	UnknownTags Tags
 39806  }
 39807  
 39808  // Default sets any default fields. Calling this allows for future compatibility
 39809  // if new fields are added to FetchSnapshotRequestTopicPartition.
 39810  func (v *FetchSnapshotRequestTopicPartition) Default() {
 39811  	{
 39812  		v := &v.SnapshotID
 39813  		_ = v
 39814  	}
 39815  }
 39816  
 39817  // NewFetchSnapshotRequestTopicPartition returns a default FetchSnapshotRequestTopicPartition
 39818  // This is a shortcut for creating a struct and calling Default yourself.
 39819  func NewFetchSnapshotRequestTopicPartition() FetchSnapshotRequestTopicPartition {
 39820  	var v FetchSnapshotRequestTopicPartition
 39821  	v.Default()
 39822  	return v
 39823  }
 39824  
 39825  type FetchSnapshotRequestTopic struct {
 39826  	// The name of the topic to fetch.
 39827  	Topic string
 39828  
 39829  	// The partitions to fetch.
 39830  	Partitions []FetchSnapshotRequestTopicPartition
 39831  
 39832  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39833  	UnknownTags Tags
 39834  }
 39835  
 39836  // Default sets any default fields. Calling this allows for future compatibility
 39837  // if new fields are added to FetchSnapshotRequestTopic.
 39838  func (v *FetchSnapshotRequestTopic) Default() {
 39839  }
 39840  
 39841  // NewFetchSnapshotRequestTopic returns a default FetchSnapshotRequestTopic
 39842  // This is a shortcut for creating a struct and calling Default yourself.
 39843  func NewFetchSnapshotRequestTopic() FetchSnapshotRequestTopic {
 39844  	var v FetchSnapshotRequestTopic
 39845  	v.Default()
 39846  	return v
 39847  }
 39848  
 39849  // Introduced for KIP-630, FetchSnapshotRequest is a part of the inter-Kafka
 39850  // raft protocol to remove the dependency on Zookeeper.
 39851  type FetchSnapshotRequest struct {
 39852  	// Version is the version of this message used with a Kafka broker.
 39853  	Version int16
 39854  
 39855  	// The ClusterID if known, this is used to validate metadata fetches prior to
 39856  	// broker registration.
 39857  	ClusterID *string // tag 0
 39858  
 39859  	// The broker ID of the follower.
 39860  	//
 39861  	// This field has a default of -1.
 39862  	ReplicaID int32
 39863  
 39864  	// The maximum bytes to fetch from all of the snapshots.
 39865  	//
 39866  	// This field has a default of 0x7fffffff.
 39867  	MaxBytes int32
 39868  
 39869  	// The topics to fetch.
 39870  	Topics []FetchSnapshotRequestTopic
 39871  
 39872  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 39873  	UnknownTags Tags
 39874  }
 39875  
 39876  func (*FetchSnapshotRequest) Key() int16                 { return 59 }
 39877  func (*FetchSnapshotRequest) MaxVersion() int16          { return 0 }
 39878  func (v *FetchSnapshotRequest) SetVersion(version int16) { v.Version = version }
 39879  func (v *FetchSnapshotRequest) GetVersion() int16        { return v.Version }
 39880  func (v *FetchSnapshotRequest) IsFlexible() bool         { return v.Version >= 0 }
 39881  func (v *FetchSnapshotRequest) ResponseKind() Response {
 39882  	r := &FetchSnapshotResponse{Version: v.Version}
 39883  	r.Default()
 39884  	return r
 39885  }
 39886  
 39887  // RequestWith is requests v on r and returns the response or an error.
 39888  // For sharded requests, the response may be merged and still return an error.
 39889  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 39890  func (v *FetchSnapshotRequest) RequestWith(ctx context.Context, r Requestor) (*FetchSnapshotResponse, error) {
 39891  	kresp, err := r.Request(ctx, v)
 39892  	resp, _ := kresp.(*FetchSnapshotResponse)
 39893  	return resp, err
 39894  }
 39895  
 39896  func (v *FetchSnapshotRequest) AppendTo(dst []byte) []byte {
 39897  	version := v.Version
 39898  	_ = version
 39899  	isFlexible := version >= 0
 39900  	_ = isFlexible
 39901  	{
 39902  		v := v.ReplicaID
 39903  		dst = kbin.AppendInt32(dst, v)
 39904  	}
 39905  	{
 39906  		v := v.MaxBytes
 39907  		dst = kbin.AppendInt32(dst, v)
 39908  	}
 39909  	{
 39910  		v := v.Topics
 39911  		if isFlexible {
 39912  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 39913  		} else {
 39914  			dst = kbin.AppendArrayLen(dst, len(v))
 39915  		}
 39916  		for i := range v {
 39917  			v := &v[i]
 39918  			{
 39919  				v := v.Topic
 39920  				if isFlexible {
 39921  					dst = kbin.AppendCompactString(dst, v)
 39922  				} else {
 39923  					dst = kbin.AppendString(dst, v)
 39924  				}
 39925  			}
 39926  			{
 39927  				v := v.Partitions
 39928  				if isFlexible {
 39929  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 39930  				} else {
 39931  					dst = kbin.AppendArrayLen(dst, len(v))
 39932  				}
 39933  				for i := range v {
 39934  					v := &v[i]
 39935  					{
 39936  						v := v.Partition
 39937  						dst = kbin.AppendInt32(dst, v)
 39938  					}
 39939  					{
 39940  						v := v.CurrentLeaderEpoch
 39941  						dst = kbin.AppendInt32(dst, v)
 39942  					}
 39943  					{
 39944  						v := &v.SnapshotID
 39945  						{
 39946  							v := v.EndOffset
 39947  							dst = kbin.AppendInt64(dst, v)
 39948  						}
 39949  						{
 39950  							v := v.Epoch
 39951  							dst = kbin.AppendInt32(dst, v)
 39952  						}
 39953  						if isFlexible {
 39954  							dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39955  							dst = v.UnknownTags.AppendEach(dst)
 39956  						}
 39957  					}
 39958  					{
 39959  						v := v.Position
 39960  						dst = kbin.AppendInt64(dst, v)
 39961  					}
 39962  					if isFlexible {
 39963  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39964  						dst = v.UnknownTags.AppendEach(dst)
 39965  					}
 39966  				}
 39967  			}
 39968  			if isFlexible {
 39969  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 39970  				dst = v.UnknownTags.AppendEach(dst)
 39971  			}
 39972  		}
 39973  	}
 39974  	if isFlexible {
 39975  		var toEncode []uint32
 39976  		if v.ClusterID != nil {
 39977  			toEncode = append(toEncode, 0)
 39978  		}
 39979  		dst = kbin.AppendUvarint(dst, uint32(len(toEncode)+v.UnknownTags.Len()))
 39980  		for _, tag := range toEncode {
 39981  			switch tag {
 39982  			case 0:
 39983  				{
 39984  					v := v.ClusterID
 39985  					dst = kbin.AppendUvarint(dst, 0)
 39986  					sized := false
 39987  					lenAt := len(dst)
 39988  				fClusterID:
 39989  					if isFlexible {
 39990  						dst = kbin.AppendCompactNullableString(dst, v)
 39991  					} else {
 39992  						dst = kbin.AppendNullableString(dst, v)
 39993  					}
 39994  					if !sized {
 39995  						dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
 39996  						sized = true
 39997  						goto fClusterID
 39998  					}
 39999  				}
 40000  			}
 40001  		}
 40002  		dst = v.UnknownTags.AppendEach(dst)
 40003  	}
 40004  	return dst
 40005  }
 40006  
 40007  func (v *FetchSnapshotRequest) ReadFrom(src []byte) error {
 40008  	return v.readFrom(src, false)
 40009  }
 40010  
 40011  func (v *FetchSnapshotRequest) UnsafeReadFrom(src []byte) error {
 40012  	return v.readFrom(src, true)
 40013  }
 40014  
 40015  func (v *FetchSnapshotRequest) readFrom(src []byte, unsafe bool) error {
 40016  	v.Default()
 40017  	b := kbin.Reader{Src: src}
 40018  	version := v.Version
 40019  	_ = version
 40020  	isFlexible := version >= 0
 40021  	_ = isFlexible
 40022  	s := v
 40023  	{
 40024  		v := b.Int32()
 40025  		s.ReplicaID = v
 40026  	}
 40027  	{
 40028  		v := b.Int32()
 40029  		s.MaxBytes = v
 40030  	}
 40031  	{
 40032  		v := s.Topics
 40033  		a := v
 40034  		var l int32
 40035  		if isFlexible {
 40036  			l = b.CompactArrayLen()
 40037  		} else {
 40038  			l = b.ArrayLen()
 40039  		}
 40040  		if !b.Ok() {
 40041  			return b.Complete()
 40042  		}
 40043  		a = a[:0]
 40044  		if l > 0 {
 40045  			a = append(a, make([]FetchSnapshotRequestTopic, l)...)
 40046  		}
 40047  		for i := int32(0); i < l; i++ {
 40048  			v := &a[i]
 40049  			v.Default()
 40050  			s := v
 40051  			{
 40052  				var v string
 40053  				if unsafe {
 40054  					if isFlexible {
 40055  						v = b.UnsafeCompactString()
 40056  					} else {
 40057  						v = b.UnsafeString()
 40058  					}
 40059  				} else {
 40060  					if isFlexible {
 40061  						v = b.CompactString()
 40062  					} else {
 40063  						v = b.String()
 40064  					}
 40065  				}
 40066  				s.Topic = v
 40067  			}
 40068  			{
 40069  				v := s.Partitions
 40070  				a := v
 40071  				var l int32
 40072  				if isFlexible {
 40073  					l = b.CompactArrayLen()
 40074  				} else {
 40075  					l = b.ArrayLen()
 40076  				}
 40077  				if !b.Ok() {
 40078  					return b.Complete()
 40079  				}
 40080  				a = a[:0]
 40081  				if l > 0 {
 40082  					a = append(a, make([]FetchSnapshotRequestTopicPartition, l)...)
 40083  				}
 40084  				for i := int32(0); i < l; i++ {
 40085  					v := &a[i]
 40086  					v.Default()
 40087  					s := v
 40088  					{
 40089  						v := b.Int32()
 40090  						s.Partition = v
 40091  					}
 40092  					{
 40093  						v := b.Int32()
 40094  						s.CurrentLeaderEpoch = v
 40095  					}
 40096  					{
 40097  						v := &s.SnapshotID
 40098  						v.Default()
 40099  						s := v
 40100  						{
 40101  							v := b.Int64()
 40102  							s.EndOffset = v
 40103  						}
 40104  						{
 40105  							v := b.Int32()
 40106  							s.Epoch = v
 40107  						}
 40108  						if isFlexible {
 40109  							s.UnknownTags = internalReadTags(&b)
 40110  						}
 40111  					}
 40112  					{
 40113  						v := b.Int64()
 40114  						s.Position = v
 40115  					}
 40116  					if isFlexible {
 40117  						s.UnknownTags = internalReadTags(&b)
 40118  					}
 40119  				}
 40120  				v = a
 40121  				s.Partitions = v
 40122  			}
 40123  			if isFlexible {
 40124  				s.UnknownTags = internalReadTags(&b)
 40125  			}
 40126  		}
 40127  		v = a
 40128  		s.Topics = v
 40129  	}
 40130  	if isFlexible {
 40131  		for i := b.Uvarint(); i > 0; i-- {
 40132  			switch key := b.Uvarint(); key {
 40133  			default:
 40134  				s.UnknownTags.Set(key, b.Span(int(b.Uvarint())))
 40135  			case 0:
 40136  				b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 40137  				var v *string
 40138  				if isFlexible {
 40139  					if unsafe {
 40140  						v = b.UnsafeCompactNullableString()
 40141  					} else {
 40142  						v = b.CompactNullableString()
 40143  					}
 40144  				} else {
 40145  					if unsafe {
 40146  						v = b.UnsafeNullableString()
 40147  					} else {
 40148  						v = b.NullableString()
 40149  					}
 40150  				}
 40151  				s.ClusterID = v
 40152  				if err := b.Complete(); err != nil {
 40153  					return err
 40154  				}
 40155  			}
 40156  		}
 40157  	}
 40158  	return b.Complete()
 40159  }
 40160  
 40161  // NewPtrFetchSnapshotRequest returns a pointer to a default FetchSnapshotRequest
 40162  // This is a shortcut for creating a new(struct) and calling Default yourself.
 40163  func NewPtrFetchSnapshotRequest() *FetchSnapshotRequest {
 40164  	var v FetchSnapshotRequest
 40165  	v.Default()
 40166  	return &v
 40167  }
 40168  
 40169  // Default sets any default fields. Calling this allows for future compatibility
 40170  // if new fields are added to FetchSnapshotRequest.
 40171  func (v *FetchSnapshotRequest) Default() {
 40172  	v.ReplicaID = -1
 40173  	v.MaxBytes = 2147483647
 40174  }
 40175  
 40176  // NewFetchSnapshotRequest returns a default FetchSnapshotRequest
 40177  // This is a shortcut for creating a struct and calling Default yourself.
 40178  func NewFetchSnapshotRequest() FetchSnapshotRequest {
 40179  	var v FetchSnapshotRequest
 40180  	v.Default()
 40181  	return v
 40182  }
 40183  
 40184  type FetchSnapshotResponseTopicPartitionSnapshotID struct {
 40185  	EndOffset int64
 40186  
 40187  	Epoch int32
 40188  
 40189  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40190  	UnknownTags Tags
 40191  }
 40192  
 40193  // Default sets any default fields. Calling this allows for future compatibility
 40194  // if new fields are added to FetchSnapshotResponseTopicPartitionSnapshotID.
 40195  func (v *FetchSnapshotResponseTopicPartitionSnapshotID) Default() {
 40196  }
 40197  
 40198  // NewFetchSnapshotResponseTopicPartitionSnapshotID returns a default FetchSnapshotResponseTopicPartitionSnapshotID
 40199  // This is a shortcut for creating a struct and calling Default yourself.
 40200  func NewFetchSnapshotResponseTopicPartitionSnapshotID() FetchSnapshotResponseTopicPartitionSnapshotID {
 40201  	var v FetchSnapshotResponseTopicPartitionSnapshotID
 40202  	v.Default()
 40203  	return v
 40204  }
 40205  
 40206  type FetchSnapshotResponseTopicPartitionCurrentLeader struct {
 40207  	LeaderID int32
 40208  
 40209  	LeaderEpoch int32
 40210  
 40211  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40212  	UnknownTags Tags
 40213  }
 40214  
 40215  // Default sets any default fields. Calling this allows for future compatibility
 40216  // if new fields are added to FetchSnapshotResponseTopicPartitionCurrentLeader.
 40217  func (v *FetchSnapshotResponseTopicPartitionCurrentLeader) Default() {
 40218  }
 40219  
 40220  // NewFetchSnapshotResponseTopicPartitionCurrentLeader returns a default FetchSnapshotResponseTopicPartitionCurrentLeader
 40221  // This is a shortcut for creating a struct and calling Default yourself.
 40222  func NewFetchSnapshotResponseTopicPartitionCurrentLeader() FetchSnapshotResponseTopicPartitionCurrentLeader {
 40223  	var v FetchSnapshotResponseTopicPartitionCurrentLeader
 40224  	v.Default()
 40225  	return v
 40226  }
 40227  
 40228  type FetchSnapshotResponseTopicPartition struct {
 40229  	// The partition.
 40230  	Partition int32
 40231  
 40232  	// An error code, or 0 if there was no fetch error.
 40233  	ErrorCode int16
 40234  
 40235  	// The snapshot end offset and epoch to fetch.
 40236  	SnapshotID FetchSnapshotResponseTopicPartitionSnapshotID
 40237  
 40238  	// The ID of the current leader (or -1 if unknown) and the latest known
 40239  	// leader epoch.
 40240  	CurrentLeader FetchSnapshotResponseTopicPartitionCurrentLeader // tag 0
 40241  
 40242  	// The total size of the snapshot.
 40243  	Size int64
 40244  
 40245  	// The starting byte position within the snapshot included in the Bytes
 40246  	// field.
 40247  	Position int64
 40248  
 40249  	// Snapshot data.
 40250  	Bytes []byte
 40251  
 40252  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40253  	UnknownTags Tags
 40254  }
 40255  
 40256  // Default sets any default fields. Calling this allows for future compatibility
 40257  // if new fields are added to FetchSnapshotResponseTopicPartition.
 40258  func (v *FetchSnapshotResponseTopicPartition) Default() {
 40259  	{
 40260  		v := &v.SnapshotID
 40261  		_ = v
 40262  	}
 40263  	{
 40264  		v := &v.CurrentLeader
 40265  		_ = v
 40266  	}
 40267  }
 40268  
 40269  // NewFetchSnapshotResponseTopicPartition returns a default FetchSnapshotResponseTopicPartition
 40270  // This is a shortcut for creating a struct and calling Default yourself.
 40271  func NewFetchSnapshotResponseTopicPartition() FetchSnapshotResponseTopicPartition {
 40272  	var v FetchSnapshotResponseTopicPartition
 40273  	v.Default()
 40274  	return v
 40275  }
 40276  
 40277  type FetchSnapshotResponseTopic struct {
 40278  	// The name of the topic to fetch.
 40279  	Topic string
 40280  
 40281  	// The partitions to fetch.
 40282  	Partitions []FetchSnapshotResponseTopicPartition
 40283  
 40284  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40285  	UnknownTags Tags
 40286  }
 40287  
 40288  // Default sets any default fields. Calling this allows for future compatibility
 40289  // if new fields are added to FetchSnapshotResponseTopic.
 40290  func (v *FetchSnapshotResponseTopic) Default() {
 40291  }
 40292  
 40293  // NewFetchSnapshotResponseTopic returns a default FetchSnapshotResponseTopic
 40294  // This is a shortcut for creating a struct and calling Default yourself.
 40295  func NewFetchSnapshotResponseTopic() FetchSnapshotResponseTopic {
 40296  	var v FetchSnapshotResponseTopic
 40297  	v.Default()
 40298  	return v
 40299  }
 40300  
 40301  // FetchSnapshotResponse is a response for a FetchSnapshotRequest.
 40302  type FetchSnapshotResponse struct {
 40303  	// Version is the version of this message used with a Kafka broker.
 40304  	Version int16
 40305  
 40306  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 40307  	// after responding to this request.
 40308  	ThrottleMillis int32
 40309  
 40310  	// The top level response error code.
 40311  	ErrorCode int16
 40312  
 40313  	// The topics to fetch.
 40314  	Topics []FetchSnapshotResponseTopic
 40315  
 40316  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40317  	UnknownTags Tags
 40318  }
 40319  
 40320  func (*FetchSnapshotResponse) Key() int16                         { return 59 }
 40321  func (*FetchSnapshotResponse) MaxVersion() int16                  { return 0 }
 40322  func (v *FetchSnapshotResponse) SetVersion(version int16)         { v.Version = version }
 40323  func (v *FetchSnapshotResponse) GetVersion() int16                { return v.Version }
 40324  func (v *FetchSnapshotResponse) IsFlexible() bool                 { return v.Version >= 0 }
 40325  func (v *FetchSnapshotResponse) Throttle() (int32, bool)          { return v.ThrottleMillis, v.Version >= 0 }
 40326  func (v *FetchSnapshotResponse) SetThrottle(throttleMillis int32) { v.ThrottleMillis = throttleMillis }
 40327  func (v *FetchSnapshotResponse) RequestKind() Request {
 40328  	return &FetchSnapshotRequest{Version: v.Version}
 40329  }
 40330  
 40331  func (v *FetchSnapshotResponse) AppendTo(dst []byte) []byte {
 40332  	version := v.Version
 40333  	_ = version
 40334  	isFlexible := version >= 0
 40335  	_ = isFlexible
 40336  	{
 40337  		v := v.ThrottleMillis
 40338  		dst = kbin.AppendInt32(dst, v)
 40339  	}
 40340  	{
 40341  		v := v.ErrorCode
 40342  		dst = kbin.AppendInt16(dst, v)
 40343  	}
 40344  	{
 40345  		v := v.Topics
 40346  		if isFlexible {
 40347  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 40348  		} else {
 40349  			dst = kbin.AppendArrayLen(dst, len(v))
 40350  		}
 40351  		for i := range v {
 40352  			v := &v[i]
 40353  			{
 40354  				v := v.Topic
 40355  				if isFlexible {
 40356  					dst = kbin.AppendCompactString(dst, v)
 40357  				} else {
 40358  					dst = kbin.AppendString(dst, v)
 40359  				}
 40360  			}
 40361  			{
 40362  				v := v.Partitions
 40363  				if isFlexible {
 40364  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 40365  				} else {
 40366  					dst = kbin.AppendArrayLen(dst, len(v))
 40367  				}
 40368  				for i := range v {
 40369  					v := &v[i]
 40370  					{
 40371  						v := v.Partition
 40372  						dst = kbin.AppendInt32(dst, v)
 40373  					}
 40374  					{
 40375  						v := v.ErrorCode
 40376  						dst = kbin.AppendInt16(dst, v)
 40377  					}
 40378  					{
 40379  						v := &v.SnapshotID
 40380  						{
 40381  							v := v.EndOffset
 40382  							dst = kbin.AppendInt64(dst, v)
 40383  						}
 40384  						{
 40385  							v := v.Epoch
 40386  							dst = kbin.AppendInt32(dst, v)
 40387  						}
 40388  						if isFlexible {
 40389  							dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40390  							dst = v.UnknownTags.AppendEach(dst)
 40391  						}
 40392  					}
 40393  					{
 40394  						v := v.Size
 40395  						dst = kbin.AppendInt64(dst, v)
 40396  					}
 40397  					{
 40398  						v := v.Position
 40399  						dst = kbin.AppendInt64(dst, v)
 40400  					}
 40401  					{
 40402  						v := v.Bytes
 40403  						if isFlexible {
 40404  							dst = kbin.AppendCompactBytes(dst, v)
 40405  						} else {
 40406  							dst = kbin.AppendBytes(dst, v)
 40407  						}
 40408  					}
 40409  					if isFlexible {
 40410  						var toEncode []uint32
 40411  						if !reflect.DeepEqual(v.CurrentLeader, (func() FetchSnapshotResponseTopicPartitionCurrentLeader {
 40412  							var v FetchSnapshotResponseTopicPartitionCurrentLeader
 40413  							v.Default()
 40414  							return v
 40415  						})()) {
 40416  							toEncode = append(toEncode, 0)
 40417  						}
 40418  						dst = kbin.AppendUvarint(dst, uint32(len(toEncode)+v.UnknownTags.Len()))
 40419  						for _, tag := range toEncode {
 40420  							switch tag {
 40421  							case 0:
 40422  								{
 40423  									v := v.CurrentLeader
 40424  									dst = kbin.AppendUvarint(dst, 0)
 40425  									sized := false
 40426  									lenAt := len(dst)
 40427  								fCurrentLeader:
 40428  									{
 40429  										v := v.LeaderID
 40430  										dst = kbin.AppendInt32(dst, v)
 40431  									}
 40432  									{
 40433  										v := v.LeaderEpoch
 40434  										dst = kbin.AppendInt32(dst, v)
 40435  									}
 40436  									if isFlexible {
 40437  										dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40438  										dst = v.UnknownTags.AppendEach(dst)
 40439  									}
 40440  									if !sized {
 40441  										dst = kbin.AppendUvarint(dst[:lenAt], uint32(len(dst[lenAt:])))
 40442  										sized = true
 40443  										goto fCurrentLeader
 40444  									}
 40445  								}
 40446  							}
 40447  						}
 40448  						dst = v.UnknownTags.AppendEach(dst)
 40449  					}
 40450  				}
 40451  			}
 40452  			if isFlexible {
 40453  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40454  				dst = v.UnknownTags.AppendEach(dst)
 40455  			}
 40456  		}
 40457  	}
 40458  	if isFlexible {
 40459  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40460  		dst = v.UnknownTags.AppendEach(dst)
 40461  	}
 40462  	return dst
 40463  }
 40464  
 40465  func (v *FetchSnapshotResponse) ReadFrom(src []byte) error {
 40466  	return v.readFrom(src, false)
 40467  }
 40468  
 40469  func (v *FetchSnapshotResponse) UnsafeReadFrom(src []byte) error {
 40470  	return v.readFrom(src, true)
 40471  }
 40472  
 40473  func (v *FetchSnapshotResponse) readFrom(src []byte, unsafe bool) error {
 40474  	v.Default()
 40475  	b := kbin.Reader{Src: src}
 40476  	version := v.Version
 40477  	_ = version
 40478  	isFlexible := version >= 0
 40479  	_ = isFlexible
 40480  	s := v
 40481  	{
 40482  		v := b.Int32()
 40483  		s.ThrottleMillis = v
 40484  	}
 40485  	{
 40486  		v := b.Int16()
 40487  		s.ErrorCode = v
 40488  	}
 40489  	{
 40490  		v := s.Topics
 40491  		a := v
 40492  		var l int32
 40493  		if isFlexible {
 40494  			l = b.CompactArrayLen()
 40495  		} else {
 40496  			l = b.ArrayLen()
 40497  		}
 40498  		if !b.Ok() {
 40499  			return b.Complete()
 40500  		}
 40501  		a = a[:0]
 40502  		if l > 0 {
 40503  			a = append(a, make([]FetchSnapshotResponseTopic, l)...)
 40504  		}
 40505  		for i := int32(0); i < l; i++ {
 40506  			v := &a[i]
 40507  			v.Default()
 40508  			s := v
 40509  			{
 40510  				var v string
 40511  				if unsafe {
 40512  					if isFlexible {
 40513  						v = b.UnsafeCompactString()
 40514  					} else {
 40515  						v = b.UnsafeString()
 40516  					}
 40517  				} else {
 40518  					if isFlexible {
 40519  						v = b.CompactString()
 40520  					} else {
 40521  						v = b.String()
 40522  					}
 40523  				}
 40524  				s.Topic = v
 40525  			}
 40526  			{
 40527  				v := s.Partitions
 40528  				a := v
 40529  				var l int32
 40530  				if isFlexible {
 40531  					l = b.CompactArrayLen()
 40532  				} else {
 40533  					l = b.ArrayLen()
 40534  				}
 40535  				if !b.Ok() {
 40536  					return b.Complete()
 40537  				}
 40538  				a = a[:0]
 40539  				if l > 0 {
 40540  					a = append(a, make([]FetchSnapshotResponseTopicPartition, l)...)
 40541  				}
 40542  				for i := int32(0); i < l; i++ {
 40543  					v := &a[i]
 40544  					v.Default()
 40545  					s := v
 40546  					{
 40547  						v := b.Int32()
 40548  						s.Partition = v
 40549  					}
 40550  					{
 40551  						v := b.Int16()
 40552  						s.ErrorCode = v
 40553  					}
 40554  					{
 40555  						v := &s.SnapshotID
 40556  						v.Default()
 40557  						s := v
 40558  						{
 40559  							v := b.Int64()
 40560  							s.EndOffset = v
 40561  						}
 40562  						{
 40563  							v := b.Int32()
 40564  							s.Epoch = v
 40565  						}
 40566  						if isFlexible {
 40567  							s.UnknownTags = internalReadTags(&b)
 40568  						}
 40569  					}
 40570  					{
 40571  						v := b.Int64()
 40572  						s.Size = v
 40573  					}
 40574  					{
 40575  						v := b.Int64()
 40576  						s.Position = v
 40577  					}
 40578  					{
 40579  						var v []byte
 40580  						if isFlexible {
 40581  							v = b.CompactBytes()
 40582  						} else {
 40583  							v = b.Bytes()
 40584  						}
 40585  						s.Bytes = v
 40586  					}
 40587  					if isFlexible {
 40588  						for i := b.Uvarint(); i > 0; i-- {
 40589  							switch key := b.Uvarint(); key {
 40590  							default:
 40591  								s.UnknownTags.Set(key, b.Span(int(b.Uvarint())))
 40592  							case 0:
 40593  								b := kbin.Reader{Src: b.Span(int(b.Uvarint()))}
 40594  								v := &s.CurrentLeader
 40595  								v.Default()
 40596  								s := v
 40597  								{
 40598  									v := b.Int32()
 40599  									s.LeaderID = v
 40600  								}
 40601  								{
 40602  									v := b.Int32()
 40603  									s.LeaderEpoch = v
 40604  								}
 40605  								if isFlexible {
 40606  									s.UnknownTags = internalReadTags(&b)
 40607  								}
 40608  								if err := b.Complete(); err != nil {
 40609  									return err
 40610  								}
 40611  							}
 40612  						}
 40613  					}
 40614  				}
 40615  				v = a
 40616  				s.Partitions = v
 40617  			}
 40618  			if isFlexible {
 40619  				s.UnknownTags = internalReadTags(&b)
 40620  			}
 40621  		}
 40622  		v = a
 40623  		s.Topics = v
 40624  	}
 40625  	if isFlexible {
 40626  		s.UnknownTags = internalReadTags(&b)
 40627  	}
 40628  	return b.Complete()
 40629  }
 40630  
 40631  // NewPtrFetchSnapshotResponse returns a pointer to a default FetchSnapshotResponse
 40632  // This is a shortcut for creating a new(struct) and calling Default yourself.
 40633  func NewPtrFetchSnapshotResponse() *FetchSnapshotResponse {
 40634  	var v FetchSnapshotResponse
 40635  	v.Default()
 40636  	return &v
 40637  }
 40638  
 40639  // Default sets any default fields. Calling this allows for future compatibility
 40640  // if new fields are added to FetchSnapshotResponse.
 40641  func (v *FetchSnapshotResponse) Default() {
 40642  }
 40643  
 40644  // NewFetchSnapshotResponse returns a default FetchSnapshotResponse
 40645  // This is a shortcut for creating a struct and calling Default yourself.
 40646  func NewFetchSnapshotResponse() FetchSnapshotResponse {
 40647  	var v FetchSnapshotResponse
 40648  	v.Default()
 40649  	return v
 40650  }
 40651  
 40652  // Introduced for KIP-700, DescribeClusterRequest is effectively an "admin"
 40653  // type metadata request for information that producers or consumers do not
 40654  // need to care about.
 40655  type DescribeClusterRequest struct {
 40656  	// Version is the version of this message used with a Kafka broker.
 40657  	Version int16
 40658  
 40659  	// Whether to include cluster authorized operations. This requires DESCRIBE
 40660  	// on CLUSTER.
 40661  	IncludeClusterAuthorizedOperations bool
 40662  
 40663  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40664  	UnknownTags Tags
 40665  }
 40666  
 40667  func (*DescribeClusterRequest) Key() int16                 { return 60 }
 40668  func (*DescribeClusterRequest) MaxVersion() int16          { return 0 }
 40669  func (v *DescribeClusterRequest) SetVersion(version int16) { v.Version = version }
 40670  func (v *DescribeClusterRequest) GetVersion() int16        { return v.Version }
 40671  func (v *DescribeClusterRequest) IsFlexible() bool         { return v.Version >= 0 }
 40672  func (v *DescribeClusterRequest) ResponseKind() Response {
 40673  	r := &DescribeClusterResponse{Version: v.Version}
 40674  	r.Default()
 40675  	return r
 40676  }
 40677  
 40678  // RequestWith is requests v on r and returns the response or an error.
 40679  // For sharded requests, the response may be merged and still return an error.
 40680  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 40681  func (v *DescribeClusterRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeClusterResponse, error) {
 40682  	kresp, err := r.Request(ctx, v)
 40683  	resp, _ := kresp.(*DescribeClusterResponse)
 40684  	return resp, err
 40685  }
 40686  
 40687  func (v *DescribeClusterRequest) AppendTo(dst []byte) []byte {
 40688  	version := v.Version
 40689  	_ = version
 40690  	isFlexible := version >= 0
 40691  	_ = isFlexible
 40692  	{
 40693  		v := v.IncludeClusterAuthorizedOperations
 40694  		dst = kbin.AppendBool(dst, v)
 40695  	}
 40696  	if isFlexible {
 40697  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40698  		dst = v.UnknownTags.AppendEach(dst)
 40699  	}
 40700  	return dst
 40701  }
 40702  
 40703  func (v *DescribeClusterRequest) ReadFrom(src []byte) error {
 40704  	return v.readFrom(src, false)
 40705  }
 40706  
 40707  func (v *DescribeClusterRequest) UnsafeReadFrom(src []byte) error {
 40708  	return v.readFrom(src, true)
 40709  }
 40710  
 40711  func (v *DescribeClusterRequest) readFrom(src []byte, unsafe bool) error {
 40712  	v.Default()
 40713  	b := kbin.Reader{Src: src}
 40714  	version := v.Version
 40715  	_ = version
 40716  	isFlexible := version >= 0
 40717  	_ = isFlexible
 40718  	s := v
 40719  	{
 40720  		v := b.Bool()
 40721  		s.IncludeClusterAuthorizedOperations = v
 40722  	}
 40723  	if isFlexible {
 40724  		s.UnknownTags = internalReadTags(&b)
 40725  	}
 40726  	return b.Complete()
 40727  }
 40728  
 40729  // NewPtrDescribeClusterRequest returns a pointer to a default DescribeClusterRequest
 40730  // This is a shortcut for creating a new(struct) and calling Default yourself.
 40731  func NewPtrDescribeClusterRequest() *DescribeClusterRequest {
 40732  	var v DescribeClusterRequest
 40733  	v.Default()
 40734  	return &v
 40735  }
 40736  
 40737  // Default sets any default fields. Calling this allows for future compatibility
 40738  // if new fields are added to DescribeClusterRequest.
 40739  func (v *DescribeClusterRequest) Default() {
 40740  }
 40741  
 40742  // NewDescribeClusterRequest returns a default DescribeClusterRequest
 40743  // This is a shortcut for creating a struct and calling Default yourself.
 40744  func NewDescribeClusterRequest() DescribeClusterRequest {
 40745  	var v DescribeClusterRequest
 40746  	v.Default()
 40747  	return v
 40748  }
 40749  
 40750  type DescribeClusterResponseBroker struct {
 40751  	// NodeID is the node ID of a Kafka broker.
 40752  	NodeID int32
 40753  
 40754  	// Host is the hostname of a Kafka broker.
 40755  	Host string
 40756  
 40757  	// Port is the port of a Kafka broker.
 40758  	Port int32
 40759  
 40760  	// Rack is the rack this Kafka broker is in, if any.
 40761  	Rack *string
 40762  
 40763  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40764  	UnknownTags Tags
 40765  }
 40766  
 40767  // Default sets any default fields. Calling this allows for future compatibility
 40768  // if new fields are added to DescribeClusterResponseBroker.
 40769  func (v *DescribeClusterResponseBroker) Default() {
 40770  }
 40771  
 40772  // NewDescribeClusterResponseBroker returns a default DescribeClusterResponseBroker
 40773  // This is a shortcut for creating a struct and calling Default yourself.
 40774  func NewDescribeClusterResponseBroker() DescribeClusterResponseBroker {
 40775  	var v DescribeClusterResponseBroker
 40776  	v.Default()
 40777  	return v
 40778  }
 40779  
 40780  // DescribeClusterResponse is a response to a DescribeClusterRequest.
 40781  type DescribeClusterResponse struct {
 40782  	// Version is the version of this message used with a Kafka broker.
 40783  	Version int16
 40784  
 40785  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 40786  	// after responding to this request.
 40787  	ThrottleMillis int32
 40788  
 40789  	// The top level response error code.
 40790  	ErrorCode int16
 40791  
 40792  	// The top level error message, if any.
 40793  	ErrorMessage *string
 40794  
 40795  	// The cluster ID that responding broker belongs to.
 40796  	ClusterID string
 40797  
 40798  	// The ID of the controller broker.
 40799  	//
 40800  	// This field has a default of -1.
 40801  	ControllerID int32
 40802  
 40803  	// Brokers is a set of alive Kafka brokers (this mirrors MetadataResponse.Brokers).
 40804  	Brokers []DescribeClusterResponseBroker
 40805  
 40806  	// 32-bit bitfield to represent authorized operations for this cluster.
 40807  	//
 40808  	// This field has a default of -2147483648.
 40809  	ClusterAuthorizedOperations int32
 40810  
 40811  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 40812  	UnknownTags Tags
 40813  }
 40814  
 40815  func (*DescribeClusterResponse) Key() int16                 { return 60 }
 40816  func (*DescribeClusterResponse) MaxVersion() int16          { return 0 }
 40817  func (v *DescribeClusterResponse) SetVersion(version int16) { v.Version = version }
 40818  func (v *DescribeClusterResponse) GetVersion() int16        { return v.Version }
 40819  func (v *DescribeClusterResponse) IsFlexible() bool         { return v.Version >= 0 }
 40820  func (v *DescribeClusterResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 0 }
 40821  func (v *DescribeClusterResponse) SetThrottle(throttleMillis int32) {
 40822  	v.ThrottleMillis = throttleMillis
 40823  }
 40824  
 40825  func (v *DescribeClusterResponse) RequestKind() Request {
 40826  	return &DescribeClusterRequest{Version: v.Version}
 40827  }
 40828  
 40829  func (v *DescribeClusterResponse) AppendTo(dst []byte) []byte {
 40830  	version := v.Version
 40831  	_ = version
 40832  	isFlexible := version >= 0
 40833  	_ = isFlexible
 40834  	{
 40835  		v := v.ThrottleMillis
 40836  		dst = kbin.AppendInt32(dst, v)
 40837  	}
 40838  	{
 40839  		v := v.ErrorCode
 40840  		dst = kbin.AppendInt16(dst, v)
 40841  	}
 40842  	{
 40843  		v := v.ErrorMessage
 40844  		if isFlexible {
 40845  			dst = kbin.AppendCompactNullableString(dst, v)
 40846  		} else {
 40847  			dst = kbin.AppendNullableString(dst, v)
 40848  		}
 40849  	}
 40850  	{
 40851  		v := v.ClusterID
 40852  		if isFlexible {
 40853  			dst = kbin.AppendCompactString(dst, v)
 40854  		} else {
 40855  			dst = kbin.AppendString(dst, v)
 40856  		}
 40857  	}
 40858  	{
 40859  		v := v.ControllerID
 40860  		dst = kbin.AppendInt32(dst, v)
 40861  	}
 40862  	{
 40863  		v := v.Brokers
 40864  		if isFlexible {
 40865  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 40866  		} else {
 40867  			dst = kbin.AppendArrayLen(dst, len(v))
 40868  		}
 40869  		for i := range v {
 40870  			v := &v[i]
 40871  			{
 40872  				v := v.NodeID
 40873  				dst = kbin.AppendInt32(dst, v)
 40874  			}
 40875  			{
 40876  				v := v.Host
 40877  				if isFlexible {
 40878  					dst = kbin.AppendCompactString(dst, v)
 40879  				} else {
 40880  					dst = kbin.AppendString(dst, v)
 40881  				}
 40882  			}
 40883  			{
 40884  				v := v.Port
 40885  				dst = kbin.AppendInt32(dst, v)
 40886  			}
 40887  			{
 40888  				v := v.Rack
 40889  				if isFlexible {
 40890  					dst = kbin.AppendCompactNullableString(dst, v)
 40891  				} else {
 40892  					dst = kbin.AppendNullableString(dst, v)
 40893  				}
 40894  			}
 40895  			if isFlexible {
 40896  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40897  				dst = v.UnknownTags.AppendEach(dst)
 40898  			}
 40899  		}
 40900  	}
 40901  	{
 40902  		v := v.ClusterAuthorizedOperations
 40903  		dst = kbin.AppendInt32(dst, v)
 40904  	}
 40905  	if isFlexible {
 40906  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 40907  		dst = v.UnknownTags.AppendEach(dst)
 40908  	}
 40909  	return dst
 40910  }
 40911  
 40912  func (v *DescribeClusterResponse) ReadFrom(src []byte) error {
 40913  	return v.readFrom(src, false)
 40914  }
 40915  
 40916  func (v *DescribeClusterResponse) UnsafeReadFrom(src []byte) error {
 40917  	return v.readFrom(src, true)
 40918  }
 40919  
 40920  func (v *DescribeClusterResponse) readFrom(src []byte, unsafe bool) error {
 40921  	v.Default()
 40922  	b := kbin.Reader{Src: src}
 40923  	version := v.Version
 40924  	_ = version
 40925  	isFlexible := version >= 0
 40926  	_ = isFlexible
 40927  	s := v
 40928  	{
 40929  		v := b.Int32()
 40930  		s.ThrottleMillis = v
 40931  	}
 40932  	{
 40933  		v := b.Int16()
 40934  		s.ErrorCode = v
 40935  	}
 40936  	{
 40937  		var v *string
 40938  		if isFlexible {
 40939  			if unsafe {
 40940  				v = b.UnsafeCompactNullableString()
 40941  			} else {
 40942  				v = b.CompactNullableString()
 40943  			}
 40944  		} else {
 40945  			if unsafe {
 40946  				v = b.UnsafeNullableString()
 40947  			} else {
 40948  				v = b.NullableString()
 40949  			}
 40950  		}
 40951  		s.ErrorMessage = v
 40952  	}
 40953  	{
 40954  		var v string
 40955  		if unsafe {
 40956  			if isFlexible {
 40957  				v = b.UnsafeCompactString()
 40958  			} else {
 40959  				v = b.UnsafeString()
 40960  			}
 40961  		} else {
 40962  			if isFlexible {
 40963  				v = b.CompactString()
 40964  			} else {
 40965  				v = b.String()
 40966  			}
 40967  		}
 40968  		s.ClusterID = v
 40969  	}
 40970  	{
 40971  		v := b.Int32()
 40972  		s.ControllerID = v
 40973  	}
 40974  	{
 40975  		v := s.Brokers
 40976  		a := v
 40977  		var l int32
 40978  		if isFlexible {
 40979  			l = b.CompactArrayLen()
 40980  		} else {
 40981  			l = b.ArrayLen()
 40982  		}
 40983  		if !b.Ok() {
 40984  			return b.Complete()
 40985  		}
 40986  		a = a[:0]
 40987  		if l > 0 {
 40988  			a = append(a, make([]DescribeClusterResponseBroker, l)...)
 40989  		}
 40990  		for i := int32(0); i < l; i++ {
 40991  			v := &a[i]
 40992  			v.Default()
 40993  			s := v
 40994  			{
 40995  				v := b.Int32()
 40996  				s.NodeID = v
 40997  			}
 40998  			{
 40999  				var v string
 41000  				if unsafe {
 41001  					if isFlexible {
 41002  						v = b.UnsafeCompactString()
 41003  					} else {
 41004  						v = b.UnsafeString()
 41005  					}
 41006  				} else {
 41007  					if isFlexible {
 41008  						v = b.CompactString()
 41009  					} else {
 41010  						v = b.String()
 41011  					}
 41012  				}
 41013  				s.Host = v
 41014  			}
 41015  			{
 41016  				v := b.Int32()
 41017  				s.Port = v
 41018  			}
 41019  			{
 41020  				var v *string
 41021  				if isFlexible {
 41022  					if unsafe {
 41023  						v = b.UnsafeCompactNullableString()
 41024  					} else {
 41025  						v = b.CompactNullableString()
 41026  					}
 41027  				} else {
 41028  					if unsafe {
 41029  						v = b.UnsafeNullableString()
 41030  					} else {
 41031  						v = b.NullableString()
 41032  					}
 41033  				}
 41034  				s.Rack = v
 41035  			}
 41036  			if isFlexible {
 41037  				s.UnknownTags = internalReadTags(&b)
 41038  			}
 41039  		}
 41040  		v = a
 41041  		s.Brokers = v
 41042  	}
 41043  	{
 41044  		v := b.Int32()
 41045  		s.ClusterAuthorizedOperations = v
 41046  	}
 41047  	if isFlexible {
 41048  		s.UnknownTags = internalReadTags(&b)
 41049  	}
 41050  	return b.Complete()
 41051  }
 41052  
 41053  // NewPtrDescribeClusterResponse returns a pointer to a default DescribeClusterResponse
 41054  // This is a shortcut for creating a new(struct) and calling Default yourself.
 41055  func NewPtrDescribeClusterResponse() *DescribeClusterResponse {
 41056  	var v DescribeClusterResponse
 41057  	v.Default()
 41058  	return &v
 41059  }
 41060  
 41061  // Default sets any default fields. Calling this allows for future compatibility
 41062  // if new fields are added to DescribeClusterResponse.
 41063  func (v *DescribeClusterResponse) Default() {
 41064  	v.ControllerID = -1
 41065  	v.ClusterAuthorizedOperations = -2147483648
 41066  }
 41067  
 41068  // NewDescribeClusterResponse returns a default DescribeClusterResponse
 41069  // This is a shortcut for creating a struct and calling Default yourself.
 41070  func NewDescribeClusterResponse() DescribeClusterResponse {
 41071  	var v DescribeClusterResponse
 41072  	v.Default()
 41073  	return v
 41074  }
 41075  
 41076  type DescribeProducersRequestTopic struct {
 41077  	Topic string
 41078  
 41079  	// The partitions to list producers for for the given topic.
 41080  	Partitions []int32
 41081  
 41082  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41083  	UnknownTags Tags
 41084  }
 41085  
 41086  // Default sets any default fields. Calling this allows for future compatibility
 41087  // if new fields are added to DescribeProducersRequestTopic.
 41088  func (v *DescribeProducersRequestTopic) Default() {
 41089  }
 41090  
 41091  // NewDescribeProducersRequestTopic returns a default DescribeProducersRequestTopic
 41092  // This is a shortcut for creating a struct and calling Default yourself.
 41093  func NewDescribeProducersRequestTopic() DescribeProducersRequestTopic {
 41094  	var v DescribeProducersRequestTopic
 41095  	v.Default()
 41096  	return v
 41097  }
 41098  
 41099  // Introduced for KIP-664, DescribeProducersRequest allows for introspecting
 41100  // the state of the transaction coordinator. This request can be used to detect
 41101  // hanging transactions or other EOS-related problems.
 41102  //
 41103  // This request allows for describing the state of the active
 41104  // idempotent/transactional producers.
 41105  type DescribeProducersRequest struct {
 41106  	// Version is the version of this message used with a Kafka broker.
 41107  	Version int16
 41108  
 41109  	// The topics to describe producers for.
 41110  	Topics []DescribeProducersRequestTopic
 41111  
 41112  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41113  	UnknownTags Tags
 41114  }
 41115  
 41116  func (*DescribeProducersRequest) Key() int16                 { return 61 }
 41117  func (*DescribeProducersRequest) MaxVersion() int16          { return 0 }
 41118  func (v *DescribeProducersRequest) SetVersion(version int16) { v.Version = version }
 41119  func (v *DescribeProducersRequest) GetVersion() int16        { return v.Version }
 41120  func (v *DescribeProducersRequest) IsFlexible() bool         { return v.Version >= 0 }
 41121  func (v *DescribeProducersRequest) ResponseKind() Response {
 41122  	r := &DescribeProducersResponse{Version: v.Version}
 41123  	r.Default()
 41124  	return r
 41125  }
 41126  
 41127  // RequestWith is requests v on r and returns the response or an error.
 41128  // For sharded requests, the response may be merged and still return an error.
 41129  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 41130  func (v *DescribeProducersRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeProducersResponse, error) {
 41131  	kresp, err := r.Request(ctx, v)
 41132  	resp, _ := kresp.(*DescribeProducersResponse)
 41133  	return resp, err
 41134  }
 41135  
 41136  func (v *DescribeProducersRequest) AppendTo(dst []byte) []byte {
 41137  	version := v.Version
 41138  	_ = version
 41139  	isFlexible := version >= 0
 41140  	_ = isFlexible
 41141  	{
 41142  		v := v.Topics
 41143  		if isFlexible {
 41144  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 41145  		} else {
 41146  			dst = kbin.AppendArrayLen(dst, len(v))
 41147  		}
 41148  		for i := range v {
 41149  			v := &v[i]
 41150  			{
 41151  				v := v.Topic
 41152  				if isFlexible {
 41153  					dst = kbin.AppendCompactString(dst, v)
 41154  				} else {
 41155  					dst = kbin.AppendString(dst, v)
 41156  				}
 41157  			}
 41158  			{
 41159  				v := v.Partitions
 41160  				if isFlexible {
 41161  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 41162  				} else {
 41163  					dst = kbin.AppendArrayLen(dst, len(v))
 41164  				}
 41165  				for i := range v {
 41166  					v := v[i]
 41167  					dst = kbin.AppendInt32(dst, v)
 41168  				}
 41169  			}
 41170  			if isFlexible {
 41171  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41172  				dst = v.UnknownTags.AppendEach(dst)
 41173  			}
 41174  		}
 41175  	}
 41176  	if isFlexible {
 41177  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41178  		dst = v.UnknownTags.AppendEach(dst)
 41179  	}
 41180  	return dst
 41181  }
 41182  
 41183  func (v *DescribeProducersRequest) ReadFrom(src []byte) error {
 41184  	return v.readFrom(src, false)
 41185  }
 41186  
 41187  func (v *DescribeProducersRequest) UnsafeReadFrom(src []byte) error {
 41188  	return v.readFrom(src, true)
 41189  }
 41190  
 41191  func (v *DescribeProducersRequest) readFrom(src []byte, unsafe bool) error {
 41192  	v.Default()
 41193  	b := kbin.Reader{Src: src}
 41194  	version := v.Version
 41195  	_ = version
 41196  	isFlexible := version >= 0
 41197  	_ = isFlexible
 41198  	s := v
 41199  	{
 41200  		v := s.Topics
 41201  		a := v
 41202  		var l int32
 41203  		if isFlexible {
 41204  			l = b.CompactArrayLen()
 41205  		} else {
 41206  			l = b.ArrayLen()
 41207  		}
 41208  		if !b.Ok() {
 41209  			return b.Complete()
 41210  		}
 41211  		a = a[:0]
 41212  		if l > 0 {
 41213  			a = append(a, make([]DescribeProducersRequestTopic, l)...)
 41214  		}
 41215  		for i := int32(0); i < l; i++ {
 41216  			v := &a[i]
 41217  			v.Default()
 41218  			s := v
 41219  			{
 41220  				var v string
 41221  				if unsafe {
 41222  					if isFlexible {
 41223  						v = b.UnsafeCompactString()
 41224  					} else {
 41225  						v = b.UnsafeString()
 41226  					}
 41227  				} else {
 41228  					if isFlexible {
 41229  						v = b.CompactString()
 41230  					} else {
 41231  						v = b.String()
 41232  					}
 41233  				}
 41234  				s.Topic = v
 41235  			}
 41236  			{
 41237  				v := s.Partitions
 41238  				a := v
 41239  				var l int32
 41240  				if isFlexible {
 41241  					l = b.CompactArrayLen()
 41242  				} else {
 41243  					l = b.ArrayLen()
 41244  				}
 41245  				if !b.Ok() {
 41246  					return b.Complete()
 41247  				}
 41248  				a = a[:0]
 41249  				if l > 0 {
 41250  					a = append(a, make([]int32, l)...)
 41251  				}
 41252  				for i := int32(0); i < l; i++ {
 41253  					v := b.Int32()
 41254  					a[i] = v
 41255  				}
 41256  				v = a
 41257  				s.Partitions = v
 41258  			}
 41259  			if isFlexible {
 41260  				s.UnknownTags = internalReadTags(&b)
 41261  			}
 41262  		}
 41263  		v = a
 41264  		s.Topics = v
 41265  	}
 41266  	if isFlexible {
 41267  		s.UnknownTags = internalReadTags(&b)
 41268  	}
 41269  	return b.Complete()
 41270  }
 41271  
 41272  // NewPtrDescribeProducersRequest returns a pointer to a default DescribeProducersRequest
 41273  // This is a shortcut for creating a new(struct) and calling Default yourself.
 41274  func NewPtrDescribeProducersRequest() *DescribeProducersRequest {
 41275  	var v DescribeProducersRequest
 41276  	v.Default()
 41277  	return &v
 41278  }
 41279  
 41280  // Default sets any default fields. Calling this allows for future compatibility
 41281  // if new fields are added to DescribeProducersRequest.
 41282  func (v *DescribeProducersRequest) Default() {
 41283  }
 41284  
 41285  // NewDescribeProducersRequest returns a default DescribeProducersRequest
 41286  // This is a shortcut for creating a struct and calling Default yourself.
 41287  func NewDescribeProducersRequest() DescribeProducersRequest {
 41288  	var v DescribeProducersRequest
 41289  	v.Default()
 41290  	return v
 41291  }
 41292  
 41293  type DescribeProducersResponseTopicPartitionActiveProducer struct {
 41294  	ProducerID int64
 41295  
 41296  	ProducerEpoch int32
 41297  
 41298  	// The last sequence produced.
 41299  	//
 41300  	// This field has a default of -1.
 41301  	LastSequence int32
 41302  
 41303  	// The last timestamp produced.
 41304  	//
 41305  	// This field has a default of -1.
 41306  	LastTimestamp int64
 41307  
 41308  	// The epoch of the transactional coordinator for this last produce.
 41309  	CoordinatorEpoch int32
 41310  
 41311  	// The first offset of the transaction.
 41312  	//
 41313  	// This field has a default of -1.
 41314  	CurrentTxnStartOffset int64
 41315  
 41316  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41317  	UnknownTags Tags
 41318  }
 41319  
 41320  // Default sets any default fields. Calling this allows for future compatibility
 41321  // if new fields are added to DescribeProducersResponseTopicPartitionActiveProducer.
 41322  func (v *DescribeProducersResponseTopicPartitionActiveProducer) Default() {
 41323  	v.LastSequence = -1
 41324  	v.LastTimestamp = -1
 41325  	v.CurrentTxnStartOffset = -1
 41326  }
 41327  
 41328  // NewDescribeProducersResponseTopicPartitionActiveProducer returns a default DescribeProducersResponseTopicPartitionActiveProducer
 41329  // This is a shortcut for creating a struct and calling Default yourself.
 41330  func NewDescribeProducersResponseTopicPartitionActiveProducer() DescribeProducersResponseTopicPartitionActiveProducer {
 41331  	var v DescribeProducersResponseTopicPartitionActiveProducer
 41332  	v.Default()
 41333  	return v
 41334  }
 41335  
 41336  type DescribeProducersResponseTopicPartition struct {
 41337  	Partition int32
 41338  
 41339  	// The partition error code, or 0 if there was no error.
 41340  	//
 41341  	// NOT_LEADER_OR_FOLLOWER is returned if the broker receiving this request
 41342  	// is not the leader of the partition.
 41343  	//
 41344  	// TOPIC_AUTHORIZATION_FAILED is returned if the user does not have Describe
 41345  	// permissions on the topic.
 41346  	//
 41347  	// UNKNOWN_TOPIC_OR_PARTITION is returned if the partition is not known to exist.
 41348  	//
 41349  	// Other errors may be returned corresponding to the partition being offline, etc.
 41350  	ErrorCode int16
 41351  
 41352  	// The partition error message, which may be null if no additional details are available.
 41353  	ErrorMessage *string
 41354  
 41355  	// The current idempotent or transactional producers producing to this partition,
 41356  	// and the metadata related to their produce requests.
 41357  	ActiveProducers []DescribeProducersResponseTopicPartitionActiveProducer
 41358  
 41359  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41360  	UnknownTags Tags
 41361  }
 41362  
 41363  // Default sets any default fields. Calling this allows for future compatibility
 41364  // if new fields are added to DescribeProducersResponseTopicPartition.
 41365  func (v *DescribeProducersResponseTopicPartition) Default() {
 41366  }
 41367  
 41368  // NewDescribeProducersResponseTopicPartition returns a default DescribeProducersResponseTopicPartition
 41369  // This is a shortcut for creating a struct and calling Default yourself.
 41370  func NewDescribeProducersResponseTopicPartition() DescribeProducersResponseTopicPartition {
 41371  	var v DescribeProducersResponseTopicPartition
 41372  	v.Default()
 41373  	return v
 41374  }
 41375  
 41376  type DescribeProducersResponseTopic struct {
 41377  	Topic string
 41378  
 41379  	Partitions []DescribeProducersResponseTopicPartition
 41380  
 41381  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41382  	UnknownTags Tags
 41383  }
 41384  
 41385  // Default sets any default fields. Calling this allows for future compatibility
 41386  // if new fields are added to DescribeProducersResponseTopic.
 41387  func (v *DescribeProducersResponseTopic) Default() {
 41388  }
 41389  
 41390  // NewDescribeProducersResponseTopic returns a default DescribeProducersResponseTopic
 41391  // This is a shortcut for creating a struct and calling Default yourself.
 41392  func NewDescribeProducersResponseTopic() DescribeProducersResponseTopic {
 41393  	var v DescribeProducersResponseTopic
 41394  	v.Default()
 41395  	return v
 41396  }
 41397  
 41398  // DescribeProducersResponse is a response to a DescribeProducersRequest.
 41399  type DescribeProducersResponse struct {
 41400  	// Version is the version of this message used with a Kafka broker.
 41401  	Version int16
 41402  
 41403  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 41404  	// after responding to this request.
 41405  	ThrottleMillis int32
 41406  
 41407  	Topics []DescribeProducersResponseTopic
 41408  
 41409  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41410  	UnknownTags Tags
 41411  }
 41412  
 41413  func (*DescribeProducersResponse) Key() int16                 { return 61 }
 41414  func (*DescribeProducersResponse) MaxVersion() int16          { return 0 }
 41415  func (v *DescribeProducersResponse) SetVersion(version int16) { v.Version = version }
 41416  func (v *DescribeProducersResponse) GetVersion() int16        { return v.Version }
 41417  func (v *DescribeProducersResponse) IsFlexible() bool         { return v.Version >= 0 }
 41418  func (v *DescribeProducersResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 0 }
 41419  func (v *DescribeProducersResponse) SetThrottle(throttleMillis int32) {
 41420  	v.ThrottleMillis = throttleMillis
 41421  }
 41422  
 41423  func (v *DescribeProducersResponse) RequestKind() Request {
 41424  	return &DescribeProducersRequest{Version: v.Version}
 41425  }
 41426  
 41427  func (v *DescribeProducersResponse) AppendTo(dst []byte) []byte {
 41428  	version := v.Version
 41429  	_ = version
 41430  	isFlexible := version >= 0
 41431  	_ = isFlexible
 41432  	{
 41433  		v := v.ThrottleMillis
 41434  		dst = kbin.AppendInt32(dst, v)
 41435  	}
 41436  	{
 41437  		v := v.Topics
 41438  		if isFlexible {
 41439  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 41440  		} else {
 41441  			dst = kbin.AppendArrayLen(dst, len(v))
 41442  		}
 41443  		for i := range v {
 41444  			v := &v[i]
 41445  			{
 41446  				v := v.Topic
 41447  				if isFlexible {
 41448  					dst = kbin.AppendCompactString(dst, v)
 41449  				} else {
 41450  					dst = kbin.AppendString(dst, v)
 41451  				}
 41452  			}
 41453  			{
 41454  				v := v.Partitions
 41455  				if isFlexible {
 41456  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 41457  				} else {
 41458  					dst = kbin.AppendArrayLen(dst, len(v))
 41459  				}
 41460  				for i := range v {
 41461  					v := &v[i]
 41462  					{
 41463  						v := v.Partition
 41464  						dst = kbin.AppendInt32(dst, v)
 41465  					}
 41466  					{
 41467  						v := v.ErrorCode
 41468  						dst = kbin.AppendInt16(dst, v)
 41469  					}
 41470  					{
 41471  						v := v.ErrorMessage
 41472  						if isFlexible {
 41473  							dst = kbin.AppendCompactNullableString(dst, v)
 41474  						} else {
 41475  							dst = kbin.AppendNullableString(dst, v)
 41476  						}
 41477  					}
 41478  					{
 41479  						v := v.ActiveProducers
 41480  						if isFlexible {
 41481  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 41482  						} else {
 41483  							dst = kbin.AppendArrayLen(dst, len(v))
 41484  						}
 41485  						for i := range v {
 41486  							v := &v[i]
 41487  							{
 41488  								v := v.ProducerID
 41489  								dst = kbin.AppendInt64(dst, v)
 41490  							}
 41491  							{
 41492  								v := v.ProducerEpoch
 41493  								dst = kbin.AppendInt32(dst, v)
 41494  							}
 41495  							{
 41496  								v := v.LastSequence
 41497  								dst = kbin.AppendInt32(dst, v)
 41498  							}
 41499  							{
 41500  								v := v.LastTimestamp
 41501  								dst = kbin.AppendInt64(dst, v)
 41502  							}
 41503  							{
 41504  								v := v.CoordinatorEpoch
 41505  								dst = kbin.AppendInt32(dst, v)
 41506  							}
 41507  							{
 41508  								v := v.CurrentTxnStartOffset
 41509  								dst = kbin.AppendInt64(dst, v)
 41510  							}
 41511  							if isFlexible {
 41512  								dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41513  								dst = v.UnknownTags.AppendEach(dst)
 41514  							}
 41515  						}
 41516  					}
 41517  					if isFlexible {
 41518  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41519  						dst = v.UnknownTags.AppendEach(dst)
 41520  					}
 41521  				}
 41522  			}
 41523  			if isFlexible {
 41524  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41525  				dst = v.UnknownTags.AppendEach(dst)
 41526  			}
 41527  		}
 41528  	}
 41529  	if isFlexible {
 41530  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41531  		dst = v.UnknownTags.AppendEach(dst)
 41532  	}
 41533  	return dst
 41534  }
 41535  
 41536  func (v *DescribeProducersResponse) ReadFrom(src []byte) error {
 41537  	return v.readFrom(src, false)
 41538  }
 41539  
 41540  func (v *DescribeProducersResponse) UnsafeReadFrom(src []byte) error {
 41541  	return v.readFrom(src, true)
 41542  }
 41543  
 41544  func (v *DescribeProducersResponse) readFrom(src []byte, unsafe bool) error {
 41545  	v.Default()
 41546  	b := kbin.Reader{Src: src}
 41547  	version := v.Version
 41548  	_ = version
 41549  	isFlexible := version >= 0
 41550  	_ = isFlexible
 41551  	s := v
 41552  	{
 41553  		v := b.Int32()
 41554  		s.ThrottleMillis = v
 41555  	}
 41556  	{
 41557  		v := s.Topics
 41558  		a := v
 41559  		var l int32
 41560  		if isFlexible {
 41561  			l = b.CompactArrayLen()
 41562  		} else {
 41563  			l = b.ArrayLen()
 41564  		}
 41565  		if !b.Ok() {
 41566  			return b.Complete()
 41567  		}
 41568  		a = a[:0]
 41569  		if l > 0 {
 41570  			a = append(a, make([]DescribeProducersResponseTopic, l)...)
 41571  		}
 41572  		for i := int32(0); i < l; i++ {
 41573  			v := &a[i]
 41574  			v.Default()
 41575  			s := v
 41576  			{
 41577  				var v string
 41578  				if unsafe {
 41579  					if isFlexible {
 41580  						v = b.UnsafeCompactString()
 41581  					} else {
 41582  						v = b.UnsafeString()
 41583  					}
 41584  				} else {
 41585  					if isFlexible {
 41586  						v = b.CompactString()
 41587  					} else {
 41588  						v = b.String()
 41589  					}
 41590  				}
 41591  				s.Topic = v
 41592  			}
 41593  			{
 41594  				v := s.Partitions
 41595  				a := v
 41596  				var l int32
 41597  				if isFlexible {
 41598  					l = b.CompactArrayLen()
 41599  				} else {
 41600  					l = b.ArrayLen()
 41601  				}
 41602  				if !b.Ok() {
 41603  					return b.Complete()
 41604  				}
 41605  				a = a[:0]
 41606  				if l > 0 {
 41607  					a = append(a, make([]DescribeProducersResponseTopicPartition, l)...)
 41608  				}
 41609  				for i := int32(0); i < l; i++ {
 41610  					v := &a[i]
 41611  					v.Default()
 41612  					s := v
 41613  					{
 41614  						v := b.Int32()
 41615  						s.Partition = v
 41616  					}
 41617  					{
 41618  						v := b.Int16()
 41619  						s.ErrorCode = v
 41620  					}
 41621  					{
 41622  						var v *string
 41623  						if isFlexible {
 41624  							if unsafe {
 41625  								v = b.UnsafeCompactNullableString()
 41626  							} else {
 41627  								v = b.CompactNullableString()
 41628  							}
 41629  						} else {
 41630  							if unsafe {
 41631  								v = b.UnsafeNullableString()
 41632  							} else {
 41633  								v = b.NullableString()
 41634  							}
 41635  						}
 41636  						s.ErrorMessage = v
 41637  					}
 41638  					{
 41639  						v := s.ActiveProducers
 41640  						a := v
 41641  						var l int32
 41642  						if isFlexible {
 41643  							l = b.CompactArrayLen()
 41644  						} else {
 41645  							l = b.ArrayLen()
 41646  						}
 41647  						if !b.Ok() {
 41648  							return b.Complete()
 41649  						}
 41650  						a = a[:0]
 41651  						if l > 0 {
 41652  							a = append(a, make([]DescribeProducersResponseTopicPartitionActiveProducer, l)...)
 41653  						}
 41654  						for i := int32(0); i < l; i++ {
 41655  							v := &a[i]
 41656  							v.Default()
 41657  							s := v
 41658  							{
 41659  								v := b.Int64()
 41660  								s.ProducerID = v
 41661  							}
 41662  							{
 41663  								v := b.Int32()
 41664  								s.ProducerEpoch = v
 41665  							}
 41666  							{
 41667  								v := b.Int32()
 41668  								s.LastSequence = v
 41669  							}
 41670  							{
 41671  								v := b.Int64()
 41672  								s.LastTimestamp = v
 41673  							}
 41674  							{
 41675  								v := b.Int32()
 41676  								s.CoordinatorEpoch = v
 41677  							}
 41678  							{
 41679  								v := b.Int64()
 41680  								s.CurrentTxnStartOffset = v
 41681  							}
 41682  							if isFlexible {
 41683  								s.UnknownTags = internalReadTags(&b)
 41684  							}
 41685  						}
 41686  						v = a
 41687  						s.ActiveProducers = v
 41688  					}
 41689  					if isFlexible {
 41690  						s.UnknownTags = internalReadTags(&b)
 41691  					}
 41692  				}
 41693  				v = a
 41694  				s.Partitions = v
 41695  			}
 41696  			if isFlexible {
 41697  				s.UnknownTags = internalReadTags(&b)
 41698  			}
 41699  		}
 41700  		v = a
 41701  		s.Topics = v
 41702  	}
 41703  	if isFlexible {
 41704  		s.UnknownTags = internalReadTags(&b)
 41705  	}
 41706  	return b.Complete()
 41707  }
 41708  
 41709  // NewPtrDescribeProducersResponse returns a pointer to a default DescribeProducersResponse
 41710  // This is a shortcut for creating a new(struct) and calling Default yourself.
 41711  func NewPtrDescribeProducersResponse() *DescribeProducersResponse {
 41712  	var v DescribeProducersResponse
 41713  	v.Default()
 41714  	return &v
 41715  }
 41716  
 41717  // Default sets any default fields. Calling this allows for future compatibility
 41718  // if new fields are added to DescribeProducersResponse.
 41719  func (v *DescribeProducersResponse) Default() {
 41720  }
 41721  
 41722  // NewDescribeProducersResponse returns a default DescribeProducersResponse
 41723  // This is a shortcut for creating a struct and calling Default yourself.
 41724  func NewDescribeProducersResponse() DescribeProducersResponse {
 41725  	var v DescribeProducersResponse
 41726  	v.Default()
 41727  	return v
 41728  }
 41729  
 41730  type BrokerRegistrationRequestListener struct {
 41731  	// The name of this endpoint.
 41732  	Name string
 41733  
 41734  	// The hostname.
 41735  	Host string
 41736  
 41737  	// The port.
 41738  	Port uint16
 41739  
 41740  	// The security protocol.
 41741  	SecurityProtocol int16
 41742  
 41743  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41744  	UnknownTags Tags
 41745  }
 41746  
 41747  // Default sets any default fields. Calling this allows for future compatibility
 41748  // if new fields are added to BrokerRegistrationRequestListener.
 41749  func (v *BrokerRegistrationRequestListener) Default() {
 41750  }
 41751  
 41752  // NewBrokerRegistrationRequestListener returns a default BrokerRegistrationRequestListener
 41753  // This is a shortcut for creating a struct and calling Default yourself.
 41754  func NewBrokerRegistrationRequestListener() BrokerRegistrationRequestListener {
 41755  	var v BrokerRegistrationRequestListener
 41756  	v.Default()
 41757  	return v
 41758  }
 41759  
 41760  type BrokerRegistrationRequestFeature struct {
 41761  	// The name of the feature.
 41762  	Name string
 41763  
 41764  	// The minimum supported feature level.
 41765  	MinSupportedVersion int16
 41766  
 41767  	// The maximum supported feature level.
 41768  	MaxSupportedVersion int16
 41769  
 41770  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41771  	UnknownTags Tags
 41772  }
 41773  
 41774  // Default sets any default fields. Calling this allows for future compatibility
 41775  // if new fields are added to BrokerRegistrationRequestFeature.
 41776  func (v *BrokerRegistrationRequestFeature) Default() {
 41777  }
 41778  
 41779  // NewBrokerRegistrationRequestFeature returns a default BrokerRegistrationRequestFeature
 41780  // This is a shortcut for creating a struct and calling Default yourself.
 41781  func NewBrokerRegistrationRequestFeature() BrokerRegistrationRequestFeature {
 41782  	var v BrokerRegistrationRequestFeature
 41783  	v.Default()
 41784  	return v
 41785  }
 41786  
 41787  // For KIP-500 / KIP-631, BrokerRegistrationRequest is an internal
 41788  // broker-to-broker only request.
 41789  type BrokerRegistrationRequest struct {
 41790  	// Version is the version of this message used with a Kafka broker.
 41791  	Version int16
 41792  
 41793  	// The broker ID.
 41794  	BrokerID int32
 41795  
 41796  	// The cluster ID of the broker process.
 41797  	ClusterID string
 41798  
 41799  	// The incarnation ID of the broker process.
 41800  	IncarnationID [16]byte
 41801  
 41802  	// The listeners for this broker.
 41803  	Listeners []BrokerRegistrationRequestListener
 41804  
 41805  	// Features on this broker.
 41806  	Features []BrokerRegistrationRequestFeature
 41807  
 41808  	// The rack that this broker is in, if any.
 41809  	Rack *string
 41810  
 41811  	// If the required configurations for ZK migration are present, this value is
 41812  	// set to true.
 41813  	IsMigratingZkBroker bool // v1+
 41814  
 41815  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 41816  	UnknownTags Tags
 41817  }
 41818  
 41819  func (*BrokerRegistrationRequest) Key() int16                 { return 62 }
 41820  func (*BrokerRegistrationRequest) MaxVersion() int16          { return 1 }
 41821  func (v *BrokerRegistrationRequest) SetVersion(version int16) { v.Version = version }
 41822  func (v *BrokerRegistrationRequest) GetVersion() int16        { return v.Version }
 41823  func (v *BrokerRegistrationRequest) IsFlexible() bool         { return v.Version >= 0 }
 41824  func (v *BrokerRegistrationRequest) ResponseKind() Response {
 41825  	r := &BrokerRegistrationResponse{Version: v.Version}
 41826  	r.Default()
 41827  	return r
 41828  }
 41829  
 41830  // RequestWith is requests v on r and returns the response or an error.
 41831  // For sharded requests, the response may be merged and still return an error.
 41832  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 41833  func (v *BrokerRegistrationRequest) RequestWith(ctx context.Context, r Requestor) (*BrokerRegistrationResponse, error) {
 41834  	kresp, err := r.Request(ctx, v)
 41835  	resp, _ := kresp.(*BrokerRegistrationResponse)
 41836  	return resp, err
 41837  }
 41838  
 41839  func (v *BrokerRegistrationRequest) AppendTo(dst []byte) []byte {
 41840  	version := v.Version
 41841  	_ = version
 41842  	isFlexible := version >= 0
 41843  	_ = isFlexible
 41844  	{
 41845  		v := v.BrokerID
 41846  		dst = kbin.AppendInt32(dst, v)
 41847  	}
 41848  	{
 41849  		v := v.ClusterID
 41850  		if isFlexible {
 41851  			dst = kbin.AppendCompactString(dst, v)
 41852  		} else {
 41853  			dst = kbin.AppendString(dst, v)
 41854  		}
 41855  	}
 41856  	{
 41857  		v := v.IncarnationID
 41858  		dst = kbin.AppendUuid(dst, v)
 41859  	}
 41860  	{
 41861  		v := v.Listeners
 41862  		if isFlexible {
 41863  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 41864  		} else {
 41865  			dst = kbin.AppendArrayLen(dst, len(v))
 41866  		}
 41867  		for i := range v {
 41868  			v := &v[i]
 41869  			{
 41870  				v := v.Name
 41871  				if isFlexible {
 41872  					dst = kbin.AppendCompactString(dst, v)
 41873  				} else {
 41874  					dst = kbin.AppendString(dst, v)
 41875  				}
 41876  			}
 41877  			{
 41878  				v := v.Host
 41879  				if isFlexible {
 41880  					dst = kbin.AppendCompactString(dst, v)
 41881  				} else {
 41882  					dst = kbin.AppendString(dst, v)
 41883  				}
 41884  			}
 41885  			{
 41886  				v := v.Port
 41887  				dst = kbin.AppendUint16(dst, v)
 41888  			}
 41889  			{
 41890  				v := v.SecurityProtocol
 41891  				dst = kbin.AppendInt16(dst, v)
 41892  			}
 41893  			if isFlexible {
 41894  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41895  				dst = v.UnknownTags.AppendEach(dst)
 41896  			}
 41897  		}
 41898  	}
 41899  	{
 41900  		v := v.Features
 41901  		if isFlexible {
 41902  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 41903  		} else {
 41904  			dst = kbin.AppendArrayLen(dst, len(v))
 41905  		}
 41906  		for i := range v {
 41907  			v := &v[i]
 41908  			{
 41909  				v := v.Name
 41910  				if isFlexible {
 41911  					dst = kbin.AppendCompactString(dst, v)
 41912  				} else {
 41913  					dst = kbin.AppendString(dst, v)
 41914  				}
 41915  			}
 41916  			{
 41917  				v := v.MinSupportedVersion
 41918  				dst = kbin.AppendInt16(dst, v)
 41919  			}
 41920  			{
 41921  				v := v.MaxSupportedVersion
 41922  				dst = kbin.AppendInt16(dst, v)
 41923  			}
 41924  			if isFlexible {
 41925  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41926  				dst = v.UnknownTags.AppendEach(dst)
 41927  			}
 41928  		}
 41929  	}
 41930  	{
 41931  		v := v.Rack
 41932  		if isFlexible {
 41933  			dst = kbin.AppendCompactNullableString(dst, v)
 41934  		} else {
 41935  			dst = kbin.AppendNullableString(dst, v)
 41936  		}
 41937  	}
 41938  	if version >= 1 {
 41939  		v := v.IsMigratingZkBroker
 41940  		dst = kbin.AppendBool(dst, v)
 41941  	}
 41942  	if isFlexible {
 41943  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 41944  		dst = v.UnknownTags.AppendEach(dst)
 41945  	}
 41946  	return dst
 41947  }
 41948  
 41949  func (v *BrokerRegistrationRequest) ReadFrom(src []byte) error {
 41950  	return v.readFrom(src, false)
 41951  }
 41952  
 41953  func (v *BrokerRegistrationRequest) UnsafeReadFrom(src []byte) error {
 41954  	return v.readFrom(src, true)
 41955  }
 41956  
 41957  func (v *BrokerRegistrationRequest) readFrom(src []byte, unsafe bool) error {
 41958  	v.Default()
 41959  	b := kbin.Reader{Src: src}
 41960  	version := v.Version
 41961  	_ = version
 41962  	isFlexible := version >= 0
 41963  	_ = isFlexible
 41964  	s := v
 41965  	{
 41966  		v := b.Int32()
 41967  		s.BrokerID = v
 41968  	}
 41969  	{
 41970  		var v string
 41971  		if unsafe {
 41972  			if isFlexible {
 41973  				v = b.UnsafeCompactString()
 41974  			} else {
 41975  				v = b.UnsafeString()
 41976  			}
 41977  		} else {
 41978  			if isFlexible {
 41979  				v = b.CompactString()
 41980  			} else {
 41981  				v = b.String()
 41982  			}
 41983  		}
 41984  		s.ClusterID = v
 41985  	}
 41986  	{
 41987  		v := b.Uuid()
 41988  		s.IncarnationID = v
 41989  	}
 41990  	{
 41991  		v := s.Listeners
 41992  		a := v
 41993  		var l int32
 41994  		if isFlexible {
 41995  			l = b.CompactArrayLen()
 41996  		} else {
 41997  			l = b.ArrayLen()
 41998  		}
 41999  		if !b.Ok() {
 42000  			return b.Complete()
 42001  		}
 42002  		a = a[:0]
 42003  		if l > 0 {
 42004  			a = append(a, make([]BrokerRegistrationRequestListener, l)...)
 42005  		}
 42006  		for i := int32(0); i < l; i++ {
 42007  			v := &a[i]
 42008  			v.Default()
 42009  			s := v
 42010  			{
 42011  				var v string
 42012  				if unsafe {
 42013  					if isFlexible {
 42014  						v = b.UnsafeCompactString()
 42015  					} else {
 42016  						v = b.UnsafeString()
 42017  					}
 42018  				} else {
 42019  					if isFlexible {
 42020  						v = b.CompactString()
 42021  					} else {
 42022  						v = b.String()
 42023  					}
 42024  				}
 42025  				s.Name = v
 42026  			}
 42027  			{
 42028  				var v string
 42029  				if unsafe {
 42030  					if isFlexible {
 42031  						v = b.UnsafeCompactString()
 42032  					} else {
 42033  						v = b.UnsafeString()
 42034  					}
 42035  				} else {
 42036  					if isFlexible {
 42037  						v = b.CompactString()
 42038  					} else {
 42039  						v = b.String()
 42040  					}
 42041  				}
 42042  				s.Host = v
 42043  			}
 42044  			{
 42045  				v := b.Uint16()
 42046  				s.Port = v
 42047  			}
 42048  			{
 42049  				v := b.Int16()
 42050  				s.SecurityProtocol = v
 42051  			}
 42052  			if isFlexible {
 42053  				s.UnknownTags = internalReadTags(&b)
 42054  			}
 42055  		}
 42056  		v = a
 42057  		s.Listeners = v
 42058  	}
 42059  	{
 42060  		v := s.Features
 42061  		a := v
 42062  		var l int32
 42063  		if isFlexible {
 42064  			l = b.CompactArrayLen()
 42065  		} else {
 42066  			l = b.ArrayLen()
 42067  		}
 42068  		if !b.Ok() {
 42069  			return b.Complete()
 42070  		}
 42071  		a = a[:0]
 42072  		if l > 0 {
 42073  			a = append(a, make([]BrokerRegistrationRequestFeature, l)...)
 42074  		}
 42075  		for i := int32(0); i < l; i++ {
 42076  			v := &a[i]
 42077  			v.Default()
 42078  			s := v
 42079  			{
 42080  				var v string
 42081  				if unsafe {
 42082  					if isFlexible {
 42083  						v = b.UnsafeCompactString()
 42084  					} else {
 42085  						v = b.UnsafeString()
 42086  					}
 42087  				} else {
 42088  					if isFlexible {
 42089  						v = b.CompactString()
 42090  					} else {
 42091  						v = b.String()
 42092  					}
 42093  				}
 42094  				s.Name = v
 42095  			}
 42096  			{
 42097  				v := b.Int16()
 42098  				s.MinSupportedVersion = v
 42099  			}
 42100  			{
 42101  				v := b.Int16()
 42102  				s.MaxSupportedVersion = v
 42103  			}
 42104  			if isFlexible {
 42105  				s.UnknownTags = internalReadTags(&b)
 42106  			}
 42107  		}
 42108  		v = a
 42109  		s.Features = v
 42110  	}
 42111  	{
 42112  		var v *string
 42113  		if isFlexible {
 42114  			if unsafe {
 42115  				v = b.UnsafeCompactNullableString()
 42116  			} else {
 42117  				v = b.CompactNullableString()
 42118  			}
 42119  		} else {
 42120  			if unsafe {
 42121  				v = b.UnsafeNullableString()
 42122  			} else {
 42123  				v = b.NullableString()
 42124  			}
 42125  		}
 42126  		s.Rack = v
 42127  	}
 42128  	if version >= 1 {
 42129  		v := b.Bool()
 42130  		s.IsMigratingZkBroker = v
 42131  	}
 42132  	if isFlexible {
 42133  		s.UnknownTags = internalReadTags(&b)
 42134  	}
 42135  	return b.Complete()
 42136  }
 42137  
 42138  // NewPtrBrokerRegistrationRequest returns a pointer to a default BrokerRegistrationRequest
 42139  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42140  func NewPtrBrokerRegistrationRequest() *BrokerRegistrationRequest {
 42141  	var v BrokerRegistrationRequest
 42142  	v.Default()
 42143  	return &v
 42144  }
 42145  
 42146  // Default sets any default fields. Calling this allows for future compatibility
 42147  // if new fields are added to BrokerRegistrationRequest.
 42148  func (v *BrokerRegistrationRequest) Default() {
 42149  }
 42150  
 42151  // NewBrokerRegistrationRequest returns a default BrokerRegistrationRequest
 42152  // This is a shortcut for creating a struct and calling Default yourself.
 42153  func NewBrokerRegistrationRequest() BrokerRegistrationRequest {
 42154  	var v BrokerRegistrationRequest
 42155  	v.Default()
 42156  	return v
 42157  }
 42158  
 42159  // BrokerRegistrationResponse is a response to a BrokerRegistrationRequest.
 42160  type BrokerRegistrationResponse struct {
 42161  	// Version is the version of this message used with a Kafka broker.
 42162  	Version int16
 42163  
 42164  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 42165  	// after responding to this request.
 42166  	ThrottleMillis int32
 42167  
 42168  	// Any error code, or 0.
 42169  	ErrorCode int16
 42170  
 42171  	// The broker's assigned epoch, or -1 if none was assigned.
 42172  	//
 42173  	// This field has a default of -1.
 42174  	BrokerEpoch int64
 42175  
 42176  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42177  	UnknownTags Tags
 42178  }
 42179  
 42180  func (*BrokerRegistrationResponse) Key() int16                 { return 62 }
 42181  func (*BrokerRegistrationResponse) MaxVersion() int16          { return 1 }
 42182  func (v *BrokerRegistrationResponse) SetVersion(version int16) { v.Version = version }
 42183  func (v *BrokerRegistrationResponse) GetVersion() int16        { return v.Version }
 42184  func (v *BrokerRegistrationResponse) IsFlexible() bool         { return v.Version >= 0 }
 42185  func (v *BrokerRegistrationResponse) Throttle() (int32, bool) {
 42186  	return v.ThrottleMillis, v.Version >= 0
 42187  }
 42188  
 42189  func (v *BrokerRegistrationResponse) SetThrottle(throttleMillis int32) {
 42190  	v.ThrottleMillis = throttleMillis
 42191  }
 42192  
 42193  func (v *BrokerRegistrationResponse) RequestKind() Request {
 42194  	return &BrokerRegistrationRequest{Version: v.Version}
 42195  }
 42196  
 42197  func (v *BrokerRegistrationResponse) AppendTo(dst []byte) []byte {
 42198  	version := v.Version
 42199  	_ = version
 42200  	isFlexible := version >= 0
 42201  	_ = isFlexible
 42202  	{
 42203  		v := v.ThrottleMillis
 42204  		dst = kbin.AppendInt32(dst, v)
 42205  	}
 42206  	{
 42207  		v := v.ErrorCode
 42208  		dst = kbin.AppendInt16(dst, v)
 42209  	}
 42210  	{
 42211  		v := v.BrokerEpoch
 42212  		dst = kbin.AppendInt64(dst, v)
 42213  	}
 42214  	if isFlexible {
 42215  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 42216  		dst = v.UnknownTags.AppendEach(dst)
 42217  	}
 42218  	return dst
 42219  }
 42220  
 42221  func (v *BrokerRegistrationResponse) ReadFrom(src []byte) error {
 42222  	return v.readFrom(src, false)
 42223  }
 42224  
 42225  func (v *BrokerRegistrationResponse) UnsafeReadFrom(src []byte) error {
 42226  	return v.readFrom(src, true)
 42227  }
 42228  
 42229  func (v *BrokerRegistrationResponse) readFrom(src []byte, unsafe bool) error {
 42230  	v.Default()
 42231  	b := kbin.Reader{Src: src}
 42232  	version := v.Version
 42233  	_ = version
 42234  	isFlexible := version >= 0
 42235  	_ = isFlexible
 42236  	s := v
 42237  	{
 42238  		v := b.Int32()
 42239  		s.ThrottleMillis = v
 42240  	}
 42241  	{
 42242  		v := b.Int16()
 42243  		s.ErrorCode = v
 42244  	}
 42245  	{
 42246  		v := b.Int64()
 42247  		s.BrokerEpoch = v
 42248  	}
 42249  	if isFlexible {
 42250  		s.UnknownTags = internalReadTags(&b)
 42251  	}
 42252  	return b.Complete()
 42253  }
 42254  
 42255  // NewPtrBrokerRegistrationResponse returns a pointer to a default BrokerRegistrationResponse
 42256  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42257  func NewPtrBrokerRegistrationResponse() *BrokerRegistrationResponse {
 42258  	var v BrokerRegistrationResponse
 42259  	v.Default()
 42260  	return &v
 42261  }
 42262  
 42263  // Default sets any default fields. Calling this allows for future compatibility
 42264  // if new fields are added to BrokerRegistrationResponse.
 42265  func (v *BrokerRegistrationResponse) Default() {
 42266  	v.BrokerEpoch = -1
 42267  }
 42268  
 42269  // NewBrokerRegistrationResponse returns a default BrokerRegistrationResponse
 42270  // This is a shortcut for creating a struct and calling Default yourself.
 42271  func NewBrokerRegistrationResponse() BrokerRegistrationResponse {
 42272  	var v BrokerRegistrationResponse
 42273  	v.Default()
 42274  	return v
 42275  }
 42276  
 42277  // For KIP-500 / KIP-631, BrokerHeartbeatRequest is an internal
 42278  // broker-to-broker only request.
 42279  type BrokerHeartbeatRequest struct {
 42280  	// Version is the version of this message used with a Kafka broker.
 42281  	Version int16
 42282  
 42283  	// The broker ID.
 42284  	BrokerID int32
 42285  
 42286  	// The broker's epoch.
 42287  	//
 42288  	// This field has a default of -1.
 42289  	BrokerEpoch int64
 42290  
 42291  	// The highest metadata offset that the broker has reached.
 42292  	CurrentMetadataOffset int64
 42293  
 42294  	// True if the broker wants to be fenced.
 42295  	WantFence bool
 42296  
 42297  	// True if the broker wants to be shutdown.
 42298  	WantShutdown bool
 42299  
 42300  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42301  	UnknownTags Tags
 42302  }
 42303  
 42304  func (*BrokerHeartbeatRequest) Key() int16                 { return 63 }
 42305  func (*BrokerHeartbeatRequest) MaxVersion() int16          { return 0 }
 42306  func (v *BrokerHeartbeatRequest) SetVersion(version int16) { v.Version = version }
 42307  func (v *BrokerHeartbeatRequest) GetVersion() int16        { return v.Version }
 42308  func (v *BrokerHeartbeatRequest) IsFlexible() bool         { return v.Version >= 0 }
 42309  func (v *BrokerHeartbeatRequest) ResponseKind() Response {
 42310  	r := &BrokerHeartbeatResponse{Version: v.Version}
 42311  	r.Default()
 42312  	return r
 42313  }
 42314  
 42315  // RequestWith is requests v on r and returns the response or an error.
 42316  // For sharded requests, the response may be merged and still return an error.
 42317  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 42318  func (v *BrokerHeartbeatRequest) RequestWith(ctx context.Context, r Requestor) (*BrokerHeartbeatResponse, error) {
 42319  	kresp, err := r.Request(ctx, v)
 42320  	resp, _ := kresp.(*BrokerHeartbeatResponse)
 42321  	return resp, err
 42322  }
 42323  
 42324  func (v *BrokerHeartbeatRequest) AppendTo(dst []byte) []byte {
 42325  	version := v.Version
 42326  	_ = version
 42327  	isFlexible := version >= 0
 42328  	_ = isFlexible
 42329  	{
 42330  		v := v.BrokerID
 42331  		dst = kbin.AppendInt32(dst, v)
 42332  	}
 42333  	{
 42334  		v := v.BrokerEpoch
 42335  		dst = kbin.AppendInt64(dst, v)
 42336  	}
 42337  	{
 42338  		v := v.CurrentMetadataOffset
 42339  		dst = kbin.AppendInt64(dst, v)
 42340  	}
 42341  	{
 42342  		v := v.WantFence
 42343  		dst = kbin.AppendBool(dst, v)
 42344  	}
 42345  	{
 42346  		v := v.WantShutdown
 42347  		dst = kbin.AppendBool(dst, v)
 42348  	}
 42349  	if isFlexible {
 42350  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 42351  		dst = v.UnknownTags.AppendEach(dst)
 42352  	}
 42353  	return dst
 42354  }
 42355  
 42356  func (v *BrokerHeartbeatRequest) ReadFrom(src []byte) error {
 42357  	return v.readFrom(src, false)
 42358  }
 42359  
 42360  func (v *BrokerHeartbeatRequest) UnsafeReadFrom(src []byte) error {
 42361  	return v.readFrom(src, true)
 42362  }
 42363  
 42364  func (v *BrokerHeartbeatRequest) readFrom(src []byte, unsafe bool) error {
 42365  	v.Default()
 42366  	b := kbin.Reader{Src: src}
 42367  	version := v.Version
 42368  	_ = version
 42369  	isFlexible := version >= 0
 42370  	_ = isFlexible
 42371  	s := v
 42372  	{
 42373  		v := b.Int32()
 42374  		s.BrokerID = v
 42375  	}
 42376  	{
 42377  		v := b.Int64()
 42378  		s.BrokerEpoch = v
 42379  	}
 42380  	{
 42381  		v := b.Int64()
 42382  		s.CurrentMetadataOffset = v
 42383  	}
 42384  	{
 42385  		v := b.Bool()
 42386  		s.WantFence = v
 42387  	}
 42388  	{
 42389  		v := b.Bool()
 42390  		s.WantShutdown = v
 42391  	}
 42392  	if isFlexible {
 42393  		s.UnknownTags = internalReadTags(&b)
 42394  	}
 42395  	return b.Complete()
 42396  }
 42397  
 42398  // NewPtrBrokerHeartbeatRequest returns a pointer to a default BrokerHeartbeatRequest
 42399  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42400  func NewPtrBrokerHeartbeatRequest() *BrokerHeartbeatRequest {
 42401  	var v BrokerHeartbeatRequest
 42402  	v.Default()
 42403  	return &v
 42404  }
 42405  
 42406  // Default sets any default fields. Calling this allows for future compatibility
 42407  // if new fields are added to BrokerHeartbeatRequest.
 42408  func (v *BrokerHeartbeatRequest) Default() {
 42409  	v.BrokerEpoch = -1
 42410  }
 42411  
 42412  // NewBrokerHeartbeatRequest returns a default BrokerHeartbeatRequest
 42413  // This is a shortcut for creating a struct and calling Default yourself.
 42414  func NewBrokerHeartbeatRequest() BrokerHeartbeatRequest {
 42415  	var v BrokerHeartbeatRequest
 42416  	v.Default()
 42417  	return v
 42418  }
 42419  
 42420  // BrokerHeartbeatResponse is a response to a BrokerHeartbeatRequest.
 42421  type BrokerHeartbeatResponse struct {
 42422  	// Version is the version of this message used with a Kafka broker.
 42423  	Version int16
 42424  
 42425  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 42426  	// after responding to this request.
 42427  	ThrottleMillis int32
 42428  
 42429  	// Any error code, or 0.
 42430  	ErrorCode int16
 42431  
 42432  	// True if the broker has approximately caught up with the latest metadata.
 42433  	IsCaughtUp bool
 42434  
 42435  	// True if the broker is fenced.
 42436  	//
 42437  	// This field has a default of true.
 42438  	IsFenced bool
 42439  
 42440  	// True if the broker should proceed with its shutdown.
 42441  	ShouldShutdown bool
 42442  
 42443  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42444  	UnknownTags Tags
 42445  }
 42446  
 42447  func (*BrokerHeartbeatResponse) Key() int16                 { return 63 }
 42448  func (*BrokerHeartbeatResponse) MaxVersion() int16          { return 0 }
 42449  func (v *BrokerHeartbeatResponse) SetVersion(version int16) { v.Version = version }
 42450  func (v *BrokerHeartbeatResponse) GetVersion() int16        { return v.Version }
 42451  func (v *BrokerHeartbeatResponse) IsFlexible() bool         { return v.Version >= 0 }
 42452  func (v *BrokerHeartbeatResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 0 }
 42453  func (v *BrokerHeartbeatResponse) SetThrottle(throttleMillis int32) {
 42454  	v.ThrottleMillis = throttleMillis
 42455  }
 42456  
 42457  func (v *BrokerHeartbeatResponse) RequestKind() Request {
 42458  	return &BrokerHeartbeatRequest{Version: v.Version}
 42459  }
 42460  
 42461  func (v *BrokerHeartbeatResponse) AppendTo(dst []byte) []byte {
 42462  	version := v.Version
 42463  	_ = version
 42464  	isFlexible := version >= 0
 42465  	_ = isFlexible
 42466  	{
 42467  		v := v.ThrottleMillis
 42468  		dst = kbin.AppendInt32(dst, v)
 42469  	}
 42470  	{
 42471  		v := v.ErrorCode
 42472  		dst = kbin.AppendInt16(dst, v)
 42473  	}
 42474  	{
 42475  		v := v.IsCaughtUp
 42476  		dst = kbin.AppendBool(dst, v)
 42477  	}
 42478  	{
 42479  		v := v.IsFenced
 42480  		dst = kbin.AppendBool(dst, v)
 42481  	}
 42482  	{
 42483  		v := v.ShouldShutdown
 42484  		dst = kbin.AppendBool(dst, v)
 42485  	}
 42486  	if isFlexible {
 42487  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 42488  		dst = v.UnknownTags.AppendEach(dst)
 42489  	}
 42490  	return dst
 42491  }
 42492  
 42493  func (v *BrokerHeartbeatResponse) ReadFrom(src []byte) error {
 42494  	return v.readFrom(src, false)
 42495  }
 42496  
 42497  func (v *BrokerHeartbeatResponse) UnsafeReadFrom(src []byte) error {
 42498  	return v.readFrom(src, true)
 42499  }
 42500  
 42501  func (v *BrokerHeartbeatResponse) readFrom(src []byte, unsafe bool) error {
 42502  	v.Default()
 42503  	b := kbin.Reader{Src: src}
 42504  	version := v.Version
 42505  	_ = version
 42506  	isFlexible := version >= 0
 42507  	_ = isFlexible
 42508  	s := v
 42509  	{
 42510  		v := b.Int32()
 42511  		s.ThrottleMillis = v
 42512  	}
 42513  	{
 42514  		v := b.Int16()
 42515  		s.ErrorCode = v
 42516  	}
 42517  	{
 42518  		v := b.Bool()
 42519  		s.IsCaughtUp = v
 42520  	}
 42521  	{
 42522  		v := b.Bool()
 42523  		s.IsFenced = v
 42524  	}
 42525  	{
 42526  		v := b.Bool()
 42527  		s.ShouldShutdown = v
 42528  	}
 42529  	if isFlexible {
 42530  		s.UnknownTags = internalReadTags(&b)
 42531  	}
 42532  	return b.Complete()
 42533  }
 42534  
 42535  // NewPtrBrokerHeartbeatResponse returns a pointer to a default BrokerHeartbeatResponse
 42536  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42537  func NewPtrBrokerHeartbeatResponse() *BrokerHeartbeatResponse {
 42538  	var v BrokerHeartbeatResponse
 42539  	v.Default()
 42540  	return &v
 42541  }
 42542  
 42543  // Default sets any default fields. Calling this allows for future compatibility
 42544  // if new fields are added to BrokerHeartbeatResponse.
 42545  func (v *BrokerHeartbeatResponse) Default() {
 42546  	v.IsFenced = true
 42547  }
 42548  
 42549  // NewBrokerHeartbeatResponse returns a default BrokerHeartbeatResponse
 42550  // This is a shortcut for creating a struct and calling Default yourself.
 42551  func NewBrokerHeartbeatResponse() BrokerHeartbeatResponse {
 42552  	var v BrokerHeartbeatResponse
 42553  	v.Default()
 42554  	return v
 42555  }
 42556  
 42557  // For KIP-500 / KIP-631, UnregisterBrokerRequest is an admin request to
 42558  // remove registration of a broker from the cluster.
 42559  type UnregisterBrokerRequest struct {
 42560  	// Version is the version of this message used with a Kafka broker.
 42561  	Version int16
 42562  
 42563  	// The broker ID to unregister.
 42564  	BrokerID int32
 42565  
 42566  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42567  	UnknownTags Tags
 42568  }
 42569  
 42570  func (*UnregisterBrokerRequest) Key() int16                 { return 64 }
 42571  func (*UnregisterBrokerRequest) MaxVersion() int16          { return 0 }
 42572  func (v *UnregisterBrokerRequest) SetVersion(version int16) { v.Version = version }
 42573  func (v *UnregisterBrokerRequest) GetVersion() int16        { return v.Version }
 42574  func (v *UnregisterBrokerRequest) IsFlexible() bool         { return v.Version >= 0 }
 42575  func (v *UnregisterBrokerRequest) ResponseKind() Response {
 42576  	r := &UnregisterBrokerResponse{Version: v.Version}
 42577  	r.Default()
 42578  	return r
 42579  }
 42580  
 42581  // RequestWith is requests v on r and returns the response or an error.
 42582  // For sharded requests, the response may be merged and still return an error.
 42583  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 42584  func (v *UnregisterBrokerRequest) RequestWith(ctx context.Context, r Requestor) (*UnregisterBrokerResponse, error) {
 42585  	kresp, err := r.Request(ctx, v)
 42586  	resp, _ := kresp.(*UnregisterBrokerResponse)
 42587  	return resp, err
 42588  }
 42589  
 42590  func (v *UnregisterBrokerRequest) AppendTo(dst []byte) []byte {
 42591  	version := v.Version
 42592  	_ = version
 42593  	isFlexible := version >= 0
 42594  	_ = isFlexible
 42595  	{
 42596  		v := v.BrokerID
 42597  		dst = kbin.AppendInt32(dst, v)
 42598  	}
 42599  	if isFlexible {
 42600  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 42601  		dst = v.UnknownTags.AppendEach(dst)
 42602  	}
 42603  	return dst
 42604  }
 42605  
 42606  func (v *UnregisterBrokerRequest) ReadFrom(src []byte) error {
 42607  	return v.readFrom(src, false)
 42608  }
 42609  
 42610  func (v *UnregisterBrokerRequest) UnsafeReadFrom(src []byte) error {
 42611  	return v.readFrom(src, true)
 42612  }
 42613  
 42614  func (v *UnregisterBrokerRequest) readFrom(src []byte, unsafe bool) error {
 42615  	v.Default()
 42616  	b := kbin.Reader{Src: src}
 42617  	version := v.Version
 42618  	_ = version
 42619  	isFlexible := version >= 0
 42620  	_ = isFlexible
 42621  	s := v
 42622  	{
 42623  		v := b.Int32()
 42624  		s.BrokerID = v
 42625  	}
 42626  	if isFlexible {
 42627  		s.UnknownTags = internalReadTags(&b)
 42628  	}
 42629  	return b.Complete()
 42630  }
 42631  
 42632  // NewPtrUnregisterBrokerRequest returns a pointer to a default UnregisterBrokerRequest
 42633  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42634  func NewPtrUnregisterBrokerRequest() *UnregisterBrokerRequest {
 42635  	var v UnregisterBrokerRequest
 42636  	v.Default()
 42637  	return &v
 42638  }
 42639  
 42640  // Default sets any default fields. Calling this allows for future compatibility
 42641  // if new fields are added to UnregisterBrokerRequest.
 42642  func (v *UnregisterBrokerRequest) Default() {
 42643  }
 42644  
 42645  // NewUnregisterBrokerRequest returns a default UnregisterBrokerRequest
 42646  // This is a shortcut for creating a struct and calling Default yourself.
 42647  func NewUnregisterBrokerRequest() UnregisterBrokerRequest {
 42648  	var v UnregisterBrokerRequest
 42649  	v.Default()
 42650  	return v
 42651  }
 42652  
 42653  // UnregisterBrokerResponse is a response to a UnregisterBrokerRequest.
 42654  type UnregisterBrokerResponse struct {
 42655  	// Version is the version of this message used with a Kafka broker.
 42656  	Version int16
 42657  
 42658  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 42659  	// after responding to this request.
 42660  	ThrottleMillis int32
 42661  
 42662  	// Any error code, or 0.
 42663  	ErrorCode int16
 42664  
 42665  	// The error message, if any.
 42666  	ErrorMessage *string
 42667  
 42668  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42669  	UnknownTags Tags
 42670  }
 42671  
 42672  func (*UnregisterBrokerResponse) Key() int16                 { return 64 }
 42673  func (*UnregisterBrokerResponse) MaxVersion() int16          { return 0 }
 42674  func (v *UnregisterBrokerResponse) SetVersion(version int16) { v.Version = version }
 42675  func (v *UnregisterBrokerResponse) GetVersion() int16        { return v.Version }
 42676  func (v *UnregisterBrokerResponse) IsFlexible() bool         { return v.Version >= 0 }
 42677  func (v *UnregisterBrokerResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 0 }
 42678  func (v *UnregisterBrokerResponse) SetThrottle(throttleMillis int32) {
 42679  	v.ThrottleMillis = throttleMillis
 42680  }
 42681  
 42682  func (v *UnregisterBrokerResponse) RequestKind() Request {
 42683  	return &UnregisterBrokerRequest{Version: v.Version}
 42684  }
 42685  
 42686  func (v *UnregisterBrokerResponse) AppendTo(dst []byte) []byte {
 42687  	version := v.Version
 42688  	_ = version
 42689  	isFlexible := version >= 0
 42690  	_ = isFlexible
 42691  	{
 42692  		v := v.ThrottleMillis
 42693  		dst = kbin.AppendInt32(dst, v)
 42694  	}
 42695  	{
 42696  		v := v.ErrorCode
 42697  		dst = kbin.AppendInt16(dst, v)
 42698  	}
 42699  	{
 42700  		v := v.ErrorMessage
 42701  		if isFlexible {
 42702  			dst = kbin.AppendCompactNullableString(dst, v)
 42703  		} else {
 42704  			dst = kbin.AppendNullableString(dst, v)
 42705  		}
 42706  	}
 42707  	if isFlexible {
 42708  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 42709  		dst = v.UnknownTags.AppendEach(dst)
 42710  	}
 42711  	return dst
 42712  }
 42713  
 42714  func (v *UnregisterBrokerResponse) ReadFrom(src []byte) error {
 42715  	return v.readFrom(src, false)
 42716  }
 42717  
 42718  func (v *UnregisterBrokerResponse) UnsafeReadFrom(src []byte) error {
 42719  	return v.readFrom(src, true)
 42720  }
 42721  
 42722  func (v *UnregisterBrokerResponse) readFrom(src []byte, unsafe bool) error {
 42723  	v.Default()
 42724  	b := kbin.Reader{Src: src}
 42725  	version := v.Version
 42726  	_ = version
 42727  	isFlexible := version >= 0
 42728  	_ = isFlexible
 42729  	s := v
 42730  	{
 42731  		v := b.Int32()
 42732  		s.ThrottleMillis = v
 42733  	}
 42734  	{
 42735  		v := b.Int16()
 42736  		s.ErrorCode = v
 42737  	}
 42738  	{
 42739  		var v *string
 42740  		if isFlexible {
 42741  			if unsafe {
 42742  				v = b.UnsafeCompactNullableString()
 42743  			} else {
 42744  				v = b.CompactNullableString()
 42745  			}
 42746  		} else {
 42747  			if unsafe {
 42748  				v = b.UnsafeNullableString()
 42749  			} else {
 42750  				v = b.NullableString()
 42751  			}
 42752  		}
 42753  		s.ErrorMessage = v
 42754  	}
 42755  	if isFlexible {
 42756  		s.UnknownTags = internalReadTags(&b)
 42757  	}
 42758  	return b.Complete()
 42759  }
 42760  
 42761  // NewPtrUnregisterBrokerResponse returns a pointer to a default UnregisterBrokerResponse
 42762  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42763  func NewPtrUnregisterBrokerResponse() *UnregisterBrokerResponse {
 42764  	var v UnregisterBrokerResponse
 42765  	v.Default()
 42766  	return &v
 42767  }
 42768  
 42769  // Default sets any default fields. Calling this allows for future compatibility
 42770  // if new fields are added to UnregisterBrokerResponse.
 42771  func (v *UnregisterBrokerResponse) Default() {
 42772  }
 42773  
 42774  // NewUnregisterBrokerResponse returns a default UnregisterBrokerResponse
 42775  // This is a shortcut for creating a struct and calling Default yourself.
 42776  func NewUnregisterBrokerResponse() UnregisterBrokerResponse {
 42777  	var v UnregisterBrokerResponse
 42778  	v.Default()
 42779  	return v
 42780  }
 42781  
 42782  // For KIP-664, DescribeTransactionsRequest describes the state of transactions.
 42783  type DescribeTransactionsRequest struct {
 42784  	// Version is the version of this message used with a Kafka broker.
 42785  	Version int16
 42786  
 42787  	// Array of transactionalIds to include in describe results. If empty, then
 42788  	// no results will be returned.
 42789  	TransactionalIDs []string
 42790  
 42791  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42792  	UnknownTags Tags
 42793  }
 42794  
 42795  func (*DescribeTransactionsRequest) Key() int16                 { return 65 }
 42796  func (*DescribeTransactionsRequest) MaxVersion() int16          { return 0 }
 42797  func (v *DescribeTransactionsRequest) SetVersion(version int16) { v.Version = version }
 42798  func (v *DescribeTransactionsRequest) GetVersion() int16        { return v.Version }
 42799  func (v *DescribeTransactionsRequest) IsFlexible() bool         { return v.Version >= 0 }
 42800  func (v *DescribeTransactionsRequest) ResponseKind() Response {
 42801  	r := &DescribeTransactionsResponse{Version: v.Version}
 42802  	r.Default()
 42803  	return r
 42804  }
 42805  
 42806  // RequestWith is requests v on r and returns the response or an error.
 42807  // For sharded requests, the response may be merged and still return an error.
 42808  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 42809  func (v *DescribeTransactionsRequest) RequestWith(ctx context.Context, r Requestor) (*DescribeTransactionsResponse, error) {
 42810  	kresp, err := r.Request(ctx, v)
 42811  	resp, _ := kresp.(*DescribeTransactionsResponse)
 42812  	return resp, err
 42813  }
 42814  
 42815  func (v *DescribeTransactionsRequest) AppendTo(dst []byte) []byte {
 42816  	version := v.Version
 42817  	_ = version
 42818  	isFlexible := version >= 0
 42819  	_ = isFlexible
 42820  	{
 42821  		v := v.TransactionalIDs
 42822  		if isFlexible {
 42823  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 42824  		} else {
 42825  			dst = kbin.AppendArrayLen(dst, len(v))
 42826  		}
 42827  		for i := range v {
 42828  			v := v[i]
 42829  			if isFlexible {
 42830  				dst = kbin.AppendCompactString(dst, v)
 42831  			} else {
 42832  				dst = kbin.AppendString(dst, v)
 42833  			}
 42834  		}
 42835  	}
 42836  	if isFlexible {
 42837  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 42838  		dst = v.UnknownTags.AppendEach(dst)
 42839  	}
 42840  	return dst
 42841  }
 42842  
 42843  func (v *DescribeTransactionsRequest) ReadFrom(src []byte) error {
 42844  	return v.readFrom(src, false)
 42845  }
 42846  
 42847  func (v *DescribeTransactionsRequest) UnsafeReadFrom(src []byte) error {
 42848  	return v.readFrom(src, true)
 42849  }
 42850  
 42851  func (v *DescribeTransactionsRequest) readFrom(src []byte, unsafe bool) error {
 42852  	v.Default()
 42853  	b := kbin.Reader{Src: src}
 42854  	version := v.Version
 42855  	_ = version
 42856  	isFlexible := version >= 0
 42857  	_ = isFlexible
 42858  	s := v
 42859  	{
 42860  		v := s.TransactionalIDs
 42861  		a := v
 42862  		var l int32
 42863  		if isFlexible {
 42864  			l = b.CompactArrayLen()
 42865  		} else {
 42866  			l = b.ArrayLen()
 42867  		}
 42868  		if !b.Ok() {
 42869  			return b.Complete()
 42870  		}
 42871  		a = a[:0]
 42872  		if l > 0 {
 42873  			a = append(a, make([]string, l)...)
 42874  		}
 42875  		for i := int32(0); i < l; i++ {
 42876  			var v string
 42877  			if unsafe {
 42878  				if isFlexible {
 42879  					v = b.UnsafeCompactString()
 42880  				} else {
 42881  					v = b.UnsafeString()
 42882  				}
 42883  			} else {
 42884  				if isFlexible {
 42885  					v = b.CompactString()
 42886  				} else {
 42887  					v = b.String()
 42888  				}
 42889  			}
 42890  			a[i] = v
 42891  		}
 42892  		v = a
 42893  		s.TransactionalIDs = v
 42894  	}
 42895  	if isFlexible {
 42896  		s.UnknownTags = internalReadTags(&b)
 42897  	}
 42898  	return b.Complete()
 42899  }
 42900  
 42901  // NewPtrDescribeTransactionsRequest returns a pointer to a default DescribeTransactionsRequest
 42902  // This is a shortcut for creating a new(struct) and calling Default yourself.
 42903  func NewPtrDescribeTransactionsRequest() *DescribeTransactionsRequest {
 42904  	var v DescribeTransactionsRequest
 42905  	v.Default()
 42906  	return &v
 42907  }
 42908  
 42909  // Default sets any default fields. Calling this allows for future compatibility
 42910  // if new fields are added to DescribeTransactionsRequest.
 42911  func (v *DescribeTransactionsRequest) Default() {
 42912  }
 42913  
 42914  // NewDescribeTransactionsRequest returns a default DescribeTransactionsRequest
 42915  // This is a shortcut for creating a struct and calling Default yourself.
 42916  func NewDescribeTransactionsRequest() DescribeTransactionsRequest {
 42917  	var v DescribeTransactionsRequest
 42918  	v.Default()
 42919  	return v
 42920  }
 42921  
 42922  type DescribeTransactionsResponseTransactionStateTopic struct {
 42923  	Topic string
 42924  
 42925  	Partitions []int32
 42926  
 42927  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42928  	UnknownTags Tags
 42929  }
 42930  
 42931  // Default sets any default fields. Calling this allows for future compatibility
 42932  // if new fields are added to DescribeTransactionsResponseTransactionStateTopic.
 42933  func (v *DescribeTransactionsResponseTransactionStateTopic) Default() {
 42934  }
 42935  
 42936  // NewDescribeTransactionsResponseTransactionStateTopic returns a default DescribeTransactionsResponseTransactionStateTopic
 42937  // This is a shortcut for creating a struct and calling Default yourself.
 42938  func NewDescribeTransactionsResponseTransactionStateTopic() DescribeTransactionsResponseTransactionStateTopic {
 42939  	var v DescribeTransactionsResponseTransactionStateTopic
 42940  	v.Default()
 42941  	return v
 42942  }
 42943  
 42944  type DescribeTransactionsResponseTransactionState struct {
 42945  	// A potential error code for describing this transaction.
 42946  	//
 42947  	// NOT_COORDINATOR is returned if the broker receiving this transactional
 42948  	// ID does not own the ID.
 42949  	//
 42950  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the coordiantor is laoding.
 42951  	//
 42952  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator is being shutdown.
 42953  	//
 42954  	// TRANSACTIONAL_ID_NOT_FOUND is returned if the transactional ID could not be found.
 42955  	//
 42956  	// TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned if the user does not have
 42957  	// Describe permissions on the transactional ID.
 42958  	ErrorCode int16
 42959  
 42960  	// TransactionalID is the transactional ID this record is for.
 42961  	TransactionalID string
 42962  
 42963  	// State is the state the transaction is in.
 42964  	State string
 42965  
 42966  	// TimeoutMillis is the timeout of this transaction in milliseconds.
 42967  	TimeoutMillis int32
 42968  
 42969  	// StartTimestamp is the timestamp in millis of when this transaction started.
 42970  	StartTimestamp int64
 42971  
 42972  	// ProducerID is the ID in use by the transactional ID.
 42973  	ProducerID int64
 42974  
 42975  	// ProducerEpoch is the epoch associated with the producer ID.
 42976  	ProducerEpoch int16
 42977  
 42978  	// The set of partitions included in the current transaction (if active).
 42979  	// When a transaction is preparing to commit or abort, this will include
 42980  	// only partitions which do not have markers.
 42981  	//
 42982  	// This does not include topics the user is not authorized to describe.
 42983  	Topics []DescribeTransactionsResponseTransactionStateTopic
 42984  
 42985  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 42986  	UnknownTags Tags
 42987  }
 42988  
 42989  // Default sets any default fields. Calling this allows for future compatibility
 42990  // if new fields are added to DescribeTransactionsResponseTransactionState.
 42991  func (v *DescribeTransactionsResponseTransactionState) Default() {
 42992  }
 42993  
 42994  // NewDescribeTransactionsResponseTransactionState returns a default DescribeTransactionsResponseTransactionState
 42995  // This is a shortcut for creating a struct and calling Default yourself.
 42996  func NewDescribeTransactionsResponseTransactionState() DescribeTransactionsResponseTransactionState {
 42997  	var v DescribeTransactionsResponseTransactionState
 42998  	v.Default()
 42999  	return v
 43000  }
 43001  
 43002  // DescribeTransactionsResponse is a response to a DescribeTransactionsRequest.
 43003  type DescribeTransactionsResponse struct {
 43004  	// Version is the version of this message used with a Kafka broker.
 43005  	Version int16
 43006  
 43007  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 43008  	// after responding to this request.
 43009  	ThrottleMillis int32
 43010  
 43011  	TransactionStates []DescribeTransactionsResponseTransactionState
 43012  
 43013  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 43014  	UnknownTags Tags
 43015  }
 43016  
 43017  func (*DescribeTransactionsResponse) Key() int16                 { return 65 }
 43018  func (*DescribeTransactionsResponse) MaxVersion() int16          { return 0 }
 43019  func (v *DescribeTransactionsResponse) SetVersion(version int16) { v.Version = version }
 43020  func (v *DescribeTransactionsResponse) GetVersion() int16        { return v.Version }
 43021  func (v *DescribeTransactionsResponse) IsFlexible() bool         { return v.Version >= 0 }
 43022  func (v *DescribeTransactionsResponse) Throttle() (int32, bool) {
 43023  	return v.ThrottleMillis, v.Version >= 0
 43024  }
 43025  
 43026  func (v *DescribeTransactionsResponse) SetThrottle(throttleMillis int32) {
 43027  	v.ThrottleMillis = throttleMillis
 43028  }
 43029  
 43030  func (v *DescribeTransactionsResponse) RequestKind() Request {
 43031  	return &DescribeTransactionsRequest{Version: v.Version}
 43032  }
 43033  
 43034  func (v *DescribeTransactionsResponse) AppendTo(dst []byte) []byte {
 43035  	version := v.Version
 43036  	_ = version
 43037  	isFlexible := version >= 0
 43038  	_ = isFlexible
 43039  	{
 43040  		v := v.ThrottleMillis
 43041  		dst = kbin.AppendInt32(dst, v)
 43042  	}
 43043  	{
 43044  		v := v.TransactionStates
 43045  		if isFlexible {
 43046  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 43047  		} else {
 43048  			dst = kbin.AppendArrayLen(dst, len(v))
 43049  		}
 43050  		for i := range v {
 43051  			v := &v[i]
 43052  			{
 43053  				v := v.ErrorCode
 43054  				dst = kbin.AppendInt16(dst, v)
 43055  			}
 43056  			{
 43057  				v := v.TransactionalID
 43058  				if isFlexible {
 43059  					dst = kbin.AppendCompactString(dst, v)
 43060  				} else {
 43061  					dst = kbin.AppendString(dst, v)
 43062  				}
 43063  			}
 43064  			{
 43065  				v := v.State
 43066  				if isFlexible {
 43067  					dst = kbin.AppendCompactString(dst, v)
 43068  				} else {
 43069  					dst = kbin.AppendString(dst, v)
 43070  				}
 43071  			}
 43072  			{
 43073  				v := v.TimeoutMillis
 43074  				dst = kbin.AppendInt32(dst, v)
 43075  			}
 43076  			{
 43077  				v := v.StartTimestamp
 43078  				dst = kbin.AppendInt64(dst, v)
 43079  			}
 43080  			{
 43081  				v := v.ProducerID
 43082  				dst = kbin.AppendInt64(dst, v)
 43083  			}
 43084  			{
 43085  				v := v.ProducerEpoch
 43086  				dst = kbin.AppendInt16(dst, v)
 43087  			}
 43088  			{
 43089  				v := v.Topics
 43090  				if isFlexible {
 43091  					dst = kbin.AppendCompactArrayLen(dst, len(v))
 43092  				} else {
 43093  					dst = kbin.AppendArrayLen(dst, len(v))
 43094  				}
 43095  				for i := range v {
 43096  					v := &v[i]
 43097  					{
 43098  						v := v.Topic
 43099  						if isFlexible {
 43100  							dst = kbin.AppendCompactString(dst, v)
 43101  						} else {
 43102  							dst = kbin.AppendString(dst, v)
 43103  						}
 43104  					}
 43105  					{
 43106  						v := v.Partitions
 43107  						if isFlexible {
 43108  							dst = kbin.AppendCompactArrayLen(dst, len(v))
 43109  						} else {
 43110  							dst = kbin.AppendArrayLen(dst, len(v))
 43111  						}
 43112  						for i := range v {
 43113  							v := v[i]
 43114  							dst = kbin.AppendInt32(dst, v)
 43115  						}
 43116  					}
 43117  					if isFlexible {
 43118  						dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43119  						dst = v.UnknownTags.AppendEach(dst)
 43120  					}
 43121  				}
 43122  			}
 43123  			if isFlexible {
 43124  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43125  				dst = v.UnknownTags.AppendEach(dst)
 43126  			}
 43127  		}
 43128  	}
 43129  	if isFlexible {
 43130  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43131  		dst = v.UnknownTags.AppendEach(dst)
 43132  	}
 43133  	return dst
 43134  }
 43135  
 43136  func (v *DescribeTransactionsResponse) ReadFrom(src []byte) error {
 43137  	return v.readFrom(src, false)
 43138  }
 43139  
 43140  func (v *DescribeTransactionsResponse) UnsafeReadFrom(src []byte) error {
 43141  	return v.readFrom(src, true)
 43142  }
 43143  
 43144  func (v *DescribeTransactionsResponse) readFrom(src []byte, unsafe bool) error {
 43145  	v.Default()
 43146  	b := kbin.Reader{Src: src}
 43147  	version := v.Version
 43148  	_ = version
 43149  	isFlexible := version >= 0
 43150  	_ = isFlexible
 43151  	s := v
 43152  	{
 43153  		v := b.Int32()
 43154  		s.ThrottleMillis = v
 43155  	}
 43156  	{
 43157  		v := s.TransactionStates
 43158  		a := v
 43159  		var l int32
 43160  		if isFlexible {
 43161  			l = b.CompactArrayLen()
 43162  		} else {
 43163  			l = b.ArrayLen()
 43164  		}
 43165  		if !b.Ok() {
 43166  			return b.Complete()
 43167  		}
 43168  		a = a[:0]
 43169  		if l > 0 {
 43170  			a = append(a, make([]DescribeTransactionsResponseTransactionState, l)...)
 43171  		}
 43172  		for i := int32(0); i < l; i++ {
 43173  			v := &a[i]
 43174  			v.Default()
 43175  			s := v
 43176  			{
 43177  				v := b.Int16()
 43178  				s.ErrorCode = v
 43179  			}
 43180  			{
 43181  				var v string
 43182  				if unsafe {
 43183  					if isFlexible {
 43184  						v = b.UnsafeCompactString()
 43185  					} else {
 43186  						v = b.UnsafeString()
 43187  					}
 43188  				} else {
 43189  					if isFlexible {
 43190  						v = b.CompactString()
 43191  					} else {
 43192  						v = b.String()
 43193  					}
 43194  				}
 43195  				s.TransactionalID = v
 43196  			}
 43197  			{
 43198  				var v string
 43199  				if unsafe {
 43200  					if isFlexible {
 43201  						v = b.UnsafeCompactString()
 43202  					} else {
 43203  						v = b.UnsafeString()
 43204  					}
 43205  				} else {
 43206  					if isFlexible {
 43207  						v = b.CompactString()
 43208  					} else {
 43209  						v = b.String()
 43210  					}
 43211  				}
 43212  				s.State = v
 43213  			}
 43214  			{
 43215  				v := b.Int32()
 43216  				s.TimeoutMillis = v
 43217  			}
 43218  			{
 43219  				v := b.Int64()
 43220  				s.StartTimestamp = v
 43221  			}
 43222  			{
 43223  				v := b.Int64()
 43224  				s.ProducerID = v
 43225  			}
 43226  			{
 43227  				v := b.Int16()
 43228  				s.ProducerEpoch = v
 43229  			}
 43230  			{
 43231  				v := s.Topics
 43232  				a := v
 43233  				var l int32
 43234  				if isFlexible {
 43235  					l = b.CompactArrayLen()
 43236  				} else {
 43237  					l = b.ArrayLen()
 43238  				}
 43239  				if !b.Ok() {
 43240  					return b.Complete()
 43241  				}
 43242  				a = a[:0]
 43243  				if l > 0 {
 43244  					a = append(a, make([]DescribeTransactionsResponseTransactionStateTopic, l)...)
 43245  				}
 43246  				for i := int32(0); i < l; i++ {
 43247  					v := &a[i]
 43248  					v.Default()
 43249  					s := v
 43250  					{
 43251  						var v string
 43252  						if unsafe {
 43253  							if isFlexible {
 43254  								v = b.UnsafeCompactString()
 43255  							} else {
 43256  								v = b.UnsafeString()
 43257  							}
 43258  						} else {
 43259  							if isFlexible {
 43260  								v = b.CompactString()
 43261  							} else {
 43262  								v = b.String()
 43263  							}
 43264  						}
 43265  						s.Topic = v
 43266  					}
 43267  					{
 43268  						v := s.Partitions
 43269  						a := v
 43270  						var l int32
 43271  						if isFlexible {
 43272  							l = b.CompactArrayLen()
 43273  						} else {
 43274  							l = b.ArrayLen()
 43275  						}
 43276  						if !b.Ok() {
 43277  							return b.Complete()
 43278  						}
 43279  						a = a[:0]
 43280  						if l > 0 {
 43281  							a = append(a, make([]int32, l)...)
 43282  						}
 43283  						for i := int32(0); i < l; i++ {
 43284  							v := b.Int32()
 43285  							a[i] = v
 43286  						}
 43287  						v = a
 43288  						s.Partitions = v
 43289  					}
 43290  					if isFlexible {
 43291  						s.UnknownTags = internalReadTags(&b)
 43292  					}
 43293  				}
 43294  				v = a
 43295  				s.Topics = v
 43296  			}
 43297  			if isFlexible {
 43298  				s.UnknownTags = internalReadTags(&b)
 43299  			}
 43300  		}
 43301  		v = a
 43302  		s.TransactionStates = v
 43303  	}
 43304  	if isFlexible {
 43305  		s.UnknownTags = internalReadTags(&b)
 43306  	}
 43307  	return b.Complete()
 43308  }
 43309  
 43310  // NewPtrDescribeTransactionsResponse returns a pointer to a default DescribeTransactionsResponse
 43311  // This is a shortcut for creating a new(struct) and calling Default yourself.
 43312  func NewPtrDescribeTransactionsResponse() *DescribeTransactionsResponse {
 43313  	var v DescribeTransactionsResponse
 43314  	v.Default()
 43315  	return &v
 43316  }
 43317  
 43318  // Default sets any default fields. Calling this allows for future compatibility
 43319  // if new fields are added to DescribeTransactionsResponse.
 43320  func (v *DescribeTransactionsResponse) Default() {
 43321  }
 43322  
 43323  // NewDescribeTransactionsResponse returns a default DescribeTransactionsResponse
 43324  // This is a shortcut for creating a struct and calling Default yourself.
 43325  func NewDescribeTransactionsResponse() DescribeTransactionsResponse {
 43326  	var v DescribeTransactionsResponse
 43327  	v.Default()
 43328  	return v
 43329  }
 43330  
 43331  // For KIP-664, ListTransactionsRequest lists transactions.
 43332  type ListTransactionsRequest struct {
 43333  	// Version is the version of this message used with a Kafka broker.
 43334  	Version int16
 43335  
 43336  	// The transaction states to filter by: if empty, all transactions are
 43337  	// returned; if non-empty, then only transactions matching one of the
 43338  	// filtered states will be returned.
 43339  	//
 43340  	// For a list of valid states, see the TransactionState enum.
 43341  	StateFilters []string
 43342  
 43343  	// The producer IDs to filter by: if empty, all transactions will be
 43344  	// returned; if non-empty, only transactions which match one of the filtered
 43345  	// producer IDs will be returned
 43346  	ProducerIDFilters []int64
 43347  
 43348  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 43349  	UnknownTags Tags
 43350  }
 43351  
 43352  func (*ListTransactionsRequest) Key() int16                 { return 66 }
 43353  func (*ListTransactionsRequest) MaxVersion() int16          { return 0 }
 43354  func (v *ListTransactionsRequest) SetVersion(version int16) { v.Version = version }
 43355  func (v *ListTransactionsRequest) GetVersion() int16        { return v.Version }
 43356  func (v *ListTransactionsRequest) IsFlexible() bool         { return v.Version >= 0 }
 43357  func (v *ListTransactionsRequest) ResponseKind() Response {
 43358  	r := &ListTransactionsResponse{Version: v.Version}
 43359  	r.Default()
 43360  	return r
 43361  }
 43362  
 43363  // RequestWith is requests v on r and returns the response or an error.
 43364  // For sharded requests, the response may be merged and still return an error.
 43365  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 43366  func (v *ListTransactionsRequest) RequestWith(ctx context.Context, r Requestor) (*ListTransactionsResponse, error) {
 43367  	kresp, err := r.Request(ctx, v)
 43368  	resp, _ := kresp.(*ListTransactionsResponse)
 43369  	return resp, err
 43370  }
 43371  
 43372  func (v *ListTransactionsRequest) AppendTo(dst []byte) []byte {
 43373  	version := v.Version
 43374  	_ = version
 43375  	isFlexible := version >= 0
 43376  	_ = isFlexible
 43377  	{
 43378  		v := v.StateFilters
 43379  		if isFlexible {
 43380  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 43381  		} else {
 43382  			dst = kbin.AppendArrayLen(dst, len(v))
 43383  		}
 43384  		for i := range v {
 43385  			v := v[i]
 43386  			if isFlexible {
 43387  				dst = kbin.AppendCompactString(dst, v)
 43388  			} else {
 43389  				dst = kbin.AppendString(dst, v)
 43390  			}
 43391  		}
 43392  	}
 43393  	{
 43394  		v := v.ProducerIDFilters
 43395  		if isFlexible {
 43396  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 43397  		} else {
 43398  			dst = kbin.AppendArrayLen(dst, len(v))
 43399  		}
 43400  		for i := range v {
 43401  			v := v[i]
 43402  			dst = kbin.AppendInt64(dst, v)
 43403  		}
 43404  	}
 43405  	if isFlexible {
 43406  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43407  		dst = v.UnknownTags.AppendEach(dst)
 43408  	}
 43409  	return dst
 43410  }
 43411  
 43412  func (v *ListTransactionsRequest) ReadFrom(src []byte) error {
 43413  	return v.readFrom(src, false)
 43414  }
 43415  
 43416  func (v *ListTransactionsRequest) UnsafeReadFrom(src []byte) error {
 43417  	return v.readFrom(src, true)
 43418  }
 43419  
 43420  func (v *ListTransactionsRequest) readFrom(src []byte, unsafe bool) error {
 43421  	v.Default()
 43422  	b := kbin.Reader{Src: src}
 43423  	version := v.Version
 43424  	_ = version
 43425  	isFlexible := version >= 0
 43426  	_ = isFlexible
 43427  	s := v
 43428  	{
 43429  		v := s.StateFilters
 43430  		a := v
 43431  		var l int32
 43432  		if isFlexible {
 43433  			l = b.CompactArrayLen()
 43434  		} else {
 43435  			l = b.ArrayLen()
 43436  		}
 43437  		if !b.Ok() {
 43438  			return b.Complete()
 43439  		}
 43440  		a = a[:0]
 43441  		if l > 0 {
 43442  			a = append(a, make([]string, l)...)
 43443  		}
 43444  		for i := int32(0); i < l; i++ {
 43445  			var v string
 43446  			if unsafe {
 43447  				if isFlexible {
 43448  					v = b.UnsafeCompactString()
 43449  				} else {
 43450  					v = b.UnsafeString()
 43451  				}
 43452  			} else {
 43453  				if isFlexible {
 43454  					v = b.CompactString()
 43455  				} else {
 43456  					v = b.String()
 43457  				}
 43458  			}
 43459  			a[i] = v
 43460  		}
 43461  		v = a
 43462  		s.StateFilters = v
 43463  	}
 43464  	{
 43465  		v := s.ProducerIDFilters
 43466  		a := v
 43467  		var l int32
 43468  		if isFlexible {
 43469  			l = b.CompactArrayLen()
 43470  		} else {
 43471  			l = b.ArrayLen()
 43472  		}
 43473  		if !b.Ok() {
 43474  			return b.Complete()
 43475  		}
 43476  		a = a[:0]
 43477  		if l > 0 {
 43478  			a = append(a, make([]int64, l)...)
 43479  		}
 43480  		for i := int32(0); i < l; i++ {
 43481  			v := b.Int64()
 43482  			a[i] = v
 43483  		}
 43484  		v = a
 43485  		s.ProducerIDFilters = v
 43486  	}
 43487  	if isFlexible {
 43488  		s.UnknownTags = internalReadTags(&b)
 43489  	}
 43490  	return b.Complete()
 43491  }
 43492  
 43493  // NewPtrListTransactionsRequest returns a pointer to a default ListTransactionsRequest
 43494  // This is a shortcut for creating a new(struct) and calling Default yourself.
 43495  func NewPtrListTransactionsRequest() *ListTransactionsRequest {
 43496  	var v ListTransactionsRequest
 43497  	v.Default()
 43498  	return &v
 43499  }
 43500  
 43501  // Default sets any default fields. Calling this allows for future compatibility
 43502  // if new fields are added to ListTransactionsRequest.
 43503  func (v *ListTransactionsRequest) Default() {
 43504  }
 43505  
 43506  // NewListTransactionsRequest returns a default ListTransactionsRequest
 43507  // This is a shortcut for creating a struct and calling Default yourself.
 43508  func NewListTransactionsRequest() ListTransactionsRequest {
 43509  	var v ListTransactionsRequest
 43510  	v.Default()
 43511  	return v
 43512  }
 43513  
 43514  type ListTransactionsResponseTransactionState struct {
 43515  	// The transactional ID being used.
 43516  	TransactionalID string
 43517  
 43518  	// The producer ID of the producer.
 43519  	ProducerID int64
 43520  
 43521  	// The current transaction state of the producer.
 43522  	TransactionState string
 43523  
 43524  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 43525  	UnknownTags Tags
 43526  }
 43527  
 43528  // Default sets any default fields. Calling this allows for future compatibility
 43529  // if new fields are added to ListTransactionsResponseTransactionState.
 43530  func (v *ListTransactionsResponseTransactionState) Default() {
 43531  }
 43532  
 43533  // NewListTransactionsResponseTransactionState returns a default ListTransactionsResponseTransactionState
 43534  // This is a shortcut for creating a struct and calling Default yourself.
 43535  func NewListTransactionsResponseTransactionState() ListTransactionsResponseTransactionState {
 43536  	var v ListTransactionsResponseTransactionState
 43537  	v.Default()
 43538  	return v
 43539  }
 43540  
 43541  // ListTransactionsResponse is a response to a ListTransactionsRequest.
 43542  type ListTransactionsResponse struct {
 43543  	// Version is the version of this message used with a Kafka broker.
 43544  	Version int16
 43545  
 43546  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 43547  	// after responding to this request.
 43548  	ThrottleMillis int32
 43549  
 43550  	// A potential error code for the listing,
 43551  	//
 43552  	// COORDINATOR_LOAD_IN_PROGRESS is returned if the coordinator is loading.
 43553  	//
 43554  	// COORDINATOR_NOT_AVAILABLE is returned if the coordinator receiving this
 43555  	// request is shutting down.
 43556  	ErrorCode int16
 43557  
 43558  	// Set of state filters provided in the request which were unknown to the
 43559  	// transaction coordinator.
 43560  	UnknownStateFilters []string
 43561  
 43562  	// TransactionStates contains all transactions that were matched for listing
 43563  	// in the request. The response elides transactions that the user does not have
 43564  	// permission to describe (DESCRIBE on TRANSACTIONAL_ID for the transaction).
 43565  	TransactionStates []ListTransactionsResponseTransactionState
 43566  
 43567  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 43568  	UnknownTags Tags
 43569  }
 43570  
 43571  func (*ListTransactionsResponse) Key() int16                 { return 66 }
 43572  func (*ListTransactionsResponse) MaxVersion() int16          { return 0 }
 43573  func (v *ListTransactionsResponse) SetVersion(version int16) { v.Version = version }
 43574  func (v *ListTransactionsResponse) GetVersion() int16        { return v.Version }
 43575  func (v *ListTransactionsResponse) IsFlexible() bool         { return v.Version >= 0 }
 43576  func (v *ListTransactionsResponse) Throttle() (int32, bool)  { return v.ThrottleMillis, v.Version >= 0 }
 43577  func (v *ListTransactionsResponse) SetThrottle(throttleMillis int32) {
 43578  	v.ThrottleMillis = throttleMillis
 43579  }
 43580  
 43581  func (v *ListTransactionsResponse) RequestKind() Request {
 43582  	return &ListTransactionsRequest{Version: v.Version}
 43583  }
 43584  
 43585  func (v *ListTransactionsResponse) AppendTo(dst []byte) []byte {
 43586  	version := v.Version
 43587  	_ = version
 43588  	isFlexible := version >= 0
 43589  	_ = isFlexible
 43590  	{
 43591  		v := v.ThrottleMillis
 43592  		dst = kbin.AppendInt32(dst, v)
 43593  	}
 43594  	{
 43595  		v := v.ErrorCode
 43596  		dst = kbin.AppendInt16(dst, v)
 43597  	}
 43598  	{
 43599  		v := v.UnknownStateFilters
 43600  		if isFlexible {
 43601  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 43602  		} else {
 43603  			dst = kbin.AppendArrayLen(dst, len(v))
 43604  		}
 43605  		for i := range v {
 43606  			v := v[i]
 43607  			if isFlexible {
 43608  				dst = kbin.AppendCompactString(dst, v)
 43609  			} else {
 43610  				dst = kbin.AppendString(dst, v)
 43611  			}
 43612  		}
 43613  	}
 43614  	{
 43615  		v := v.TransactionStates
 43616  		if isFlexible {
 43617  			dst = kbin.AppendCompactArrayLen(dst, len(v))
 43618  		} else {
 43619  			dst = kbin.AppendArrayLen(dst, len(v))
 43620  		}
 43621  		for i := range v {
 43622  			v := &v[i]
 43623  			{
 43624  				v := v.TransactionalID
 43625  				if isFlexible {
 43626  					dst = kbin.AppendCompactString(dst, v)
 43627  				} else {
 43628  					dst = kbin.AppendString(dst, v)
 43629  				}
 43630  			}
 43631  			{
 43632  				v := v.ProducerID
 43633  				dst = kbin.AppendInt64(dst, v)
 43634  			}
 43635  			{
 43636  				v := v.TransactionState
 43637  				if isFlexible {
 43638  					dst = kbin.AppendCompactString(dst, v)
 43639  				} else {
 43640  					dst = kbin.AppendString(dst, v)
 43641  				}
 43642  			}
 43643  			if isFlexible {
 43644  				dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43645  				dst = v.UnknownTags.AppendEach(dst)
 43646  			}
 43647  		}
 43648  	}
 43649  	if isFlexible {
 43650  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43651  		dst = v.UnknownTags.AppendEach(dst)
 43652  	}
 43653  	return dst
 43654  }
 43655  
 43656  func (v *ListTransactionsResponse) ReadFrom(src []byte) error {
 43657  	return v.readFrom(src, false)
 43658  }
 43659  
 43660  func (v *ListTransactionsResponse) UnsafeReadFrom(src []byte) error {
 43661  	return v.readFrom(src, true)
 43662  }
 43663  
 43664  func (v *ListTransactionsResponse) readFrom(src []byte, unsafe bool) error {
 43665  	v.Default()
 43666  	b := kbin.Reader{Src: src}
 43667  	version := v.Version
 43668  	_ = version
 43669  	isFlexible := version >= 0
 43670  	_ = isFlexible
 43671  	s := v
 43672  	{
 43673  		v := b.Int32()
 43674  		s.ThrottleMillis = v
 43675  	}
 43676  	{
 43677  		v := b.Int16()
 43678  		s.ErrorCode = v
 43679  	}
 43680  	{
 43681  		v := s.UnknownStateFilters
 43682  		a := v
 43683  		var l int32
 43684  		if isFlexible {
 43685  			l = b.CompactArrayLen()
 43686  		} else {
 43687  			l = b.ArrayLen()
 43688  		}
 43689  		if !b.Ok() {
 43690  			return b.Complete()
 43691  		}
 43692  		a = a[:0]
 43693  		if l > 0 {
 43694  			a = append(a, make([]string, l)...)
 43695  		}
 43696  		for i := int32(0); i < l; i++ {
 43697  			var v string
 43698  			if unsafe {
 43699  				if isFlexible {
 43700  					v = b.UnsafeCompactString()
 43701  				} else {
 43702  					v = b.UnsafeString()
 43703  				}
 43704  			} else {
 43705  				if isFlexible {
 43706  					v = b.CompactString()
 43707  				} else {
 43708  					v = b.String()
 43709  				}
 43710  			}
 43711  			a[i] = v
 43712  		}
 43713  		v = a
 43714  		s.UnknownStateFilters = v
 43715  	}
 43716  	{
 43717  		v := s.TransactionStates
 43718  		a := v
 43719  		var l int32
 43720  		if isFlexible {
 43721  			l = b.CompactArrayLen()
 43722  		} else {
 43723  			l = b.ArrayLen()
 43724  		}
 43725  		if !b.Ok() {
 43726  			return b.Complete()
 43727  		}
 43728  		a = a[:0]
 43729  		if l > 0 {
 43730  			a = append(a, make([]ListTransactionsResponseTransactionState, l)...)
 43731  		}
 43732  		for i := int32(0); i < l; i++ {
 43733  			v := &a[i]
 43734  			v.Default()
 43735  			s := v
 43736  			{
 43737  				var v string
 43738  				if unsafe {
 43739  					if isFlexible {
 43740  						v = b.UnsafeCompactString()
 43741  					} else {
 43742  						v = b.UnsafeString()
 43743  					}
 43744  				} else {
 43745  					if isFlexible {
 43746  						v = b.CompactString()
 43747  					} else {
 43748  						v = b.String()
 43749  					}
 43750  				}
 43751  				s.TransactionalID = v
 43752  			}
 43753  			{
 43754  				v := b.Int64()
 43755  				s.ProducerID = v
 43756  			}
 43757  			{
 43758  				var v string
 43759  				if unsafe {
 43760  					if isFlexible {
 43761  						v = b.UnsafeCompactString()
 43762  					} else {
 43763  						v = b.UnsafeString()
 43764  					}
 43765  				} else {
 43766  					if isFlexible {
 43767  						v = b.CompactString()
 43768  					} else {
 43769  						v = b.String()
 43770  					}
 43771  				}
 43772  				s.TransactionState = v
 43773  			}
 43774  			if isFlexible {
 43775  				s.UnknownTags = internalReadTags(&b)
 43776  			}
 43777  		}
 43778  		v = a
 43779  		s.TransactionStates = v
 43780  	}
 43781  	if isFlexible {
 43782  		s.UnknownTags = internalReadTags(&b)
 43783  	}
 43784  	return b.Complete()
 43785  }
 43786  
 43787  // NewPtrListTransactionsResponse returns a pointer to a default ListTransactionsResponse
 43788  // This is a shortcut for creating a new(struct) and calling Default yourself.
 43789  func NewPtrListTransactionsResponse() *ListTransactionsResponse {
 43790  	var v ListTransactionsResponse
 43791  	v.Default()
 43792  	return &v
 43793  }
 43794  
 43795  // Default sets any default fields. Calling this allows for future compatibility
 43796  // if new fields are added to ListTransactionsResponse.
 43797  func (v *ListTransactionsResponse) Default() {
 43798  }
 43799  
 43800  // NewListTransactionsResponse returns a default ListTransactionsResponse
 43801  // This is a shortcut for creating a struct and calling Default yourself.
 43802  func NewListTransactionsResponse() ListTransactionsResponse {
 43803  	var v ListTransactionsResponse
 43804  	v.Default()
 43805  	return v
 43806  }
 43807  
 43808  // For KIP-730, AllocateProducerIDsRequest is a broker-to-broker request that
 43809  // requests a block of producer IDs from the controller broker. This is more
 43810  // specifically introduced for raft, but allows for one more request to avoid
 43811  // zookeeper in the non-raft world as well.
 43812  type AllocateProducerIDsRequest struct {
 43813  	// Version is the version of this message used with a Kafka broker.
 43814  	Version int16
 43815  
 43816  	// The ID of the requesting broker.
 43817  	BrokerID int32
 43818  
 43819  	// The epoch of the requesting broker.
 43820  	//
 43821  	// This field has a default of -1.
 43822  	BrokerEpoch int64
 43823  
 43824  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 43825  	UnknownTags Tags
 43826  }
 43827  
 43828  func (*AllocateProducerIDsRequest) Key() int16                 { return 67 }
 43829  func (*AllocateProducerIDsRequest) MaxVersion() int16          { return 0 }
 43830  func (v *AllocateProducerIDsRequest) SetVersion(version int16) { v.Version = version }
 43831  func (v *AllocateProducerIDsRequest) GetVersion() int16        { return v.Version }
 43832  func (v *AllocateProducerIDsRequest) IsFlexible() bool         { return v.Version >= 0 }
 43833  func (v *AllocateProducerIDsRequest) ResponseKind() Response {
 43834  	r := &AllocateProducerIDsResponse{Version: v.Version}
 43835  	r.Default()
 43836  	return r
 43837  }
 43838  
 43839  // RequestWith is requests v on r and returns the response or an error.
 43840  // For sharded requests, the response may be merged and still return an error.
 43841  // It is better to rely on client.RequestSharded than to rely on proper merging behavior.
 43842  func (v *AllocateProducerIDsRequest) RequestWith(ctx context.Context, r Requestor) (*AllocateProducerIDsResponse, error) {
 43843  	kresp, err := r.Request(ctx, v)
 43844  	resp, _ := kresp.(*AllocateProducerIDsResponse)
 43845  	return resp, err
 43846  }
 43847  
 43848  func (v *AllocateProducerIDsRequest) AppendTo(dst []byte) []byte {
 43849  	version := v.Version
 43850  	_ = version
 43851  	isFlexible := version >= 0
 43852  	_ = isFlexible
 43853  	{
 43854  		v := v.BrokerID
 43855  		dst = kbin.AppendInt32(dst, v)
 43856  	}
 43857  	{
 43858  		v := v.BrokerEpoch
 43859  		dst = kbin.AppendInt64(dst, v)
 43860  	}
 43861  	if isFlexible {
 43862  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43863  		dst = v.UnknownTags.AppendEach(dst)
 43864  	}
 43865  	return dst
 43866  }
 43867  
 43868  func (v *AllocateProducerIDsRequest) ReadFrom(src []byte) error {
 43869  	return v.readFrom(src, false)
 43870  }
 43871  
 43872  func (v *AllocateProducerIDsRequest) UnsafeReadFrom(src []byte) error {
 43873  	return v.readFrom(src, true)
 43874  }
 43875  
 43876  func (v *AllocateProducerIDsRequest) readFrom(src []byte, unsafe bool) error {
 43877  	v.Default()
 43878  	b := kbin.Reader{Src: src}
 43879  	version := v.Version
 43880  	_ = version
 43881  	isFlexible := version >= 0
 43882  	_ = isFlexible
 43883  	s := v
 43884  	{
 43885  		v := b.Int32()
 43886  		s.BrokerID = v
 43887  	}
 43888  	{
 43889  		v := b.Int64()
 43890  		s.BrokerEpoch = v
 43891  	}
 43892  	if isFlexible {
 43893  		s.UnknownTags = internalReadTags(&b)
 43894  	}
 43895  	return b.Complete()
 43896  }
 43897  
 43898  // NewPtrAllocateProducerIDsRequest returns a pointer to a default AllocateProducerIDsRequest
 43899  // This is a shortcut for creating a new(struct) and calling Default yourself.
 43900  func NewPtrAllocateProducerIDsRequest() *AllocateProducerIDsRequest {
 43901  	var v AllocateProducerIDsRequest
 43902  	v.Default()
 43903  	return &v
 43904  }
 43905  
 43906  // Default sets any default fields. Calling this allows for future compatibility
 43907  // if new fields are added to AllocateProducerIDsRequest.
 43908  func (v *AllocateProducerIDsRequest) Default() {
 43909  	v.BrokerEpoch = -1
 43910  }
 43911  
 43912  // NewAllocateProducerIDsRequest returns a default AllocateProducerIDsRequest
 43913  // This is a shortcut for creating a struct and calling Default yourself.
 43914  func NewAllocateProducerIDsRequest() AllocateProducerIDsRequest {
 43915  	var v AllocateProducerIDsRequest
 43916  	v.Default()
 43917  	return v
 43918  }
 43919  
 43920  // AllocateProducerIDsResponse is a response to an AllocateProducerIDsRequest.
 43921  type AllocateProducerIDsResponse struct {
 43922  	// Version is the version of this message used with a Kafka broker.
 43923  	Version int16
 43924  
 43925  	// ThrottleMillis is how long of a throttle Kafka will apply to the client
 43926  	// after responding to this request.
 43927  	ThrottleMillis int32
 43928  
 43929  	// An error code, if any.
 43930  	ErrorCode int16
 43931  
 43932  	// The first producer ID in this range, inclusive.
 43933  	ProducerIDStart int64
 43934  
 43935  	// The number of producer IDs in this range.
 43936  	ProducerIDLen int32
 43937  
 43938  	// UnknownTags are tags Kafka sent that we do not know the purpose of.
 43939  	UnknownTags Tags
 43940  }
 43941  
 43942  func (*AllocateProducerIDsResponse) Key() int16                 { return 67 }
 43943  func (*AllocateProducerIDsResponse) MaxVersion() int16          { return 0 }
 43944  func (v *AllocateProducerIDsResponse) SetVersion(version int16) { v.Version = version }
 43945  func (v *AllocateProducerIDsResponse) GetVersion() int16        { return v.Version }
 43946  func (v *AllocateProducerIDsResponse) IsFlexible() bool         { return v.Version >= 0 }
 43947  func (v *AllocateProducerIDsResponse) Throttle() (int32, bool) {
 43948  	return v.ThrottleMillis, v.Version >= 0
 43949  }
 43950  
 43951  func (v *AllocateProducerIDsResponse) SetThrottle(throttleMillis int32) {
 43952  	v.ThrottleMillis = throttleMillis
 43953  }
 43954  
 43955  func (v *AllocateProducerIDsResponse) RequestKind() Request {
 43956  	return &AllocateProducerIDsRequest{Version: v.Version}
 43957  }
 43958  
 43959  func (v *AllocateProducerIDsResponse) AppendTo(dst []byte) []byte {
 43960  	version := v.Version
 43961  	_ = version
 43962  	isFlexible := version >= 0
 43963  	_ = isFlexible
 43964  	{
 43965  		v := v.ThrottleMillis
 43966  		dst = kbin.AppendInt32(dst, v)
 43967  	}
 43968  	{
 43969  		v := v.ErrorCode
 43970  		dst = kbin.AppendInt16(dst, v)
 43971  	}
 43972  	{
 43973  		v := v.ProducerIDStart
 43974  		dst = kbin.AppendInt64(dst, v)
 43975  	}
 43976  	{
 43977  		v := v.ProducerIDLen
 43978  		dst = kbin.AppendInt32(dst, v)
 43979  	}
 43980  	if isFlexible {
 43981  		dst = kbin.AppendUvarint(dst, 0+uint32(v.UnknownTags.Len()))
 43982  		dst = v.UnknownTags.AppendEach(dst)
 43983  	}
 43984  	return dst
 43985  }
 43986  
 43987  func (v *AllocateProducerIDsResponse) ReadFrom(src []byte) error {
 43988  	return v.readFrom(src, false)
 43989  }
 43990  
 43991  func (v *AllocateProducerIDsResponse) UnsafeReadFrom(src []byte) error {
 43992  	return v.readFrom(src, true)
 43993  }
 43994  
 43995  func (v *AllocateProducerIDsResponse) readFrom(src []byte, unsafe bool) error {
 43996  	v.Default()
 43997  	b := kbin.Reader{Src: src}
 43998  	version := v.Version
 43999  	_ = version
 44000  	isFlexible := version >= 0
 44001  	_ = isFlexible
 44002  	s := v
 44003  	{
 44004  		v := b.Int32()
 44005  		s.ThrottleMillis = v
 44006  	}
 44007  	{
 44008  		v := b.Int16()
 44009  		s.ErrorCode = v
 44010  	}
 44011  	{
 44012  		v := b.Int64()
 44013  		s.ProducerIDStart = v
 44014  	}
 44015  	{
 44016  		v := b.Int32()
 44017  		s.ProducerIDLen = v
 44018  	}
 44019  	if isFlexible {
 44020  		s.UnknownTags = internalReadTags(&b)
 44021  	}
 44022  	return b.Complete()
 44023  }
 44024  
 44025  // NewPtrAllocateProducerIDsResponse returns a pointer to a default AllocateProducerIDsResponse
 44026  // This is a shortcut for creating a new(struct) and calling Default yourself.
 44027  func NewPtrAllocateProducerIDsResponse() *AllocateProducerIDsResponse {
 44028  	var v AllocateProducerIDsResponse
 44029  	v.Default()
 44030  	return &v
 44031  }
 44032  
 44033  // Default sets any default fields. Calling this allows for future compatibility
 44034  // if new fields are added to AllocateProducerIDsResponse.
 44035  func (v *AllocateProducerIDsResponse) Default() {
 44036  }
 44037  
 44038  // NewAllocateProducerIDsResponse returns a default AllocateProducerIDsResponse
 44039  // This is a shortcut for creating a struct and calling Default yourself.
 44040  func NewAllocateProducerIDsResponse() AllocateProducerIDsResponse {
 44041  	var v AllocateProducerIDsResponse
 44042  	v.Default()
 44043  	return v
 44044  }
 44045  
 44046  // RequestForKey returns the request corresponding to the given request key
 44047  // or nil if the key is unknown.
 44048  func RequestForKey(key int16) Request {
 44049  	switch key {
 44050  	default:
 44051  		return nil
 44052  	case 0:
 44053  		return NewPtrProduceRequest()
 44054  	case 1:
 44055  		return NewPtrFetchRequest()
 44056  	case 2:
 44057  		return NewPtrListOffsetsRequest()
 44058  	case 3:
 44059  		return NewPtrMetadataRequest()
 44060  	case 4:
 44061  		return NewPtrLeaderAndISRRequest()
 44062  	case 5:
 44063  		return NewPtrStopReplicaRequest()
 44064  	case 6:
 44065  		return NewPtrUpdateMetadataRequest()
 44066  	case 7:
 44067  		return NewPtrControlledShutdownRequest()
 44068  	case 8:
 44069  		return NewPtrOffsetCommitRequest()
 44070  	case 9:
 44071  		return NewPtrOffsetFetchRequest()
 44072  	case 10:
 44073  		return NewPtrFindCoordinatorRequest()
 44074  	case 11:
 44075  		return NewPtrJoinGroupRequest()
 44076  	case 12:
 44077  		return NewPtrHeartbeatRequest()
 44078  	case 13:
 44079  		return NewPtrLeaveGroupRequest()
 44080  	case 14:
 44081  		return NewPtrSyncGroupRequest()
 44082  	case 15:
 44083  		return NewPtrDescribeGroupsRequest()
 44084  	case 16:
 44085  		return NewPtrListGroupsRequest()
 44086  	case 17:
 44087  		return NewPtrSASLHandshakeRequest()
 44088  	case 18:
 44089  		return NewPtrApiVersionsRequest()
 44090  	case 19:
 44091  		return NewPtrCreateTopicsRequest()
 44092  	case 20:
 44093  		return NewPtrDeleteTopicsRequest()
 44094  	case 21:
 44095  		return NewPtrDeleteRecordsRequest()
 44096  	case 22:
 44097  		return NewPtrInitProducerIDRequest()
 44098  	case 23:
 44099  		return NewPtrOffsetForLeaderEpochRequest()
 44100  	case 24:
 44101  		return NewPtrAddPartitionsToTxnRequest()
 44102  	case 25:
 44103  		return NewPtrAddOffsetsToTxnRequest()
 44104  	case 26:
 44105  		return NewPtrEndTxnRequest()
 44106  	case 27:
 44107  		return NewPtrWriteTxnMarkersRequest()
 44108  	case 28:
 44109  		return NewPtrTxnOffsetCommitRequest()
 44110  	case 29:
 44111  		return NewPtrDescribeACLsRequest()
 44112  	case 30:
 44113  		return NewPtrCreateACLsRequest()
 44114  	case 31:
 44115  		return NewPtrDeleteACLsRequest()
 44116  	case 32:
 44117  		return NewPtrDescribeConfigsRequest()
 44118  	case 33:
 44119  		return NewPtrAlterConfigsRequest()
 44120  	case 34:
 44121  		return NewPtrAlterReplicaLogDirsRequest()
 44122  	case 35:
 44123  		return NewPtrDescribeLogDirsRequest()
 44124  	case 36:
 44125  		return NewPtrSASLAuthenticateRequest()
 44126  	case 37:
 44127  		return NewPtrCreatePartitionsRequest()
 44128  	case 38:
 44129  		return NewPtrCreateDelegationTokenRequest()
 44130  	case 39:
 44131  		return NewPtrRenewDelegationTokenRequest()
 44132  	case 40:
 44133  		return NewPtrExpireDelegationTokenRequest()
 44134  	case 41:
 44135  		return NewPtrDescribeDelegationTokenRequest()
 44136  	case 42:
 44137  		return NewPtrDeleteGroupsRequest()
 44138  	case 43:
 44139  		return NewPtrElectLeadersRequest()
 44140  	case 44:
 44141  		return NewPtrIncrementalAlterConfigsRequest()
 44142  	case 45:
 44143  		return NewPtrAlterPartitionAssignmentsRequest()
 44144  	case 46:
 44145  		return NewPtrListPartitionReassignmentsRequest()
 44146  	case 47:
 44147  		return NewPtrOffsetDeleteRequest()
 44148  	case 48:
 44149  		return NewPtrDescribeClientQuotasRequest()
 44150  	case 49:
 44151  		return NewPtrAlterClientQuotasRequest()
 44152  	case 50:
 44153  		return NewPtrDescribeUserSCRAMCredentialsRequest()
 44154  	case 51:
 44155  		return NewPtrAlterUserSCRAMCredentialsRequest()
 44156  	case 52:
 44157  		return NewPtrVoteRequest()
 44158  	case 53:
 44159  		return NewPtrBeginQuorumEpochRequest()
 44160  	case 54:
 44161  		return NewPtrEndQuorumEpochRequest()
 44162  	case 55:
 44163  		return NewPtrDescribeQuorumRequest()
 44164  	case 56:
 44165  		return NewPtrAlterPartitionRequest()
 44166  	case 57:
 44167  		return NewPtrUpdateFeaturesRequest()
 44168  	case 58:
 44169  		return NewPtrEnvelopeRequest()
 44170  	case 59:
 44171  		return NewPtrFetchSnapshotRequest()
 44172  	case 60:
 44173  		return NewPtrDescribeClusterRequest()
 44174  	case 61:
 44175  		return NewPtrDescribeProducersRequest()
 44176  	case 62:
 44177  		return NewPtrBrokerRegistrationRequest()
 44178  	case 63:
 44179  		return NewPtrBrokerHeartbeatRequest()
 44180  	case 64:
 44181  		return NewPtrUnregisterBrokerRequest()
 44182  	case 65:
 44183  		return NewPtrDescribeTransactionsRequest()
 44184  	case 66:
 44185  		return NewPtrListTransactionsRequest()
 44186  	case 67:
 44187  		return NewPtrAllocateProducerIDsRequest()
 44188  	}
 44189  }
 44190  
 44191  // ResponseForKey returns the response corresponding to the given request key
 44192  // or nil if the key is unknown.
 44193  func ResponseForKey(key int16) Response {
 44194  	switch key {
 44195  	default:
 44196  		return nil
 44197  	case 0:
 44198  		return NewPtrProduceResponse()
 44199  	case 1:
 44200  		return NewPtrFetchResponse()
 44201  	case 2:
 44202  		return NewPtrListOffsetsResponse()
 44203  	case 3:
 44204  		return NewPtrMetadataResponse()
 44205  	case 4:
 44206  		return NewPtrLeaderAndISRResponse()
 44207  	case 5:
 44208  		return NewPtrStopReplicaResponse()
 44209  	case 6:
 44210  		return NewPtrUpdateMetadataResponse()
 44211  	case 7:
 44212  		return NewPtrControlledShutdownResponse()
 44213  	case 8:
 44214  		return NewPtrOffsetCommitResponse()
 44215  	case 9:
 44216  		return NewPtrOffsetFetchResponse()
 44217  	case 10:
 44218  		return NewPtrFindCoordinatorResponse()
 44219  	case 11:
 44220  		return NewPtrJoinGroupResponse()
 44221  	case 12:
 44222  		return NewPtrHeartbeatResponse()
 44223  	case 13:
 44224  		return NewPtrLeaveGroupResponse()
 44225  	case 14:
 44226  		return NewPtrSyncGroupResponse()
 44227  	case 15:
 44228  		return NewPtrDescribeGroupsResponse()
 44229  	case 16:
 44230  		return NewPtrListGroupsResponse()
 44231  	case 17:
 44232  		return NewPtrSASLHandshakeResponse()
 44233  	case 18:
 44234  		return NewPtrApiVersionsResponse()
 44235  	case 19:
 44236  		return NewPtrCreateTopicsResponse()
 44237  	case 20:
 44238  		return NewPtrDeleteTopicsResponse()
 44239  	case 21:
 44240  		return NewPtrDeleteRecordsResponse()
 44241  	case 22:
 44242  		return NewPtrInitProducerIDResponse()
 44243  	case 23:
 44244  		return NewPtrOffsetForLeaderEpochResponse()
 44245  	case 24:
 44246  		return NewPtrAddPartitionsToTxnResponse()
 44247  	case 25:
 44248  		return NewPtrAddOffsetsToTxnResponse()
 44249  	case 26:
 44250  		return NewPtrEndTxnResponse()
 44251  	case 27:
 44252  		return NewPtrWriteTxnMarkersResponse()
 44253  	case 28:
 44254  		return NewPtrTxnOffsetCommitResponse()
 44255  	case 29:
 44256  		return NewPtrDescribeACLsResponse()
 44257  	case 30:
 44258  		return NewPtrCreateACLsResponse()
 44259  	case 31:
 44260  		return NewPtrDeleteACLsResponse()
 44261  	case 32:
 44262  		return NewPtrDescribeConfigsResponse()
 44263  	case 33:
 44264  		return NewPtrAlterConfigsResponse()
 44265  	case 34:
 44266  		return NewPtrAlterReplicaLogDirsResponse()
 44267  	case 35:
 44268  		return NewPtrDescribeLogDirsResponse()
 44269  	case 36:
 44270  		return NewPtrSASLAuthenticateResponse()
 44271  	case 37:
 44272  		return NewPtrCreatePartitionsResponse()
 44273  	case 38:
 44274  		return NewPtrCreateDelegationTokenResponse()
 44275  	case 39:
 44276  		return NewPtrRenewDelegationTokenResponse()
 44277  	case 40:
 44278  		return NewPtrExpireDelegationTokenResponse()
 44279  	case 41:
 44280  		return NewPtrDescribeDelegationTokenResponse()
 44281  	case 42:
 44282  		return NewPtrDeleteGroupsResponse()
 44283  	case 43:
 44284  		return NewPtrElectLeadersResponse()
 44285  	case 44:
 44286  		return NewPtrIncrementalAlterConfigsResponse()
 44287  	case 45:
 44288  		return NewPtrAlterPartitionAssignmentsResponse()
 44289  	case 46:
 44290  		return NewPtrListPartitionReassignmentsResponse()
 44291  	case 47:
 44292  		return NewPtrOffsetDeleteResponse()
 44293  	case 48:
 44294  		return NewPtrDescribeClientQuotasResponse()
 44295  	case 49:
 44296  		return NewPtrAlterClientQuotasResponse()
 44297  	case 50:
 44298  		return NewPtrDescribeUserSCRAMCredentialsResponse()
 44299  	case 51:
 44300  		return NewPtrAlterUserSCRAMCredentialsResponse()
 44301  	case 52:
 44302  		return NewPtrVoteResponse()
 44303  	case 53:
 44304  		return NewPtrBeginQuorumEpochResponse()
 44305  	case 54:
 44306  		return NewPtrEndQuorumEpochResponse()
 44307  	case 55:
 44308  		return NewPtrDescribeQuorumResponse()
 44309  	case 56:
 44310  		return NewPtrAlterPartitionResponse()
 44311  	case 57:
 44312  		return NewPtrUpdateFeaturesResponse()
 44313  	case 58:
 44314  		return NewPtrEnvelopeResponse()
 44315  	case 59:
 44316  		return NewPtrFetchSnapshotResponse()
 44317  	case 60:
 44318  		return NewPtrDescribeClusterResponse()
 44319  	case 61:
 44320  		return NewPtrDescribeProducersResponse()
 44321  	case 62:
 44322  		return NewPtrBrokerRegistrationResponse()
 44323  	case 63:
 44324  		return NewPtrBrokerHeartbeatResponse()
 44325  	case 64:
 44326  		return NewPtrUnregisterBrokerResponse()
 44327  	case 65:
 44328  		return NewPtrDescribeTransactionsResponse()
 44329  	case 66:
 44330  		return NewPtrListTransactionsResponse()
 44331  	case 67:
 44332  		return NewPtrAllocateProducerIDsResponse()
 44333  	}
 44334  }
 44335  
 44336  // NameForKey returns the name (e.g., "Fetch") corresponding to a given request key
 44337  // or "" if the key is unknown.
 44338  func NameForKey(key int16) string {
 44339  	switch key {
 44340  	default:
 44341  		return "Unknown"
 44342  	case 0:
 44343  		return "Produce"
 44344  	case 1:
 44345  		return "Fetch"
 44346  	case 2:
 44347  		return "ListOffsets"
 44348  	case 3:
 44349  		return "Metadata"
 44350  	case 4:
 44351  		return "LeaderAndISR"
 44352  	case 5:
 44353  		return "StopReplica"
 44354  	case 6:
 44355  		return "UpdateMetadata"
 44356  	case 7:
 44357  		return "ControlledShutdown"
 44358  	case 8:
 44359  		return "OffsetCommit"
 44360  	case 9:
 44361  		return "OffsetFetch"
 44362  	case 10:
 44363  		return "FindCoordinator"
 44364  	case 11:
 44365  		return "JoinGroup"
 44366  	case 12:
 44367  		return "Heartbeat"
 44368  	case 13:
 44369  		return "LeaveGroup"
 44370  	case 14:
 44371  		return "SyncGroup"
 44372  	case 15:
 44373  		return "DescribeGroups"
 44374  	case 16:
 44375  		return "ListGroups"
 44376  	case 17:
 44377  		return "SASLHandshake"
 44378  	case 18:
 44379  		return "ApiVersions"
 44380  	case 19:
 44381  		return "CreateTopics"
 44382  	case 20:
 44383  		return "DeleteTopics"
 44384  	case 21:
 44385  		return "DeleteRecords"
 44386  	case 22:
 44387  		return "InitProducerID"
 44388  	case 23:
 44389  		return "OffsetForLeaderEpoch"
 44390  	case 24:
 44391  		return "AddPartitionsToTxn"
 44392  	case 25:
 44393  		return "AddOffsetsToTxn"
 44394  	case 26:
 44395  		return "EndTxn"
 44396  	case 27:
 44397  		return "WriteTxnMarkers"
 44398  	case 28:
 44399  		return "TxnOffsetCommit"
 44400  	case 29:
 44401  		return "DescribeACLs"
 44402  	case 30:
 44403  		return "CreateACLs"
 44404  	case 31:
 44405  		return "DeleteACLs"
 44406  	case 32:
 44407  		return "DescribeConfigs"
 44408  	case 33:
 44409  		return "AlterConfigs"
 44410  	case 34:
 44411  		return "AlterReplicaLogDirs"
 44412  	case 35:
 44413  		return "DescribeLogDirs"
 44414  	case 36:
 44415  		return "SASLAuthenticate"
 44416  	case 37:
 44417  		return "CreatePartitions"
 44418  	case 38:
 44419  		return "CreateDelegationToken"
 44420  	case 39:
 44421  		return "RenewDelegationToken"
 44422  	case 40:
 44423  		return "ExpireDelegationToken"
 44424  	case 41:
 44425  		return "DescribeDelegationToken"
 44426  	case 42:
 44427  		return "DeleteGroups"
 44428  	case 43:
 44429  		return "ElectLeaders"
 44430  	case 44:
 44431  		return "IncrementalAlterConfigs"
 44432  	case 45:
 44433  		return "AlterPartitionAssignments"
 44434  	case 46:
 44435  		return "ListPartitionReassignments"
 44436  	case 47:
 44437  		return "OffsetDelete"
 44438  	case 48:
 44439  		return "DescribeClientQuotas"
 44440  	case 49:
 44441  		return "AlterClientQuotas"
 44442  	case 50:
 44443  		return "DescribeUserSCRAMCredentials"
 44444  	case 51:
 44445  		return "AlterUserSCRAMCredentials"
 44446  	case 52:
 44447  		return "Vote"
 44448  	case 53:
 44449  		return "BeginQuorumEpoch"
 44450  	case 54:
 44451  		return "EndQuorumEpoch"
 44452  	case 55:
 44453  		return "DescribeQuorum"
 44454  	case 56:
 44455  		return "AlterPartition"
 44456  	case 57:
 44457  		return "UpdateFeatures"
 44458  	case 58:
 44459  		return "Envelope"
 44460  	case 59:
 44461  		return "FetchSnapshot"
 44462  	case 60:
 44463  		return "DescribeCluster"
 44464  	case 61:
 44465  		return "DescribeProducers"
 44466  	case 62:
 44467  		return "BrokerRegistration"
 44468  	case 63:
 44469  		return "BrokerHeartbeat"
 44470  	case 64:
 44471  		return "UnregisterBroker"
 44472  	case 65:
 44473  		return "DescribeTransactions"
 44474  	case 66:
 44475  		return "ListTransactions"
 44476  	case 67:
 44477  		return "AllocateProducerIDs"
 44478  	}
 44479  }
 44480  
 44481  // Key is a typed representation of a request key, with helper functions.
 44482  type Key int16
 44483  
 44484  const (
 44485  	Produce                      Key = 0
 44486  	Fetch                        Key = 1
 44487  	ListOffsets                  Key = 2
 44488  	Metadata                     Key = 3
 44489  	LeaderAndISR                 Key = 4
 44490  	StopReplica                  Key = 5
 44491  	UpdateMetadata               Key = 6
 44492  	ControlledShutdown           Key = 7
 44493  	OffsetCommit                 Key = 8
 44494  	OffsetFetch                  Key = 9
 44495  	FindCoordinator              Key = 10
 44496  	JoinGroup                    Key = 11
 44497  	Heartbeat                    Key = 12
 44498  	LeaveGroup                   Key = 13
 44499  	SyncGroup                    Key = 14
 44500  	DescribeGroups               Key = 15
 44501  	ListGroups                   Key = 16
 44502  	SASLHandshake                Key = 17
 44503  	ApiVersions                  Key = 18
 44504  	CreateTopics                 Key = 19
 44505  	DeleteTopics                 Key = 20
 44506  	DeleteRecords                Key = 21
 44507  	InitProducerID               Key = 22
 44508  	OffsetForLeaderEpoch         Key = 23
 44509  	AddPartitionsToTxn           Key = 24
 44510  	AddOffsetsToTxn              Key = 25
 44511  	EndTxn                       Key = 26
 44512  	WriteTxnMarkers              Key = 27
 44513  	TxnOffsetCommit              Key = 28
 44514  	DescribeACLs                 Key = 29
 44515  	CreateACLs                   Key = 30
 44516  	DeleteACLs                   Key = 31
 44517  	DescribeConfigs              Key = 32
 44518  	AlterConfigs                 Key = 33
 44519  	AlterReplicaLogDirs          Key = 34
 44520  	DescribeLogDirs              Key = 35
 44521  	SASLAuthenticate             Key = 36
 44522  	CreatePartitions             Key = 37
 44523  	CreateDelegationToken        Key = 38
 44524  	RenewDelegationToken         Key = 39
 44525  	ExpireDelegationToken        Key = 40
 44526  	DescribeDelegationToken      Key = 41
 44527  	DeleteGroups                 Key = 42
 44528  	ElectLeaders                 Key = 43
 44529  	IncrementalAlterConfigs      Key = 44
 44530  	AlterPartitionAssignments    Key = 45
 44531  	ListPartitionReassignments   Key = 46
 44532  	OffsetDelete                 Key = 47
 44533  	DescribeClientQuotas         Key = 48
 44534  	AlterClientQuotas            Key = 49
 44535  	DescribeUserSCRAMCredentials Key = 50
 44536  	AlterUserSCRAMCredentials    Key = 51
 44537  	Vote                         Key = 52
 44538  	BeginQuorumEpoch             Key = 53
 44539  	EndQuorumEpoch               Key = 54
 44540  	DescribeQuorum               Key = 55
 44541  	AlterPartition               Key = 56
 44542  	UpdateFeatures               Key = 57
 44543  	Envelope                     Key = 58
 44544  	FetchSnapshot                Key = 59
 44545  	DescribeCluster              Key = 60
 44546  	DescribeProducers            Key = 61
 44547  	BrokerRegistration           Key = 62
 44548  	BrokerHeartbeat              Key = 63
 44549  	UnregisterBroker             Key = 64
 44550  	DescribeTransactions         Key = 65
 44551  	ListTransactions             Key = 66
 44552  	AllocateProducerIDs          Key = 67
 44553  )
 44554  
 44555  // Name returns the name for this key.
 44556  func (k Key) Name() string { return NameForKey(int16(k)) }
 44557  
 44558  // Request returns a new request for this key if the key is known.
 44559  func (k Key) Request() Request { return RequestForKey(int16(k)) }
 44560  
 44561  // Response returns a new response for this key if the key is known.
 44562  func (k Key) Response() Response { return ResponseForKey(int16(k)) }
 44563  
 44564  // Int16 is an alias for int16(k).
 44565  func (k Key) Int16() int16 { return int16(k) }
 44566  
 44567  // A type of config.
 44568  //
 44569  // Possible values and their meanings:
 44570  //
 44571  // * 2 (TOPIC)
 44572  //
 44573  // * 4 (BROKER)
 44574  //
 44575  // * 8 (BROKER_LOGGER)
 44576  type ConfigResourceType int8
 44577  
 44578  func (v ConfigResourceType) String() string {
 44579  	switch v {
 44580  	default:
 44581  		return "UNKNOWN"
 44582  	case 2:
 44583  		return "TOPIC"
 44584  	case 4:
 44585  		return "BROKER"
 44586  	case 8:
 44587  		return "BROKER_LOGGER"
 44588  	}
 44589  }
 44590  
 44591  func ConfigResourceTypeStrings() []string {
 44592  	return []string{
 44593  		"TOPIC",
 44594  		"BROKER",
 44595  		"BROKER_LOGGER",
 44596  	}
 44597  }
 44598  
 44599  // ParseConfigResourceType normalizes the input s and returns
 44600  // the value represented by the string.
 44601  //
 44602  // Normalizing works by stripping all dots, underscores, and dashes,
 44603  // trimming spaces, and lowercasing.
 44604  func ParseConfigResourceType(s string) (ConfigResourceType, error) {
 44605  	switch strnorm(s) {
 44606  	case "topic":
 44607  		return 2, nil
 44608  	case "broker":
 44609  		return 4, nil
 44610  	case "brokerlogger":
 44611  		return 8, nil
 44612  	default:
 44613  		return 0, fmt.Errorf("ConfigResourceType: unable to parse %q", s)
 44614  	}
 44615  }
 44616  
 44617  const (
 44618  	ConfigResourceTypeUnknown      ConfigResourceType = 0
 44619  	ConfigResourceTypeTopic        ConfigResourceType = 2
 44620  	ConfigResourceTypeBroker       ConfigResourceType = 4
 44621  	ConfigResourceTypeBrokerLogger ConfigResourceType = 8
 44622  )
 44623  
 44624  // MarshalText implements encoding.TextMarshaler.
 44625  func (e ConfigResourceType) MarshalText() (text []byte, err error) {
 44626  	return []byte(e.String()), nil
 44627  }
 44628  
 44629  // UnmarshalText implements encoding.TextUnmarshaler.
 44630  func (e *ConfigResourceType) UnmarshalText(text []byte) error {
 44631  	v, err := ParseConfigResourceType(string(text))
 44632  	*e = v
 44633  	return err
 44634  }
 44635  
 44636  // Where a config entry is from. If there are no config synonyms,
 44637  // the source is DEFAULT_CONFIG.
 44638  //
 44639  // Possible values and their meanings:
 44640  //
 44641  // * 1 (DYNAMIC_TOPIC_CONFIG)
 44642  // Dynamic topic config for a specific topic.
 44643  //
 44644  // * 2 (DYNAMIC_BROKER_CONFIG)
 44645  // Dynamic broker config for a specific broker.
 44646  //
 44647  // * 3 (DYNAMIC_DEFAULT_BROKER_CONFIG)
 44648  // Dynamic broker config used as the default for all brokers in a cluster.
 44649  //
 44650  // * 4 (STATIC_BROKER_CONFIG)
 44651  // Static broker config provided at start up.
 44652  //
 44653  // * 5 (DEFAULT_CONFIG)
 44654  // Built-in default configuration for those that have defaults.
 44655  //
 44656  // * 6 (DYNAMIC_BROKER_LOGGER_CONFIG)
 44657  // Broker logger; see KIP-412.
 44658  type ConfigSource int8
 44659  
 44660  func (v ConfigSource) String() string {
 44661  	switch v {
 44662  	default:
 44663  		return "UNKNOWN"
 44664  	case 1:
 44665  		return "DYNAMIC_TOPIC_CONFIG"
 44666  	case 2:
 44667  		return "DYNAMIC_BROKER_CONFIG"
 44668  	case 3:
 44669  		return "DYNAMIC_DEFAULT_BROKER_CONFIG"
 44670  	case 4:
 44671  		return "STATIC_BROKER_CONFIG"
 44672  	case 5:
 44673  		return "DEFAULT_CONFIG"
 44674  	case 6:
 44675  		return "DYNAMIC_BROKER_LOGGER_CONFIG"
 44676  	}
 44677  }
 44678  
 44679  func ConfigSourceStrings() []string {
 44680  	return []string{
 44681  		"DYNAMIC_TOPIC_CONFIG",
 44682  		"DYNAMIC_BROKER_CONFIG",
 44683  		"DYNAMIC_DEFAULT_BROKER_CONFIG",
 44684  		"STATIC_BROKER_CONFIG",
 44685  		"DEFAULT_CONFIG",
 44686  		"DYNAMIC_BROKER_LOGGER_CONFIG",
 44687  	}
 44688  }
 44689  
 44690  // ParseConfigSource normalizes the input s and returns
 44691  // the value represented by the string.
 44692  //
 44693  // Normalizing works by stripping all dots, underscores, and dashes,
 44694  // trimming spaces, and lowercasing.
 44695  func ParseConfigSource(s string) (ConfigSource, error) {
 44696  	switch strnorm(s) {
 44697  	case "dynamictopicconfig":
 44698  		return 1, nil
 44699  	case "dynamicbrokerconfig":
 44700  		return 2, nil
 44701  	case "dynamicdefaultbrokerconfig":
 44702  		return 3, nil
 44703  	case "staticbrokerconfig":
 44704  		return 4, nil
 44705  	case "defaultconfig":
 44706  		return 5, nil
 44707  	case "dynamicbrokerloggerconfig":
 44708  		return 6, nil
 44709  	default:
 44710  		return 0, fmt.Errorf("ConfigSource: unable to parse %q", s)
 44711  	}
 44712  }
 44713  
 44714  const (
 44715  	ConfigSourceUnknown                    ConfigSource = 0
 44716  	ConfigSourceDynamicTopicConfig         ConfigSource = 1
 44717  	ConfigSourceDynamicBrokerConfig        ConfigSource = 2
 44718  	ConfigSourceDynamicDefaultBrokerConfig ConfigSource = 3
 44719  	ConfigSourceStaticBrokerConfig         ConfigSource = 4
 44720  	ConfigSourceDefaultConfig              ConfigSource = 5
 44721  	ConfigSourceDynamicBrokerLoggerConfig  ConfigSource = 6
 44722  )
 44723  
 44724  // MarshalText implements encoding.TextMarshaler.
 44725  func (e ConfigSource) MarshalText() (text []byte, err error) {
 44726  	return []byte(e.String()), nil
 44727  }
 44728  
 44729  // UnmarshalText implements encoding.TextUnmarshaler.
 44730  func (e *ConfigSource) UnmarshalText(text []byte) error {
 44731  	v, err := ParseConfigSource(string(text))
 44732  	*e = v
 44733  	return err
 44734  }
 44735  
 44736  // A configuration data type.
 44737  //
 44738  // Possible values and their meanings:
 44739  //
 44740  // * 1 (BOOLEAN)
 44741  //
 44742  // * 2 (STRING)
 44743  //
 44744  // * 3 (INT)
 44745  //
 44746  // * 4 (SHORT)
 44747  //
 44748  // * 5 (LONG)
 44749  //
 44750  // * 6 (DOUBLE)
 44751  //
 44752  // * 7 (LIST)
 44753  //
 44754  // * 8 (CLASS)
 44755  //
 44756  // * 9 (PASSWORD)
 44757  type ConfigType int8
 44758  
 44759  func (v ConfigType) String() string {
 44760  	switch v {
 44761  	default:
 44762  		return "UNKNOWN"
 44763  	case 1:
 44764  		return "BOOLEAN"
 44765  	case 2:
 44766  		return "STRING"
 44767  	case 3:
 44768  		return "INT"
 44769  	case 4:
 44770  		return "SHORT"
 44771  	case 5:
 44772  		return "LONG"
 44773  	case 6:
 44774  		return "DOUBLE"
 44775  	case 7:
 44776  		return "LIST"
 44777  	case 8:
 44778  		return "CLASS"
 44779  	case 9:
 44780  		return "PASSWORD"
 44781  	}
 44782  }
 44783  
 44784  func ConfigTypeStrings() []string {
 44785  	return []string{
 44786  		"BOOLEAN",
 44787  		"STRING",
 44788  		"INT",
 44789  		"SHORT",
 44790  		"LONG",
 44791  		"DOUBLE",
 44792  		"LIST",
 44793  		"CLASS",
 44794  		"PASSWORD",
 44795  	}
 44796  }
 44797  
 44798  // ParseConfigType normalizes the input s and returns
 44799  // the value represented by the string.
 44800  //
 44801  // Normalizing works by stripping all dots, underscores, and dashes,
 44802  // trimming spaces, and lowercasing.
 44803  func ParseConfigType(s string) (ConfigType, error) {
 44804  	switch strnorm(s) {
 44805  	case "boolean":
 44806  		return 1, nil
 44807  	case "string":
 44808  		return 2, nil
 44809  	case "int":
 44810  		return 3, nil
 44811  	case "short":
 44812  		return 4, nil
 44813  	case "long":
 44814  		return 5, nil
 44815  	case "double":
 44816  		return 6, nil
 44817  	case "list":
 44818  		return 7, nil
 44819  	case "class":
 44820  		return 8, nil
 44821  	case "password":
 44822  		return 9, nil
 44823  	default:
 44824  		return 0, fmt.Errorf("ConfigType: unable to parse %q", s)
 44825  	}
 44826  }
 44827  
 44828  const (
 44829  	ConfigTypeUnknown  ConfigType = 0
 44830  	ConfigTypeBoolean  ConfigType = 1
 44831  	ConfigTypeString   ConfigType = 2
 44832  	ConfigTypeInt      ConfigType = 3
 44833  	ConfigTypeShort    ConfigType = 4
 44834  	ConfigTypeLong     ConfigType = 5
 44835  	ConfigTypeDouble   ConfigType = 6
 44836  	ConfigTypeList     ConfigType = 7
 44837  	ConfigTypeClass    ConfigType = 8
 44838  	ConfigTypePassword ConfigType = 9
 44839  )
 44840  
 44841  // MarshalText implements encoding.TextMarshaler.
 44842  func (e ConfigType) MarshalText() (text []byte, err error) {
 44843  	return []byte(e.String()), nil
 44844  }
 44845  
 44846  // UnmarshalText implements encoding.TextUnmarshaler.
 44847  func (e *ConfigType) UnmarshalText(text []byte) error {
 44848  	v, err := ParseConfigType(string(text))
 44849  	*e = v
 44850  	return err
 44851  }
 44852  
 44853  // An incremental configuration operation.
 44854  //
 44855  // Possible values and their meanings:
 44856  //
 44857  // * 0 (SET)
 44858  //
 44859  // * 1 (DELETE)
 44860  //
 44861  // * 2 (APPEND)
 44862  //
 44863  // * 3 (SUBTRACT)
 44864  type IncrementalAlterConfigOp int8
 44865  
 44866  func (v IncrementalAlterConfigOp) String() string {
 44867  	switch v {
 44868  	default:
 44869  		return "UNKNOWN"
 44870  	case 0:
 44871  		return "SET"
 44872  	case 1:
 44873  		return "DELETE"
 44874  	case 2:
 44875  		return "APPEND"
 44876  	case 3:
 44877  		return "SUBTRACT"
 44878  	}
 44879  }
 44880  
 44881  func IncrementalAlterConfigOpStrings() []string {
 44882  	return []string{
 44883  		"SET",
 44884  		"DELETE",
 44885  		"APPEND",
 44886  		"SUBTRACT",
 44887  	}
 44888  }
 44889  
 44890  // ParseIncrementalAlterConfigOp normalizes the input s and returns
 44891  // the value represented by the string.
 44892  //
 44893  // Normalizing works by stripping all dots, underscores, and dashes,
 44894  // trimming spaces, and lowercasing.
 44895  func ParseIncrementalAlterConfigOp(s string) (IncrementalAlterConfigOp, error) {
 44896  	switch strnorm(s) {
 44897  	case "set":
 44898  		return 0, nil
 44899  	case "delete":
 44900  		return 1, nil
 44901  	case "append":
 44902  		return 2, nil
 44903  	case "subtract":
 44904  		return 3, nil
 44905  	default:
 44906  		return 0, fmt.Errorf("IncrementalAlterConfigOp: unable to parse %q", s)
 44907  	}
 44908  }
 44909  
 44910  const (
 44911  	IncrementalAlterConfigOpSet      IncrementalAlterConfigOp = 0
 44912  	IncrementalAlterConfigOpDelete   IncrementalAlterConfigOp = 1
 44913  	IncrementalAlterConfigOpAppend   IncrementalAlterConfigOp = 2
 44914  	IncrementalAlterConfigOpSubtract IncrementalAlterConfigOp = 3
 44915  )
 44916  
 44917  // MarshalText implements encoding.TextMarshaler.
 44918  func (e IncrementalAlterConfigOp) MarshalText() (text []byte, err error) {
 44919  	return []byte(e.String()), nil
 44920  }
 44921  
 44922  // UnmarshalText implements encoding.TextUnmarshaler.
 44923  func (e *IncrementalAlterConfigOp) UnmarshalText(text []byte) error {
 44924  	v, err := ParseIncrementalAlterConfigOp(string(text))
 44925  	*e = v
 44926  	return err
 44927  }
 44928  
 44929  // ACLResourceType is a type of resource to use for ACLs.
 44930  //
 44931  // Possible values and their meanings:
 44932  //
 44933  // * 1 (ANY)
 44934  //
 44935  // * 2 (TOPIC)
 44936  //
 44937  // * 3 (GROUP)
 44938  //
 44939  // * 4 (CLUSTER)
 44940  //
 44941  // * 5 (TRANSACTIONAL_ID)
 44942  //
 44943  // * 6 (DELEGATION_TOKEN)
 44944  //
 44945  // * 7 (USER)
 44946  type ACLResourceType int8
 44947  
 44948  func (v ACLResourceType) String() string {
 44949  	switch v {
 44950  	default:
 44951  		return "UNKNOWN"
 44952  	case 1:
 44953  		return "ANY"
 44954  	case 2:
 44955  		return "TOPIC"
 44956  	case 3:
 44957  		return "GROUP"
 44958  	case 4:
 44959  		return "CLUSTER"
 44960  	case 5:
 44961  		return "TRANSACTIONAL_ID"
 44962  	case 6:
 44963  		return "DELEGATION_TOKEN"
 44964  	case 7:
 44965  		return "USER"
 44966  	}
 44967  }
 44968  
 44969  func ACLResourceTypeStrings() []string {
 44970  	return []string{
 44971  		"ANY",
 44972  		"TOPIC",
 44973  		"GROUP",
 44974  		"CLUSTER",
 44975  		"TRANSACTIONAL_ID",
 44976  		"DELEGATION_TOKEN",
 44977  		"USER",
 44978  	}
 44979  }
 44980  
 44981  // ParseACLResourceType normalizes the input s and returns
 44982  // the value represented by the string.
 44983  //
 44984  // Normalizing works by stripping all dots, underscores, and dashes,
 44985  // trimming spaces, and lowercasing.
 44986  func ParseACLResourceType(s string) (ACLResourceType, error) {
 44987  	switch strnorm(s) {
 44988  	case "any":
 44989  		return 1, nil
 44990  	case "topic":
 44991  		return 2, nil
 44992  	case "group":
 44993  		return 3, nil
 44994  	case "cluster":
 44995  		return 4, nil
 44996  	case "transactionalid":
 44997  		return 5, nil
 44998  	case "delegationtoken":
 44999  		return 6, nil
 45000  	case "user":
 45001  		return 7, nil
 45002  	default:
 45003  		return 0, fmt.Errorf("ACLResourceType: unable to parse %q", s)
 45004  	}
 45005  }
 45006  
 45007  const (
 45008  	ACLResourceTypeUnknown         ACLResourceType = 0
 45009  	ACLResourceTypeAny             ACLResourceType = 1
 45010  	ACLResourceTypeTopic           ACLResourceType = 2
 45011  	ACLResourceTypeGroup           ACLResourceType = 3
 45012  	ACLResourceTypeCluster         ACLResourceType = 4
 45013  	ACLResourceTypeTransactionalId ACLResourceType = 5
 45014  	ACLResourceTypeDelegationToken ACLResourceType = 6
 45015  	ACLResourceTypeUser            ACLResourceType = 7
 45016  )
 45017  
 45018  // MarshalText implements encoding.TextMarshaler.
 45019  func (e ACLResourceType) MarshalText() (text []byte, err error) {
 45020  	return []byte(e.String()), nil
 45021  }
 45022  
 45023  // UnmarshalText implements encoding.TextUnmarshaler.
 45024  func (e *ACLResourceType) UnmarshalText(text []byte) error {
 45025  	v, err := ParseACLResourceType(string(text))
 45026  	*e = v
 45027  	return err
 45028  }
 45029  
 45030  // ACLResourcePatternType is how an acl's ResourceName is understood.
 45031  //
 45032  // This field was added with Kafka 2.0.0 for KIP-290.
 45033  //
 45034  // Possible values and their meanings:
 45035  //
 45036  // * 1 (ANY)
 45037  // Matches anything.
 45038  //
 45039  // * 2 (MATCH)
 45040  // Performs pattern matching; i.e., a literal match, or a prefix match, or wildcard.
 45041  //
 45042  // * 3 (LITERAL)
 45043  // The name must be an exact match.
 45044  //
 45045  // * 4 (PREFIXED)
 45046  // The name must have our requested name as a prefix (that is, "foo" will match on "foobar").
 45047  type ACLResourcePatternType int8
 45048  
 45049  func (v ACLResourcePatternType) String() string {
 45050  	switch v {
 45051  	default:
 45052  		return "UNKNOWN"
 45053  	case 1:
 45054  		return "ANY"
 45055  	case 2:
 45056  		return "MATCH"
 45057  	case 3:
 45058  		return "LITERAL"
 45059  	case 4:
 45060  		return "PREFIXED"
 45061  	}
 45062  }
 45063  
 45064  func ACLResourcePatternTypeStrings() []string {
 45065  	return []string{
 45066  		"ANY",
 45067  		"MATCH",
 45068  		"LITERAL",
 45069  		"PREFIXED",
 45070  	}
 45071  }
 45072  
 45073  // ParseACLResourcePatternType normalizes the input s and returns
 45074  // the value represented by the string.
 45075  //
 45076  // Normalizing works by stripping all dots, underscores, and dashes,
 45077  // trimming spaces, and lowercasing.
 45078  func ParseACLResourcePatternType(s string) (ACLResourcePatternType, error) {
 45079  	switch strnorm(s) {
 45080  	case "any":
 45081  		return 1, nil
 45082  	case "match":
 45083  		return 2, nil
 45084  	case "literal":
 45085  		return 3, nil
 45086  	case "prefixed":
 45087  		return 4, nil
 45088  	default:
 45089  		return 0, fmt.Errorf("ACLResourcePatternType: unable to parse %q", s)
 45090  	}
 45091  }
 45092  
 45093  const (
 45094  	ACLResourcePatternTypeUnknown  ACLResourcePatternType = 0
 45095  	ACLResourcePatternTypeAny      ACLResourcePatternType = 1
 45096  	ACLResourcePatternTypeMatch    ACLResourcePatternType = 2
 45097  	ACLResourcePatternTypeLiteral  ACLResourcePatternType = 3
 45098  	ACLResourcePatternTypePrefixed ACLResourcePatternType = 4
 45099  )
 45100  
 45101  // MarshalText implements encoding.TextMarshaler.
 45102  func (e ACLResourcePatternType) MarshalText() (text []byte, err error) {
 45103  	return []byte(e.String()), nil
 45104  }
 45105  
 45106  // UnmarshalText implements encoding.TextUnmarshaler.
 45107  func (e *ACLResourcePatternType) UnmarshalText(text []byte) error {
 45108  	v, err := ParseACLResourcePatternType(string(text))
 45109  	*e = v
 45110  	return err
 45111  }
 45112  
 45113  // An ACL permission type.
 45114  //
 45115  // Possible values and their meanings:
 45116  //
 45117  // * 1 (ANY)
 45118  // Any permission.
 45119  //
 45120  // * 2 (DENY)
 45121  // Any deny permission.
 45122  //
 45123  // * 3 (ALLOW)
 45124  // Any allow permission.
 45125  type ACLPermissionType int8
 45126  
 45127  func (v ACLPermissionType) String() string {
 45128  	switch v {
 45129  	default:
 45130  		return "UNKNOWN"
 45131  	case 1:
 45132  		return "ANY"
 45133  	case 2:
 45134  		return "DENY"
 45135  	case 3:
 45136  		return "ALLOW"
 45137  	}
 45138  }
 45139  
 45140  func ACLPermissionTypeStrings() []string {
 45141  	return []string{
 45142  		"ANY",
 45143  		"DENY",
 45144  		"ALLOW",
 45145  	}
 45146  }
 45147  
 45148  // ParseACLPermissionType normalizes the input s and returns
 45149  // the value represented by the string.
 45150  //
 45151  // Normalizing works by stripping all dots, underscores, and dashes,
 45152  // trimming spaces, and lowercasing.
 45153  func ParseACLPermissionType(s string) (ACLPermissionType, error) {
 45154  	switch strnorm(s) {
 45155  	case "any":
 45156  		return 1, nil
 45157  	case "deny":
 45158  		return 2, nil
 45159  	case "allow":
 45160  		return 3, nil
 45161  	default:
 45162  		return 0, fmt.Errorf("ACLPermissionType: unable to parse %q", s)
 45163  	}
 45164  }
 45165  
 45166  const (
 45167  	ACLPermissionTypeUnknown ACLPermissionType = 0
 45168  	ACLPermissionTypeAny     ACLPermissionType = 1
 45169  	ACLPermissionTypeDeny    ACLPermissionType = 2
 45170  	ACLPermissionTypeAllow   ACLPermissionType = 3
 45171  )
 45172  
 45173  // MarshalText implements encoding.TextMarshaler.
 45174  func (e ACLPermissionType) MarshalText() (text []byte, err error) {
 45175  	return []byte(e.String()), nil
 45176  }
 45177  
 45178  // UnmarshalText implements encoding.TextUnmarshaler.
 45179  func (e *ACLPermissionType) UnmarshalText(text []byte) error {
 45180  	v, err := ParseACLPermissionType(string(text))
 45181  	*e = v
 45182  	return err
 45183  }
 45184  
 45185  // An ACL operation.
 45186  //
 45187  // Possible values and their meanings:
 45188  //
 45189  // * 1 (ANY)
 45190  // Matches anything.
 45191  //
 45192  // * 2 (ALL)
 45193  // Matches anything granted all permissions.
 45194  //
 45195  // * 3 (READ)
 45196  //
 45197  // * 4 (WRITE)
 45198  //
 45199  // * 5 (CREATE)
 45200  //
 45201  // * 6 (DELETE)
 45202  //
 45203  // * 7 (ALTER)
 45204  //
 45205  // * 8 (DESCRIBE)
 45206  //
 45207  // * 9 (CLUSTER_ACTION)
 45208  //
 45209  // * 10 (DESCRIBE_CONFIGS)
 45210  //
 45211  // * 11 (ALTER_CONFIGS)
 45212  //
 45213  // * 12 (IDEMPOTENT_WRITE)
 45214  //
 45215  // * 13 (CREATE_TOKENS)
 45216  //
 45217  // * 14 (DESCRIBE_TOKENS)
 45218  type ACLOperation int8
 45219  
 45220  func (v ACLOperation) String() string {
 45221  	switch v {
 45222  	default:
 45223  		return "UNKNOWN"
 45224  	case 1:
 45225  		return "ANY"
 45226  	case 2:
 45227  		return "ALL"
 45228  	case 3:
 45229  		return "READ"
 45230  	case 4:
 45231  		return "WRITE"
 45232  	case 5:
 45233  		return "CREATE"
 45234  	case 6:
 45235  		return "DELETE"
 45236  	case 7:
 45237  		return "ALTER"
 45238  	case 8:
 45239  		return "DESCRIBE"
 45240  	case 9:
 45241  		return "CLUSTER_ACTION"
 45242  	case 10:
 45243  		return "DESCRIBE_CONFIGS"
 45244  	case 11:
 45245  		return "ALTER_CONFIGS"
 45246  	case 12:
 45247  		return "IDEMPOTENT_WRITE"
 45248  	case 13:
 45249  		return "CREATE_TOKENS"
 45250  	case 14:
 45251  		return "DESCRIBE_TOKENS"
 45252  	}
 45253  }
 45254  
 45255  func ACLOperationStrings() []string {
 45256  	return []string{
 45257  		"ANY",
 45258  		"ALL",
 45259  		"READ",
 45260  		"WRITE",
 45261  		"CREATE",
 45262  		"DELETE",
 45263  		"ALTER",
 45264  		"DESCRIBE",
 45265  		"CLUSTER_ACTION",
 45266  		"DESCRIBE_CONFIGS",
 45267  		"ALTER_CONFIGS",
 45268  		"IDEMPOTENT_WRITE",
 45269  		"CREATE_TOKENS",
 45270  		"DESCRIBE_TOKENS",
 45271  	}
 45272  }
 45273  
 45274  // ParseACLOperation normalizes the input s and returns
 45275  // the value represented by the string.
 45276  //
 45277  // Normalizing works by stripping all dots, underscores, and dashes,
 45278  // trimming spaces, and lowercasing.
 45279  func ParseACLOperation(s string) (ACLOperation, error) {
 45280  	switch strnorm(s) {
 45281  	case "any":
 45282  		return 1, nil
 45283  	case "all":
 45284  		return 2, nil
 45285  	case "read":
 45286  		return 3, nil
 45287  	case "write":
 45288  		return 4, nil
 45289  	case "create":
 45290  		return 5, nil
 45291  	case "delete":
 45292  		return 6, nil
 45293  	case "alter":
 45294  		return 7, nil
 45295  	case "describe":
 45296  		return 8, nil
 45297  	case "clusteraction":
 45298  		return 9, nil
 45299  	case "describeconfigs":
 45300  		return 10, nil
 45301  	case "alterconfigs":
 45302  		return 11, nil
 45303  	case "idempotentwrite":
 45304  		return 12, nil
 45305  	case "createtokens":
 45306  		return 13, nil
 45307  	case "describetokens":
 45308  		return 14, nil
 45309  	default:
 45310  		return 0, fmt.Errorf("ACLOperation: unable to parse %q", s)
 45311  	}
 45312  }
 45313  
 45314  const (
 45315  	ACLOperationUnknown         ACLOperation = 0
 45316  	ACLOperationAny             ACLOperation = 1
 45317  	ACLOperationAll             ACLOperation = 2
 45318  	ACLOperationRead            ACLOperation = 3
 45319  	ACLOperationWrite           ACLOperation = 4
 45320  	ACLOperationCreate          ACLOperation = 5
 45321  	ACLOperationDelete          ACLOperation = 6
 45322  	ACLOperationAlter           ACLOperation = 7
 45323  	ACLOperationDescribe        ACLOperation = 8
 45324  	ACLOperationClusterAction   ACLOperation = 9
 45325  	ACLOperationDescribeConfigs ACLOperation = 10
 45326  	ACLOperationAlterConfigs    ACLOperation = 11
 45327  	ACLOperationIdempotentWrite ACLOperation = 12
 45328  	ACLOperationCreateTokens    ACLOperation = 13
 45329  	ACLOperationDescribeTokens  ACLOperation = 14
 45330  )
 45331  
 45332  // MarshalText implements encoding.TextMarshaler.
 45333  func (e ACLOperation) MarshalText() (text []byte, err error) {
 45334  	return []byte(e.String()), nil
 45335  }
 45336  
 45337  // UnmarshalText implements encoding.TextUnmarshaler.
 45338  func (e *ACLOperation) UnmarshalText(text []byte) error {
 45339  	v, err := ParseACLOperation(string(text))
 45340  	*e = v
 45341  	return err
 45342  }
 45343  
 45344  // TransactionState is the state of a transaction.
 45345  //
 45346  // Possible values and their meanings:
 45347  //
 45348  // * 0 (Empty)
 45349  //
 45350  // * 1 (Ongoing)
 45351  //
 45352  // * 2 (PrepareCommit)
 45353  //
 45354  // * 3 (PrepareAbort)
 45355  //
 45356  // * 4 (CompleteCommit)
 45357  //
 45358  // * 5 (CompleteAbort)
 45359  //
 45360  // * 6 (Dead)
 45361  //
 45362  // * 7 (PrepareEpochFence)
 45363  type TransactionState int8
 45364  
 45365  func (v TransactionState) String() string {
 45366  	switch v {
 45367  	default:
 45368  		return "Unknown"
 45369  	case 0:
 45370  		return "Empty"
 45371  	case 1:
 45372  		return "Ongoing"
 45373  	case 2:
 45374  		return "PrepareCommit"
 45375  	case 3:
 45376  		return "PrepareAbort"
 45377  	case 4:
 45378  		return "CompleteCommit"
 45379  	case 5:
 45380  		return "CompleteAbort"
 45381  	case 6:
 45382  		return "Dead"
 45383  	case 7:
 45384  		return "PrepareEpochFence"
 45385  	}
 45386  }
 45387  
 45388  func TransactionStateStrings() []string {
 45389  	return []string{
 45390  		"Empty",
 45391  		"Ongoing",
 45392  		"PrepareCommit",
 45393  		"PrepareAbort",
 45394  		"CompleteCommit",
 45395  		"CompleteAbort",
 45396  		"Dead",
 45397  		"PrepareEpochFence",
 45398  	}
 45399  }
 45400  
 45401  // ParseTransactionState normalizes the input s and returns
 45402  // the value represented by the string.
 45403  //
 45404  // Normalizing works by stripping all dots, underscores, and dashes,
 45405  // trimming spaces, and lowercasing.
 45406  func ParseTransactionState(s string) (TransactionState, error) {
 45407  	switch strnorm(s) {
 45408  	case "empty":
 45409  		return 0, nil
 45410  	case "ongoing":
 45411  		return 1, nil
 45412  	case "preparecommit":
 45413  		return 2, nil
 45414  	case "prepareabort":
 45415  		return 3, nil
 45416  	case "completecommit":
 45417  		return 4, nil
 45418  	case "completeabort":
 45419  		return 5, nil
 45420  	case "dead":
 45421  		return 6, nil
 45422  	case "prepareepochfence":
 45423  		return 7, nil
 45424  	default:
 45425  		return 0, fmt.Errorf("TransactionState: unable to parse %q", s)
 45426  	}
 45427  }
 45428  
 45429  const (
 45430  	TransactionStateEmpty             TransactionState = 0
 45431  	TransactionStateOngoing           TransactionState = 1
 45432  	TransactionStatePrepareCommit     TransactionState = 2
 45433  	TransactionStatePrepareAbort      TransactionState = 3
 45434  	TransactionStateCompleteCommit    TransactionState = 4
 45435  	TransactionStateCompleteAbort     TransactionState = 5
 45436  	TransactionStateDead              TransactionState = 6
 45437  	TransactionStatePrepareEpochFence TransactionState = 7
 45438  )
 45439  
 45440  // MarshalText implements encoding.TextMarshaler.
 45441  func (e TransactionState) MarshalText() (text []byte, err error) {
 45442  	return []byte(e.String()), nil
 45443  }
 45444  
 45445  // UnmarshalText implements encoding.TextUnmarshaler.
 45446  func (e *TransactionState) UnmarshalText(text []byte) error {
 45447  	v, err := ParseTransactionState(string(text))
 45448  	*e = v
 45449  	return err
 45450  }
 45451  
 45452  // QuotasMatchType specifies how to match a Quota entity as part of the DescribeClientQuotasRequestComponent.
 45453  //
 45454  // Possible values and their meanings:
 45455  //
 45456  // * 0 (EXACT)
 45457  // Matches all quotas for the given EntityType with names equal to the Match field.
 45458  //
 45459  // * 1 (DEFAULT)
 45460  // Matches the default for the given EntityType.
 45461  //
 45462  // * 2 (ANY)
 45463  // Matches all named quotas and default quotas for the given EntityType.
 45464  type QuotasMatchType int8
 45465  
 45466  func (v QuotasMatchType) String() string {
 45467  	switch v {
 45468  	default:
 45469  		return "UNKNOWN"
 45470  	case 0:
 45471  		return "EXACT"
 45472  	case 1:
 45473  		return "DEFAULT"
 45474  	case 2:
 45475  		return "ANY"
 45476  	}
 45477  }
 45478  
 45479  func QuotasMatchTypeStrings() []string {
 45480  	return []string{
 45481  		"EXACT",
 45482  		"DEFAULT",
 45483  		"ANY",
 45484  	}
 45485  }
 45486  
 45487  // ParseQuotasMatchType normalizes the input s and returns
 45488  // the value represented by the string.
 45489  //
 45490  // Normalizing works by stripping all dots, underscores, and dashes,
 45491  // trimming spaces, and lowercasing.
 45492  func ParseQuotasMatchType(s string) (QuotasMatchType, error) {
 45493  	switch strnorm(s) {
 45494  	case "exact":
 45495  		return 0, nil
 45496  	case "default":
 45497  		return 1, nil
 45498  	case "any":
 45499  		return 2, nil
 45500  	default:
 45501  		return 0, fmt.Errorf("QuotasMatchType: unable to parse %q", s)
 45502  	}
 45503  }
 45504  
 45505  const (
 45506  	QuotasMatchTypeExact   QuotasMatchType = 0
 45507  	QuotasMatchTypeDefault QuotasMatchType = 1
 45508  	QuotasMatchTypeAny     QuotasMatchType = 2
 45509  )
 45510  
 45511  // MarshalText implements encoding.TextMarshaler.
 45512  func (e QuotasMatchType) MarshalText() (text []byte, err error) {
 45513  	return []byte(e.String()), nil
 45514  }
 45515  
 45516  // UnmarshalText implements encoding.TextUnmarshaler.
 45517  func (e *QuotasMatchType) UnmarshalText(text []byte) error {
 45518  	v, err := ParseQuotasMatchType(string(text))
 45519  	*e = v
 45520  	return err
 45521  }
 45522  
 45523  // Possible values and their meanings:
 45524  //
 45525  // * 0 (ABORT)
 45526  //
 45527  // * 1 (COMMIT)
 45528  //
 45529  // * 2 (QUORUM_REASSIGNMENT)
 45530  //
 45531  // * 3 (LEADER_CHANGE)
 45532  type ControlRecordKeyType int8
 45533  
 45534  func (v ControlRecordKeyType) String() string {
 45535  	switch v {
 45536  	default:
 45537  		return "UNKNOWN"
 45538  	case 0:
 45539  		return "ABORT"
 45540  	case 1:
 45541  		return "COMMIT"
 45542  	case 2:
 45543  		return "QUORUM_REASSIGNMENT"
 45544  	case 3:
 45545  		return "LEADER_CHANGE"
 45546  	}
 45547  }
 45548  
 45549  func ControlRecordKeyTypeStrings() []string {
 45550  	return []string{
 45551  		"ABORT",
 45552  		"COMMIT",
 45553  		"QUORUM_REASSIGNMENT",
 45554  		"LEADER_CHANGE",
 45555  	}
 45556  }
 45557  
 45558  // ParseControlRecordKeyType normalizes the input s and returns
 45559  // the value represented by the string.
 45560  //
 45561  // Normalizing works by stripping all dots, underscores, and dashes,
 45562  // trimming spaces, and lowercasing.
 45563  func ParseControlRecordKeyType(s string) (ControlRecordKeyType, error) {
 45564  	switch strnorm(s) {
 45565  	case "abort":
 45566  		return 0, nil
 45567  	case "commit":
 45568  		return 1, nil
 45569  	case "quorumreassignment":
 45570  		return 2, nil
 45571  	case "leaderchange":
 45572  		return 3, nil
 45573  	default:
 45574  		return 0, fmt.Errorf("ControlRecordKeyType: unable to parse %q", s)
 45575  	}
 45576  }
 45577  
 45578  const (
 45579  	ControlRecordKeyTypeAbort              ControlRecordKeyType = 0
 45580  	ControlRecordKeyTypeCommit             ControlRecordKeyType = 1
 45581  	ControlRecordKeyTypeQuorumReassignment ControlRecordKeyType = 2
 45582  	ControlRecordKeyTypeLeaderChange       ControlRecordKeyType = 3
 45583  )
 45584  
 45585  // MarshalText implements encoding.TextMarshaler.
 45586  func (e ControlRecordKeyType) MarshalText() (text []byte, err error) {
 45587  	return []byte(e.String()), nil
 45588  }
 45589  
 45590  // UnmarshalText implements encoding.TextUnmarshaler.
 45591  func (e *ControlRecordKeyType) UnmarshalText(text []byte) error {
 45592  	v, err := ParseControlRecordKeyType(string(text))
 45593  	*e = v
 45594  	return err
 45595  }
 45596  
 45597  func strnorm(s string) string {
 45598  	s = strings.ReplaceAll(s, ".", "")
 45599  	s = strings.ReplaceAll(s, "_", "")
 45600  	s = strings.ReplaceAll(s, "-", "")
 45601  	s = strings.TrimSpace(s)
 45602  	s = strings.ToLower(s)
 45603  	return s
 45604  }
 45605  

View as plain text