1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, strum::IntoStaticStr)]
13#[repr(i16)]
14#[non_exhaustive]
15pub enum ApiKey {
16 Produce = 0,
18 Fetch = 1,
20 ListOffsets = 2,
22 Metadata = 3,
24 OffsetCommit = 8,
26 OffsetFetch = 9,
28 FindCoordinator = 10,
30 JoinGroup = 11,
32 Heartbeat = 12,
34 LeaveGroup = 13,
36 SyncGroup = 14,
38 DescribeGroups = 15,
40 ListGroups = 16,
42 SaslHandshake = 17,
44 ApiVersions = 18,
46 CreateTopics = 19,
48 DeleteTopics = 20,
50 DeleteRecords = 21,
52 InitProducerId = 22,
54 OffsetForLeaderEpoch = 23,
56 AddPartitionsToTxn = 24,
58 AddOffsetsToTxn = 25,
60 EndTxn = 26,
62 WriteTxnMarkers = 27,
64 TxnOffsetCommit = 28,
66 DescribeAcls = 29,
68 CreateAcls = 30,
70 DeleteAcls = 31,
72 DescribeConfigs = 32,
74 AlterConfigs = 33,
76 AlterReplicaLogDirs = 34,
78 DescribeLogDirs = 35,
80 SaslAuthenticate = 36,
82 CreatePartitions = 37,
84 CreateDelegationToken = 38,
86 RenewDelegationToken = 39,
88 ExpireDelegationToken = 40,
90 DescribeDelegationToken = 41,
92 DeleteGroups = 42,
94 ElectLeaders = 43,
96 IncrementalAlterConfigs = 44,
98 AlterPartitionReassignments = 45,
100 ListPartitionReassignments = 46,
102 OffsetDelete = 47,
104 DescribeClientQuotas = 48,
106 AlterClientQuotas = 49,
108 DescribeUserScramCredentials = 50,
110 AlterUserScramCredentials = 51,
112 Vote = 52,
114 BeginQuorumEpoch = 53,
116 EndQuorumEpoch = 54,
118 DescribeQuorum = 55,
120 AlterPartition = 56,
122 UpdateFeatures = 57,
124 Envelope = 58,
126 FetchSnapshot = 59,
128 DescribeCluster = 60,
130 DescribeProducers = 61,
132 BrokerRegistration = 62,
134 BrokerHeartbeat = 63,
136 UnregisterBroker = 64,
138 DescribeTransactions = 65,
140 ListTransactions = 66,
142 AllocateProducerIds = 67,
144 ConsumerGroupHeartbeat = 68,
146 ConsumerGroupDescribe = 69,
148 ControllerRegistration = 70,
150 GetTelemetrySubscriptions = 71,
152 PushTelemetry = 72,
154 AssignReplicasToDirs = 73,
156 ListConfigResources = 74,
158 DescribeTopicPartitions = 75,
160 ShareGroupHeartbeat = 76,
162 ShareGroupDescribe = 77,
164 ShareFetch = 78,
166 ShareAcknowledge = 79,
168 AddRaftVoter = 80,
170 RemoveRaftVoter = 81,
172 UpdateRaftVoter = 82,
174 InitializeShareGroupState = 83,
176 ReadShareGroupState = 84,
178 WriteShareGroupState = 85,
180 DeleteShareGroupState = 86,
182 ReadShareGroupStateSummary = 87,
184 StreamsGroupHeartbeat = 88,
186 StreamsGroupDescribe = 89,
188 DescribeShareGroupOffsets = 90,
190 AlterShareGroupOffsets = 91,
192 DeleteShareGroupOffsets = 92,
194 StreamsGroupTopologyDescriptionUpdate = 93,
196 UnregisterController = 94,
198 GetReplicaLogInfo = 1020,
200}
201impl ApiKey {
202 pub const ALL: &'static [Self] = &[
204 Self::Produce,
205 Self::Fetch,
206 Self::ListOffsets,
207 Self::Metadata,
208 Self::OffsetCommit,
209 Self::OffsetFetch,
210 Self::FindCoordinator,
211 Self::JoinGroup,
212 Self::Heartbeat,
213 Self::LeaveGroup,
214 Self::SyncGroup,
215 Self::DescribeGroups,
216 Self::ListGroups,
217 Self::SaslHandshake,
218 Self::ApiVersions,
219 Self::CreateTopics,
220 Self::DeleteTopics,
221 Self::DeleteRecords,
222 Self::InitProducerId,
223 Self::OffsetForLeaderEpoch,
224 Self::AddPartitionsToTxn,
225 Self::AddOffsetsToTxn,
226 Self::EndTxn,
227 Self::WriteTxnMarkers,
228 Self::TxnOffsetCommit,
229 Self::DescribeAcls,
230 Self::CreateAcls,
231 Self::DeleteAcls,
232 Self::DescribeConfigs,
233 Self::AlterConfigs,
234 Self::AlterReplicaLogDirs,
235 Self::DescribeLogDirs,
236 Self::SaslAuthenticate,
237 Self::CreatePartitions,
238 Self::CreateDelegationToken,
239 Self::RenewDelegationToken,
240 Self::ExpireDelegationToken,
241 Self::DescribeDelegationToken,
242 Self::DeleteGroups,
243 Self::ElectLeaders,
244 Self::IncrementalAlterConfigs,
245 Self::AlterPartitionReassignments,
246 Self::ListPartitionReassignments,
247 Self::OffsetDelete,
248 Self::DescribeClientQuotas,
249 Self::AlterClientQuotas,
250 Self::DescribeUserScramCredentials,
251 Self::AlterUserScramCredentials,
252 Self::Vote,
253 Self::BeginQuorumEpoch,
254 Self::EndQuorumEpoch,
255 Self::DescribeQuorum,
256 Self::AlterPartition,
257 Self::UpdateFeatures,
258 Self::Envelope,
259 Self::FetchSnapshot,
260 Self::DescribeCluster,
261 Self::DescribeProducers,
262 Self::BrokerRegistration,
263 Self::BrokerHeartbeat,
264 Self::UnregisterBroker,
265 Self::DescribeTransactions,
266 Self::ListTransactions,
267 Self::AllocateProducerIds,
268 Self::ConsumerGroupHeartbeat,
269 Self::ConsumerGroupDescribe,
270 Self::ControllerRegistration,
271 Self::GetTelemetrySubscriptions,
272 Self::PushTelemetry,
273 Self::AssignReplicasToDirs,
274 Self::ListConfigResources,
275 Self::DescribeTopicPartitions,
276 Self::ShareGroupHeartbeat,
277 Self::ShareGroupDescribe,
278 Self::ShareFetch,
279 Self::ShareAcknowledge,
280 Self::AddRaftVoter,
281 Self::RemoveRaftVoter,
282 Self::UpdateRaftVoter,
283 Self::InitializeShareGroupState,
284 Self::ReadShareGroupState,
285 Self::WriteShareGroupState,
286 Self::DeleteShareGroupState,
287 Self::ReadShareGroupStateSummary,
288 Self::StreamsGroupHeartbeat,
289 Self::StreamsGroupDescribe,
290 Self::DescribeShareGroupOffsets,
291 Self::AlterShareGroupOffsets,
292 Self::DeleteShareGroupOffsets,
293 Self::StreamsGroupTopologyDescriptionUpdate,
294 Self::UnregisterController,
295 Self::GetReplicaLogInfo,
296 ];
297 #[must_use]
299 pub fn from_i16(k: i16) -> Option<Self> {
300 match k {
301 0 => Some(Self::Produce),
302 1 => Some(Self::Fetch),
303 2 => Some(Self::ListOffsets),
304 3 => Some(Self::Metadata),
305 8 => Some(Self::OffsetCommit),
306 9 => Some(Self::OffsetFetch),
307 10 => Some(Self::FindCoordinator),
308 11 => Some(Self::JoinGroup),
309 12 => Some(Self::Heartbeat),
310 13 => Some(Self::LeaveGroup),
311 14 => Some(Self::SyncGroup),
312 15 => Some(Self::DescribeGroups),
313 16 => Some(Self::ListGroups),
314 17 => Some(Self::SaslHandshake),
315 18 => Some(Self::ApiVersions),
316 19 => Some(Self::CreateTopics),
317 20 => Some(Self::DeleteTopics),
318 21 => Some(Self::DeleteRecords),
319 22 => Some(Self::InitProducerId),
320 23 => Some(Self::OffsetForLeaderEpoch),
321 24 => Some(Self::AddPartitionsToTxn),
322 25 => Some(Self::AddOffsetsToTxn),
323 26 => Some(Self::EndTxn),
324 27 => Some(Self::WriteTxnMarkers),
325 28 => Some(Self::TxnOffsetCommit),
326 29 => Some(Self::DescribeAcls),
327 30 => Some(Self::CreateAcls),
328 31 => Some(Self::DeleteAcls),
329 32 => Some(Self::DescribeConfigs),
330 33 => Some(Self::AlterConfigs),
331 34 => Some(Self::AlterReplicaLogDirs),
332 35 => Some(Self::DescribeLogDirs),
333 36 => Some(Self::SaslAuthenticate),
334 37 => Some(Self::CreatePartitions),
335 38 => Some(Self::CreateDelegationToken),
336 39 => Some(Self::RenewDelegationToken),
337 40 => Some(Self::ExpireDelegationToken),
338 41 => Some(Self::DescribeDelegationToken),
339 42 => Some(Self::DeleteGroups),
340 43 => Some(Self::ElectLeaders),
341 44 => Some(Self::IncrementalAlterConfigs),
342 45 => Some(Self::AlterPartitionReassignments),
343 46 => Some(Self::ListPartitionReassignments),
344 47 => Some(Self::OffsetDelete),
345 48 => Some(Self::DescribeClientQuotas),
346 49 => Some(Self::AlterClientQuotas),
347 50 => Some(Self::DescribeUserScramCredentials),
348 51 => Some(Self::AlterUserScramCredentials),
349 52 => Some(Self::Vote),
350 53 => Some(Self::BeginQuorumEpoch),
351 54 => Some(Self::EndQuorumEpoch),
352 55 => Some(Self::DescribeQuorum),
353 56 => Some(Self::AlterPartition),
354 57 => Some(Self::UpdateFeatures),
355 58 => Some(Self::Envelope),
356 59 => Some(Self::FetchSnapshot),
357 60 => Some(Self::DescribeCluster),
358 61 => Some(Self::DescribeProducers),
359 62 => Some(Self::BrokerRegistration),
360 63 => Some(Self::BrokerHeartbeat),
361 64 => Some(Self::UnregisterBroker),
362 65 => Some(Self::DescribeTransactions),
363 66 => Some(Self::ListTransactions),
364 67 => Some(Self::AllocateProducerIds),
365 68 => Some(Self::ConsumerGroupHeartbeat),
366 69 => Some(Self::ConsumerGroupDescribe),
367 70 => Some(Self::ControllerRegistration),
368 71 => Some(Self::GetTelemetrySubscriptions),
369 72 => Some(Self::PushTelemetry),
370 73 => Some(Self::AssignReplicasToDirs),
371 74 => Some(Self::ListConfigResources),
372 75 => Some(Self::DescribeTopicPartitions),
373 76 => Some(Self::ShareGroupHeartbeat),
374 77 => Some(Self::ShareGroupDescribe),
375 78 => Some(Self::ShareFetch),
376 79 => Some(Self::ShareAcknowledge),
377 80 => Some(Self::AddRaftVoter),
378 81 => Some(Self::RemoveRaftVoter),
379 82 => Some(Self::UpdateRaftVoter),
380 83 => Some(Self::InitializeShareGroupState),
381 84 => Some(Self::ReadShareGroupState),
382 85 => Some(Self::WriteShareGroupState),
383 86 => Some(Self::DeleteShareGroupState),
384 87 => Some(Self::ReadShareGroupStateSummary),
385 88 => Some(Self::StreamsGroupHeartbeat),
386 89 => Some(Self::StreamsGroupDescribe),
387 90 => Some(Self::DescribeShareGroupOffsets),
388 91 => Some(Self::AlterShareGroupOffsets),
389 92 => Some(Self::DeleteShareGroupOffsets),
390 93 => Some(Self::StreamsGroupTopologyDescriptionUpdate),
391 94 => Some(Self::UnregisterController),
392 1020 => Some(Self::GetReplicaLogInfo),
393 _ => None,
394 }
395 }
396}