{-# language DerivingStrategies #-}
{-# language GeneralizedNewtypeDeriving #-}
{-# language PatternSynonyms #-}

module Kafka.ApiKey
  ( -- * Type
    ApiKey(..)
    -- * Patterns
  , pattern Produce
  , pattern Fetch
  , pattern ListOffsets
  , pattern Metadata
  , pattern LeaderAndIsr
  , pattern StopReplica
  , pattern UpdateMetadata
  , pattern ControlledShutdown
  , pattern OffsetCommit
  , pattern OffsetFetch
  , pattern FindCoordinator
  , pattern JoinGroup
  , pattern Heartbeat
  , pattern LeaveGroup
  , pattern SyncGroup
  , pattern DescribeGroups
  , pattern ListGroups
  , pattern SaslHandshake
  , pattern ApiVersions
  , pattern CreateTopics
  , pattern DeleteTopics
  , pattern DeleteRecords
  , pattern InitProducerId
  , pattern OffsetForLeaderEpoch
  , pattern AddPartitionsToTxn
  , pattern AddOffsetsToTxn
  , pattern EndTxn
  , pattern WriteTxnMarkers
  , pattern TxnOffsetCommit
  , pattern DescribeAcls
  , pattern CreateAcls
  , pattern DeleteAcls
  , pattern DescribeConfigs
  , pattern AlterConfigs
  , pattern AlterReplicaLogDirs
  , pattern DescribeLogDirs
  , pattern SaslAuthenticate
  , pattern CreatePartitions
  , pattern CreateDelegationToken
  , pattern RenewDelegationToken
  , pattern ExpireDelegationToken
  , pattern DescribeDelegationToken
  , pattern DeleteGroups
  , pattern ElectLeaders
  , pattern IncrementalAlterConfigs
  , pattern AlterPartitionReassignments
  , pattern ListPartitionReassignments
  , pattern OffsetDelete
  ) where

import Data.Int (Int16)

-- | An ApiKey. This is given its own type because it improves a lot
-- of derived 'Show' instances and because it makes several type
-- signatures more clear.
newtype ApiKey = ApiKey Int16
  deriving newtype (ApiKey -> ApiKey -> Bool
(ApiKey -> ApiKey -> Bool)
-> (ApiKey -> ApiKey -> Bool) -> Eq ApiKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ApiKey -> ApiKey -> Bool
== :: ApiKey -> ApiKey -> Bool
$c/= :: ApiKey -> ApiKey -> Bool
/= :: ApiKey -> ApiKey -> Bool
Eq)

instance Show ApiKey where
  showsPrec :: Int -> ApiKey -> ShowS
showsPrec Int
_ (ApiKey Int16
k) String
s = case Int16
k of
    Int16
0  -> String
"Produce" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
1  -> String
"Fetch" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
2  -> String
"ListOffsets" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
3  -> String
"Metadata" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
4  -> String
"LeaderAndIsr" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
5  -> String
"StopReplica" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
6  -> String
"UpdateMetadata" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
7  -> String
"ControlledShutdown" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
8  -> String
"OffsetCommit" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
9  -> String
"OffsetFetch" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
10 -> String
"FindCoordinator" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
11 -> String
"JoinGroup" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
12 -> String
"Heartbeat" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
13 -> String
"LeaveGroup" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
14 -> String
"SyncGroup" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
15 -> String
"DescribeGroups" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
16 -> String
"ListGroups" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
17 -> String
"SaslHandshake" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
18 -> String
"ApiVersions" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
19 -> String
"CreateTopics" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
20 -> String
"DeleteTopics" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
21 -> String
"DeleteRecords" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
22 -> String
"InitProducerId" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
23 -> String
"OffsetForLeaderEpoch" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
24 -> String
"AddPartitionsToTxn" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
25 -> String
"AddOffsetsToTxn" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
26 -> String
"EndTxn" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
27 -> String
"WriteTxnMarkers" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
28 -> String
"TxnOffsetCommit" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
29 -> String
"DescribeAcls" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
30 -> String
"CreateAcls" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
31 -> String
"DeleteAcls" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
32 -> String
"DescribeConfigs" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
33 -> String
"AlterConfigs" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
34 -> String
"AlterReplicaLogDirs" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
35 -> String
"DescribeLogDirs" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
36 -> String
"SaslAuthenticate" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
37 -> String
"CreatePartitions" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
38 -> String
"CreateDelegationToken" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
39 -> String
"RenewDelegationToken" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
40 -> String
"ExpireDelegationToken" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
41 -> String
"DescribeDelegationToken" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
42 -> String
"DeleteGroups" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
43 -> String
"ElectLeaders" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
44 -> String
"IncrementalAlterConfigs" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
45 -> String
"AlterPartitionReassignments" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
46 -> String
"ListPartitionReassignments" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
47 -> String
"OffsetDelete" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
48 -> String
"DescribeClientQuotas" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
49 -> String
"AlterClientQuotas" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
50 -> String
"DescribeUserScramCredentials" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
51 -> String
"AlterUserScramCredentials" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
55 -> String
"DescribeQuorum" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
56 -> String
"AlterPartition" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
57 -> String
"UpdateFeatures" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
58 -> String
"Envelope" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
60 -> String
"DescribeCluster" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
61 -> String
"DescribeProducers" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
64 -> String
"UnregisterBroker" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
65 -> String
"DescribeTransactions" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
66 -> String
"ListTransactions" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
67 -> String
"AllocateProducerIds" String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
s
    Int16
_ -> String
"(ApiKey " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int16 -> ShowS
forall a. Show a => a -> ShowS
shows Int16
k (Char
')'Char -> ShowS
forall a. a -> [a] -> [a]
:String
s)

pattern Produce :: ApiKey
pattern $mProduce :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bProduce :: ApiKey
Produce = ApiKey 0

pattern Fetch :: ApiKey
pattern $mFetch :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bFetch :: ApiKey
Fetch = ApiKey 1

pattern ListOffsets :: ApiKey
pattern $mListOffsets :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bListOffsets :: ApiKey
ListOffsets = ApiKey 2

pattern Metadata :: ApiKey
pattern $mMetadata :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bMetadata :: ApiKey
Metadata = ApiKey 3

pattern LeaderAndIsr :: ApiKey
pattern $mLeaderAndIsr :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bLeaderAndIsr :: ApiKey
LeaderAndIsr = ApiKey 4

pattern StopReplica :: ApiKey
pattern $mStopReplica :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bStopReplica :: ApiKey
StopReplica = ApiKey 5

pattern UpdateMetadata :: ApiKey
pattern $mUpdateMetadata :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bUpdateMetadata :: ApiKey
UpdateMetadata = ApiKey 6

pattern ControlledShutdown :: ApiKey
pattern $mControlledShutdown :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bControlledShutdown :: ApiKey
ControlledShutdown = ApiKey 7

pattern OffsetCommit :: ApiKey
pattern $mOffsetCommit :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bOffsetCommit :: ApiKey
OffsetCommit = ApiKey 8

pattern OffsetFetch :: ApiKey
pattern $mOffsetFetch :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bOffsetFetch :: ApiKey
OffsetFetch = ApiKey 9

pattern FindCoordinator :: ApiKey
pattern $mFindCoordinator :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bFindCoordinator :: ApiKey
FindCoordinator = ApiKey 10

pattern JoinGroup :: ApiKey
pattern $mJoinGroup :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bJoinGroup :: ApiKey
JoinGroup = ApiKey 11

pattern Heartbeat :: ApiKey
pattern $mHeartbeat :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bHeartbeat :: ApiKey
Heartbeat = ApiKey 12

pattern LeaveGroup :: ApiKey
pattern $mLeaveGroup :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bLeaveGroup :: ApiKey
LeaveGroup = ApiKey 13

pattern SyncGroup :: ApiKey
pattern $mSyncGroup :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bSyncGroup :: ApiKey
SyncGroup = ApiKey 14

pattern DescribeGroups :: ApiKey
pattern $mDescribeGroups :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDescribeGroups :: ApiKey
DescribeGroups = ApiKey 15

pattern ListGroups :: ApiKey
pattern $mListGroups :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bListGroups :: ApiKey
ListGroups = ApiKey 16

pattern SaslHandshake :: ApiKey
pattern $mSaslHandshake :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bSaslHandshake :: ApiKey
SaslHandshake = ApiKey 17

pattern ApiVersions :: ApiKey
pattern $mApiVersions :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bApiVersions :: ApiKey
ApiVersions = ApiKey 18

pattern CreateTopics :: ApiKey
pattern $mCreateTopics :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bCreateTopics :: ApiKey
CreateTopics = ApiKey 19

pattern DeleteTopics :: ApiKey
pattern $mDeleteTopics :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDeleteTopics :: ApiKey
DeleteTopics = ApiKey 20

pattern DeleteRecords :: ApiKey
pattern $mDeleteRecords :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDeleteRecords :: ApiKey
DeleteRecords = ApiKey 21

pattern InitProducerId :: ApiKey
pattern $mInitProducerId :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bInitProducerId :: ApiKey
InitProducerId = ApiKey 22

pattern OffsetForLeaderEpoch :: ApiKey
pattern $mOffsetForLeaderEpoch :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bOffsetForLeaderEpoch :: ApiKey
OffsetForLeaderEpoch = ApiKey 23

pattern AddPartitionsToTxn :: ApiKey
pattern $mAddPartitionsToTxn :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bAddPartitionsToTxn :: ApiKey
AddPartitionsToTxn = ApiKey 24

pattern AddOffsetsToTxn :: ApiKey
pattern $mAddOffsetsToTxn :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bAddOffsetsToTxn :: ApiKey
AddOffsetsToTxn = ApiKey 25

pattern EndTxn :: ApiKey
pattern $mEndTxn :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bEndTxn :: ApiKey
EndTxn = ApiKey 26

pattern WriteTxnMarkers :: ApiKey
pattern $mWriteTxnMarkers :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bWriteTxnMarkers :: ApiKey
WriteTxnMarkers = ApiKey 27

pattern TxnOffsetCommit :: ApiKey
pattern $mTxnOffsetCommit :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bTxnOffsetCommit :: ApiKey
TxnOffsetCommit = ApiKey 28

pattern DescribeAcls :: ApiKey
pattern $mDescribeAcls :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDescribeAcls :: ApiKey
DescribeAcls = ApiKey 29

pattern CreateAcls :: ApiKey
pattern $mCreateAcls :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bCreateAcls :: ApiKey
CreateAcls = ApiKey 30

pattern DeleteAcls :: ApiKey
pattern $mDeleteAcls :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDeleteAcls :: ApiKey
DeleteAcls = ApiKey 31

pattern DescribeConfigs :: ApiKey
pattern $mDescribeConfigs :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDescribeConfigs :: ApiKey
DescribeConfigs = ApiKey 32

pattern AlterConfigs :: ApiKey
pattern $mAlterConfigs :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bAlterConfigs :: ApiKey
AlterConfigs = ApiKey 33

pattern AlterReplicaLogDirs :: ApiKey
pattern $mAlterReplicaLogDirs :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bAlterReplicaLogDirs :: ApiKey
AlterReplicaLogDirs = ApiKey 34

pattern DescribeLogDirs :: ApiKey
pattern $mDescribeLogDirs :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDescribeLogDirs :: ApiKey
DescribeLogDirs = ApiKey 35

pattern SaslAuthenticate :: ApiKey
pattern $mSaslAuthenticate :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bSaslAuthenticate :: ApiKey
SaslAuthenticate = ApiKey 36

pattern CreatePartitions :: ApiKey
pattern $mCreatePartitions :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bCreatePartitions :: ApiKey
CreatePartitions = ApiKey 37

pattern CreateDelegationToken :: ApiKey
pattern $mCreateDelegationToken :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bCreateDelegationToken :: ApiKey
CreateDelegationToken = ApiKey 38

pattern RenewDelegationToken :: ApiKey
pattern $mRenewDelegationToken :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bRenewDelegationToken :: ApiKey
RenewDelegationToken = ApiKey 39

pattern ExpireDelegationToken :: ApiKey
pattern $mExpireDelegationToken :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bExpireDelegationToken :: ApiKey
ExpireDelegationToken = ApiKey 40

pattern DescribeDelegationToken :: ApiKey
pattern $mDescribeDelegationToken :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDescribeDelegationToken :: ApiKey
DescribeDelegationToken = ApiKey 41

pattern DeleteGroups :: ApiKey
pattern $mDeleteGroups :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bDeleteGroups :: ApiKey
DeleteGroups = ApiKey 42

pattern ElectLeaders :: ApiKey
pattern $mElectLeaders :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bElectLeaders :: ApiKey
ElectLeaders = ApiKey 43

pattern IncrementalAlterConfigs :: ApiKey
pattern $mIncrementalAlterConfigs :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bIncrementalAlterConfigs :: ApiKey
IncrementalAlterConfigs = ApiKey 44

pattern AlterPartitionReassignments :: ApiKey
pattern $mAlterPartitionReassignments :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bAlterPartitionReassignments :: ApiKey
AlterPartitionReassignments = ApiKey 45

pattern ListPartitionReassignments :: ApiKey
pattern $mListPartitionReassignments :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bListPartitionReassignments :: ApiKey
ListPartitionReassignments = ApiKey 46

pattern OffsetDelete :: ApiKey
pattern $mOffsetDelete :: forall {r}. ApiKey -> ((# #) -> r) -> ((# #) -> r) -> r
$bOffsetDelete :: ApiKey
OffsetDelete = ApiKey 47