content: -------------------------------------------------------------------------------
  -- Autogenerated by kafka message json schema
  --
  -- $ ./script/kafka_gen.py run
  --
  -- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  
  {-# LANGUAGE DataKinds             #-}
  {-# LANGUAGE DuplicateRecordFields #-}
  {-# LANGUAGE TypeFamilies          #-}
  
  module Kafka.Protocol.Message.Struct where
  
  import           Data.ByteString         (ByteString)
  import           Data.Int
  import           Data.Text               (Text)
  import           GHC.Generics
  
  import           Kafka.Protocol.Encoding
  import           Kafka.Protocol.Error
  import           Kafka.Protocol.Service
  
  -------------------------------------------------------------------------------
  
  data ApiVersionV0 = ApiVersionV0
    { apiKey     :: {-# UNPACK #-} !ApiKey
      -- ^ The API index.
    , minVersion :: {-# UNPACK #-} !Int16
      -- ^ The minimum supported version, inclusive.
    , maxVersion :: {-# UNPACK #-} !Int16
      -- ^ The maximum supported version, inclusive.
    } deriving (Show, Eq, Generic)
  instance Serializable ApiVersionV0
  
  type ApiVersionV1 = ApiVersionV0
  
  type ApiVersionV2 = ApiVersionV0
  
  data ApiVersionV3 = ApiVersionV3
    { apiKey       :: {-# UNPACK #-} !ApiKey
      -- ^ The API index.
    , minVersion   :: {-# UNPACK #-} !Int16
      -- ^ The minimum supported version, inclusive.
    , maxVersion   :: {-# UNPACK #-} !Int16
      -- ^ The maximum supported version, inclusive.
    , taggedFields :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable ApiVersionV3
  
  data SupportedFeatureKeyV3 = SupportedFeatureKeyV3
    { name         :: !CompactString
      -- ^ The name of the feature.
    , minVersion   :: {-# UNPACK #-} !Int16
      -- ^ The minimum supported version for the feature.
    , maxVersion   :: {-# UNPACK #-} !Int16
      -- ^ The maximum supported version for the feature.
    , taggedFields :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable SupportedFeatureKeyV3
  
  data FinalizedFeatureKeyV3 = FinalizedFeatureKeyV3
    { name            :: !CompactString
      -- ^ The name of the feature.
    , maxVersionLevel :: {-# UNPACK #-} !Int16
      -- ^ The cluster-wide finalized max version level for the feature.
    , minVersionLevel :: {-# UNPACK #-} !Int16
      -- ^ The cluster-wide finalized min version level for the feature.
    , taggedFields    :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable FinalizedFeatureKeyV3
  
  data AclCreationV0 = AclCreationV0
    { resourceType   :: {-# UNPACK #-} !Int8
      -- ^ The type of the resource.
    , resourceName   :: !Text
      -- ^ The resource name for the ACL.
    , principal      :: !Text
      -- ^ The principal for the ACL.
    , host           :: !Text
      -- ^ The host for the ACL.
    , operation      :: {-# UNPACK #-} !Int8
      -- ^ The operation type for the ACL (read, write, etc.).
    , permissionType :: {-# UNPACK #-} !Int8
      -- ^ The permission type for the ACL (allow, deny, etc.).
    } deriving (Show, Eq, Generic)
  instance Serializable AclCreationV0
  
  data AclCreationResultV0 = AclCreationResultV0
    { errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The result error, or zero if there was no error.
    , errorMessage :: !NullableString
      -- ^ The result message, or null if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable AclCreationResultV0
  
  newtype CreatePartitionsAssignmentV0 = CreatePartitionsAssignmentV0
    { brokerIds :: (KaArray Int32)
    } deriving (Show, Eq, Generic)
  instance Serializable CreatePartitionsAssignmentV0
  
  data CreatePartitionsTopicV0 = CreatePartitionsTopicV0
    { name        :: !Text
      -- ^ The topic name.
    , count       :: {-# UNPACK #-} !Int32
      -- ^ The new partition count.
    , assignments :: !(KaArray CreatePartitionsAssignmentV0)
      -- ^ The new partition assignments.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatePartitionsTopicV0
  
  type CreatePartitionsAssignmentV1 = CreatePartitionsAssignmentV0
  
  type CreatePartitionsTopicV1 = CreatePartitionsTopicV0
  
  data CreatePartitionsTopicResultV0 = CreatePartitionsTopicResultV0
    { name         :: !Text
      -- ^ The topic name.
    , errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The result error, or zero if there was no error.
    , errorMessage :: !NullableString
      -- ^ The result message, or null if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatePartitionsTopicResultV0
  
  type CreatePartitionsTopicResultV1 = CreatePartitionsTopicResultV0
  
  data CreatableReplicaAssignmentV0 = CreatableReplicaAssignmentV0
    { partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , brokerIds      :: !(KaArray Int32)
      -- ^ The brokers to place the partition on.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatableReplicaAssignmentV0
  
  data CreateableTopicConfigV0 = CreateableTopicConfigV0
    { name  :: !Text
      -- ^ The configuration name.
    , value :: !NullableString
      -- ^ The configuration value.
    } deriving (Show, Eq, Generic)
  instance Serializable CreateableTopicConfigV0
  
  data CreatableTopicV0 = CreatableTopicV0
    { name              :: !Text
      -- ^ The topic name.
    , numPartitions     :: {-# UNPACK #-} !Int32
      -- ^ The number of partitions to create in the topic, or -1 if we are
      -- either specifying a manual partition assignment or using the default
      -- partitions.
    , replicationFactor :: {-# UNPACK #-} !Int16
      -- ^ The number of replicas to create for each partition in the topic, or
      -- -1 if we are either specifying a manual partition assignment or using
      -- the default replication factor.
    , assignments       :: !(KaArray CreatableReplicaAssignmentV0)
      -- ^ The manual partition assignment, or the empty array if we are using
      -- automatic assignment.
    , configs           :: !(KaArray CreateableTopicConfigV0)
      -- ^ The custom topic configurations to set.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatableTopicV0
  
  type CreatableReplicaAssignmentV1 = CreatableReplicaAssignmentV0
  
  type CreateableTopicConfigV1 = CreateableTopicConfigV0
  
  type CreatableTopicV1 = CreatableTopicV0
  
  type CreatableReplicaAssignmentV2 = CreatableReplicaAssignmentV0
  
  type CreateableTopicConfigV2 = CreateableTopicConfigV0
  
  type CreatableTopicV2 = CreatableTopicV0
  
  data CreatableTopicResultV0 = CreatableTopicResultV0
    { name      :: !Text
      -- ^ The topic name.
    , errorCode :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatableTopicResultV0
  
  data CreatableTopicResultV1 = CreatableTopicResultV1
    { name         :: !Text
      -- ^ The topic name.
    , errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , errorMessage :: !NullableString
      -- ^ The error message, or null if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatableTopicResultV1
  
  type CreatableTopicResultV2 = CreatableTopicResultV1
  
  data DeleteAclsFilterV0 = DeleteAclsFilterV0
    { resourceTypeFilter :: {-# UNPACK #-} !Int8
      -- ^ The resource type.
    , resourceNameFilter :: !NullableString
      -- ^ The resource name.
    , principalFilter    :: !NullableString
      -- ^ The principal filter, or null to accept all principals.
    , hostFilter         :: !NullableString
      -- ^ The host filter, or null to accept all hosts.
    , operation          :: {-# UNPACK #-} !Int8
      -- ^ The ACL operation.
    , permissionType     :: {-# UNPACK #-} !Int8
      -- ^ The permission type.
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteAclsFilterV0
  
  data DeleteAclsMatchingAclV0 = DeleteAclsMatchingAclV0
    { errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The deletion error code, or 0 if the deletion succeeded.
    , errorMessage   :: !NullableString
      -- ^ The deletion error message, or null if the deletion succeeded.
    , resourceType   :: {-# UNPACK #-} !Int8
      -- ^ The ACL resource type.
    , resourceName   :: !Text
      -- ^ The ACL resource name.
    , principal      :: !Text
      -- ^ The ACL principal.
    , host           :: !Text
      -- ^ The ACL host.
    , operation      :: {-# UNPACK #-} !Int8
      -- ^ The ACL operation.
    , permissionType :: {-# UNPACK #-} !Int8
      -- ^ The ACL permission type.
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteAclsMatchingAclV0
  
  data DeleteAclsFilterResultV0 = DeleteAclsFilterResultV0
    { errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if the filter succeeded.
    , errorMessage :: !NullableString
      -- ^ The error message, or null if the filter succeeded.
    , matchingAcls :: !(KaArray DeleteAclsMatchingAclV0)
      -- ^ The ACLs which matched this filter.
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteAclsFilterResultV0
  
  data DeletableTopicResultV0 = DeletableTopicResultV0
    { name      :: !Text
      -- ^ The topic name
    , errorCode :: {-# UNPACK #-} !ErrorCode
      -- ^ The deletion error, or 0 if the deletion succeeded.
    } deriving (Show, Eq, Generic)
  instance Serializable DeletableTopicResultV0
  
  type DeletableTopicResultV1 = DeletableTopicResultV0
  
  data AclDescriptionV0 = AclDescriptionV0
    { principal      :: !Text
      -- ^ The ACL principal.
    , host           :: !Text
      -- ^ The ACL host.
    , operation      :: {-# UNPACK #-} !Int8
      -- ^ The ACL operation.
    , permissionType :: {-# UNPACK #-} !Int8
      -- ^ The ACL permission type.
    } deriving (Show, Eq, Generic)
  instance Serializable AclDescriptionV0
  
  data DescribeAclsResourceV0 = DescribeAclsResourceV0
    { resourceType :: {-# UNPACK #-} !Int8
      -- ^ The resource type.
    , resourceName :: !Text
      -- ^ The resource name.
    , acls         :: !(KaArray AclDescriptionV0)
      -- ^ The ACLs.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeAclsResourceV0
  
  data DescribeConfigsResourceV0 = DescribeConfigsResourceV0
    { resourceType      :: {-# UNPACK #-} !Int8
      -- ^ The resource type.
    , resourceName      :: !Text
      -- ^ The resource name.
    , configurationKeys :: !(KaArray Text)
      -- ^ The configuration keys to list, or null to list all configuration
      -- keys.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeConfigsResourceV0
  
  data DescribeConfigsResourceResultV0 = DescribeConfigsResourceResultV0
    { name        :: !Text
      -- ^ The configuration name.
    , value       :: !NullableString
      -- ^ The configuration value.
    , readOnly    :: Bool
      -- ^ True if the configuration is read-only.
    , isDefault   :: Bool
      -- ^ True if the configuration is not set.
    , isSensitive :: Bool
      -- ^ True if this configuration is sensitive.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeConfigsResourceResultV0
  
  data DescribeConfigsResultV0 = DescribeConfigsResultV0
    { errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if we were able to successfully describe the
      -- configurations.
    , errorMessage :: !NullableString
      -- ^ The error message, or null if we were able to successfully describe
      -- the configurations.
    , resourceType :: {-# UNPACK #-} !Int8
      -- ^ The resource type.
    , resourceName :: !Text
      -- ^ The resource name.
    , configs      :: !(KaArray DescribeConfigsResourceResultV0)
      -- ^ Each listed configuration.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeConfigsResultV0
  
  data DescribedGroupMemberV0 = DescribedGroupMemberV0
    { memberId         :: !Text
      -- ^ The member ID assigned by the group coordinator.
    , clientId         :: !Text
      -- ^ The client ID used in the member's latest join group request.
    , clientHost       :: !Text
      -- ^ The client host.
    , memberMetadata   :: !ByteString
      -- ^ The metadata corresponding to the current group protocol in use.
    , memberAssignment :: !ByteString
      -- ^ The current assignment provided by the group leader.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribedGroupMemberV0
  
  data DescribedGroupV0 = DescribedGroupV0
    { errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The describe error, or 0 if there was no error.
    , groupId      :: !Text
      -- ^ The group ID string.
    , groupState   :: !Text
      -- ^ The group state string, or the empty string.
    , protocolType :: !Text
      -- ^ The group protocol type, or the empty string.
    , protocolData :: !Text
      -- ^ The group protocol data, or the empty string.
    , members      :: !(KaArray DescribedGroupMemberV0)
      -- ^ The group members.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribedGroupV0
  
  type DescribedGroupMemberV1 = DescribedGroupMemberV0
  
  type DescribedGroupV1 = DescribedGroupV0
  
  data FetchPartitionV0 = FetchPartitionV0
    { partition         :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , fetchOffset       :: {-# UNPACK #-} !Int64
      -- ^ The message offset.
    , partitionMaxBytes :: {-# UNPACK #-} !Int32
      -- ^ The maximum bytes to fetch from this partition.  See KIP-74 for cases
      -- where this limit may not be honored.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchPartitionV0
  
  data FetchTopicV0 = FetchTopicV0
    { topic      :: !Text
      -- ^ The name of the topic to fetch.
    , partitions :: !(KaArray FetchPartitionV0)
      -- ^ The partitions to fetch.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchTopicV0
  
  type FetchPartitionV1 = FetchPartitionV0
  
  type FetchTopicV1 = FetchTopicV0
  
  type FetchPartitionV2 = FetchPartitionV0
  
  type FetchTopicV2 = FetchTopicV0
  
  type FetchPartitionV3 = FetchPartitionV0
  
  type FetchTopicV3 = FetchTopicV0
  
  type FetchPartitionV4 = FetchPartitionV0
  
  type FetchTopicV4 = FetchTopicV0
  
  data FetchPartitionV5 = FetchPartitionV5
    { partition         :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , fetchOffset       :: {-# UNPACK #-} !Int64
      -- ^ The message offset.
    , logStartOffset    :: {-# UNPACK #-} !Int64
      -- ^ The earliest available offset of the follower replica.  The field is
      -- only used when the request is sent by the follower.
    , partitionMaxBytes :: {-# UNPACK #-} !Int32
      -- ^ The maximum bytes to fetch from this partition.  See KIP-74 for cases
      -- where this limit may not be honored.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchPartitionV5
  
  data FetchTopicV5 = FetchTopicV5
    { topic      :: !Text
      -- ^ The name of the topic to fetch.
    , partitions :: !(KaArray FetchPartitionV5)
      -- ^ The partitions to fetch.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchTopicV5
  
  type FetchPartitionV6 = FetchPartitionV5
  
  type FetchTopicV6 = FetchTopicV5
  
  data PartitionDataV0 = PartitionDataV0
    { partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no fetch error.
    , highWatermark  :: {-# UNPACK #-} !Int64
      -- ^ The current high water mark.
    , recordBytes    :: !RecordBytes
      -- ^ The record data.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionDataV0
  
  data FetchableTopicResponseV0 = FetchableTopicResponseV0
    { topic      :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray PartitionDataV0)
      -- ^ The topic partitions.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchableTopicResponseV0
  
  type PartitionDataV1 = PartitionDataV0
  
  type FetchableTopicResponseV1 = FetchableTopicResponseV0
  
  type PartitionDataV2 = PartitionDataV0
  
  type FetchableTopicResponseV2 = FetchableTopicResponseV0
  
  type PartitionDataV3 = PartitionDataV0
  
  type FetchableTopicResponseV3 = FetchableTopicResponseV0
  
  data AbortedTransactionV4 = AbortedTransactionV4
    { producerId  :: {-# UNPACK #-} !Int64
      -- ^ The producer id associated with the aborted transaction.
    , firstOffset :: {-# UNPACK #-} !Int64
      -- ^ The first offset in the aborted transaction.
    } deriving (Show, Eq, Generic)
  instance Serializable AbortedTransactionV4
  
  data PartitionDataV4 = PartitionDataV4
    { partitionIndex      :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode           :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no fetch error.
    , highWatermark       :: {-# UNPACK #-} !Int64
      -- ^ The current high water mark.
    , lastStableOffset    :: {-# UNPACK #-} !Int64
      -- ^ The last stable offset (or LSO) of the partition. This is the last
      -- offset such that the state of all transactional records prior to this
      -- offset have been decided (ABORTED or COMMITTED)
    , abortedTransactions :: !(KaArray AbortedTransactionV4)
      -- ^ The aborted transactions.
    , recordBytes         :: !RecordBytes
      -- ^ The record data.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionDataV4
  
  data FetchableTopicResponseV4 = FetchableTopicResponseV4
    { topic      :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray PartitionDataV4)
      -- ^ The topic partitions.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchableTopicResponseV4
  
  type AbortedTransactionV5 = AbortedTransactionV4
  
  data PartitionDataV5 = PartitionDataV5
    { partitionIndex      :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode           :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no fetch error.
    , highWatermark       :: {-# UNPACK #-} !Int64
      -- ^ The current high water mark.
    , lastStableOffset    :: {-# UNPACK #-} !Int64
      -- ^ The last stable offset (or LSO) of the partition. This is the last
      -- offset such that the state of all transactional records prior to this
      -- offset have been decided (ABORTED or COMMITTED)
    , logStartOffset      :: {-# UNPACK #-} !Int64
      -- ^ The current log start offset.
    , abortedTransactions :: !(KaArray AbortedTransactionV4)
      -- ^ The aborted transactions.
    , recordBytes         :: !RecordBytes
      -- ^ The record data.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionDataV5
  
  data FetchableTopicResponseV5 = FetchableTopicResponseV5
    { topic      :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray PartitionDataV5)
      -- ^ The topic partitions.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchableTopicResponseV5
  
  type AbortedTransactionV6 = AbortedTransactionV4
  
  type PartitionDataV6 = PartitionDataV5
  
  type FetchableTopicResponseV6 = FetchableTopicResponseV5
  
  data JoinGroupRequestProtocolV0 = JoinGroupRequestProtocolV0
    { name     :: !Text
      -- ^ The protocol name.
    , metadata :: !ByteString
      -- ^ The protocol metadata.
    } deriving (Show, Eq, Generic)
  instance Serializable JoinGroupRequestProtocolV0
  
  type JoinGroupRequestProtocolV1 = JoinGroupRequestProtocolV0
  
  type JoinGroupRequestProtocolV2 = JoinGroupRequestProtocolV0
  
  data JoinGroupResponseMemberV0 = JoinGroupResponseMemberV0
    { memberId :: !Text
      -- ^ The group member ID.
    , metadata :: !ByteString
      -- ^ The group member metadata.
    } deriving (Show, Eq, Generic)
  instance Serializable JoinGroupResponseMemberV0
  
  type JoinGroupResponseMemberV1 = JoinGroupResponseMemberV0
  
  type JoinGroupResponseMemberV2 = JoinGroupResponseMemberV0
  
  data ListedGroupV0 = ListedGroupV0
    { groupId      :: !Text
      -- ^ The group ID.
    , protocolType :: !Text
      -- ^ The group protocol type.
    } deriving (Show, Eq, Generic)
  instance Serializable ListedGroupV0
  
  type ListedGroupV1 = ListedGroupV0
  
  data ListOffsetsPartitionV0 = ListOffsetsPartitionV0
    { partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , timestamp      :: {-# UNPACK #-} !Int64
      -- ^ The current timestamp.
    , maxNumOffsets  :: {-# UNPACK #-} !Int32
      -- ^ The maximum number of offsets to report.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsPartitionV0
  
  data ListOffsetsTopicV0 = ListOffsetsTopicV0
    { name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray ListOffsetsPartitionV0)
      -- ^ Each partition in the request.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsTopicV0
  
  data ListOffsetsPartitionV1 = ListOffsetsPartitionV1
    { partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , timestamp      :: {-# UNPACK #-} !Int64
      -- ^ The current timestamp.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsPartitionV1
  
  data ListOffsetsTopicV1 = ListOffsetsTopicV1
    { name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray ListOffsetsPartitionV1)
      -- ^ Each partition in the request.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsTopicV1
  
  type ListOffsetsPartitionV2 = ListOffsetsPartitionV1
  
  type ListOffsetsTopicV2 = ListOffsetsTopicV1
  
  data ListOffsetsPartitionResponseV0 = ListOffsetsPartitionResponseV0
    { partitionIndex  :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode       :: {-# UNPACK #-} !ErrorCode
      -- ^ The partition error code, or 0 if there was no error.
    , oldStyleOffsets :: !(KaArray Int64)
      -- ^ The result offsets.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsPartitionResponseV0
  
  data ListOffsetsTopicResponseV0 = ListOffsetsTopicResponseV0
    { name       :: !Text
      -- ^ The topic name
    , partitions :: !(KaArray ListOffsetsPartitionResponseV0)
      -- ^ Each partition in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsTopicResponseV0
  
  data ListOffsetsPartitionResponseV1 = ListOffsetsPartitionResponseV1
    { partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The partition error code, or 0 if there was no error.
    , timestamp      :: {-# UNPACK #-} !Int64
      -- ^ The timestamp associated with the returned offset.
    , offset         :: {-# UNPACK #-} !Int64
      -- ^ The returned offset.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsPartitionResponseV1
  
  data ListOffsetsTopicResponseV1 = ListOffsetsTopicResponseV1
    { name       :: !Text
      -- ^ The topic name
    , partitions :: !(KaArray ListOffsetsPartitionResponseV1)
      -- ^ Each partition in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsTopicResponseV1
  
  type ListOffsetsPartitionResponseV2 = ListOffsetsPartitionResponseV1
  
  type ListOffsetsTopicResponseV2 = ListOffsetsTopicResponseV1
  
  newtype MetadataRequestTopicV0 = MetadataRequestTopicV0
    { name :: Text
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataRequestTopicV0
  
  type MetadataRequestTopicV1 = MetadataRequestTopicV0
  
  type MetadataRequestTopicV2 = MetadataRequestTopicV0
  
  type MetadataRequestTopicV3 = MetadataRequestTopicV0
  
  type MetadataRequestTopicV4 = MetadataRequestTopicV0
  
  type MetadataRequestTopicV5 = MetadataRequestTopicV0
  
  data MetadataResponseBrokerV0 = MetadataResponseBrokerV0
    { nodeId :: {-# UNPACK #-} !Int32
      -- ^ The broker ID.
    , host   :: !Text
      -- ^ The broker hostname.
    , port   :: {-# UNPACK #-} !Int32
      -- ^ The broker port.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseBrokerV0
  
  data MetadataResponsePartitionV0 = MetadataResponsePartitionV0
    { errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The partition error, or 0 if there was no error.
    , partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , leaderId       :: {-# UNPACK #-} !Int32
      -- ^ The ID of the leader broker.
    , replicaNodes   :: !(KaArray Int32)
      -- ^ The set of all nodes that host this partition.
    , isrNodes       :: !(KaArray Int32)
      -- ^ The set of nodes that are in sync with the leader for this partition.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponsePartitionV0
  
  data MetadataResponseTopicV0 = MetadataResponseTopicV0
    { errorCode  :: {-# UNPACK #-} !ErrorCode
      -- ^ The topic error, or 0 if there was no error.
    , name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray MetadataResponsePartitionV0)
      -- ^ Each partition in the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseTopicV0
  
  data MetadataResponseBrokerV1 = MetadataResponseBrokerV1
    { nodeId :: {-# UNPACK #-} !Int32
      -- ^ The broker ID.
    , host   :: !Text
      -- ^ The broker hostname.
    , port   :: {-# UNPACK #-} !Int32
      -- ^ The broker port.
    , rack   :: !NullableString
      -- ^ The rack of the broker, or null if it has not been assigned to a rack.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseBrokerV1
  
  type MetadataResponsePartitionV1 = MetadataResponsePartitionV0
  
  data MetadataResponseTopicV1 = MetadataResponseTopicV1
    { errorCode  :: {-# UNPACK #-} !ErrorCode
      -- ^ The topic error, or 0 if there was no error.
    , name       :: !Text
      -- ^ The topic name.
    , isInternal :: Bool
      -- ^ True if the topic is internal.
    , partitions :: !(KaArray MetadataResponsePartitionV0)
      -- ^ Each partition in the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseTopicV1
  
  type MetadataResponseBrokerV2 = MetadataResponseBrokerV1
  
  type MetadataResponsePartitionV2 = MetadataResponsePartitionV0
  
  type MetadataResponseTopicV2 = MetadataResponseTopicV1
  
  type MetadataResponseBrokerV3 = MetadataResponseBrokerV1
  
  type MetadataResponsePartitionV3 = MetadataResponsePartitionV0
  
  type MetadataResponseTopicV3 = MetadataResponseTopicV1
  
  type MetadataResponseBrokerV4 = MetadataResponseBrokerV1
  
  type MetadataResponsePartitionV4 = MetadataResponsePartitionV0
  
  type MetadataResponseTopicV4 = MetadataResponseTopicV1
  
  type MetadataResponseBrokerV5 = MetadataResponseBrokerV1
  
  data MetadataResponsePartitionV5 = MetadataResponsePartitionV5
    { errorCode       :: {-# UNPACK #-} !ErrorCode
      -- ^ The partition error, or 0 if there was no error.
    , partitionIndex  :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , leaderId        :: {-# UNPACK #-} !Int32
      -- ^ The ID of the leader broker.
    , replicaNodes    :: !(KaArray Int32)
      -- ^ The set of all nodes that host this partition.
    , isrNodes        :: !(KaArray Int32)
      -- ^ The set of nodes that are in sync with the leader for this partition.
    , offlineReplicas :: !(KaArray Int32)
      -- ^ The set of offline replicas of this partition.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponsePartitionV5
  
  data MetadataResponseTopicV5 = MetadataResponseTopicV5
    { errorCode  :: {-# UNPACK #-} !ErrorCode
      -- ^ The topic error, or 0 if there was no error.
    , name       :: !Text
      -- ^ The topic name.
    , isInternal :: Bool
      -- ^ True if the topic is internal.
    , partitions :: !(KaArray MetadataResponsePartitionV5)
      -- ^ Each partition in the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseTopicV5
  
  data OffsetCommitRequestPartitionV0 = OffsetCommitRequestPartitionV0
    { partitionIndex    :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , committedOffset   :: {-# UNPACK #-} !Int64
      -- ^ The message offset to be committed.
    , committedMetadata :: !NullableString
      -- ^ Any associated metadata the client wants to keep.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestPartitionV0
  
  data OffsetCommitRequestTopicV0 = OffsetCommitRequestTopicV0
    { name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray OffsetCommitRequestPartitionV0)
      -- ^ Each partition to commit offsets for.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestTopicV0
  
  data OffsetCommitRequestPartitionV1 = OffsetCommitRequestPartitionV1
    { partitionIndex    :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , committedOffset   :: {-# UNPACK #-} !Int64
      -- ^ The message offset to be committed.
    , commitTimestamp   :: {-# UNPACK #-} !Int64
      -- ^ The timestamp of the commit.
    , committedMetadata :: !NullableString
      -- ^ Any associated metadata the client wants to keep.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestPartitionV1
  
  data OffsetCommitRequestTopicV1 = OffsetCommitRequestTopicV1
    { name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray OffsetCommitRequestPartitionV1)
      -- ^ Each partition to commit offsets for.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestTopicV1
  
  type OffsetCommitRequestPartitionV2 = OffsetCommitRequestPartitionV0
  
  type OffsetCommitRequestTopicV2 = OffsetCommitRequestTopicV0
  
  type OffsetCommitRequestPartitionV3 = OffsetCommitRequestPartitionV0
  
  type OffsetCommitRequestTopicV3 = OffsetCommitRequestTopicV0
  
  data OffsetCommitResponsePartitionV0 = OffsetCommitResponsePartitionV0
    { partitionIndex :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitResponsePartitionV0
  
  data OffsetCommitResponseTopicV0 = OffsetCommitResponseTopicV0
    { name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray OffsetCommitResponsePartitionV0)
      -- ^ The responses for each partition in the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitResponseTopicV0
  
  type OffsetCommitResponsePartitionV1 = OffsetCommitResponsePartitionV0
  
  type OffsetCommitResponseTopicV1 = OffsetCommitResponseTopicV0
  
  type OffsetCommitResponsePartitionV2 = OffsetCommitResponsePartitionV0
  
  type OffsetCommitResponseTopicV2 = OffsetCommitResponseTopicV0
  
  type OffsetCommitResponsePartitionV3 = OffsetCommitResponsePartitionV0
  
  type OffsetCommitResponseTopicV3 = OffsetCommitResponseTopicV0
  
  data OffsetFetchRequestTopicV0 = OffsetFetchRequestTopicV0
    { name             :: !Text
      -- ^ The topic name.
    , partitionIndexes :: !(KaArray Int32)
      -- ^ The partition indexes we would like to fetch offsets for.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchRequestTopicV0
  
  type OffsetFetchRequestTopicV1 = OffsetFetchRequestTopicV0
  
  type OffsetFetchRequestTopicV2 = OffsetFetchRequestTopicV0
  
  type OffsetFetchRequestTopicV3 = OffsetFetchRequestTopicV0
  
  data OffsetFetchResponsePartitionV0 = OffsetFetchResponsePartitionV0
    { partitionIndex  :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , committedOffset :: {-# UNPACK #-} !Int64
      -- ^ The committed message offset.
    , metadata        :: !NullableString
      -- ^ The partition metadata.
    , errorCode       :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchResponsePartitionV0
  
  data OffsetFetchResponseTopicV0 = OffsetFetchResponseTopicV0
    { name       :: !Text
      -- ^ The topic name.
    , partitions :: !(KaArray OffsetFetchResponsePartitionV0)
      -- ^ The responses per partition
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchResponseTopicV0
  
  type OffsetFetchResponsePartitionV1 = OffsetFetchResponsePartitionV0
  
  type OffsetFetchResponseTopicV1 = OffsetFetchResponseTopicV0
  
  type OffsetFetchResponsePartitionV2 = OffsetFetchResponsePartitionV0
  
  type OffsetFetchResponseTopicV2 = OffsetFetchResponseTopicV0
  
  type OffsetFetchResponsePartitionV3 = OffsetFetchResponsePartitionV0
  
  type OffsetFetchResponseTopicV3 = OffsetFetchResponseTopicV0
  
  data PartitionProduceDataV0 = PartitionProduceDataV0
    { index       :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , recordBytes :: !RecordBytes
      -- ^ The record data to be produced.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionProduceDataV0
  
  data TopicProduceDataV0 = TopicProduceDataV0
    { name          :: !Text
      -- ^ The topic name.
    , partitionData :: !(KaArray PartitionProduceDataV0)
      -- ^ Each partition to produce to.
    } deriving (Show, Eq, Generic)
  instance Serializable TopicProduceDataV0
  
  type PartitionProduceDataV1 = PartitionProduceDataV0
  
  type TopicProduceDataV1 = TopicProduceDataV0
  
  type PartitionProduceDataV2 = PartitionProduceDataV0
  
  type TopicProduceDataV2 = TopicProduceDataV0
  
  type PartitionProduceDataV3 = PartitionProduceDataV0
  
  type TopicProduceDataV3 = TopicProduceDataV0
  
  type PartitionProduceDataV4 = PartitionProduceDataV0
  
  type TopicProduceDataV4 = TopicProduceDataV0
  
  type PartitionProduceDataV5 = PartitionProduceDataV0
  
  type TopicProduceDataV5 = TopicProduceDataV0
  
  type PartitionProduceDataV6 = PartitionProduceDataV0
  
  type TopicProduceDataV6 = TopicProduceDataV0
  
  type PartitionProduceDataV7 = PartitionProduceDataV0
  
  type TopicProduceDataV7 = TopicProduceDataV0
  
  data PartitionProduceResponseV0 = PartitionProduceResponseV0
    { index      :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode  :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , baseOffset :: {-# UNPACK #-} !Int64
      -- ^ The base offset.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionProduceResponseV0
  
  data TopicProduceResponseV0 = TopicProduceResponseV0
    { name               :: !Text
      -- ^ The topic name
    , partitionResponses :: !(KaArray PartitionProduceResponseV0)
      -- ^ Each partition that we produced to within the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable TopicProduceResponseV0
  
  type PartitionProduceResponseV1 = PartitionProduceResponseV0
  
  type TopicProduceResponseV1 = TopicProduceResponseV0
  
  data PartitionProduceResponseV2 = PartitionProduceResponseV2
    { index           :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode       :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , baseOffset      :: {-# UNPACK #-} !Int64
      -- ^ The base offset.
    , logAppendTimeMs :: {-# UNPACK #-} !Int64
      -- ^ The timestamp returned by broker after appending the messages. If
      -- CreateTime is used for the topic, the timestamp will be -1.  If
      -- LogAppendTime is used for the topic, the timestamp will be the broker
      -- local time when the messages are appended.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionProduceResponseV2
  
  data TopicProduceResponseV2 = TopicProduceResponseV2
    { name               :: !Text
      -- ^ The topic name
    , partitionResponses :: !(KaArray PartitionProduceResponseV2)
      -- ^ Each partition that we produced to within the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable TopicProduceResponseV2
  
  type PartitionProduceResponseV3 = PartitionProduceResponseV2
  
  type TopicProduceResponseV3 = TopicProduceResponseV2
  
  type PartitionProduceResponseV4 = PartitionProduceResponseV2
  
  type TopicProduceResponseV4 = TopicProduceResponseV2
  
  data PartitionProduceResponseV5 = PartitionProduceResponseV5
    { index           :: {-# UNPACK #-} !Int32
      -- ^ The partition index.
    , errorCode       :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , baseOffset      :: {-# UNPACK #-} !Int64
      -- ^ The base offset.
    , logAppendTimeMs :: {-# UNPACK #-} !Int64
      -- ^ The timestamp returned by broker after appending the messages. If
      -- CreateTime is used for the topic, the timestamp will be -1.  If
      -- LogAppendTime is used for the topic, the timestamp will be the broker
      -- local time when the messages are appended.
    , logStartOffset  :: {-# UNPACK #-} !Int64
      -- ^ The log start offset.
    } deriving (Show, Eq, Generic)
  instance Serializable PartitionProduceResponseV5
  
  data TopicProduceResponseV5 = TopicProduceResponseV5
    { name               :: !Text
      -- ^ The topic name
    , partitionResponses :: !(KaArray PartitionProduceResponseV5)
      -- ^ Each partition that we produced to within the topic.
    } deriving (Show, Eq, Generic)
  instance Serializable TopicProduceResponseV5
  
  type PartitionProduceResponseV6 = PartitionProduceResponseV5
  
  type TopicProduceResponseV6 = TopicProduceResponseV5
  
  type PartitionProduceResponseV7 = PartitionProduceResponseV5
  
  type TopicProduceResponseV7 = TopicProduceResponseV5
  
  data SyncGroupRequestAssignmentV0 = SyncGroupRequestAssignmentV0
    { memberId   :: !Text
      -- ^ The ID of the member to assign.
    , assignment :: !ByteString
      -- ^ The member assignment.
    } deriving (Show, Eq, Generic)
  instance Serializable SyncGroupRequestAssignmentV0
  
  type SyncGroupRequestAssignmentV1 = SyncGroupRequestAssignmentV0
  
  -------------------------------------------------------------------------------
  
  data ApiVersionsRequestV0 = ApiVersionsRequestV0
    deriving (Show, Eq, Generic)
  instance Serializable ApiVersionsRequestV0
  
  type ApiVersionsRequestV1 = ApiVersionsRequestV0
  
  type ApiVersionsRequestV2 = ApiVersionsRequestV0
  
  data ApiVersionsRequestV3 = ApiVersionsRequestV3
    { clientSoftwareName    :: !CompactString
      -- ^ The name of the client.
    , clientSoftwareVersion :: !CompactString
      -- ^ The version of the client.
    , taggedFields          :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable ApiVersionsRequestV3
  
  data ApiVersionsResponseV0 = ApiVersionsResponseV0
    { errorCode :: {-# UNPACK #-} !ErrorCode
      -- ^ The top-level error code.
    , apiKeys   :: !(KaArray ApiVersionV0)
      -- ^ The APIs supported by the broker.
    } deriving (Show, Eq, Generic)
  instance Serializable ApiVersionsResponseV0
  
  data ApiVersionsResponseV1 = ApiVersionsResponseV1
    { errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The top-level error code.
    , apiKeys        :: !(KaArray ApiVersionV0)
      -- ^ The APIs supported by the broker.
    , throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    } deriving (Show, Eq, Generic)
  instance Serializable ApiVersionsResponseV1
  
  type ApiVersionsResponseV2 = ApiVersionsResponseV1
  
  data ApiVersionsResponseV3 = ApiVersionsResponseV3
    { errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The top-level error code.
    , apiKeys        :: !(CompactKaArray ApiVersionV3)
      -- ^ The APIs supported by the broker.
    , throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , taggedFields   :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable ApiVersionsResponseV3
  
  newtype CreateAclsRequestV0 = CreateAclsRequestV0
    { creations :: (KaArray AclCreationV0)
    } deriving (Show, Eq, Generic)
  instance Serializable CreateAclsRequestV0
  
  data CreateAclsResponseV0 = CreateAclsResponseV0
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , results        :: !(KaArray AclCreationResultV0)
      -- ^ The results for each ACL creation.
    } deriving (Show, Eq, Generic)
  instance Serializable CreateAclsResponseV0
  
  data CreatePartitionsRequestV0 = CreatePartitionsRequestV0
    { topics       :: !(KaArray CreatePartitionsTopicV0)
      -- ^ Each topic that we want to create new partitions inside.
    , timeoutMs    :: {-# UNPACK #-} !Int32
      -- ^ The time in ms to wait for the partitions to be created.
    , validateOnly :: Bool
      -- ^ If true, then validate the request, but don't actually increase the
      -- number of partitions.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatePartitionsRequestV0
  
  type CreatePartitionsRequestV1 = CreatePartitionsRequestV0
  
  data CreatePartitionsResponseV0 = CreatePartitionsResponseV0
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , results        :: !(KaArray CreatePartitionsTopicResultV0)
      -- ^ The partition creation results for each topic.
    } deriving (Show, Eq, Generic)
  instance Serializable CreatePartitionsResponseV0
  
  type CreatePartitionsResponseV1 = CreatePartitionsResponseV0
  
  data CreateTopicsRequestV0 = CreateTopicsRequestV0
    { topics    :: !(KaArray CreatableTopicV0)
      -- ^ The topics to create.
    , timeoutMs :: {-# UNPACK #-} !Int32
      -- ^ How long to wait in milliseconds before timing out the request.
    } deriving (Show, Eq, Generic)
  instance Serializable CreateTopicsRequestV0
  
  data CreateTopicsRequestV1 = CreateTopicsRequestV1
    { topics       :: !(KaArray CreatableTopicV0)
      -- ^ The topics to create.
    , timeoutMs    :: {-# UNPACK #-} !Int32
      -- ^ How long to wait in milliseconds before timing out the request.
    , validateOnly :: Bool
      -- ^ If true, check that the topics can be created as specified, but don't
      -- create anything.
    } deriving (Show, Eq, Generic)
  instance Serializable CreateTopicsRequestV1
  
  type CreateTopicsRequestV2 = CreateTopicsRequestV1
  
  newtype CreateTopicsResponseV0 = CreateTopicsResponseV0
    { topics :: (KaArray CreatableTopicResultV0)
    } deriving (Show, Eq, Generic)
  instance Serializable CreateTopicsResponseV0
  
  newtype CreateTopicsResponseV1 = CreateTopicsResponseV1
    { topics :: (KaArray CreatableTopicResultV1)
    } deriving (Show, Eq, Generic)
  instance Serializable CreateTopicsResponseV1
  
  data CreateTopicsResponseV2 = CreateTopicsResponseV2
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , topics         :: !(KaArray CreatableTopicResultV1)
      -- ^ Results for each topic we tried to create.
    } deriving (Show, Eq, Generic)
  instance Serializable CreateTopicsResponseV2
  
  newtype DeleteAclsRequestV0 = DeleteAclsRequestV0
    { filters :: (KaArray DeleteAclsFilterV0)
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteAclsRequestV0
  
  data DeleteAclsResponseV0 = DeleteAclsResponseV0
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , filterResults  :: !(KaArray DeleteAclsFilterResultV0)
      -- ^ The results for each filter.
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteAclsResponseV0
  
  data DeleteTopicsRequestV0 = DeleteTopicsRequestV0
    { topicNames :: !(KaArray Text)
      -- ^ The names of the topics to delete
    , timeoutMs  :: {-# UNPACK #-} !Int32
      -- ^ The length of time in milliseconds to wait for the deletions to
      -- complete.
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteTopicsRequestV0
  
  type DeleteTopicsRequestV1 = DeleteTopicsRequestV0
  
  newtype DeleteTopicsResponseV0 = DeleteTopicsResponseV0
    { responses :: (KaArray DeletableTopicResultV0)
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteTopicsResponseV0
  
  data DeleteTopicsResponseV1 = DeleteTopicsResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , responses      :: !(KaArray DeletableTopicResultV0)
      -- ^ The results for each topic we tried to delete.
    } deriving (Show, Eq, Generic)
  instance Serializable DeleteTopicsResponseV1
  
  data DescribeAclsRequestV0 = DescribeAclsRequestV0
    { resourceTypeFilter :: {-# UNPACK #-} !Int8
      -- ^ The resource type.
    , resourceNameFilter :: !NullableString
      -- ^ The resource name, or null to match any resource name.
    , principalFilter    :: !NullableString
      -- ^ The principal to match, or null to match any principal.
    , hostFilter         :: !NullableString
      -- ^ The host to match, or null to match any host.
    , operation          :: {-# UNPACK #-} !Int8
      -- ^ The operation to match.
    , permissionType     :: {-# UNPACK #-} !Int8
      -- ^ The permission type to match.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeAclsRequestV0
  
  data DescribeAclsResponseV0 = DescribeAclsResponseV0
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , errorMessage   :: !NullableString
      -- ^ The error message, or null if there was no error.
    , resources      :: !(KaArray DescribeAclsResourceV0)
      -- ^ Each Resource that is referenced in an ACL.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeAclsResponseV0
  
  newtype DescribeConfigsRequestV0 = DescribeConfigsRequestV0
    { resources :: (KaArray DescribeConfigsResourceV0)
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeConfigsRequestV0
  
  data DescribeConfigsResponseV0 = DescribeConfigsResponseV0
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , results        :: !(KaArray DescribeConfigsResultV0)
      -- ^ The results for each resource.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeConfigsResponseV0
  
  newtype DescribeGroupsRequestV0 = DescribeGroupsRequestV0
    { groups :: (KaArray Text)
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeGroupsRequestV0
  
  type DescribeGroupsRequestV1 = DescribeGroupsRequestV0
  
  newtype DescribeGroupsResponseV0 = DescribeGroupsResponseV0
    { groups :: (KaArray DescribedGroupV0)
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeGroupsResponseV0
  
  data DescribeGroupsResponseV1 = DescribeGroupsResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , groups         :: !(KaArray DescribedGroupV0)
      -- ^ Each described group.
    } deriving (Show, Eq, Generic)
  instance Serializable DescribeGroupsResponseV1
  
  data FetchRequestV0 = FetchRequestV0
    { replicaId :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the follower, of -1 if this request is from a
      -- consumer.
    , maxWaitMs :: {-# UNPACK #-} !Int32
      -- ^ The maximum time in milliseconds to wait for the response.
    , minBytes  :: {-# UNPACK #-} !Int32
      -- ^ The minimum bytes to accumulate in the response.
    , topics    :: !(KaArray FetchTopicV0)
      -- ^ The topics to fetch.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchRequestV0
  
  type FetchRequestV1 = FetchRequestV0
  
  type FetchRequestV2 = FetchRequestV0
  
  data FetchRequestV3 = FetchRequestV3
    { replicaId :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the follower, of -1 if this request is from a
      -- consumer.
    , maxWaitMs :: {-# UNPACK #-} !Int32
      -- ^ The maximum time in milliseconds to wait for the response.
    , minBytes  :: {-# UNPACK #-} !Int32
      -- ^ The minimum bytes to accumulate in the response.
    , maxBytes  :: {-# UNPACK #-} !Int32
      -- ^ The maximum bytes to fetch.  See KIP-74 for cases where this limit may
      -- not be honored.
    , topics    :: !(KaArray FetchTopicV0)
      -- ^ The topics to fetch.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchRequestV3
  
  data FetchRequestV4 = FetchRequestV4
    { replicaId      :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the follower, of -1 if this request is from a
      -- consumer.
    , maxWaitMs      :: {-# UNPACK #-} !Int32
      -- ^ The maximum time in milliseconds to wait for the response.
    , minBytes       :: {-# UNPACK #-} !Int32
      -- ^ The minimum bytes to accumulate in the response.
    , maxBytes       :: {-# UNPACK #-} !Int32
      -- ^ The maximum bytes to fetch.  See KIP-74 for cases where this limit may
      -- not be honored.
    , isolationLevel :: {-# UNPACK #-} !Int8
      -- ^ This setting controls the visibility of transactional records. Using
      -- READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With
      -- READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED
      -- transactional records are visible. To be more concrete, READ_COMMITTED
      -- returns all data from offsets smaller than the current LSO (last stable
      -- offset), and enables the inclusion of the list of aborted transactions
      -- in the result, which allows consumers to discard ABORTED transactional
      -- records
    , topics         :: !(KaArray FetchTopicV0)
      -- ^ The topics to fetch.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchRequestV4
  
  data FetchRequestV5 = FetchRequestV5
    { replicaId      :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the follower, of -1 if this request is from a
      -- consumer.
    , maxWaitMs      :: {-# UNPACK #-} !Int32
      -- ^ The maximum time in milliseconds to wait for the response.
    , minBytes       :: {-# UNPACK #-} !Int32
      -- ^ The minimum bytes to accumulate in the response.
    , maxBytes       :: {-# UNPACK #-} !Int32
      -- ^ The maximum bytes to fetch.  See KIP-74 for cases where this limit may
      -- not be honored.
    , isolationLevel :: {-# UNPACK #-} !Int8
      -- ^ This setting controls the visibility of transactional records. Using
      -- READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With
      -- READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED
      -- transactional records are visible. To be more concrete, READ_COMMITTED
      -- returns all data from offsets smaller than the current LSO (last stable
      -- offset), and enables the inclusion of the list of aborted transactions
      -- in the result, which allows consumers to discard ABORTED transactional
      -- records
    , topics         :: !(KaArray FetchTopicV5)
      -- ^ The topics to fetch.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchRequestV5
  
  type FetchRequestV6 = FetchRequestV5
  
  newtype FetchResponseV0 = FetchResponseV0
    { responses :: (KaArray FetchableTopicResponseV0)
    } deriving (Show, Eq, Generic)
  instance Serializable FetchResponseV0
  
  data FetchResponseV1 = FetchResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , responses      :: !(KaArray FetchableTopicResponseV0)
      -- ^ The response topics.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchResponseV1
  
  type FetchResponseV2 = FetchResponseV1
  
  type FetchResponseV3 = FetchResponseV1
  
  data FetchResponseV4 = FetchResponseV4
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , responses      :: !(KaArray FetchableTopicResponseV4)
      -- ^ The response topics.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchResponseV4
  
  data FetchResponseV5 = FetchResponseV5
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , responses      :: !(KaArray FetchableTopicResponseV5)
      -- ^ The response topics.
    } deriving (Show, Eq, Generic)
  instance Serializable FetchResponseV5
  
  type FetchResponseV6 = FetchResponseV5
  
  newtype FindCoordinatorRequestV0 = FindCoordinatorRequestV0
    { key :: Text
    } deriving (Show, Eq, Generic)
  instance Serializable FindCoordinatorRequestV0
  
  data FindCoordinatorRequestV1 = FindCoordinatorRequestV1
    { key     :: !Text
      -- ^ The coordinator key.
    , keyType :: {-# UNPACK #-} !Int8
      -- ^ The coordinator key type. (Group, transaction, etc.)
    } deriving (Show, Eq, Generic)
  instance Serializable FindCoordinatorRequestV1
  
  data FindCoordinatorResponseV0 = FindCoordinatorResponseV0
    { errorCode :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , nodeId    :: {-# UNPACK #-} !Int32
      -- ^ The node id.
    , host      :: !Text
      -- ^ The host name.
    , port      :: {-# UNPACK #-} !Int32
      -- ^ The port.
    } deriving (Show, Eq, Generic)
  instance Serializable FindCoordinatorResponseV0
  
  data FindCoordinatorResponseV1 = FindCoordinatorResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , errorMessage   :: !NullableString
      -- ^ The error message, or null if there was no error.
    , nodeId         :: {-# UNPACK #-} !Int32
      -- ^ The node id.
    , host           :: !Text
      -- ^ The host name.
    , port           :: {-# UNPACK #-} !Int32
      -- ^ The port.
    } deriving (Show, Eq, Generic)
  instance Serializable FindCoordinatorResponseV1
  
  data HeartbeatRequestV0 = HeartbeatRequestV0
    { groupId      :: !Text
      -- ^ The group id.
    , generationId :: {-# UNPACK #-} !Int32
      -- ^ The generation of the group.
    , memberId     :: !Text
      -- ^ The member ID.
    } deriving (Show, Eq, Generic)
  instance Serializable HeartbeatRequestV0
  
  type HeartbeatRequestV1 = HeartbeatRequestV0
  
  newtype HeartbeatResponseV0 = HeartbeatResponseV0
    { errorCode :: ErrorCode
    } deriving (Show, Eq, Generic)
  instance Serializable HeartbeatResponseV0
  
  data HeartbeatResponseV1 = HeartbeatResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable HeartbeatResponseV1
  
  data InitProducerIdRequestV0 = InitProducerIdRequestV0
    { transactionalId      :: !NullableString
      -- ^ The transactional id, or null if the producer is not transactional.
    , transactionTimeoutMs :: {-# UNPACK #-} !Int32
      -- ^ The time in ms to wait before aborting idle transactions sent by this
      -- producer. This is only relevant if a TransactionalId has been defined.
    } deriving (Show, Eq, Generic)
  instance Serializable InitProducerIdRequestV0
  
  data InitProducerIdResponseV0 = InitProducerIdResponseV0
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , producerId     :: {-# UNPACK #-} !Int64
      -- ^ The current producer id.
    , producerEpoch  :: {-# UNPACK #-} !Int16
      -- ^ The current epoch associated with the producer id.
    } deriving (Show, Eq, Generic)
  instance Serializable InitProducerIdResponseV0
  
  data JoinGroupRequestV0 = JoinGroupRequestV0
    { groupId          :: !Text
      -- ^ The group identifier.
    , sessionTimeoutMs :: {-# UNPACK #-} !Int32
      -- ^ The coordinator considers the consumer dead if it receives no
      -- heartbeat after this timeout in milliseconds.
    , memberId         :: !Text
      -- ^ The member id assigned by the group coordinator.
    , protocolType     :: !Text
      -- ^ The unique name the for class of protocols implemented by the group we
      -- want to join.
    , protocols        :: !(KaArray JoinGroupRequestProtocolV0)
      -- ^ The list of protocols that the member supports.
    } deriving (Show, Eq, Generic)
  instance Serializable JoinGroupRequestV0
  
  data JoinGroupRequestV1 = JoinGroupRequestV1
    { groupId            :: !Text
      -- ^ The group identifier.
    , sessionTimeoutMs   :: {-# UNPACK #-} !Int32
      -- ^ The coordinator considers the consumer dead if it receives no
      -- heartbeat after this timeout in milliseconds.
    , rebalanceTimeoutMs :: {-# UNPACK #-} !Int32
      -- ^ The maximum time in milliseconds that the coordinator will wait for
      -- each member to rejoin when rebalancing the group.
    , memberId           :: !Text
      -- ^ The member id assigned by the group coordinator.
    , protocolType       :: !Text
      -- ^ The unique name the for class of protocols implemented by the group we
      -- want to join.
    , protocols          :: !(KaArray JoinGroupRequestProtocolV0)
      -- ^ The list of protocols that the member supports.
    } deriving (Show, Eq, Generic)
  instance Serializable JoinGroupRequestV1
  
  type JoinGroupRequestV2 = JoinGroupRequestV1
  
  data JoinGroupResponseV0 = JoinGroupResponseV0
    { errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , generationId :: {-# UNPACK #-} !Int32
      -- ^ The generation ID of the group.
    , protocolName :: !Text
      -- ^ The group protocol selected by the coordinator.
    , leader       :: !Text
      -- ^ The leader of the group.
    , memberId     :: !Text
      -- ^ The member ID assigned by the group coordinator.
    , members      :: !(KaArray JoinGroupResponseMemberV0)
    } deriving (Show, Eq, Generic)
  instance Serializable JoinGroupResponseV0
  
  type JoinGroupResponseV1 = JoinGroupResponseV0
  
  data JoinGroupResponseV2 = JoinGroupResponseV2
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , generationId   :: {-# UNPACK #-} !Int32
      -- ^ The generation ID of the group.
    , protocolName   :: !Text
      -- ^ The group protocol selected by the coordinator.
    , leader         :: !Text
      -- ^ The leader of the group.
    , memberId       :: !Text
      -- ^ The member ID assigned by the group coordinator.
    , members        :: !(KaArray JoinGroupResponseMemberV0)
    } deriving (Show, Eq, Generic)
  instance Serializable JoinGroupResponseV2
  
  data LeaveGroupRequestV0 = LeaveGroupRequestV0
    { groupId  :: !Text
      -- ^ The ID of the group to leave.
    , memberId :: !Text
      -- ^ The member ID to remove from the group.
    } deriving (Show, Eq, Generic)
  instance Serializable LeaveGroupRequestV0
  
  type LeaveGroupRequestV1 = LeaveGroupRequestV0
  
  newtype LeaveGroupResponseV0 = LeaveGroupResponseV0
    { errorCode :: ErrorCode
    } deriving (Show, Eq, Generic)
  instance Serializable LeaveGroupResponseV0
  
  data LeaveGroupResponseV1 = LeaveGroupResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable LeaveGroupResponseV1
  
  data ListGroupsRequestV0 = ListGroupsRequestV0
    deriving (Show, Eq, Generic)
  instance Serializable ListGroupsRequestV0
  
  type ListGroupsRequestV1 = ListGroupsRequestV0
  
  data ListGroupsResponseV0 = ListGroupsResponseV0
    { errorCode :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , groups    :: !(KaArray ListedGroupV0)
      -- ^ Each group in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable ListGroupsResponseV0
  
  data ListGroupsResponseV1 = ListGroupsResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , groups         :: !(KaArray ListedGroupV0)
      -- ^ Each group in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable ListGroupsResponseV1
  
  data ListOffsetsRequestV0 = ListOffsetsRequestV0
    { replicaId :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the requestor, or -1 if this request is being made by
      -- a normal consumer.
    , topics    :: !(KaArray ListOffsetsTopicV0)
      -- ^ Each topic in the request.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsRequestV0
  
  data ListOffsetsRequestV1 = ListOffsetsRequestV1
    { replicaId :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the requestor, or -1 if this request is being made by
      -- a normal consumer.
    , topics    :: !(KaArray ListOffsetsTopicV1)
      -- ^ Each topic in the request.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsRequestV1
  
  data ListOffsetsRequestV2 = ListOffsetsRequestV2
    { replicaId      :: {-# UNPACK #-} !Int32
      -- ^ The broker ID of the requestor, or -1 if this request is being made by
      -- a normal consumer.
    , isolationLevel :: {-# UNPACK #-} !Int8
      -- ^ This setting controls the visibility of transactional records. Using
      -- READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With
      -- READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED
      -- transactional records are visible. To be more concrete, READ_COMMITTED
      -- returns all data from offsets smaller than the current LSO (last stable
      -- offset), and enables the inclusion of the list of aborted transactions
      -- in the result, which allows consumers to discard ABORTED transactional
      -- records
    , topics         :: !(KaArray ListOffsetsTopicV1)
      -- ^ Each topic in the request.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsRequestV2
  
  newtype ListOffsetsResponseV0 = ListOffsetsResponseV0
    { topics :: (KaArray ListOffsetsTopicResponseV0)
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsResponseV0
  
  newtype ListOffsetsResponseV1 = ListOffsetsResponseV1
    { topics :: (KaArray ListOffsetsTopicResponseV1)
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsResponseV1
  
  data ListOffsetsResponseV2 = ListOffsetsResponseV2
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , topics         :: !(KaArray ListOffsetsTopicResponseV1)
      -- ^ Each topic in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable ListOffsetsResponseV2
  
  newtype MetadataRequestV0 = MetadataRequestV0
    { topics :: (KaArray MetadataRequestTopicV0)
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataRequestV0
  
  type MetadataRequestV1 = MetadataRequestV0
  
  type MetadataRequestV2 = MetadataRequestV0
  
  type MetadataRequestV3 = MetadataRequestV0
  
  data MetadataRequestV4 = MetadataRequestV4
    { topics                 :: !(KaArray MetadataRequestTopicV0)
      -- ^ The topics to fetch metadata for.
    , allowAutoTopicCreation :: Bool
      -- ^ If this is true, the broker may auto-create topics that we requested
      -- which do not already exist, if it is configured to do so.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataRequestV4
  
  type MetadataRequestV5 = MetadataRequestV4
  
  data MetadataResponseV0 = MetadataResponseV0
    { brokers :: !(KaArray MetadataResponseBrokerV0)
      -- ^ Each broker in the response.
    , topics  :: !(KaArray MetadataResponseTopicV0)
      -- ^ Each topic in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseV0
  
  data MetadataResponseV1 = MetadataResponseV1
    { brokers      :: !(KaArray MetadataResponseBrokerV1)
      -- ^ Each broker in the response.
    , controllerId :: {-# UNPACK #-} !Int32
      -- ^ The ID of the controller broker.
    , topics       :: !(KaArray MetadataResponseTopicV1)
      -- ^ Each topic in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseV1
  
  data MetadataResponseV2 = MetadataResponseV2
    { brokers      :: !(KaArray MetadataResponseBrokerV1)
      -- ^ Each broker in the response.
    , clusterId    :: !NullableString
      -- ^ The cluster ID that responding broker belongs to.
    , controllerId :: {-# UNPACK #-} !Int32
      -- ^ The ID of the controller broker.
    , topics       :: !(KaArray MetadataResponseTopicV1)
      -- ^ Each topic in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseV2
  
  data MetadataResponseV3 = MetadataResponseV3
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , brokers        :: !(KaArray MetadataResponseBrokerV1)
      -- ^ Each broker in the response.
    , clusterId      :: !NullableString
      -- ^ The cluster ID that responding broker belongs to.
    , controllerId   :: {-# UNPACK #-} !Int32
      -- ^ The ID of the controller broker.
    , topics         :: !(KaArray MetadataResponseTopicV1)
      -- ^ Each topic in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseV3
  
  type MetadataResponseV4 = MetadataResponseV3
  
  data MetadataResponseV5 = MetadataResponseV5
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , brokers        :: !(KaArray MetadataResponseBrokerV1)
      -- ^ Each broker in the response.
    , clusterId      :: !NullableString
      -- ^ The cluster ID that responding broker belongs to.
    , controllerId   :: {-# UNPACK #-} !Int32
      -- ^ The ID of the controller broker.
    , topics         :: !(KaArray MetadataResponseTopicV5)
      -- ^ Each topic in the response.
    } deriving (Show, Eq, Generic)
  instance Serializable MetadataResponseV5
  
  data OffsetCommitRequestV0 = OffsetCommitRequestV0
    { groupId :: !Text
      -- ^ The unique group identifier.
    , topics  :: !(KaArray OffsetCommitRequestTopicV0)
      -- ^ The topics to commit offsets for.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestV0
  
  data OffsetCommitRequestV1 = OffsetCommitRequestV1
    { groupId      :: !Text
      -- ^ The unique group identifier.
    , generationId :: {-# UNPACK #-} !Int32
      -- ^ The generation of the group.
    , memberId     :: !Text
      -- ^ The member ID assigned by the group coordinator.
    , topics       :: !(KaArray OffsetCommitRequestTopicV1)
      -- ^ The topics to commit offsets for.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestV1
  
  data OffsetCommitRequestV2 = OffsetCommitRequestV2
    { groupId         :: !Text
      -- ^ The unique group identifier.
    , generationId    :: {-# UNPACK #-} !Int32
      -- ^ The generation of the group.
    , memberId        :: !Text
      -- ^ The member ID assigned by the group coordinator.
    , retentionTimeMs :: {-# UNPACK #-} !Int64
      -- ^ The time period in ms to retain the offset.
    , topics          :: !(KaArray OffsetCommitRequestTopicV0)
      -- ^ The topics to commit offsets for.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitRequestV2
  
  type OffsetCommitRequestV3 = OffsetCommitRequestV2
  
  newtype OffsetCommitResponseV0 = OffsetCommitResponseV0
    { topics :: (KaArray OffsetCommitResponseTopicV0)
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitResponseV0
  
  type OffsetCommitResponseV1 = OffsetCommitResponseV0
  
  type OffsetCommitResponseV2 = OffsetCommitResponseV0
  
  data OffsetCommitResponseV3 = OffsetCommitResponseV3
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , topics         :: !(KaArray OffsetCommitResponseTopicV0)
      -- ^ The responses for each topic.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetCommitResponseV3
  
  data OffsetFetchRequestV0 = OffsetFetchRequestV0
    { groupId :: !Text
      -- ^ The group to fetch offsets for.
    , topics  :: !(KaArray OffsetFetchRequestTopicV0)
      -- ^ Each topic we would like to fetch offsets for, or null to fetch
      -- offsets for all topics.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchRequestV0
  
  type OffsetFetchRequestV1 = OffsetFetchRequestV0
  
  type OffsetFetchRequestV2 = OffsetFetchRequestV0
  
  type OffsetFetchRequestV3 = OffsetFetchRequestV0
  
  newtype OffsetFetchResponseV0 = OffsetFetchResponseV0
    { topics :: (KaArray OffsetFetchResponseTopicV0)
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchResponseV0
  
  type OffsetFetchResponseV1 = OffsetFetchResponseV0
  
  data OffsetFetchResponseV2 = OffsetFetchResponseV2
    { topics    :: !(KaArray OffsetFetchResponseTopicV0)
      -- ^ The responses per topic.
    , errorCode :: {-# UNPACK #-} !ErrorCode
      -- ^ The top-level error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchResponseV2
  
  data OffsetFetchResponseV3 = OffsetFetchResponseV3
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , topics         :: !(KaArray OffsetFetchResponseTopicV0)
      -- ^ The responses per topic.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The top-level error code, or 0 if there was no error.
    } deriving (Show, Eq, Generic)
  instance Serializable OffsetFetchResponseV3
  
  data ProduceRequestV0 = ProduceRequestV0
    { acks      :: {-# UNPACK #-} !Int16
      -- ^ The number of acknowledgments the producer requires the leader to have
      -- received before considering a request complete. Allowed values: 0 for no
      -- acknowledgments, 1 for only the leader and -1 for the full ISR.
    , timeoutMs :: {-# UNPACK #-} !Int32
      -- ^ The timeout to await a response in milliseconds.
    , topicData :: !(KaArray TopicProduceDataV0)
      -- ^ Each topic to produce to.
    } deriving (Show, Eq, Generic)
  instance Serializable ProduceRequestV0
  
  type ProduceRequestV1 = ProduceRequestV0
  
  type ProduceRequestV2 = ProduceRequestV0
  
  data ProduceRequestV3 = ProduceRequestV3
    { transactionalId :: !NullableString
      -- ^ The transactional ID, or null if the producer is not transactional.
    , acks            :: {-# UNPACK #-} !Int16
      -- ^ The number of acknowledgments the producer requires the leader to have
      -- received before considering a request complete. Allowed values: 0 for no
      -- acknowledgments, 1 for only the leader and -1 for the full ISR.
    , timeoutMs       :: {-# UNPACK #-} !Int32
      -- ^ The timeout to await a response in milliseconds.
    , topicData       :: !(KaArray TopicProduceDataV0)
      -- ^ Each topic to produce to.
    } deriving (Show, Eq, Generic)
  instance Serializable ProduceRequestV3
  
  type ProduceRequestV4 = ProduceRequestV3
  
  type ProduceRequestV5 = ProduceRequestV3
  
  type ProduceRequestV6 = ProduceRequestV3
  
  type ProduceRequestV7 = ProduceRequestV3
  
  newtype ProduceResponseV0 = ProduceResponseV0
    { responses :: (KaArray TopicProduceResponseV0)
    } deriving (Show, Eq, Generic)
  instance Serializable ProduceResponseV0
  
  data ProduceResponseV1 = ProduceResponseV1
    { responses      :: !(KaArray TopicProduceResponseV0)
      -- ^ Each produce response
    , throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    } deriving (Show, Eq, Generic)
  instance Serializable ProduceResponseV1
  
  data ProduceResponseV2 = ProduceResponseV2
    { responses      :: !(KaArray TopicProduceResponseV2)
      -- ^ Each produce response
    , throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    } deriving (Show, Eq, Generic)
  instance Serializable ProduceResponseV2
  
  type ProduceResponseV3 = ProduceResponseV2
  
  type ProduceResponseV4 = ProduceResponseV2
  
  data ProduceResponseV5 = ProduceResponseV5
    { responses      :: !(KaArray TopicProduceResponseV5)
      -- ^ Each produce response
    , throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    } deriving (Show, Eq, Generic)
  instance Serializable ProduceResponseV5
  
  type ProduceResponseV6 = ProduceResponseV5
  
  type ProduceResponseV7 = ProduceResponseV5
  
  newtype SaslAuthenticateRequestV0 = SaslAuthenticateRequestV0
    { authBytes :: ByteString
    } deriving (Show, Eq, Generic)
  instance Serializable SaslAuthenticateRequestV0
  
  data SaslAuthenticateResponseV0 = SaslAuthenticateResponseV0
    { errorCode    :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , errorMessage :: !NullableString
      -- ^ The error message, or null if there was no error.
    , authBytes    :: !ByteString
      -- ^ The SASL authentication bytes from the server, as defined by the SASL
      -- mechanism.
    } deriving (Show, Eq, Generic)
  instance Serializable SaslAuthenticateResponseV0
  
  newtype SaslHandshakeRequestV0 = SaslHandshakeRequestV0
    { mechanism :: Text
    } deriving (Show, Eq, Generic)
  instance Serializable SaslHandshakeRequestV0
  
  type SaslHandshakeRequestV1 = SaslHandshakeRequestV0
  
  data SaslHandshakeResponseV0 = SaslHandshakeResponseV0
    { errorCode  :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , mechanisms :: !(KaArray Text)
      -- ^ The mechanisms enabled in the server.
    } deriving (Show, Eq, Generic)
  instance Serializable SaslHandshakeResponseV0
  
  type SaslHandshakeResponseV1 = SaslHandshakeResponseV0
  
  data SyncGroupRequestV0 = SyncGroupRequestV0
    { groupId      :: !Text
      -- ^ The unique group identifier.
    , generationId :: {-# UNPACK #-} !Int32
      -- ^ The generation of the group.
    , memberId     :: !Text
      -- ^ The member ID assigned by the group.
    , assignments  :: !(KaArray SyncGroupRequestAssignmentV0)
      -- ^ Each assignment.
    } deriving (Show, Eq, Generic)
  instance Serializable SyncGroupRequestV0
  
  type SyncGroupRequestV1 = SyncGroupRequestV0
  
  data SyncGroupResponseV0 = SyncGroupResponseV0
    { errorCode  :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , assignment :: !ByteString
      -- ^ The member assignment.
    } deriving (Show, Eq, Generic)
  instance Serializable SyncGroupResponseV0
  
  data SyncGroupResponseV1 = SyncGroupResponseV1
    { throttleTimeMs :: {-# UNPACK #-} !Int32
      -- ^ The duration in milliseconds for which the request was throttled due
      -- to a quota violation, or zero if the request did not violate any quota.
    , errorCode      :: {-# UNPACK #-} !ErrorCode
      -- ^ The error code, or 0 if there was no error.
    , assignment     :: !ByteString
      -- ^ The member assignment.
    } deriving (Show, Eq, Generic)
  instance Serializable SyncGroupResponseV1
  
  data HadminCommandRequestV0 = HadminCommandRequestV0
    { command      :: !CompactString
      -- ^ The admin command.
    , taggedFields :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable HadminCommandRequestV0
  
  data HadminCommandResponseV0 = HadminCommandResponseV0
    { result       :: !CompactString
      -- ^ The admin command result.
    , taggedFields :: !TaggedFields
    } deriving (Show, Eq, Generic)
  instance Serializable HadminCommandResponseV0
  
  -------------------------------------------------------------------------------
  
  data HStreamKafkaV0
  
  instance Service HStreamKafkaV0 where
    type ServiceName HStreamKafkaV0 = "HStreamKafkaV0"
    type ServiceMethods HStreamKafkaV0 =
      '[ "hadminCommand"
       , "produce"
       , "fetch"
       , "listOffsets"
       , "metadata"
       , "offsetCommit"
       , "offsetFetch"
       , "findCoordinator"
       , "joinGroup"
       , "heartbeat"
       , "leaveGroup"
       , "syncGroup"
       , "describeGroups"
       , "listGroups"
       , "saslHandshake"
       , "apiVersions"
       , "createTopics"
       , "deleteTopics"
       , "initProducerId"
       , "describeAcls"
       , "createAcls"
       , "deleteAcls"
       , "describeConfigs"
       , "saslAuthenticate"
       , "createPartitions"
       ]
  
  instance HasMethodImpl HStreamKafkaV0 "hadminCommand" where
    type MethodName HStreamKafkaV0 "hadminCommand" = "hadminCommand"
    type MethodKey HStreamKafkaV0 "hadminCommand" = 65526
    type MethodVersion HStreamKafkaV0 "hadminCommand" = 0
    type MethodInput HStreamKafkaV0 "hadminCommand" = HadminCommandRequestV0
    type MethodOutput HStreamKafkaV0 "hadminCommand" = HadminCommandResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "produce" where
    type MethodName HStreamKafkaV0 "produce" = "produce"
    type MethodKey HStreamKafkaV0 "produce" = 0
    type MethodVersion HStreamKafkaV0 "produce" = 0
    type MethodInput HStreamKafkaV0 "produce" = ProduceRequestV0
    type MethodOutput HStreamKafkaV0 "produce" = ProduceResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "fetch" where
    type MethodName HStreamKafkaV0 "fetch" = "fetch"
    type MethodKey HStreamKafkaV0 "fetch" = 1
    type MethodVersion HStreamKafkaV0 "fetch" = 0
    type MethodInput HStreamKafkaV0 "fetch" = FetchRequestV0
    type MethodOutput HStreamKafkaV0 "fetch" = FetchResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "listOffsets" where
    type MethodName HStreamKafkaV0 "listOffsets" = "listOffsets"
    type MethodKey HStreamKafkaV0 "listOffsets" = 2
    type MethodVersion HStreamKafkaV0 "listOffsets" = 0
    type MethodInput HStreamKafkaV0 "listOffsets" = ListOffsetsRequestV0
    type MethodOutput HStreamKafkaV0 "listOffsets" = ListOffsetsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "metadata" where
    type MethodName HStreamKafkaV0 "metadata" = "metadata"
    type MethodKey HStreamKafkaV0 "metadata" = 3
    type MethodVersion HStreamKafkaV0 "metadata" = 0
    type MethodInput HStreamKafkaV0 "metadata" = MetadataRequestV0
    type MethodOutput HStreamKafkaV0 "metadata" = MetadataResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "offsetCommit" where
    type MethodName HStreamKafkaV0 "offsetCommit" = "offsetCommit"
    type MethodKey HStreamKafkaV0 "offsetCommit" = 8
    type MethodVersion HStreamKafkaV0 "offsetCommit" = 0
    type MethodInput HStreamKafkaV0 "offsetCommit" = OffsetCommitRequestV0
    type MethodOutput HStreamKafkaV0 "offsetCommit" = OffsetCommitResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "offsetFetch" where
    type MethodName HStreamKafkaV0 "offsetFetch" = "offsetFetch"
    type MethodKey HStreamKafkaV0 "offsetFetch" = 9
    type MethodVersion HStreamKafkaV0 "offsetFetch" = 0
    type MethodInput HStreamKafkaV0 "offsetFetch" = OffsetFetchRequestV0
    type MethodOutput HStreamKafkaV0 "offsetFetch" = OffsetFetchResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "findCoordinator" where
    type MethodName HStreamKafkaV0 "findCoordinator" = "findCoordinator"
    type MethodKey HStreamKafkaV0 "findCoordinator" = 10
    type MethodVersion HStreamKafkaV0 "findCoordinator" = 0
    type MethodInput HStreamKafkaV0 "findCoordinator" = FindCoordinatorRequestV0
    type MethodOutput HStreamKafkaV0 "findCoordinator" = FindCoordinatorResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "joinGroup" where
    type MethodName HStreamKafkaV0 "joinGroup" = "joinGroup"
    type MethodKey HStreamKafkaV0 "joinGroup" = 11
    type MethodVersion HStreamKafkaV0 "joinGroup" = 0
    type MethodInput HStreamKafkaV0 "joinGroup" = JoinGroupRequestV0
    type MethodOutput HStreamKafkaV0 "joinGroup" = JoinGroupResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "heartbeat" where
    type MethodName HStreamKafkaV0 "heartbeat" = "heartbeat"
    type MethodKey HStreamKafkaV0 "heartbeat" = 12
    type MethodVersion HStreamKafkaV0 "heartbeat" = 0
    type MethodInput HStreamKafkaV0 "heartbeat" = HeartbeatRequestV0
    type MethodOutput HStreamKafkaV0 "heartbeat" = HeartbeatResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "leaveGroup" where
    type MethodName HStreamKafkaV0 "leaveGroup" = "leaveGroup"
    type MethodKey HStreamKafkaV0 "leaveGroup" = 13
    type MethodVersion HStreamKafkaV0 "leaveGroup" = 0
    type MethodInput HStreamKafkaV0 "leaveGroup" = LeaveGroupRequestV0
    type MethodOutput HStreamKafkaV0 "leaveGroup" = LeaveGroupResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "syncGroup" where
    type MethodName HStreamKafkaV0 "syncGroup" = "syncGroup"
    type MethodKey HStreamKafkaV0 "syncGroup" = 14
    type MethodVersion HStreamKafkaV0 "syncGroup" = 0
    type MethodInput HStreamKafkaV0 "syncGroup" = SyncGroupRequestV0
    type MethodOutput HStreamKafkaV0 "syncGroup" = SyncGroupResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "describeGroups" where
    type MethodName HStreamKafkaV0 "describeGroups" = "describeGroups"
    type MethodKey HStreamKafkaV0 "describeGroups" = 15
    type MethodVersion HStreamKafkaV0 "describeGroups" = 0
    type MethodInput HStreamKafkaV0 "describeGroups" = DescribeGroupsRequestV0
    type MethodOutput HStreamKafkaV0 "describeGroups" = DescribeGroupsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "listGroups" where
    type MethodName HStreamKafkaV0 "listGroups" = "listGroups"
    type MethodKey HStreamKafkaV0 "listGroups" = 16
    type MethodVersion HStreamKafkaV0 "listGroups" = 0
    type MethodInput HStreamKafkaV0 "listGroups" = ListGroupsRequestV0
    type MethodOutput HStreamKafkaV0 "listGroups" = ListGroupsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "saslHandshake" where
    type MethodName HStreamKafkaV0 "saslHandshake" = "saslHandshake"
    type MethodKey HStreamKafkaV0 "saslHandshake" = 17
    type MethodVersion HStreamKafkaV0 "saslHandshake" = 0
    type MethodInput HStreamKafkaV0 "saslHandshake" = SaslHandshakeRequestV0
    type MethodOutput HStreamKafkaV0 "saslHandshake" = SaslHandshakeResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "apiVersions" where
    type MethodName HStreamKafkaV0 "apiVersions" = "apiVersions"
    type MethodKey HStreamKafkaV0 "apiVersions" = 18
    type MethodVersion HStreamKafkaV0 "apiVersions" = 0
    type MethodInput HStreamKafkaV0 "apiVersions" = ApiVersionsRequestV0
    type MethodOutput HStreamKafkaV0 "apiVersions" = ApiVersionsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "createTopics" where
    type MethodName HStreamKafkaV0 "createTopics" = "createTopics"
    type MethodKey HStreamKafkaV0 "createTopics" = 19
    type MethodVersion HStreamKafkaV0 "createTopics" = 0
    type MethodInput HStreamKafkaV0 "createTopics" = CreateTopicsRequestV0
    type MethodOutput HStreamKafkaV0 "createTopics" = CreateTopicsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "deleteTopics" where
    type MethodName HStreamKafkaV0 "deleteTopics" = "deleteTopics"
    type MethodKey HStreamKafkaV0 "deleteTopics" = 20
    type MethodVersion HStreamKafkaV0 "deleteTopics" = 0
    type MethodInput HStreamKafkaV0 "deleteTopics" = DeleteTopicsRequestV0
    type MethodOutput HStreamKafkaV0 "deleteTopics" = DeleteTopicsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "initProducerId" where
    type MethodName HStreamKafkaV0 "initProducerId" = "initProducerId"
    type MethodKey HStreamKafkaV0 "initProducerId" = 22
    type MethodVersion HStreamKafkaV0 "initProducerId" = 0
    type MethodInput HStreamKafkaV0 "initProducerId" = InitProducerIdRequestV0
    type MethodOutput HStreamKafkaV0 "initProducerId" = InitProducerIdResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "describeAcls" where
    type MethodName HStreamKafkaV0 "describeAcls" = "describeAcls"
    type MethodKey HStreamKafkaV0 "describeAcls" = 29
    type MethodVersion HStreamKafkaV0 "describeAcls" = 0
    type MethodInput HStreamKafkaV0 "describeAcls" = DescribeAclsRequestV0
    type MethodOutput HStreamKafkaV0 "describeAcls" = DescribeAclsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "createAcls" where
    type MethodName HStreamKafkaV0 "createAcls" = "createAcls"
    type MethodKey HStreamKafkaV0 "createAcls" = 30
    type MethodVersion HStreamKafkaV0 "createAcls" = 0
    type MethodInput HStreamKafkaV0 "createAcls" = CreateAclsRequestV0
    type MethodOutput HStreamKafkaV0 "createAcls" = CreateAclsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "deleteAcls" where
    type MethodName HStreamKafkaV0 "deleteAcls" = "deleteAcls"
    type MethodKey HStreamKafkaV0 "deleteAcls" = 31
    type MethodVersion HStreamKafkaV0 "deleteAcls" = 0
    type MethodInput HStreamKafkaV0 "deleteAcls" = DeleteAclsRequestV0
    type MethodOutput HStreamKafkaV0 "deleteAcls" = DeleteAclsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "describeConfigs" where
    type MethodName HStreamKafkaV0 "describeConfigs" = "describeConfigs"
    type MethodKey HStreamKafkaV0 "describeConfigs" = 32
    type MethodVersion HStreamKafkaV0 "describeConfigs" = 0
    type MethodInput HStreamKafkaV0 "describeConfigs" = DescribeConfigsRequestV0
    type MethodOutput HStreamKafkaV0 "describeConfigs" = DescribeConfigsResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "saslAuthenticate" where
    type MethodName HStreamKafkaV0 "saslAuthenticate" = "saslAuthenticate"
    type MethodKey HStreamKafkaV0 "saslAuthenticate" = 36
    type MethodVersion HStreamKafkaV0 "saslAuthenticate" = 0
    type MethodInput HStreamKafkaV0 "saslAuthenticate" = SaslAuthenticateRequestV0
    type MethodOutput HStreamKafkaV0 "saslAuthenticate" = SaslAuthenticateResponseV0
  
  instance HasMethodImpl HStreamKafkaV0 "createPartitions" where
    type MethodName HStreamKafkaV0 "createPartitions" = "createPartitions"
    type MethodKey HStreamKafkaV0 "createPartitions" = 37
    type MethodVersion HStreamKafkaV0 "createPartitions" = 0
    type MethodInput HStreamKafkaV0 "createPartitions" = CreatePartitionsRequestV0
    type MethodOutput HStreamKafkaV0 "createPartitions" = CreatePartitionsResponseV0
  
  data HStreamKafkaV1
  
  instance Service HStreamKafkaV1 where
    type ServiceName HStreamKafkaV1 = "HStreamKafkaV1"
    type ServiceMethods HStreamKafkaV1 =
      '[ "produce"
       , "fetch"
       , "listOffsets"
       , "metadata"
       , "offsetCommit"
       , "offsetFetch"
       , "findCoordinator"
       , "joinGroup"
       , "heartbeat"
       , "leaveGroup"
       , "syncGroup"
       , "describeGroups"
       , "listGroups"
       , "saslHandshake"
       , "apiVersions"
       , "createTopics"
       , "deleteTopics"
       , "createPartitions"
       ]
  
  instance HasMethodImpl HStreamKafkaV1 "produce" where
    type MethodName HStreamKafkaV1 "produce" = "produce"
    type MethodKey HStreamKafkaV1 "produce" = 0
    type MethodVersion HStreamKafkaV1 "produce" = 1
    type MethodInput HStreamKafkaV1 "produce" = ProduceRequestV1
    type MethodOutput HStreamKafkaV1 "produce" = ProduceResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "fetch" where
    type MethodName HStreamKafkaV1 "fetch" = "fetch"
    type MethodKey HStreamKafkaV1 "fetch" = 1
    type MethodVersion HStreamKafkaV1 "fetch" = 1
    type MethodInput HStreamKafkaV1 "fetch" = FetchRequestV1
    type MethodOutput HStreamKafkaV1 "fetch" = FetchResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "listOffsets" where
    type MethodName HStreamKafkaV1 "listOffsets" = "listOffsets"
    type MethodKey HStreamKafkaV1 "listOffsets" = 2
    type MethodVersion HStreamKafkaV1 "listOffsets" = 1
    type MethodInput HStreamKafkaV1 "listOffsets" = ListOffsetsRequestV1
    type MethodOutput HStreamKafkaV1 "listOffsets" = ListOffsetsResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "metadata" where
    type MethodName HStreamKafkaV1 "metadata" = "metadata"
    type MethodKey HStreamKafkaV1 "metadata" = 3
    type MethodVersion HStreamKafkaV1 "metadata" = 1
    type MethodInput HStreamKafkaV1 "metadata" = MetadataRequestV1
    type MethodOutput HStreamKafkaV1 "metadata" = MetadataResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "offsetCommit" where
    type MethodName HStreamKafkaV1 "offsetCommit" = "offsetCommit"
    type MethodKey HStreamKafkaV1 "offsetCommit" = 8
    type MethodVersion HStreamKafkaV1 "offsetCommit" = 1
    type MethodInput HStreamKafkaV1 "offsetCommit" = OffsetCommitRequestV1
    type MethodOutput HStreamKafkaV1 "offsetCommit" = OffsetCommitResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "offsetFetch" where
    type MethodName HStreamKafkaV1 "offsetFetch" = "offsetFetch"
    type MethodKey HStreamKafkaV1 "offsetFetch" = 9
    type MethodVersion HStreamKafkaV1 "offsetFetch" = 1
    type MethodInput HStreamKafkaV1 "offsetFetch" = OffsetFetchRequestV1
    type MethodOutput HStreamKafkaV1 "offsetFetch" = OffsetFetchResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "findCoordinator" where
    type MethodName HStreamKafkaV1 "findCoordinator" = "findCoordinator"
    type MethodKey HStreamKafkaV1 "findCoordinator" = 10
    type MethodVersion HStreamKafkaV1 "findCoordinator" = 1
    type MethodInput HStreamKafkaV1 "findCoordinator" = FindCoordinatorRequestV1
    type MethodOutput HStreamKafkaV1 "findCoordinator" = FindCoordinatorResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "joinGroup" where
    type MethodName HStreamKafkaV1 "joinGroup" = "joinGroup"
    type MethodKey HStreamKafkaV1 "joinGroup" = 11
    type MethodVersion HStreamKafkaV1 "joinGroup" = 1
    type MethodInput HStreamKafkaV1 "joinGroup" = JoinGroupRequestV1
    type MethodOutput HStreamKafkaV1 "joinGroup" = JoinGroupResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "heartbeat" where
    type MethodName HStreamKafkaV1 "heartbeat" = "heartbeat"
    type MethodKey HStreamKafkaV1 "heartbeat" = 12
    type MethodVersion HStreamKafkaV1 "heartbeat" = 1
    type MethodInput HStreamKafkaV1 "heartbeat" = HeartbeatRequestV1
    type MethodOutput HStreamKafkaV1 "heartbeat" = HeartbeatResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "leaveGroup" where
    type MethodName HStreamKafkaV1 "leaveGroup" = "leaveGroup"
    type MethodKey HStreamKafkaV1 "leaveGroup" = 13
    type MethodVersion HStreamKafkaV1 "leaveGroup" = 1
    type MethodInput HStreamKafkaV1 "leaveGroup" = LeaveGroupRequestV1
    type MethodOutput HStreamKafkaV1 "leaveGroup" = LeaveGroupResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "syncGroup" where
    type MethodName HStreamKafkaV1 "syncGroup" = "syncGroup"
    type MethodKey HStreamKafkaV1 "syncGroup" = 14
    type MethodVersion HStreamKafkaV1 "syncGroup" = 1
    type MethodInput HStreamKafkaV1 "syncGroup" = SyncGroupRequestV1
    type MethodOutput HStreamKafkaV1 "syncGroup" = SyncGroupResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "describeGroups" where
    type MethodName HStreamKafkaV1 "describeGroups" = "describeGroups"
    type MethodKey HStreamKafkaV1 "describeGroups" = 15
    type MethodVersion HStreamKafkaV1 "describeGroups" = 1
    type MethodInput HStreamKafkaV1 "describeGroups" = DescribeGroupsRequestV1
    type MethodOutput HStreamKafkaV1 "describeGroups" = DescribeGroupsResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "listGroups" where
    type MethodName HStreamKafkaV1 "listGroups" = "listGroups"
    type MethodKey HStreamKafkaV1 "listGroups" = 16
    type MethodVersion HStreamKafkaV1 "listGroups" = 1
    type MethodInput HStreamKafkaV1 "listGroups" = ListGroupsRequestV1
    type MethodOutput HStreamKafkaV1 "listGroups" = ListGroupsResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "saslHandshake" where
    type MethodName HStreamKafkaV1 "saslHandshake" = "saslHandshake"
    type MethodKey HStreamKafkaV1 "saslHandshake" = 17
    type MethodVersion HStreamKafkaV1 "saslHandshake" = 1
    type MethodInput HStreamKafkaV1 "saslHandshake" = SaslHandshakeRequestV1
    type MethodOutput HStreamKafkaV1 "saslHandshake" = SaslHandshakeResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "apiVersions" where
    type MethodName HStreamKafkaV1 "apiVersions" = "apiVersions"
    type MethodKey HStreamKafkaV1 "apiVersions" = 18
    type MethodVersion HStreamKafkaV1 "apiVersions" = 1
    type MethodInput HStreamKafkaV1 "apiVersions" = ApiVersionsRequestV1
    type MethodOutput HStreamKafkaV1 "apiVersions" = ApiVersionsResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "createTopics" where
    type MethodName HStreamKafkaV1 "createTopics" = "createTopics"
    type MethodKey HStreamKafkaV1 "createTopics" = 19
    type MethodVersion HStreamKafkaV1 "createTopics" = 1
    type MethodInput HStreamKafkaV1 "createTopics" = CreateTopicsRequestV1
    type MethodOutput HStreamKafkaV1 "createTopics" = CreateTopicsResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "deleteTopics" where
    type MethodName HStreamKafkaV1 "deleteTopics" = "deleteTopics"
    type MethodKey HStreamKafkaV1 "deleteTopics" = 20
    type MethodVersion HStreamKafkaV1 "deleteTopics" = 1
    type MethodInput HStreamKafkaV1 "deleteTopics" = DeleteTopicsRequestV1
    type MethodOutput HStreamKafkaV1 "deleteTopics" = DeleteTopicsResponseV1
  
  instance HasMethodImpl HStreamKafkaV1 "createPartitions" where
    type MethodName HStreamKafkaV1 "createPartitions" = "createPartitions"
    type MethodKey HStreamKafkaV1 "createPartitions" = 37
    type MethodVersion HStreamKafkaV1 "createPartitions" = 1
    type MethodInput HStreamKafkaV1 "createPartitions" = CreatePartitionsRequestV1
    type MethodOutput HStreamKafkaV1 "createPartitions" = CreatePartitionsResponseV1
  
  data HStreamKafkaV2
  
  instance Service HStreamKafkaV2 where
    type ServiceName HStreamKafkaV2 = "HStreamKafkaV2"
    type ServiceMethods HStreamKafkaV2 =
      '[ "produce"
       , "fetch"
       , "listOffsets"
       , "metadata"
       , "offsetCommit"
       , "offsetFetch"
       , "joinGroup"
       , "apiVersions"
       , "createTopics"
       ]
  
  instance HasMethodImpl HStreamKafkaV2 "produce" where
    type MethodName HStreamKafkaV2 "produce" = "produce"
    type MethodKey HStreamKafkaV2 "produce" = 0
    type MethodVersion HStreamKafkaV2 "produce" = 2
    type MethodInput HStreamKafkaV2 "produce" = ProduceRequestV2
    type MethodOutput HStreamKafkaV2 "produce" = ProduceResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "fetch" where
    type MethodName HStreamKafkaV2 "fetch" = "fetch"
    type MethodKey HStreamKafkaV2 "fetch" = 1
    type MethodVersion HStreamKafkaV2 "fetch" = 2
    type MethodInput HStreamKafkaV2 "fetch" = FetchRequestV2
    type MethodOutput HStreamKafkaV2 "fetch" = FetchResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "listOffsets" where
    type MethodName HStreamKafkaV2 "listOffsets" = "listOffsets"
    type MethodKey HStreamKafkaV2 "listOffsets" = 2
    type MethodVersion HStreamKafkaV2 "listOffsets" = 2
    type MethodInput HStreamKafkaV2 "listOffsets" = ListOffsetsRequestV2
    type MethodOutput HStreamKafkaV2 "listOffsets" = ListOffsetsResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "metadata" where
    type MethodName HStreamKafkaV2 "metadata" = "metadata"
    type MethodKey HStreamKafkaV2 "metadata" = 3
    type MethodVersion HStreamKafkaV2 "metadata" = 2
    type MethodInput HStreamKafkaV2 "metadata" = MetadataRequestV2
    type MethodOutput HStreamKafkaV2 "metadata" = MetadataResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "offsetCommit" where
    type MethodName HStreamKafkaV2 "offsetCommit" = "offsetCommit"
    type MethodKey HStreamKafkaV2 "offsetCommit" = 8
    type MethodVersion HStreamKafkaV2 "offsetCommit" = 2
    type MethodInput HStreamKafkaV2 "offsetCommit" = OffsetCommitRequestV2
    type MethodOutput HStreamKafkaV2 "offsetCommit" = OffsetCommitResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "offsetFetch" where
    type MethodName HStreamKafkaV2 "offsetFetch" = "offsetFetch"
    type MethodKey HStreamKafkaV2 "offsetFetch" = 9
    type MethodVersion HStreamKafkaV2 "offsetFetch" = 2
    type MethodInput HStreamKafkaV2 "offsetFetch" = OffsetFetchRequestV2
    type MethodOutput HStreamKafkaV2 "offsetFetch" = OffsetFetchResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "joinGroup" where
    type MethodName HStreamKafkaV2 "joinGroup" = "joinGroup"
    type MethodKey HStreamKafkaV2 "joinGroup" = 11
    type MethodVersion HStreamKafkaV2 "joinGroup" = 2
    type MethodInput HStreamKafkaV2 "joinGroup" = JoinGroupRequestV2
    type MethodOutput HStreamKafkaV2 "joinGroup" = JoinGroupResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "apiVersions" where
    type MethodName HStreamKafkaV2 "apiVersions" = "apiVersions"
    type MethodKey HStreamKafkaV2 "apiVersions" = 18
    type MethodVersion HStreamKafkaV2 "apiVersions" = 2
    type MethodInput HStreamKafkaV2 "apiVersions" = ApiVersionsRequestV2
    type MethodOutput HStreamKafkaV2 "apiVersions" = ApiVersionsResponseV2
  
  instance HasMethodImpl HStreamKafkaV2 "createTopics" where
    type MethodName HStreamKafkaV2 "createTopics" = "createTopics"
    type MethodKey HStreamKafkaV2 "createTopics" = 19
    type MethodVersion HStreamKafkaV2 "createTopics" = 2
    type MethodInput HStreamKafkaV2 "createTopics" = CreateTopicsRequestV2
    type MethodOutput HStreamKafkaV2 "createTopics" = CreateTopicsResponseV2
  
  data HStreamKafkaV3
  
  instance Service HStreamKafkaV3 where
    type ServiceName HStreamKafkaV3 = "HStreamKafkaV3"
    type ServiceMethods HStreamKafkaV3 =
      '[ "produce"
       , "fetch"
       , "metadata"
       , "offsetCommit"
       , "offsetFetch"
       , "apiVersions"
       ]
  
  instance HasMethodImpl HStreamKafkaV3 "produce" where
    type MethodName HStreamKafkaV3 "produce" = "produce"
    type MethodKey HStreamKafkaV3 "produce" = 0
    type MethodVersion HStreamKafkaV3 "produce" = 3
    type MethodInput HStreamKafkaV3 "produce" = ProduceRequestV3
    type MethodOutput HStreamKafkaV3 "produce" = ProduceResponseV3
  
  instance HasMethodImpl HStreamKafkaV3 "fetch" where
    type MethodName HStreamKafkaV3 "fetch" = "fetch"
    type MethodKey HStreamKafkaV3 "fetch" = 1
    type MethodVersion HStreamKafkaV3 "fetch" = 3
    type MethodInput HStreamKafkaV3 "fetch" = FetchRequestV3
    type MethodOutput HStreamKafkaV3 "fetch" = FetchResponseV3
  
  instance HasMethodImpl HStreamKafkaV3 "metadata" where
    type MethodName HStreamKafkaV3 "metadata" = "metadata"
    type MethodKey HStreamKafkaV3 "metadata" = 3
    type MethodVersion HStreamKafkaV3 "metadata" = 3
    type MethodInput HStreamKafkaV3 "metadata" = MetadataRequestV3
    type MethodOutput HStreamKafkaV3 "metadata" = MetadataResponseV3
  
  instance HasMethodImpl HStreamKafkaV3 "offsetCommit" where
    type MethodName HStreamKafkaV3 "offsetCommit" = "offsetCommit"
    type MethodKey HStreamKafkaV3 "offsetCommit" = 8
    type MethodVersion HStreamKafkaV3 "offsetCommit" = 3
    type MethodInput HStreamKafkaV3 "offsetCommit" = OffsetCommitRequestV3
    type MethodOutput HStreamKafkaV3 "offsetCommit" = OffsetCommitResponseV3
  
  instance HasMethodImpl HStreamKafkaV3 "offsetFetch" where
    type MethodName HStreamKafkaV3 "offsetFetch" = "offsetFetch"
    type MethodKey HStreamKafkaV3 "offsetFetch" = 9
    type MethodVersion HStreamKafkaV3 "offsetFetch" = 3
    type MethodInput HStreamKafkaV3 "offsetFetch" = OffsetFetchRequestV3
    type MethodOutput HStreamKafkaV3 "offsetFetch" = OffsetFetchResponseV3
  
  instance HasMethodImpl HStreamKafkaV3 "apiVersions" where
    type MethodName HStreamKafkaV3 "apiVersions" = "apiVersions"
    type MethodKey HStreamKafkaV3 "apiVersions" = 18
    type MethodVersion HStreamKafkaV3 "apiVersions" = 3
    type MethodInput HStreamKafkaV3 "apiVersions" = ApiVersionsRequestV3
    type MethodOutput HStreamKafkaV3 "apiVersions" = ApiVersionsResponseV3
  
  data HStreamKafkaV4
  
  instance Service HStreamKafkaV4 where
    type ServiceName HStreamKafkaV4 = "HStreamKafkaV4"
    type ServiceMethods HStreamKafkaV4 =
      '[ "produce"
       , "fetch"
       , "metadata"
       ]
  
  instance HasMethodImpl HStreamKafkaV4 "produce" where
    type MethodName HStreamKafkaV4 "produce" = "produce"
    type MethodKey HStreamKafkaV4 "produce" = 0
    type MethodVersion HStreamKafkaV4 "produce" = 4
    type MethodInput HStreamKafkaV4 "produce" = ProduceRequestV4
    type MethodOutput HStreamKafkaV4 "produce" = ProduceResponseV4
  
  instance HasMethodImpl HStreamKafkaV4 "fetch" where
    type MethodName HStreamKafkaV4 "fetch" = "fetch"
    type MethodKey HStreamKafkaV4 "fetch" = 1
    type MethodVersion HStreamKafkaV4 "fetch" = 4
    type MethodInput HStreamKafkaV4 "fetch" = FetchRequestV4
    type MethodOutput HStreamKafkaV4 "fetch" = FetchResponseV4
  
  instance HasMethodImpl HStreamKafkaV4 "metadata" where
    type MethodName HStreamKafkaV4 "metadata" = "metadata"
    type MethodKey HStreamKafkaV4 "metadata" = 3
    type MethodVersion HStreamKafkaV4 "metadata" = 4
    type MethodInput HStreamKafkaV4 "metadata" = MetadataRequestV4
    type MethodOutput HStreamKafkaV4 "metadata" = MetadataResponseV4
  
  data HStreamKafkaV5
  
  instance Service HStreamKafkaV5 where
    type ServiceName HStreamKafkaV5 = "HStreamKafkaV5"
    type ServiceMethods HStreamKafkaV5 =
      '[ "produce"
       , "fetch"
       , "metadata"
       ]
  
  instance HasMethodImpl HStreamKafkaV5 "produce" where
    type MethodName HStreamKafkaV5 "produce" = "produce"
    type MethodKey HStreamKafkaV5 "produce" = 0
    type MethodVersion HStreamKafkaV5 "produce" = 5
    type MethodInput HStreamKafkaV5 "produce" = ProduceRequestV5
    type MethodOutput HStreamKafkaV5 "produce" = ProduceResponseV5
  
  instance HasMethodImpl HStreamKafkaV5 "fetch" where
    type MethodName HStreamKafkaV5 "fetch" = "fetch"
    type MethodKey HStreamKafkaV5 "fetch" = 1
    type MethodVersion HStreamKafkaV5 "fetch" = 5
    type MethodInput HStreamKafkaV5 "fetch" = FetchRequestV5
    type MethodOutput HStreamKafkaV5 "fetch" = FetchResponseV5
  
  instance HasMethodImpl HStreamKafkaV5 "metadata" where
    type MethodName HStreamKafkaV5 "metadata" = "metadata"
    type MethodKey HStreamKafkaV5 "metadata" = 3
    type MethodVersion HStreamKafkaV5 "metadata" = 5
    type MethodInput HStreamKafkaV5 "metadata" = MetadataRequestV5
    type MethodOutput HStreamKafkaV5 "metadata" = MetadataResponseV5
  
  data HStreamKafkaV6
  
  instance Service HStreamKafkaV6 where
    type ServiceName HStreamKafkaV6 = "HStreamKafkaV6"
    type ServiceMethods HStreamKafkaV6 =
      '[ "produce"
       , "fetch"
       ]
  
  instance HasMethodImpl HStreamKafkaV6 "produce" where
    type MethodName HStreamKafkaV6 "produce" = "produce"
    type MethodKey HStreamKafkaV6 "produce" = 0
    type MethodVersion HStreamKafkaV6 "produce" = 6
    type MethodInput HStreamKafkaV6 "produce" = ProduceRequestV6
    type MethodOutput HStreamKafkaV6 "produce" = ProduceResponseV6
  
  instance HasMethodImpl HStreamKafkaV6 "fetch" where
    type MethodName HStreamKafkaV6 "fetch" = "fetch"
    type MethodKey HStreamKafkaV6 "fetch" = 1
    type MethodVersion HStreamKafkaV6 "fetch" = 6
    type MethodInput HStreamKafkaV6 "fetch" = FetchRequestV6
    type MethodOutput HStreamKafkaV6 "fetch" = FetchResponseV6
  
  data HStreamKafkaV7
  
  instance Service HStreamKafkaV7 where
    type ServiceName HStreamKafkaV7 = "HStreamKafkaV7"
    type ServiceMethods HStreamKafkaV7 =
      '[ "produce"
       ]
  
  instance HasMethodImpl HStreamKafkaV7 "produce" where
    type MethodName HStreamKafkaV7 "produce" = "produce"
    type MethodKey HStreamKafkaV7 "produce" = 0
    type MethodVersion HStreamKafkaV7 "produce" = 7
    type MethodInput HStreamKafkaV7 "produce" = ProduceRequestV7
    type MethodOutput HStreamKafkaV7 "produce" = ProduceResponseV7
  
  -------------------------------------------------------------------------------
  
  newtype ApiKey = ApiKey Int16
    deriving newtype (Num, Integral, Real, Enum, Ord, Eq, Bounded, Serializable)
  
  instance Show ApiKey where
    show (ApiKey (-10)) = "HadminCommand(-10)"
    show (ApiKey (0))   = "Produce(0)"
    show (ApiKey (1))   = "Fetch(1)"
    show (ApiKey (2))   = "ListOffsets(2)"
    show (ApiKey (3))   = "Metadata(3)"
    show (ApiKey (8))   = "OffsetCommit(8)"
    show (ApiKey (9))   = "OffsetFetch(9)"
    show (ApiKey (10))  = "FindCoordinator(10)"
    show (ApiKey (11))  = "JoinGroup(11)"
    show (ApiKey (12))  = "Heartbeat(12)"
    show (ApiKey (13))  = "LeaveGroup(13)"
    show (ApiKey (14))  = "SyncGroup(14)"
    show (ApiKey (15))  = "DescribeGroups(15)"
    show (ApiKey (16))  = "ListGroups(16)"
    show (ApiKey (17))  = "SaslHandshake(17)"
    show (ApiKey (18))  = "ApiVersions(18)"
    show (ApiKey (19))  = "CreateTopics(19)"
    show (ApiKey (20))  = "DeleteTopics(20)"
    show (ApiKey (22))  = "InitProducerId(22)"
    show (ApiKey (29))  = "DescribeAcls(29)"
    show (ApiKey (30))  = "CreateAcls(30)"
    show (ApiKey (31))  = "DeleteAcls(31)"
    show (ApiKey (32))  = "DescribeConfigs(32)"
    show (ApiKey (36))  = "SaslAuthenticate(36)"
    show (ApiKey (37))  = "CreatePartitions(37)"
    show (ApiKey n)     = "Unknown " <> show n
  
  supportedApiVersions :: [ApiVersionV0]
  supportedApiVersions =
    [ ApiVersionV0 (ApiKey 0) 0 7
    , ApiVersionV0 (ApiKey 1) 0 6
    , ApiVersionV0 (ApiKey 2) 0 2
    , ApiVersionV0 (ApiKey 3) 0 5
    , ApiVersionV0 (ApiKey 8) 0 3
    , ApiVersionV0 (ApiKey 9) 0 3
    , ApiVersionV0 (ApiKey 10) 0 1
    , ApiVersionV0 (ApiKey 11) 0 2
    , ApiVersionV0 (ApiKey 12) 0 1
    , ApiVersionV0 (ApiKey 13) 0 1
    , ApiVersionV0 (ApiKey 14) 0 1
    , ApiVersionV0 (ApiKey 15) 0 1
    , ApiVersionV0 (ApiKey 16) 0 1
    , ApiVersionV0 (ApiKey 17) 0 1
    , ApiVersionV0 (ApiKey 18) 0 3
    , ApiVersionV0 (ApiKey 19) 0 2
    , ApiVersionV0 (ApiKey 20) 0 1
    , ApiVersionV0 (ApiKey 22) 0 0
    , ApiVersionV0 (ApiKey 29) 0 0
    , ApiVersionV0 (ApiKey 30) 0 0
    , ApiVersionV0 (ApiKey 31) 0 0
    , ApiVersionV0 (ApiKey 32) 0 0
    , ApiVersionV0 (ApiKey 36) 0 0
    , ApiVersionV0 (ApiKey 37) 0 1
    ]
  
  getHeaderVersion :: ApiKey -> Int16 -> (Int16, Int16)
  getHeaderVersion (ApiKey (-10)) 0 = (2, 1)
  getHeaderVersion (ApiKey (0)) 0 = (1, 0)
  getHeaderVersion (ApiKey (0)) 1 = (1, 0)
  getHeaderVersion (ApiKey (0)) 2 = (1, 0)
  getHeaderVersion (ApiKey (0)) 3 = (1, 0)
  getHeaderVersion (ApiKey (0)) 4 = (1, 0)
  getHeaderVersion (ApiKey (0)) 5 = (1, 0)
  getHeaderVersion (ApiKey (0)) 6 = (1, 0)
  getHeaderVersion (ApiKey (0)) 7 = (1, 0)
  getHeaderVersion (ApiKey (1)) 0 = (1, 0)
  getHeaderVersion (ApiKey (1)) 1 = (1, 0)
  getHeaderVersion (ApiKey (1)) 2 = (1, 0)
  getHeaderVersion (ApiKey (1)) 3 = (1, 0)
  getHeaderVersion (ApiKey (1)) 4 = (1, 0)
  getHeaderVersion (ApiKey (1)) 5 = (1, 0)
  getHeaderVersion (ApiKey (1)) 6 = (1, 0)
  getHeaderVersion (ApiKey (2)) 0 = (1, 0)
  getHeaderVersion (ApiKey (2)) 1 = (1, 0)
  getHeaderVersion (ApiKey (2)) 2 = (1, 0)
  getHeaderVersion (ApiKey (3)) 0 = (1, 0)
  getHeaderVersion (ApiKey (3)) 1 = (1, 0)
  getHeaderVersion (ApiKey (3)) 2 = (1, 0)
  getHeaderVersion (ApiKey (3)) 3 = (1, 0)
  getHeaderVersion (ApiKey (3)) 4 = (1, 0)
  getHeaderVersion (ApiKey (3)) 5 = (1, 0)
  getHeaderVersion (ApiKey (8)) 0 = (1, 0)
  getHeaderVersion (ApiKey (8)) 1 = (1, 0)
  getHeaderVersion (ApiKey (8)) 2 = (1, 0)
  getHeaderVersion (ApiKey (8)) 3 = (1, 0)
  getHeaderVersion (ApiKey (9)) 0 = (1, 0)
  getHeaderVersion (ApiKey (9)) 1 = (1, 0)
  getHeaderVersion (ApiKey (9)) 2 = (1, 0)
  getHeaderVersion (ApiKey (9)) 3 = (1, 0)
  getHeaderVersion (ApiKey (10)) 0 = (1, 0)
  getHeaderVersion (ApiKey (10)) 1 = (1, 0)
  getHeaderVersion (ApiKey (11)) 0 = (1, 0)
  getHeaderVersion (ApiKey (11)) 1 = (1, 0)
  getHeaderVersion (ApiKey (11)) 2 = (1, 0)
  getHeaderVersion (ApiKey (12)) 0 = (1, 0)
  getHeaderVersion (ApiKey (12)) 1 = (1, 0)
  getHeaderVersion (ApiKey (13)) 0 = (1, 0)
  getHeaderVersion (ApiKey (13)) 1 = (1, 0)
  getHeaderVersion (ApiKey (14)) 0 = (1, 0)
  getHeaderVersion (ApiKey (14)) 1 = (1, 0)
  getHeaderVersion (ApiKey (15)) 0 = (1, 0)
  getHeaderVersion (ApiKey (15)) 1 = (1, 0)
  getHeaderVersion (ApiKey (16)) 0 = (1, 0)
  getHeaderVersion (ApiKey (16)) 1 = (1, 0)
  getHeaderVersion (ApiKey (17)) 0 = (1, 0)
  getHeaderVersion (ApiKey (17)) 1 = (1, 0)
  getHeaderVersion (ApiKey (18)) 0 = (1, 0)
  getHeaderVersion (ApiKey (18)) 1 = (1, 0)
  getHeaderVersion (ApiKey (18)) 2 = (1, 0)
  getHeaderVersion (ApiKey (18)) 3 = (2, 0)
  getHeaderVersion (ApiKey (19)) 0 = (1, 0)
  getHeaderVersion (ApiKey (19)) 1 = (1, 0)
  getHeaderVersion (ApiKey (19)) 2 = (1, 0)
  getHeaderVersion (ApiKey (20)) 0 = (1, 0)
  getHeaderVersion (ApiKey (20)) 1 = (1, 0)
  getHeaderVersion (ApiKey (22)) 0 = (1, 0)
  getHeaderVersion (ApiKey (29)) 0 = (1, 0)
  getHeaderVersion (ApiKey (30)) 0 = (1, 0)
  getHeaderVersion (ApiKey (31)) 0 = (1, 0)
  getHeaderVersion (ApiKey (32)) 0 = (1, 0)
  getHeaderVersion (ApiKey (36)) 0 = (1, 0)
  getHeaderVersion (ApiKey (37)) 0 = (1, 0)
  getHeaderVersion (ApiKey (37)) 1 = (1, 0)
  getHeaderVersion k v = error $ "Unknown " <> show k <> " v" <> show v
  {-# INLINE getHeaderVersion #-}
  