1#[cfg(feature = "messages_enums")]
7#[cfg(any(feature = "client", feature = "broker"))]
8use crate::protocol::Decodable;
9#[cfg(feature = "messages_enums")]
10#[cfg(any(feature = "client", feature = "broker"))]
11use crate::protocol::Encodable;
12#[cfg(all(feature = "client", feature = "broker"))]
13use crate::protocol::Request;
14use crate::protocol::VersionRange;
15use crate::protocol::{HeaderVersion, NewType, StrBytes};
16#[cfg(feature = "messages_enums")]
17#[cfg(any(feature = "client", feature = "broker"))]
18use anyhow::Context;
19use anyhow::Result;
20use std::convert::TryFrom;
21
22pub mod consumer_protocol_assignment;
23pub use consumer_protocol_assignment::ConsumerProtocolAssignment;
24
25pub mod consumer_protocol_subscription;
26pub use consumer_protocol_subscription::ConsumerProtocolSubscription;
27
28pub mod default_principal_data;
29pub use default_principal_data::DefaultPrincipalData;
30
31pub mod k_raft_version_record;
32pub use k_raft_version_record::KRaftVersionRecord;
33
34pub mod leader_change_message;
35pub use leader_change_message::LeaderChangeMessage;
36
37pub mod request_header;
38pub use request_header::RequestHeader;
39
40pub mod response_header;
41pub use response_header::ResponseHeader;
42
43pub mod snapshot_footer_record;
44pub use snapshot_footer_record::SnapshotFooterRecord;
45
46pub mod snapshot_header_record;
47pub use snapshot_header_record::SnapshotHeaderRecord;
48
49pub mod voters_record;
50pub use voters_record::VotersRecord;
51
52pub mod produce_request;
53pub use produce_request::ProduceRequest;
54
55pub mod fetch_request;
56pub use fetch_request::FetchRequest;
57
58pub mod list_offsets_request;
59pub use list_offsets_request::ListOffsetsRequest;
60
61pub mod metadata_request;
62pub use metadata_request::MetadataRequest;
63
64pub mod leader_and_isr_request;
65pub use leader_and_isr_request::LeaderAndIsrRequest;
66
67pub mod stop_replica_request;
68pub use stop_replica_request::StopReplicaRequest;
69
70pub mod update_metadata_request;
71pub use update_metadata_request::UpdateMetadataRequest;
72
73pub mod controlled_shutdown_request;
74pub use controlled_shutdown_request::ControlledShutdownRequest;
75
76pub mod offset_commit_request;
77pub use offset_commit_request::OffsetCommitRequest;
78
79pub mod offset_fetch_request;
80pub use offset_fetch_request::OffsetFetchRequest;
81
82pub mod find_coordinator_request;
83pub use find_coordinator_request::FindCoordinatorRequest;
84
85pub mod join_group_request;
86pub use join_group_request::JoinGroupRequest;
87
88pub mod heartbeat_request;
89pub use heartbeat_request::HeartbeatRequest;
90
91pub mod leave_group_request;
92pub use leave_group_request::LeaveGroupRequest;
93
94pub mod sync_group_request;
95pub use sync_group_request::SyncGroupRequest;
96
97pub mod describe_groups_request;
98pub use describe_groups_request::DescribeGroupsRequest;
99
100pub mod list_groups_request;
101pub use list_groups_request::ListGroupsRequest;
102
103pub mod sasl_handshake_request;
104pub use sasl_handshake_request::SaslHandshakeRequest;
105
106pub mod api_versions_request;
107pub use api_versions_request::ApiVersionsRequest;
108
109pub mod create_topics_request;
110pub use create_topics_request::CreateTopicsRequest;
111
112pub mod delete_topics_request;
113pub use delete_topics_request::DeleteTopicsRequest;
114
115pub mod delete_records_request;
116pub use delete_records_request::DeleteRecordsRequest;
117
118pub mod init_producer_id_request;
119pub use init_producer_id_request::InitProducerIdRequest;
120
121pub mod offset_for_leader_epoch_request;
122pub use offset_for_leader_epoch_request::OffsetForLeaderEpochRequest;
123
124pub mod add_partitions_to_txn_request;
125pub use add_partitions_to_txn_request::AddPartitionsToTxnRequest;
126
127pub mod add_offsets_to_txn_request;
128pub use add_offsets_to_txn_request::AddOffsetsToTxnRequest;
129
130pub mod end_txn_request;
131pub use end_txn_request::EndTxnRequest;
132
133pub mod write_txn_markers_request;
134pub use write_txn_markers_request::WriteTxnMarkersRequest;
135
136pub mod txn_offset_commit_request;
137pub use txn_offset_commit_request::TxnOffsetCommitRequest;
138
139pub mod describe_acls_request;
140pub use describe_acls_request::DescribeAclsRequest;
141
142pub mod create_acls_request;
143pub use create_acls_request::CreateAclsRequest;
144
145pub mod delete_acls_request;
146pub use delete_acls_request::DeleteAclsRequest;
147
148pub mod describe_configs_request;
149pub use describe_configs_request::DescribeConfigsRequest;
150
151pub mod alter_configs_request;
152pub use alter_configs_request::AlterConfigsRequest;
153
154pub mod alter_replica_log_dirs_request;
155pub use alter_replica_log_dirs_request::AlterReplicaLogDirsRequest;
156
157pub mod describe_log_dirs_request;
158pub use describe_log_dirs_request::DescribeLogDirsRequest;
159
160pub mod sasl_authenticate_request;
161pub use sasl_authenticate_request::SaslAuthenticateRequest;
162
163pub mod create_partitions_request;
164pub use create_partitions_request::CreatePartitionsRequest;
165
166pub mod create_delegation_token_request;
167pub use create_delegation_token_request::CreateDelegationTokenRequest;
168
169pub mod renew_delegation_token_request;
170pub use renew_delegation_token_request::RenewDelegationTokenRequest;
171
172pub mod expire_delegation_token_request;
173pub use expire_delegation_token_request::ExpireDelegationTokenRequest;
174
175pub mod describe_delegation_token_request;
176pub use describe_delegation_token_request::DescribeDelegationTokenRequest;
177
178pub mod delete_groups_request;
179pub use delete_groups_request::DeleteGroupsRequest;
180
181pub mod elect_leaders_request;
182pub use elect_leaders_request::ElectLeadersRequest;
183
184pub mod incremental_alter_configs_request;
185pub use incremental_alter_configs_request::IncrementalAlterConfigsRequest;
186
187pub mod alter_partition_reassignments_request;
188pub use alter_partition_reassignments_request::AlterPartitionReassignmentsRequest;
189
190pub mod list_partition_reassignments_request;
191pub use list_partition_reassignments_request::ListPartitionReassignmentsRequest;
192
193pub mod offset_delete_request;
194pub use offset_delete_request::OffsetDeleteRequest;
195
196pub mod describe_client_quotas_request;
197pub use describe_client_quotas_request::DescribeClientQuotasRequest;
198
199pub mod alter_client_quotas_request;
200pub use alter_client_quotas_request::AlterClientQuotasRequest;
201
202pub mod describe_user_scram_credentials_request;
203pub use describe_user_scram_credentials_request::DescribeUserScramCredentialsRequest;
204
205pub mod alter_user_scram_credentials_request;
206pub use alter_user_scram_credentials_request::AlterUserScramCredentialsRequest;
207
208pub mod vote_request;
209pub use vote_request::VoteRequest;
210
211pub mod begin_quorum_epoch_request;
212pub use begin_quorum_epoch_request::BeginQuorumEpochRequest;
213
214pub mod end_quorum_epoch_request;
215pub use end_quorum_epoch_request::EndQuorumEpochRequest;
216
217pub mod describe_quorum_request;
218pub use describe_quorum_request::DescribeQuorumRequest;
219
220pub mod alter_partition_request;
221pub use alter_partition_request::AlterPartitionRequest;
222
223pub mod update_features_request;
224pub use update_features_request::UpdateFeaturesRequest;
225
226pub mod envelope_request;
227pub use envelope_request::EnvelopeRequest;
228
229pub mod fetch_snapshot_request;
230pub use fetch_snapshot_request::FetchSnapshotRequest;
231
232pub mod describe_cluster_request;
233pub use describe_cluster_request::DescribeClusterRequest;
234
235pub mod describe_producers_request;
236pub use describe_producers_request::DescribeProducersRequest;
237
238pub mod broker_registration_request;
239pub use broker_registration_request::BrokerRegistrationRequest;
240
241pub mod broker_heartbeat_request;
242pub use broker_heartbeat_request::BrokerHeartbeatRequest;
243
244pub mod unregister_broker_request;
245pub use unregister_broker_request::UnregisterBrokerRequest;
246
247pub mod describe_transactions_request;
248pub use describe_transactions_request::DescribeTransactionsRequest;
249
250pub mod list_transactions_request;
251pub use list_transactions_request::ListTransactionsRequest;
252
253pub mod allocate_producer_ids_request;
254pub use allocate_producer_ids_request::AllocateProducerIdsRequest;
255
256pub mod consumer_group_heartbeat_request;
257pub use consumer_group_heartbeat_request::ConsumerGroupHeartbeatRequest;
258
259pub mod consumer_group_describe_request;
260pub use consumer_group_describe_request::ConsumerGroupDescribeRequest;
261
262pub mod controller_registration_request;
263pub use controller_registration_request::ControllerRegistrationRequest;
264
265pub mod get_telemetry_subscriptions_request;
266pub use get_telemetry_subscriptions_request::GetTelemetrySubscriptionsRequest;
267
268pub mod push_telemetry_request;
269pub use push_telemetry_request::PushTelemetryRequest;
270
271pub mod assign_replicas_to_dirs_request;
272pub use assign_replicas_to_dirs_request::AssignReplicasToDirsRequest;
273
274pub mod list_client_metrics_resources_request;
275pub use list_client_metrics_resources_request::ListClientMetricsResourcesRequest;
276
277pub mod describe_topic_partitions_request;
278pub use describe_topic_partitions_request::DescribeTopicPartitionsRequest;
279
280pub mod produce_response;
281pub use produce_response::ProduceResponse;
282
283pub mod fetch_response;
284pub use fetch_response::FetchResponse;
285
286pub mod list_offsets_response;
287pub use list_offsets_response::ListOffsetsResponse;
288
289pub mod metadata_response;
290pub use metadata_response::MetadataResponse;
291
292pub mod leader_and_isr_response;
293pub use leader_and_isr_response::LeaderAndIsrResponse;
294
295pub mod stop_replica_response;
296pub use stop_replica_response::StopReplicaResponse;
297
298pub mod update_metadata_response;
299pub use update_metadata_response::UpdateMetadataResponse;
300
301pub mod controlled_shutdown_response;
302pub use controlled_shutdown_response::ControlledShutdownResponse;
303
304pub mod offset_commit_response;
305pub use offset_commit_response::OffsetCommitResponse;
306
307pub mod offset_fetch_response;
308pub use offset_fetch_response::OffsetFetchResponse;
309
310pub mod find_coordinator_response;
311pub use find_coordinator_response::FindCoordinatorResponse;
312
313pub mod join_group_response;
314pub use join_group_response::JoinGroupResponse;
315
316pub mod heartbeat_response;
317pub use heartbeat_response::HeartbeatResponse;
318
319pub mod leave_group_response;
320pub use leave_group_response::LeaveGroupResponse;
321
322pub mod sync_group_response;
323pub use sync_group_response::SyncGroupResponse;
324
325pub mod describe_groups_response;
326pub use describe_groups_response::DescribeGroupsResponse;
327
328pub mod list_groups_response;
329pub use list_groups_response::ListGroupsResponse;
330
331pub mod sasl_handshake_response;
332pub use sasl_handshake_response::SaslHandshakeResponse;
333
334pub mod api_versions_response;
335pub use api_versions_response::ApiVersionsResponse;
336
337pub mod create_topics_response;
338pub use create_topics_response::CreateTopicsResponse;
339
340pub mod delete_topics_response;
341pub use delete_topics_response::DeleteTopicsResponse;
342
343pub mod delete_records_response;
344pub use delete_records_response::DeleteRecordsResponse;
345
346pub mod init_producer_id_response;
347pub use init_producer_id_response::InitProducerIdResponse;
348
349pub mod offset_for_leader_epoch_response;
350pub use offset_for_leader_epoch_response::OffsetForLeaderEpochResponse;
351
352pub mod add_partitions_to_txn_response;
353pub use add_partitions_to_txn_response::AddPartitionsToTxnResponse;
354
355pub mod add_offsets_to_txn_response;
356pub use add_offsets_to_txn_response::AddOffsetsToTxnResponse;
357
358pub mod end_txn_response;
359pub use end_txn_response::EndTxnResponse;
360
361pub mod write_txn_markers_response;
362pub use write_txn_markers_response::WriteTxnMarkersResponse;
363
364pub mod txn_offset_commit_response;
365pub use txn_offset_commit_response::TxnOffsetCommitResponse;
366
367pub mod describe_acls_response;
368pub use describe_acls_response::DescribeAclsResponse;
369
370pub mod create_acls_response;
371pub use create_acls_response::CreateAclsResponse;
372
373pub mod delete_acls_response;
374pub use delete_acls_response::DeleteAclsResponse;
375
376pub mod describe_configs_response;
377pub use describe_configs_response::DescribeConfigsResponse;
378
379pub mod alter_configs_response;
380pub use alter_configs_response::AlterConfigsResponse;
381
382pub mod alter_replica_log_dirs_response;
383pub use alter_replica_log_dirs_response::AlterReplicaLogDirsResponse;
384
385pub mod describe_log_dirs_response;
386pub use describe_log_dirs_response::DescribeLogDirsResponse;
387
388pub mod sasl_authenticate_response;
389pub use sasl_authenticate_response::SaslAuthenticateResponse;
390
391pub mod create_partitions_response;
392pub use create_partitions_response::CreatePartitionsResponse;
393
394pub mod create_delegation_token_response;
395pub use create_delegation_token_response::CreateDelegationTokenResponse;
396
397pub mod renew_delegation_token_response;
398pub use renew_delegation_token_response::RenewDelegationTokenResponse;
399
400pub mod expire_delegation_token_response;
401pub use expire_delegation_token_response::ExpireDelegationTokenResponse;
402
403pub mod describe_delegation_token_response;
404pub use describe_delegation_token_response::DescribeDelegationTokenResponse;
405
406pub mod delete_groups_response;
407pub use delete_groups_response::DeleteGroupsResponse;
408
409pub mod elect_leaders_response;
410pub use elect_leaders_response::ElectLeadersResponse;
411
412pub mod incremental_alter_configs_response;
413pub use incremental_alter_configs_response::IncrementalAlterConfigsResponse;
414
415pub mod alter_partition_reassignments_response;
416pub use alter_partition_reassignments_response::AlterPartitionReassignmentsResponse;
417
418pub mod list_partition_reassignments_response;
419pub use list_partition_reassignments_response::ListPartitionReassignmentsResponse;
420
421pub mod offset_delete_response;
422pub use offset_delete_response::OffsetDeleteResponse;
423
424pub mod describe_client_quotas_response;
425pub use describe_client_quotas_response::DescribeClientQuotasResponse;
426
427pub mod alter_client_quotas_response;
428pub use alter_client_quotas_response::AlterClientQuotasResponse;
429
430pub mod describe_user_scram_credentials_response;
431pub use describe_user_scram_credentials_response::DescribeUserScramCredentialsResponse;
432
433pub mod alter_user_scram_credentials_response;
434pub use alter_user_scram_credentials_response::AlterUserScramCredentialsResponse;
435
436pub mod vote_response;
437pub use vote_response::VoteResponse;
438
439pub mod begin_quorum_epoch_response;
440pub use begin_quorum_epoch_response::BeginQuorumEpochResponse;
441
442pub mod end_quorum_epoch_response;
443pub use end_quorum_epoch_response::EndQuorumEpochResponse;
444
445pub mod describe_quorum_response;
446pub use describe_quorum_response::DescribeQuorumResponse;
447
448pub mod alter_partition_response;
449pub use alter_partition_response::AlterPartitionResponse;
450
451pub mod update_features_response;
452pub use update_features_response::UpdateFeaturesResponse;
453
454pub mod envelope_response;
455pub use envelope_response::EnvelopeResponse;
456
457pub mod fetch_snapshot_response;
458pub use fetch_snapshot_response::FetchSnapshotResponse;
459
460pub mod describe_cluster_response;
461pub use describe_cluster_response::DescribeClusterResponse;
462
463pub mod describe_producers_response;
464pub use describe_producers_response::DescribeProducersResponse;
465
466pub mod broker_registration_response;
467pub use broker_registration_response::BrokerRegistrationResponse;
468
469pub mod broker_heartbeat_response;
470pub use broker_heartbeat_response::BrokerHeartbeatResponse;
471
472pub mod unregister_broker_response;
473pub use unregister_broker_response::UnregisterBrokerResponse;
474
475pub mod describe_transactions_response;
476pub use describe_transactions_response::DescribeTransactionsResponse;
477
478pub mod list_transactions_response;
479pub use list_transactions_response::ListTransactionsResponse;
480
481pub mod allocate_producer_ids_response;
482pub use allocate_producer_ids_response::AllocateProducerIdsResponse;
483
484pub mod consumer_group_heartbeat_response;
485pub use consumer_group_heartbeat_response::ConsumerGroupHeartbeatResponse;
486
487pub mod consumer_group_describe_response;
488pub use consumer_group_describe_response::ConsumerGroupDescribeResponse;
489
490pub mod controller_registration_response;
491pub use controller_registration_response::ControllerRegistrationResponse;
492
493pub mod get_telemetry_subscriptions_response;
494pub use get_telemetry_subscriptions_response::GetTelemetrySubscriptionsResponse;
495
496pub mod push_telemetry_response;
497pub use push_telemetry_response::PushTelemetryResponse;
498
499pub mod assign_replicas_to_dirs_response;
500pub use assign_replicas_to_dirs_response::AssignReplicasToDirsResponse;
501
502pub mod list_client_metrics_resources_response;
503pub use list_client_metrics_resources_response::ListClientMetricsResourcesResponse;
504
505pub mod describe_topic_partitions_response;
506pub use describe_topic_partitions_response::DescribeTopicPartitionsResponse;
507
508#[cfg(all(feature = "client", feature = "broker"))]
509impl Request for ProduceRequest {
510 const KEY: i16 = 0;
511 type Response = ProduceResponse;
512}
513
514#[cfg(all(feature = "client", feature = "broker"))]
515impl Request for FetchRequest {
516 const KEY: i16 = 1;
517 type Response = FetchResponse;
518}
519
520#[cfg(all(feature = "client", feature = "broker"))]
521impl Request for ListOffsetsRequest {
522 const KEY: i16 = 2;
523 type Response = ListOffsetsResponse;
524}
525
526#[cfg(all(feature = "client", feature = "broker"))]
527impl Request for MetadataRequest {
528 const KEY: i16 = 3;
529 type Response = MetadataResponse;
530}
531
532#[cfg(all(feature = "client", feature = "broker"))]
533impl Request for LeaderAndIsrRequest {
534 const KEY: i16 = 4;
535 type Response = LeaderAndIsrResponse;
536}
537
538#[cfg(all(feature = "client", feature = "broker"))]
539impl Request for StopReplicaRequest {
540 const KEY: i16 = 5;
541 type Response = StopReplicaResponse;
542}
543
544#[cfg(all(feature = "client", feature = "broker"))]
545impl Request for UpdateMetadataRequest {
546 const KEY: i16 = 6;
547 type Response = UpdateMetadataResponse;
548}
549
550#[cfg(all(feature = "client", feature = "broker"))]
551impl Request for ControlledShutdownRequest {
552 const KEY: i16 = 7;
553 type Response = ControlledShutdownResponse;
554}
555
556#[cfg(all(feature = "client", feature = "broker"))]
557impl Request for OffsetCommitRequest {
558 const KEY: i16 = 8;
559 type Response = OffsetCommitResponse;
560}
561
562#[cfg(all(feature = "client", feature = "broker"))]
563impl Request for OffsetFetchRequest {
564 const KEY: i16 = 9;
565 type Response = OffsetFetchResponse;
566}
567
568#[cfg(all(feature = "client", feature = "broker"))]
569impl Request for FindCoordinatorRequest {
570 const KEY: i16 = 10;
571 type Response = FindCoordinatorResponse;
572}
573
574#[cfg(all(feature = "client", feature = "broker"))]
575impl Request for JoinGroupRequest {
576 const KEY: i16 = 11;
577 type Response = JoinGroupResponse;
578}
579
580#[cfg(all(feature = "client", feature = "broker"))]
581impl Request for HeartbeatRequest {
582 const KEY: i16 = 12;
583 type Response = HeartbeatResponse;
584}
585
586#[cfg(all(feature = "client", feature = "broker"))]
587impl Request for LeaveGroupRequest {
588 const KEY: i16 = 13;
589 type Response = LeaveGroupResponse;
590}
591
592#[cfg(all(feature = "client", feature = "broker"))]
593impl Request for SyncGroupRequest {
594 const KEY: i16 = 14;
595 type Response = SyncGroupResponse;
596}
597
598#[cfg(all(feature = "client", feature = "broker"))]
599impl Request for DescribeGroupsRequest {
600 const KEY: i16 = 15;
601 type Response = DescribeGroupsResponse;
602}
603
604#[cfg(all(feature = "client", feature = "broker"))]
605impl Request for ListGroupsRequest {
606 const KEY: i16 = 16;
607 type Response = ListGroupsResponse;
608}
609
610#[cfg(all(feature = "client", feature = "broker"))]
611impl Request for SaslHandshakeRequest {
612 const KEY: i16 = 17;
613 type Response = SaslHandshakeResponse;
614}
615
616#[cfg(all(feature = "client", feature = "broker"))]
617impl Request for ApiVersionsRequest {
618 const KEY: i16 = 18;
619 type Response = ApiVersionsResponse;
620}
621
622#[cfg(all(feature = "client", feature = "broker"))]
623impl Request for CreateTopicsRequest {
624 const KEY: i16 = 19;
625 type Response = CreateTopicsResponse;
626}
627
628#[cfg(all(feature = "client", feature = "broker"))]
629impl Request for DeleteTopicsRequest {
630 const KEY: i16 = 20;
631 type Response = DeleteTopicsResponse;
632}
633
634#[cfg(all(feature = "client", feature = "broker"))]
635impl Request for DeleteRecordsRequest {
636 const KEY: i16 = 21;
637 type Response = DeleteRecordsResponse;
638}
639
640#[cfg(all(feature = "client", feature = "broker"))]
641impl Request for InitProducerIdRequest {
642 const KEY: i16 = 22;
643 type Response = InitProducerIdResponse;
644}
645
646#[cfg(all(feature = "client", feature = "broker"))]
647impl Request for OffsetForLeaderEpochRequest {
648 const KEY: i16 = 23;
649 type Response = OffsetForLeaderEpochResponse;
650}
651
652#[cfg(all(feature = "client", feature = "broker"))]
653impl Request for AddPartitionsToTxnRequest {
654 const KEY: i16 = 24;
655 type Response = AddPartitionsToTxnResponse;
656}
657
658#[cfg(all(feature = "client", feature = "broker"))]
659impl Request for AddOffsetsToTxnRequest {
660 const KEY: i16 = 25;
661 type Response = AddOffsetsToTxnResponse;
662}
663
664#[cfg(all(feature = "client", feature = "broker"))]
665impl Request for EndTxnRequest {
666 const KEY: i16 = 26;
667 type Response = EndTxnResponse;
668}
669
670#[cfg(all(feature = "client", feature = "broker"))]
671impl Request for WriteTxnMarkersRequest {
672 const KEY: i16 = 27;
673 type Response = WriteTxnMarkersResponse;
674}
675
676#[cfg(all(feature = "client", feature = "broker"))]
677impl Request for TxnOffsetCommitRequest {
678 const KEY: i16 = 28;
679 type Response = TxnOffsetCommitResponse;
680}
681
682#[cfg(all(feature = "client", feature = "broker"))]
683impl Request for DescribeAclsRequest {
684 const KEY: i16 = 29;
685 type Response = DescribeAclsResponse;
686}
687
688#[cfg(all(feature = "client", feature = "broker"))]
689impl Request for CreateAclsRequest {
690 const KEY: i16 = 30;
691 type Response = CreateAclsResponse;
692}
693
694#[cfg(all(feature = "client", feature = "broker"))]
695impl Request for DeleteAclsRequest {
696 const KEY: i16 = 31;
697 type Response = DeleteAclsResponse;
698}
699
700#[cfg(all(feature = "client", feature = "broker"))]
701impl Request for DescribeConfigsRequest {
702 const KEY: i16 = 32;
703 type Response = DescribeConfigsResponse;
704}
705
706#[cfg(all(feature = "client", feature = "broker"))]
707impl Request for AlterConfigsRequest {
708 const KEY: i16 = 33;
709 type Response = AlterConfigsResponse;
710}
711
712#[cfg(all(feature = "client", feature = "broker"))]
713impl Request for AlterReplicaLogDirsRequest {
714 const KEY: i16 = 34;
715 type Response = AlterReplicaLogDirsResponse;
716}
717
718#[cfg(all(feature = "client", feature = "broker"))]
719impl Request for DescribeLogDirsRequest {
720 const KEY: i16 = 35;
721 type Response = DescribeLogDirsResponse;
722}
723
724#[cfg(all(feature = "client", feature = "broker"))]
725impl Request for SaslAuthenticateRequest {
726 const KEY: i16 = 36;
727 type Response = SaslAuthenticateResponse;
728}
729
730#[cfg(all(feature = "client", feature = "broker"))]
731impl Request for CreatePartitionsRequest {
732 const KEY: i16 = 37;
733 type Response = CreatePartitionsResponse;
734}
735
736#[cfg(all(feature = "client", feature = "broker"))]
737impl Request for CreateDelegationTokenRequest {
738 const KEY: i16 = 38;
739 type Response = CreateDelegationTokenResponse;
740}
741
742#[cfg(all(feature = "client", feature = "broker"))]
743impl Request for RenewDelegationTokenRequest {
744 const KEY: i16 = 39;
745 type Response = RenewDelegationTokenResponse;
746}
747
748#[cfg(all(feature = "client", feature = "broker"))]
749impl Request for ExpireDelegationTokenRequest {
750 const KEY: i16 = 40;
751 type Response = ExpireDelegationTokenResponse;
752}
753
754#[cfg(all(feature = "client", feature = "broker"))]
755impl Request for DescribeDelegationTokenRequest {
756 const KEY: i16 = 41;
757 type Response = DescribeDelegationTokenResponse;
758}
759
760#[cfg(all(feature = "client", feature = "broker"))]
761impl Request for DeleteGroupsRequest {
762 const KEY: i16 = 42;
763 type Response = DeleteGroupsResponse;
764}
765
766#[cfg(all(feature = "client", feature = "broker"))]
767impl Request for ElectLeadersRequest {
768 const KEY: i16 = 43;
769 type Response = ElectLeadersResponse;
770}
771
772#[cfg(all(feature = "client", feature = "broker"))]
773impl Request for IncrementalAlterConfigsRequest {
774 const KEY: i16 = 44;
775 type Response = IncrementalAlterConfigsResponse;
776}
777
778#[cfg(all(feature = "client", feature = "broker"))]
779impl Request for AlterPartitionReassignmentsRequest {
780 const KEY: i16 = 45;
781 type Response = AlterPartitionReassignmentsResponse;
782}
783
784#[cfg(all(feature = "client", feature = "broker"))]
785impl Request for ListPartitionReassignmentsRequest {
786 const KEY: i16 = 46;
787 type Response = ListPartitionReassignmentsResponse;
788}
789
790#[cfg(all(feature = "client", feature = "broker"))]
791impl Request for OffsetDeleteRequest {
792 const KEY: i16 = 47;
793 type Response = OffsetDeleteResponse;
794}
795
796#[cfg(all(feature = "client", feature = "broker"))]
797impl Request for DescribeClientQuotasRequest {
798 const KEY: i16 = 48;
799 type Response = DescribeClientQuotasResponse;
800}
801
802#[cfg(all(feature = "client", feature = "broker"))]
803impl Request for AlterClientQuotasRequest {
804 const KEY: i16 = 49;
805 type Response = AlterClientQuotasResponse;
806}
807
808#[cfg(all(feature = "client", feature = "broker"))]
809impl Request for DescribeUserScramCredentialsRequest {
810 const KEY: i16 = 50;
811 type Response = DescribeUserScramCredentialsResponse;
812}
813
814#[cfg(all(feature = "client", feature = "broker"))]
815impl Request for AlterUserScramCredentialsRequest {
816 const KEY: i16 = 51;
817 type Response = AlterUserScramCredentialsResponse;
818}
819
820#[cfg(all(feature = "client", feature = "broker"))]
821impl Request for VoteRequest {
822 const KEY: i16 = 52;
823 type Response = VoteResponse;
824}
825
826#[cfg(all(feature = "client", feature = "broker"))]
827impl Request for BeginQuorumEpochRequest {
828 const KEY: i16 = 53;
829 type Response = BeginQuorumEpochResponse;
830}
831
832#[cfg(all(feature = "client", feature = "broker"))]
833impl Request for EndQuorumEpochRequest {
834 const KEY: i16 = 54;
835 type Response = EndQuorumEpochResponse;
836}
837
838#[cfg(all(feature = "client", feature = "broker"))]
839impl Request for DescribeQuorumRequest {
840 const KEY: i16 = 55;
841 type Response = DescribeQuorumResponse;
842}
843
844#[cfg(all(feature = "client", feature = "broker"))]
845impl Request for AlterPartitionRequest {
846 const KEY: i16 = 56;
847 type Response = AlterPartitionResponse;
848}
849
850#[cfg(all(feature = "client", feature = "broker"))]
851impl Request for UpdateFeaturesRequest {
852 const KEY: i16 = 57;
853 type Response = UpdateFeaturesResponse;
854}
855
856#[cfg(all(feature = "client", feature = "broker"))]
857impl Request for EnvelopeRequest {
858 const KEY: i16 = 58;
859 type Response = EnvelopeResponse;
860}
861
862#[cfg(all(feature = "client", feature = "broker"))]
863impl Request for FetchSnapshotRequest {
864 const KEY: i16 = 59;
865 type Response = FetchSnapshotResponse;
866}
867
868#[cfg(all(feature = "client", feature = "broker"))]
869impl Request for DescribeClusterRequest {
870 const KEY: i16 = 60;
871 type Response = DescribeClusterResponse;
872}
873
874#[cfg(all(feature = "client", feature = "broker"))]
875impl Request for DescribeProducersRequest {
876 const KEY: i16 = 61;
877 type Response = DescribeProducersResponse;
878}
879
880#[cfg(all(feature = "client", feature = "broker"))]
881impl Request for BrokerRegistrationRequest {
882 const KEY: i16 = 62;
883 type Response = BrokerRegistrationResponse;
884}
885
886#[cfg(all(feature = "client", feature = "broker"))]
887impl Request for BrokerHeartbeatRequest {
888 const KEY: i16 = 63;
889 type Response = BrokerHeartbeatResponse;
890}
891
892#[cfg(all(feature = "client", feature = "broker"))]
893impl Request for UnregisterBrokerRequest {
894 const KEY: i16 = 64;
895 type Response = UnregisterBrokerResponse;
896}
897
898#[cfg(all(feature = "client", feature = "broker"))]
899impl Request for DescribeTransactionsRequest {
900 const KEY: i16 = 65;
901 type Response = DescribeTransactionsResponse;
902}
903
904#[cfg(all(feature = "client", feature = "broker"))]
905impl Request for ListTransactionsRequest {
906 const KEY: i16 = 66;
907 type Response = ListTransactionsResponse;
908}
909
910#[cfg(all(feature = "client", feature = "broker"))]
911impl Request for AllocateProducerIdsRequest {
912 const KEY: i16 = 67;
913 type Response = AllocateProducerIdsResponse;
914}
915
916#[cfg(all(feature = "client", feature = "broker"))]
917impl Request for ConsumerGroupHeartbeatRequest {
918 const KEY: i16 = 68;
919 type Response = ConsumerGroupHeartbeatResponse;
920}
921
922#[cfg(all(feature = "client", feature = "broker"))]
923impl Request for ConsumerGroupDescribeRequest {
924 const KEY: i16 = 69;
925 type Response = ConsumerGroupDescribeResponse;
926}
927
928#[cfg(all(feature = "client", feature = "broker"))]
929impl Request for ControllerRegistrationRequest {
930 const KEY: i16 = 70;
931 type Response = ControllerRegistrationResponse;
932}
933
934#[cfg(all(feature = "client", feature = "broker"))]
935impl Request for GetTelemetrySubscriptionsRequest {
936 const KEY: i16 = 71;
937 type Response = GetTelemetrySubscriptionsResponse;
938}
939
940#[cfg(all(feature = "client", feature = "broker"))]
941impl Request for PushTelemetryRequest {
942 const KEY: i16 = 72;
943 type Response = PushTelemetryResponse;
944}
945
946#[cfg(all(feature = "client", feature = "broker"))]
947impl Request for AssignReplicasToDirsRequest {
948 const KEY: i16 = 73;
949 type Response = AssignReplicasToDirsResponse;
950}
951
952#[cfg(all(feature = "client", feature = "broker"))]
953impl Request for ListClientMetricsResourcesRequest {
954 const KEY: i16 = 74;
955 type Response = ListClientMetricsResourcesResponse;
956}
957
958#[cfg(all(feature = "client", feature = "broker"))]
959impl Request for DescribeTopicPartitionsRequest {
960 const KEY: i16 = 75;
961 type Response = DescribeTopicPartitionsResponse;
962}
963
964#[derive(Debug, Clone, Copy, PartialEq, Eq)]
966pub enum ApiKey {
967 Produce = 0,
969 Fetch = 1,
971 ListOffsets = 2,
973 Metadata = 3,
975 LeaderAndIsr = 4,
977 StopReplica = 5,
979 UpdateMetadata = 6,
981 ControlledShutdown = 7,
983 OffsetCommit = 8,
985 OffsetFetch = 9,
987 FindCoordinator = 10,
989 JoinGroup = 11,
991 Heartbeat = 12,
993 LeaveGroup = 13,
995 SyncGroup = 14,
997 DescribeGroups = 15,
999 ListGroups = 16,
1001 SaslHandshake = 17,
1003 ApiVersions = 18,
1005 CreateTopics = 19,
1007 DeleteTopics = 20,
1009 DeleteRecords = 21,
1011 InitProducerId = 22,
1013 OffsetForLeaderEpoch = 23,
1015 AddPartitionsToTxn = 24,
1017 AddOffsetsToTxn = 25,
1019 EndTxn = 26,
1021 WriteTxnMarkers = 27,
1023 TxnOffsetCommit = 28,
1025 DescribeAcls = 29,
1027 CreateAcls = 30,
1029 DeleteAcls = 31,
1031 DescribeConfigs = 32,
1033 AlterConfigs = 33,
1035 AlterReplicaLogDirs = 34,
1037 DescribeLogDirs = 35,
1039 SaslAuthenticate = 36,
1041 CreatePartitions = 37,
1043 CreateDelegationToken = 38,
1045 RenewDelegationToken = 39,
1047 ExpireDelegationToken = 40,
1049 DescribeDelegationToken = 41,
1051 DeleteGroups = 42,
1053 ElectLeaders = 43,
1055 IncrementalAlterConfigs = 44,
1057 AlterPartitionReassignments = 45,
1059 ListPartitionReassignments = 46,
1061 OffsetDelete = 47,
1063 DescribeClientQuotas = 48,
1065 AlterClientQuotas = 49,
1067 DescribeUserScramCredentials = 50,
1069 AlterUserScramCredentials = 51,
1071 Vote = 52,
1073 BeginQuorumEpoch = 53,
1075 EndQuorumEpoch = 54,
1077 DescribeQuorum = 55,
1079 AlterPartition = 56,
1081 UpdateFeatures = 57,
1083 Envelope = 58,
1085 FetchSnapshot = 59,
1087 DescribeCluster = 60,
1089 DescribeProducers = 61,
1091 BrokerRegistration = 62,
1093 BrokerHeartbeat = 63,
1095 UnregisterBroker = 64,
1097 DescribeTransactions = 65,
1099 ListTransactions = 66,
1101 AllocateProducerIds = 67,
1103 ConsumerGroupHeartbeat = 68,
1105 ConsumerGroupDescribe = 69,
1107 ControllerRegistration = 70,
1109 GetTelemetrySubscriptions = 71,
1111 PushTelemetry = 72,
1113 AssignReplicasToDirs = 73,
1115 ListClientMetricsResources = 74,
1117 DescribeTopicPartitions = 75,
1119}
1120
1121impl ApiKey {
1122 pub fn request_header_version(&self, version: i16) -> i16 {
1124 match self {
1125 ApiKey::Produce => ProduceRequest::header_version(version),
1126 ApiKey::Fetch => FetchRequest::header_version(version),
1127 ApiKey::ListOffsets => ListOffsetsRequest::header_version(version),
1128 ApiKey::Metadata => MetadataRequest::header_version(version),
1129 ApiKey::LeaderAndIsr => LeaderAndIsrRequest::header_version(version),
1130 ApiKey::StopReplica => StopReplicaRequest::header_version(version),
1131 ApiKey::UpdateMetadata => UpdateMetadataRequest::header_version(version),
1132 ApiKey::ControlledShutdown => ControlledShutdownRequest::header_version(version),
1133 ApiKey::OffsetCommit => OffsetCommitRequest::header_version(version),
1134 ApiKey::OffsetFetch => OffsetFetchRequest::header_version(version),
1135 ApiKey::FindCoordinator => FindCoordinatorRequest::header_version(version),
1136 ApiKey::JoinGroup => JoinGroupRequest::header_version(version),
1137 ApiKey::Heartbeat => HeartbeatRequest::header_version(version),
1138 ApiKey::LeaveGroup => LeaveGroupRequest::header_version(version),
1139 ApiKey::SyncGroup => SyncGroupRequest::header_version(version),
1140 ApiKey::DescribeGroups => DescribeGroupsRequest::header_version(version),
1141 ApiKey::ListGroups => ListGroupsRequest::header_version(version),
1142 ApiKey::SaslHandshake => SaslHandshakeRequest::header_version(version),
1143 ApiKey::ApiVersions => ApiVersionsRequest::header_version(version),
1144 ApiKey::CreateTopics => CreateTopicsRequest::header_version(version),
1145 ApiKey::DeleteTopics => DeleteTopicsRequest::header_version(version),
1146 ApiKey::DeleteRecords => DeleteRecordsRequest::header_version(version),
1147 ApiKey::InitProducerId => InitProducerIdRequest::header_version(version),
1148 ApiKey::OffsetForLeaderEpoch => OffsetForLeaderEpochRequest::header_version(version),
1149 ApiKey::AddPartitionsToTxn => AddPartitionsToTxnRequest::header_version(version),
1150 ApiKey::AddOffsetsToTxn => AddOffsetsToTxnRequest::header_version(version),
1151 ApiKey::EndTxn => EndTxnRequest::header_version(version),
1152 ApiKey::WriteTxnMarkers => WriteTxnMarkersRequest::header_version(version),
1153 ApiKey::TxnOffsetCommit => TxnOffsetCommitRequest::header_version(version),
1154 ApiKey::DescribeAcls => DescribeAclsRequest::header_version(version),
1155 ApiKey::CreateAcls => CreateAclsRequest::header_version(version),
1156 ApiKey::DeleteAcls => DeleteAclsRequest::header_version(version),
1157 ApiKey::DescribeConfigs => DescribeConfigsRequest::header_version(version),
1158 ApiKey::AlterConfigs => AlterConfigsRequest::header_version(version),
1159 ApiKey::AlterReplicaLogDirs => AlterReplicaLogDirsRequest::header_version(version),
1160 ApiKey::DescribeLogDirs => DescribeLogDirsRequest::header_version(version),
1161 ApiKey::SaslAuthenticate => SaslAuthenticateRequest::header_version(version),
1162 ApiKey::CreatePartitions => CreatePartitionsRequest::header_version(version),
1163 ApiKey::CreateDelegationToken => CreateDelegationTokenRequest::header_version(version),
1164 ApiKey::RenewDelegationToken => RenewDelegationTokenRequest::header_version(version),
1165 ApiKey::ExpireDelegationToken => ExpireDelegationTokenRequest::header_version(version),
1166 ApiKey::DescribeDelegationToken => {
1167 DescribeDelegationTokenRequest::header_version(version)
1168 }
1169 ApiKey::DeleteGroups => DeleteGroupsRequest::header_version(version),
1170 ApiKey::ElectLeaders => ElectLeadersRequest::header_version(version),
1171 ApiKey::IncrementalAlterConfigs => {
1172 IncrementalAlterConfigsRequest::header_version(version)
1173 }
1174 ApiKey::AlterPartitionReassignments => {
1175 AlterPartitionReassignmentsRequest::header_version(version)
1176 }
1177 ApiKey::ListPartitionReassignments => {
1178 ListPartitionReassignmentsRequest::header_version(version)
1179 }
1180 ApiKey::OffsetDelete => OffsetDeleteRequest::header_version(version),
1181 ApiKey::DescribeClientQuotas => DescribeClientQuotasRequest::header_version(version),
1182 ApiKey::AlterClientQuotas => AlterClientQuotasRequest::header_version(version),
1183 ApiKey::DescribeUserScramCredentials => {
1184 DescribeUserScramCredentialsRequest::header_version(version)
1185 }
1186 ApiKey::AlterUserScramCredentials => {
1187 AlterUserScramCredentialsRequest::header_version(version)
1188 }
1189 ApiKey::Vote => VoteRequest::header_version(version),
1190 ApiKey::BeginQuorumEpoch => BeginQuorumEpochRequest::header_version(version),
1191 ApiKey::EndQuorumEpoch => EndQuorumEpochRequest::header_version(version),
1192 ApiKey::DescribeQuorum => DescribeQuorumRequest::header_version(version),
1193 ApiKey::AlterPartition => AlterPartitionRequest::header_version(version),
1194 ApiKey::UpdateFeatures => UpdateFeaturesRequest::header_version(version),
1195 ApiKey::Envelope => EnvelopeRequest::header_version(version),
1196 ApiKey::FetchSnapshot => FetchSnapshotRequest::header_version(version),
1197 ApiKey::DescribeCluster => DescribeClusterRequest::header_version(version),
1198 ApiKey::DescribeProducers => DescribeProducersRequest::header_version(version),
1199 ApiKey::BrokerRegistration => BrokerRegistrationRequest::header_version(version),
1200 ApiKey::BrokerHeartbeat => BrokerHeartbeatRequest::header_version(version),
1201 ApiKey::UnregisterBroker => UnregisterBrokerRequest::header_version(version),
1202 ApiKey::DescribeTransactions => DescribeTransactionsRequest::header_version(version),
1203 ApiKey::ListTransactions => ListTransactionsRequest::header_version(version),
1204 ApiKey::AllocateProducerIds => AllocateProducerIdsRequest::header_version(version),
1205 ApiKey::ConsumerGroupHeartbeat => {
1206 ConsumerGroupHeartbeatRequest::header_version(version)
1207 }
1208 ApiKey::ConsumerGroupDescribe => ConsumerGroupDescribeRequest::header_version(version),
1209 ApiKey::ControllerRegistration => {
1210 ControllerRegistrationRequest::header_version(version)
1211 }
1212 ApiKey::GetTelemetrySubscriptions => {
1213 GetTelemetrySubscriptionsRequest::header_version(version)
1214 }
1215 ApiKey::PushTelemetry => PushTelemetryRequest::header_version(version),
1216 ApiKey::AssignReplicasToDirs => AssignReplicasToDirsRequest::header_version(version),
1217 ApiKey::ListClientMetricsResources => {
1218 ListClientMetricsResourcesRequest::header_version(version)
1219 }
1220 ApiKey::DescribeTopicPartitions => {
1221 DescribeTopicPartitionsRequest::header_version(version)
1222 }
1223 }
1224 }
1225 pub fn response_header_version(&self, version: i16) -> i16 {
1227 match self {
1228 ApiKey::Produce => ProduceResponse::header_version(version),
1229 ApiKey::Fetch => FetchResponse::header_version(version),
1230 ApiKey::ListOffsets => ListOffsetsResponse::header_version(version),
1231 ApiKey::Metadata => MetadataResponse::header_version(version),
1232 ApiKey::LeaderAndIsr => LeaderAndIsrResponse::header_version(version),
1233 ApiKey::StopReplica => StopReplicaResponse::header_version(version),
1234 ApiKey::UpdateMetadata => UpdateMetadataResponse::header_version(version),
1235 ApiKey::ControlledShutdown => ControlledShutdownResponse::header_version(version),
1236 ApiKey::OffsetCommit => OffsetCommitResponse::header_version(version),
1237 ApiKey::OffsetFetch => OffsetFetchResponse::header_version(version),
1238 ApiKey::FindCoordinator => FindCoordinatorResponse::header_version(version),
1239 ApiKey::JoinGroup => JoinGroupResponse::header_version(version),
1240 ApiKey::Heartbeat => HeartbeatResponse::header_version(version),
1241 ApiKey::LeaveGroup => LeaveGroupResponse::header_version(version),
1242 ApiKey::SyncGroup => SyncGroupResponse::header_version(version),
1243 ApiKey::DescribeGroups => DescribeGroupsResponse::header_version(version),
1244 ApiKey::ListGroups => ListGroupsResponse::header_version(version),
1245 ApiKey::SaslHandshake => SaslHandshakeResponse::header_version(version),
1246 ApiKey::ApiVersions => ApiVersionsResponse::header_version(version),
1247 ApiKey::CreateTopics => CreateTopicsResponse::header_version(version),
1248 ApiKey::DeleteTopics => DeleteTopicsResponse::header_version(version),
1249 ApiKey::DeleteRecords => DeleteRecordsResponse::header_version(version),
1250 ApiKey::InitProducerId => InitProducerIdResponse::header_version(version),
1251 ApiKey::OffsetForLeaderEpoch => OffsetForLeaderEpochResponse::header_version(version),
1252 ApiKey::AddPartitionsToTxn => AddPartitionsToTxnResponse::header_version(version),
1253 ApiKey::AddOffsetsToTxn => AddOffsetsToTxnResponse::header_version(version),
1254 ApiKey::EndTxn => EndTxnResponse::header_version(version),
1255 ApiKey::WriteTxnMarkers => WriteTxnMarkersResponse::header_version(version),
1256 ApiKey::TxnOffsetCommit => TxnOffsetCommitResponse::header_version(version),
1257 ApiKey::DescribeAcls => DescribeAclsResponse::header_version(version),
1258 ApiKey::CreateAcls => CreateAclsResponse::header_version(version),
1259 ApiKey::DeleteAcls => DeleteAclsResponse::header_version(version),
1260 ApiKey::DescribeConfigs => DescribeConfigsResponse::header_version(version),
1261 ApiKey::AlterConfigs => AlterConfigsResponse::header_version(version),
1262 ApiKey::AlterReplicaLogDirs => AlterReplicaLogDirsResponse::header_version(version),
1263 ApiKey::DescribeLogDirs => DescribeLogDirsResponse::header_version(version),
1264 ApiKey::SaslAuthenticate => SaslAuthenticateResponse::header_version(version),
1265 ApiKey::CreatePartitions => CreatePartitionsResponse::header_version(version),
1266 ApiKey::CreateDelegationToken => CreateDelegationTokenResponse::header_version(version),
1267 ApiKey::RenewDelegationToken => RenewDelegationTokenResponse::header_version(version),
1268 ApiKey::ExpireDelegationToken => ExpireDelegationTokenResponse::header_version(version),
1269 ApiKey::DescribeDelegationToken => {
1270 DescribeDelegationTokenResponse::header_version(version)
1271 }
1272 ApiKey::DeleteGroups => DeleteGroupsResponse::header_version(version),
1273 ApiKey::ElectLeaders => ElectLeadersResponse::header_version(version),
1274 ApiKey::IncrementalAlterConfigs => {
1275 IncrementalAlterConfigsResponse::header_version(version)
1276 }
1277 ApiKey::AlterPartitionReassignments => {
1278 AlterPartitionReassignmentsResponse::header_version(version)
1279 }
1280 ApiKey::ListPartitionReassignments => {
1281 ListPartitionReassignmentsResponse::header_version(version)
1282 }
1283 ApiKey::OffsetDelete => OffsetDeleteResponse::header_version(version),
1284 ApiKey::DescribeClientQuotas => DescribeClientQuotasResponse::header_version(version),
1285 ApiKey::AlterClientQuotas => AlterClientQuotasResponse::header_version(version),
1286 ApiKey::DescribeUserScramCredentials => {
1287 DescribeUserScramCredentialsResponse::header_version(version)
1288 }
1289 ApiKey::AlterUserScramCredentials => {
1290 AlterUserScramCredentialsResponse::header_version(version)
1291 }
1292 ApiKey::Vote => VoteResponse::header_version(version),
1293 ApiKey::BeginQuorumEpoch => BeginQuorumEpochResponse::header_version(version),
1294 ApiKey::EndQuorumEpoch => EndQuorumEpochResponse::header_version(version),
1295 ApiKey::DescribeQuorum => DescribeQuorumResponse::header_version(version),
1296 ApiKey::AlterPartition => AlterPartitionResponse::header_version(version),
1297 ApiKey::UpdateFeatures => UpdateFeaturesResponse::header_version(version),
1298 ApiKey::Envelope => EnvelopeResponse::header_version(version),
1299 ApiKey::FetchSnapshot => FetchSnapshotResponse::header_version(version),
1300 ApiKey::DescribeCluster => DescribeClusterResponse::header_version(version),
1301 ApiKey::DescribeProducers => DescribeProducersResponse::header_version(version),
1302 ApiKey::BrokerRegistration => BrokerRegistrationResponse::header_version(version),
1303 ApiKey::BrokerHeartbeat => BrokerHeartbeatResponse::header_version(version),
1304 ApiKey::UnregisterBroker => UnregisterBrokerResponse::header_version(version),
1305 ApiKey::DescribeTransactions => DescribeTransactionsResponse::header_version(version),
1306 ApiKey::ListTransactions => ListTransactionsResponse::header_version(version),
1307 ApiKey::AllocateProducerIds => AllocateProducerIdsResponse::header_version(version),
1308 ApiKey::ConsumerGroupHeartbeat => {
1309 ConsumerGroupHeartbeatResponse::header_version(version)
1310 }
1311 ApiKey::ConsumerGroupDescribe => ConsumerGroupDescribeResponse::header_version(version),
1312 ApiKey::ControllerRegistration => {
1313 ControllerRegistrationResponse::header_version(version)
1314 }
1315 ApiKey::GetTelemetrySubscriptions => {
1316 GetTelemetrySubscriptionsResponse::header_version(version)
1317 }
1318 ApiKey::PushTelemetry => PushTelemetryResponse::header_version(version),
1319 ApiKey::AssignReplicasToDirs => AssignReplicasToDirsResponse::header_version(version),
1320 ApiKey::ListClientMetricsResources => {
1321 ListClientMetricsResourcesResponse::header_version(version)
1322 }
1323 ApiKey::DescribeTopicPartitions => {
1324 DescribeTopicPartitionsResponse::header_version(version)
1325 }
1326 }
1327 }
1328 pub fn valid_versions(&self) -> VersionRange {
1330 match self {
1331 ApiKey::Produce => VersionRange { min: 0, max: 11 },
1332 ApiKey::Fetch => VersionRange { min: 0, max: 16 },
1333 ApiKey::ListOffsets => VersionRange { min: 0, max: 8 },
1334 ApiKey::Metadata => VersionRange { min: 0, max: 12 },
1335 ApiKey::LeaderAndIsr => VersionRange { min: 0, max: 7 },
1336 ApiKey::StopReplica => VersionRange { min: 0, max: 4 },
1337 ApiKey::UpdateMetadata => VersionRange { min: 0, max: 8 },
1338 ApiKey::ControlledShutdown => VersionRange { min: 0, max: 3 },
1339 ApiKey::OffsetCommit => VersionRange { min: 0, max: 9 },
1340 ApiKey::OffsetFetch => VersionRange { min: 0, max: 9 },
1341 ApiKey::FindCoordinator => VersionRange { min: 0, max: 5 },
1342 ApiKey::JoinGroup => VersionRange { min: 0, max: 9 },
1343 ApiKey::Heartbeat => VersionRange { min: 0, max: 4 },
1344 ApiKey::LeaveGroup => VersionRange { min: 0, max: 5 },
1345 ApiKey::SyncGroup => VersionRange { min: 0, max: 5 },
1346 ApiKey::DescribeGroups => VersionRange { min: 0, max: 5 },
1347 ApiKey::ListGroups => VersionRange { min: 0, max: 5 },
1348 ApiKey::SaslHandshake => VersionRange { min: 0, max: 1 },
1349 ApiKey::ApiVersions => VersionRange { min: 0, max: 3 },
1350 ApiKey::CreateTopics => VersionRange { min: 0, max: 7 },
1351 ApiKey::DeleteTopics => VersionRange { min: 0, max: 6 },
1352 ApiKey::DeleteRecords => VersionRange { min: 0, max: 2 },
1353 ApiKey::InitProducerId => VersionRange { min: 0, max: 5 },
1354 ApiKey::OffsetForLeaderEpoch => VersionRange { min: 0, max: 4 },
1355 ApiKey::AddPartitionsToTxn => VersionRange { min: 0, max: 5 },
1356 ApiKey::AddOffsetsToTxn => VersionRange { min: 0, max: 4 },
1357 ApiKey::EndTxn => VersionRange { min: 0, max: 4 },
1358 ApiKey::WriteTxnMarkers => VersionRange { min: 0, max: 1 },
1359 ApiKey::TxnOffsetCommit => VersionRange { min: 0, max: 4 },
1360 ApiKey::DescribeAcls => VersionRange { min: 0, max: 3 },
1361 ApiKey::CreateAcls => VersionRange { min: 0, max: 3 },
1362 ApiKey::DeleteAcls => VersionRange { min: 0, max: 3 },
1363 ApiKey::DescribeConfigs => VersionRange { min: 0, max: 4 },
1364 ApiKey::AlterConfigs => VersionRange { min: 0, max: 2 },
1365 ApiKey::AlterReplicaLogDirs => VersionRange { min: 0, max: 2 },
1366 ApiKey::DescribeLogDirs => VersionRange { min: 0, max: 4 },
1367 ApiKey::SaslAuthenticate => VersionRange { min: 0, max: 2 },
1368 ApiKey::CreatePartitions => VersionRange { min: 0, max: 3 },
1369 ApiKey::CreateDelegationToken => VersionRange { min: 0, max: 3 },
1370 ApiKey::RenewDelegationToken => VersionRange { min: 0, max: 2 },
1371 ApiKey::ExpireDelegationToken => VersionRange { min: 0, max: 2 },
1372 ApiKey::DescribeDelegationToken => VersionRange { min: 0, max: 3 },
1373 ApiKey::DeleteGroups => VersionRange { min: 0, max: 2 },
1374 ApiKey::ElectLeaders => VersionRange { min: 0, max: 2 },
1375 ApiKey::IncrementalAlterConfigs => VersionRange { min: 0, max: 1 },
1376 ApiKey::AlterPartitionReassignments => VersionRange { min: 0, max: 0 },
1377 ApiKey::ListPartitionReassignments => VersionRange { min: 0, max: 0 },
1378 ApiKey::OffsetDelete => VersionRange { min: 0, max: 0 },
1379 ApiKey::DescribeClientQuotas => VersionRange { min: 0, max: 1 },
1380 ApiKey::AlterClientQuotas => VersionRange { min: 0, max: 1 },
1381 ApiKey::DescribeUserScramCredentials => VersionRange { min: 0, max: 0 },
1382 ApiKey::AlterUserScramCredentials => VersionRange { min: 0, max: 0 },
1383 ApiKey::Vote => VersionRange { min: 0, max: 0 },
1384 ApiKey::BeginQuorumEpoch => VersionRange { min: 0, max: 0 },
1385 ApiKey::EndQuorumEpoch => VersionRange { min: 0, max: 0 },
1386 ApiKey::DescribeQuorum => VersionRange { min: 0, max: 1 },
1387 ApiKey::AlterPartition => VersionRange { min: 0, max: 3 },
1388 ApiKey::UpdateFeatures => VersionRange { min: 0, max: 1 },
1389 ApiKey::Envelope => VersionRange { min: 0, max: 0 },
1390 ApiKey::FetchSnapshot => VersionRange { min: 0, max: 0 },
1391 ApiKey::DescribeCluster => VersionRange { min: 0, max: 1 },
1392 ApiKey::DescribeProducers => VersionRange { min: 0, max: 0 },
1393 ApiKey::BrokerRegistration => VersionRange { min: 0, max: 3 },
1394 ApiKey::BrokerHeartbeat => VersionRange { min: 0, max: 1 },
1395 ApiKey::UnregisterBroker => VersionRange { min: 0, max: 0 },
1396 ApiKey::DescribeTransactions => VersionRange { min: 0, max: 0 },
1397 ApiKey::ListTransactions => VersionRange { min: 0, max: 1 },
1398 ApiKey::AllocateProducerIds => VersionRange { min: 0, max: 0 },
1399 ApiKey::ConsumerGroupHeartbeat => VersionRange { min: 0, max: 0 },
1400 ApiKey::ConsumerGroupDescribe => VersionRange { min: 0, max: 0 },
1401 ApiKey::ControllerRegistration => VersionRange { min: 0, max: 0 },
1402 ApiKey::GetTelemetrySubscriptions => VersionRange { min: 0, max: 0 },
1403 ApiKey::PushTelemetry => VersionRange { min: 0, max: 0 },
1404 ApiKey::AssignReplicasToDirs => VersionRange { min: 0, max: 0 },
1405 ApiKey::ListClientMetricsResources => VersionRange { min: 0, max: 0 },
1406 ApiKey::DescribeTopicPartitions => VersionRange { min: 0, max: 0 },
1407 }
1408 }
1409
1410 pub fn iter() -> impl Iterator<Item = ApiKey> {
1412 (0..i16::MAX).map_while(|i| ApiKey::try_from(i).ok())
1413 }
1414}
1415impl TryFrom<i16> for ApiKey {
1416 type Error = ();
1417
1418 fn try_from(v: i16) -> Result<Self, Self::Error> {
1419 match v {
1420 x if x == ApiKey::Produce as i16 => Ok(ApiKey::Produce),
1421 x if x == ApiKey::Fetch as i16 => Ok(ApiKey::Fetch),
1422 x if x == ApiKey::ListOffsets as i16 => Ok(ApiKey::ListOffsets),
1423 x if x == ApiKey::Metadata as i16 => Ok(ApiKey::Metadata),
1424 x if x == ApiKey::LeaderAndIsr as i16 => Ok(ApiKey::LeaderAndIsr),
1425 x if x == ApiKey::StopReplica as i16 => Ok(ApiKey::StopReplica),
1426 x if x == ApiKey::UpdateMetadata as i16 => Ok(ApiKey::UpdateMetadata),
1427 x if x == ApiKey::ControlledShutdown as i16 => Ok(ApiKey::ControlledShutdown),
1428 x if x == ApiKey::OffsetCommit as i16 => Ok(ApiKey::OffsetCommit),
1429 x if x == ApiKey::OffsetFetch as i16 => Ok(ApiKey::OffsetFetch),
1430 x if x == ApiKey::FindCoordinator as i16 => Ok(ApiKey::FindCoordinator),
1431 x if x == ApiKey::JoinGroup as i16 => Ok(ApiKey::JoinGroup),
1432 x if x == ApiKey::Heartbeat as i16 => Ok(ApiKey::Heartbeat),
1433 x if x == ApiKey::LeaveGroup as i16 => Ok(ApiKey::LeaveGroup),
1434 x if x == ApiKey::SyncGroup as i16 => Ok(ApiKey::SyncGroup),
1435 x if x == ApiKey::DescribeGroups as i16 => Ok(ApiKey::DescribeGroups),
1436 x if x == ApiKey::ListGroups as i16 => Ok(ApiKey::ListGroups),
1437 x if x == ApiKey::SaslHandshake as i16 => Ok(ApiKey::SaslHandshake),
1438 x if x == ApiKey::ApiVersions as i16 => Ok(ApiKey::ApiVersions),
1439 x if x == ApiKey::CreateTopics as i16 => Ok(ApiKey::CreateTopics),
1440 x if x == ApiKey::DeleteTopics as i16 => Ok(ApiKey::DeleteTopics),
1441 x if x == ApiKey::DeleteRecords as i16 => Ok(ApiKey::DeleteRecords),
1442 x if x == ApiKey::InitProducerId as i16 => Ok(ApiKey::InitProducerId),
1443 x if x == ApiKey::OffsetForLeaderEpoch as i16 => Ok(ApiKey::OffsetForLeaderEpoch),
1444 x if x == ApiKey::AddPartitionsToTxn as i16 => Ok(ApiKey::AddPartitionsToTxn),
1445 x if x == ApiKey::AddOffsetsToTxn as i16 => Ok(ApiKey::AddOffsetsToTxn),
1446 x if x == ApiKey::EndTxn as i16 => Ok(ApiKey::EndTxn),
1447 x if x == ApiKey::WriteTxnMarkers as i16 => Ok(ApiKey::WriteTxnMarkers),
1448 x if x == ApiKey::TxnOffsetCommit as i16 => Ok(ApiKey::TxnOffsetCommit),
1449 x if x == ApiKey::DescribeAcls as i16 => Ok(ApiKey::DescribeAcls),
1450 x if x == ApiKey::CreateAcls as i16 => Ok(ApiKey::CreateAcls),
1451 x if x == ApiKey::DeleteAcls as i16 => Ok(ApiKey::DeleteAcls),
1452 x if x == ApiKey::DescribeConfigs as i16 => Ok(ApiKey::DescribeConfigs),
1453 x if x == ApiKey::AlterConfigs as i16 => Ok(ApiKey::AlterConfigs),
1454 x if x == ApiKey::AlterReplicaLogDirs as i16 => Ok(ApiKey::AlterReplicaLogDirs),
1455 x if x == ApiKey::DescribeLogDirs as i16 => Ok(ApiKey::DescribeLogDirs),
1456 x if x == ApiKey::SaslAuthenticate as i16 => Ok(ApiKey::SaslAuthenticate),
1457 x if x == ApiKey::CreatePartitions as i16 => Ok(ApiKey::CreatePartitions),
1458 x if x == ApiKey::CreateDelegationToken as i16 => Ok(ApiKey::CreateDelegationToken),
1459 x if x == ApiKey::RenewDelegationToken as i16 => Ok(ApiKey::RenewDelegationToken),
1460 x if x == ApiKey::ExpireDelegationToken as i16 => Ok(ApiKey::ExpireDelegationToken),
1461 x if x == ApiKey::DescribeDelegationToken as i16 => Ok(ApiKey::DescribeDelegationToken),
1462 x if x == ApiKey::DeleteGroups as i16 => Ok(ApiKey::DeleteGroups),
1463 x if x == ApiKey::ElectLeaders as i16 => Ok(ApiKey::ElectLeaders),
1464 x if x == ApiKey::IncrementalAlterConfigs as i16 => Ok(ApiKey::IncrementalAlterConfigs),
1465 x if x == ApiKey::AlterPartitionReassignments as i16 => {
1466 Ok(ApiKey::AlterPartitionReassignments)
1467 }
1468 x if x == ApiKey::ListPartitionReassignments as i16 => {
1469 Ok(ApiKey::ListPartitionReassignments)
1470 }
1471 x if x == ApiKey::OffsetDelete as i16 => Ok(ApiKey::OffsetDelete),
1472 x if x == ApiKey::DescribeClientQuotas as i16 => Ok(ApiKey::DescribeClientQuotas),
1473 x if x == ApiKey::AlterClientQuotas as i16 => Ok(ApiKey::AlterClientQuotas),
1474 x if x == ApiKey::DescribeUserScramCredentials as i16 => {
1475 Ok(ApiKey::DescribeUserScramCredentials)
1476 }
1477 x if x == ApiKey::AlterUserScramCredentials as i16 => {
1478 Ok(ApiKey::AlterUserScramCredentials)
1479 }
1480 x if x == ApiKey::Vote as i16 => Ok(ApiKey::Vote),
1481 x if x == ApiKey::BeginQuorumEpoch as i16 => Ok(ApiKey::BeginQuorumEpoch),
1482 x if x == ApiKey::EndQuorumEpoch as i16 => Ok(ApiKey::EndQuorumEpoch),
1483 x if x == ApiKey::DescribeQuorum as i16 => Ok(ApiKey::DescribeQuorum),
1484 x if x == ApiKey::AlterPartition as i16 => Ok(ApiKey::AlterPartition),
1485 x if x == ApiKey::UpdateFeatures as i16 => Ok(ApiKey::UpdateFeatures),
1486 x if x == ApiKey::Envelope as i16 => Ok(ApiKey::Envelope),
1487 x if x == ApiKey::FetchSnapshot as i16 => Ok(ApiKey::FetchSnapshot),
1488 x if x == ApiKey::DescribeCluster as i16 => Ok(ApiKey::DescribeCluster),
1489 x if x == ApiKey::DescribeProducers as i16 => Ok(ApiKey::DescribeProducers),
1490 x if x == ApiKey::BrokerRegistration as i16 => Ok(ApiKey::BrokerRegistration),
1491 x if x == ApiKey::BrokerHeartbeat as i16 => Ok(ApiKey::BrokerHeartbeat),
1492 x if x == ApiKey::UnregisterBroker as i16 => Ok(ApiKey::UnregisterBroker),
1493 x if x == ApiKey::DescribeTransactions as i16 => Ok(ApiKey::DescribeTransactions),
1494 x if x == ApiKey::ListTransactions as i16 => Ok(ApiKey::ListTransactions),
1495 x if x == ApiKey::AllocateProducerIds as i16 => Ok(ApiKey::AllocateProducerIds),
1496 x if x == ApiKey::ConsumerGroupHeartbeat as i16 => Ok(ApiKey::ConsumerGroupHeartbeat),
1497 x if x == ApiKey::ConsumerGroupDescribe as i16 => Ok(ApiKey::ConsumerGroupDescribe),
1498 x if x == ApiKey::ControllerRegistration as i16 => Ok(ApiKey::ControllerRegistration),
1499 x if x == ApiKey::GetTelemetrySubscriptions as i16 => {
1500 Ok(ApiKey::GetTelemetrySubscriptions)
1501 }
1502 x if x == ApiKey::PushTelemetry as i16 => Ok(ApiKey::PushTelemetry),
1503 x if x == ApiKey::AssignReplicasToDirs as i16 => Ok(ApiKey::AssignReplicasToDirs),
1504 x if x == ApiKey::ListClientMetricsResources as i16 => {
1505 Ok(ApiKey::ListClientMetricsResources)
1506 }
1507 x if x == ApiKey::DescribeTopicPartitions as i16 => Ok(ApiKey::DescribeTopicPartitions),
1508 _ => Err(()),
1509 }
1510 }
1511}
1512
1513#[cfg(feature = "messages_enums")]
1515#[non_exhaustive]
1516#[derive(Debug, Clone, PartialEq)]
1517pub enum RequestKind {
1518 Produce(ProduceRequest),
1520 Fetch(FetchRequest),
1522 ListOffsets(ListOffsetsRequest),
1524 Metadata(MetadataRequest),
1526 LeaderAndIsr(LeaderAndIsrRequest),
1528 StopReplica(StopReplicaRequest),
1530 UpdateMetadata(UpdateMetadataRequest),
1532 ControlledShutdown(ControlledShutdownRequest),
1534 OffsetCommit(OffsetCommitRequest),
1536 OffsetFetch(OffsetFetchRequest),
1538 FindCoordinator(FindCoordinatorRequest),
1540 JoinGroup(JoinGroupRequest),
1542 Heartbeat(HeartbeatRequest),
1544 LeaveGroup(LeaveGroupRequest),
1546 SyncGroup(SyncGroupRequest),
1548 DescribeGroups(DescribeGroupsRequest),
1550 ListGroups(ListGroupsRequest),
1552 SaslHandshake(SaslHandshakeRequest),
1554 ApiVersions(ApiVersionsRequest),
1556 CreateTopics(CreateTopicsRequest),
1558 DeleteTopics(DeleteTopicsRequest),
1560 DeleteRecords(DeleteRecordsRequest),
1562 InitProducerId(InitProducerIdRequest),
1564 OffsetForLeaderEpoch(OffsetForLeaderEpochRequest),
1566 AddPartitionsToTxn(AddPartitionsToTxnRequest),
1568 AddOffsetsToTxn(AddOffsetsToTxnRequest),
1570 EndTxn(EndTxnRequest),
1572 WriteTxnMarkers(WriteTxnMarkersRequest),
1574 TxnOffsetCommit(TxnOffsetCommitRequest),
1576 DescribeAcls(DescribeAclsRequest),
1578 CreateAcls(CreateAclsRequest),
1580 DeleteAcls(DeleteAclsRequest),
1582 DescribeConfigs(DescribeConfigsRequest),
1584 AlterConfigs(AlterConfigsRequest),
1586 AlterReplicaLogDirs(AlterReplicaLogDirsRequest),
1588 DescribeLogDirs(DescribeLogDirsRequest),
1590 SaslAuthenticate(SaslAuthenticateRequest),
1592 CreatePartitions(CreatePartitionsRequest),
1594 CreateDelegationToken(CreateDelegationTokenRequest),
1596 RenewDelegationToken(RenewDelegationTokenRequest),
1598 ExpireDelegationToken(ExpireDelegationTokenRequest),
1600 DescribeDelegationToken(DescribeDelegationTokenRequest),
1602 DeleteGroups(DeleteGroupsRequest),
1604 ElectLeaders(ElectLeadersRequest),
1606 IncrementalAlterConfigs(IncrementalAlterConfigsRequest),
1608 AlterPartitionReassignments(AlterPartitionReassignmentsRequest),
1610 ListPartitionReassignments(ListPartitionReassignmentsRequest),
1612 OffsetDelete(OffsetDeleteRequest),
1614 DescribeClientQuotas(DescribeClientQuotasRequest),
1616 AlterClientQuotas(AlterClientQuotasRequest),
1618 DescribeUserScramCredentials(DescribeUserScramCredentialsRequest),
1620 AlterUserScramCredentials(AlterUserScramCredentialsRequest),
1622 Vote(VoteRequest),
1624 BeginQuorumEpoch(BeginQuorumEpochRequest),
1626 EndQuorumEpoch(EndQuorumEpochRequest),
1628 DescribeQuorum(DescribeQuorumRequest),
1630 AlterPartition(AlterPartitionRequest),
1632 UpdateFeatures(UpdateFeaturesRequest),
1634 Envelope(EnvelopeRequest),
1636 FetchSnapshot(FetchSnapshotRequest),
1638 DescribeCluster(DescribeClusterRequest),
1640 DescribeProducers(DescribeProducersRequest),
1642 BrokerRegistration(BrokerRegistrationRequest),
1644 BrokerHeartbeat(BrokerHeartbeatRequest),
1646 UnregisterBroker(UnregisterBrokerRequest),
1648 DescribeTransactions(DescribeTransactionsRequest),
1650 ListTransactions(ListTransactionsRequest),
1652 AllocateProducerIds(AllocateProducerIdsRequest),
1654 ConsumerGroupHeartbeat(ConsumerGroupHeartbeatRequest),
1656 ConsumerGroupDescribe(ConsumerGroupDescribeRequest),
1658 ControllerRegistration(ControllerRegistrationRequest),
1660 GetTelemetrySubscriptions(GetTelemetrySubscriptionsRequest),
1662 PushTelemetry(PushTelemetryRequest),
1664 AssignReplicasToDirs(AssignReplicasToDirsRequest),
1666 ListClientMetricsResources(ListClientMetricsResourcesRequest),
1668 DescribeTopicPartitions(DescribeTopicPartitionsRequest),
1670}
1671
1672#[cfg(feature = "messages_enums")]
1673impl RequestKind {
1674 #[cfg(feature = "client")]
1676 pub fn encode(&self, bytes: &mut bytes::BytesMut, version: i16) -> anyhow::Result<()> {
1677 match self {
1678 RequestKind::Produce(x) => encode(x, bytes, version),
1679 RequestKind::Fetch(x) => encode(x, bytes, version),
1680 RequestKind::ListOffsets(x) => encode(x, bytes, version),
1681 RequestKind::Metadata(x) => encode(x, bytes, version),
1682 RequestKind::LeaderAndIsr(x) => encode(x, bytes, version),
1683 RequestKind::StopReplica(x) => encode(x, bytes, version),
1684 RequestKind::UpdateMetadata(x) => encode(x, bytes, version),
1685 RequestKind::ControlledShutdown(x) => encode(x, bytes, version),
1686 RequestKind::OffsetCommit(x) => encode(x, bytes, version),
1687 RequestKind::OffsetFetch(x) => encode(x, bytes, version),
1688 RequestKind::FindCoordinator(x) => encode(x, bytes, version),
1689 RequestKind::JoinGroup(x) => encode(x, bytes, version),
1690 RequestKind::Heartbeat(x) => encode(x, bytes, version),
1691 RequestKind::LeaveGroup(x) => encode(x, bytes, version),
1692 RequestKind::SyncGroup(x) => encode(x, bytes, version),
1693 RequestKind::DescribeGroups(x) => encode(x, bytes, version),
1694 RequestKind::ListGroups(x) => encode(x, bytes, version),
1695 RequestKind::SaslHandshake(x) => encode(x, bytes, version),
1696 RequestKind::ApiVersions(x) => encode(x, bytes, version),
1697 RequestKind::CreateTopics(x) => encode(x, bytes, version),
1698 RequestKind::DeleteTopics(x) => encode(x, bytes, version),
1699 RequestKind::DeleteRecords(x) => encode(x, bytes, version),
1700 RequestKind::InitProducerId(x) => encode(x, bytes, version),
1701 RequestKind::OffsetForLeaderEpoch(x) => encode(x, bytes, version),
1702 RequestKind::AddPartitionsToTxn(x) => encode(x, bytes, version),
1703 RequestKind::AddOffsetsToTxn(x) => encode(x, bytes, version),
1704 RequestKind::EndTxn(x) => encode(x, bytes, version),
1705 RequestKind::WriteTxnMarkers(x) => encode(x, bytes, version),
1706 RequestKind::TxnOffsetCommit(x) => encode(x, bytes, version),
1707 RequestKind::DescribeAcls(x) => encode(x, bytes, version),
1708 RequestKind::CreateAcls(x) => encode(x, bytes, version),
1709 RequestKind::DeleteAcls(x) => encode(x, bytes, version),
1710 RequestKind::DescribeConfigs(x) => encode(x, bytes, version),
1711 RequestKind::AlterConfigs(x) => encode(x, bytes, version),
1712 RequestKind::AlterReplicaLogDirs(x) => encode(x, bytes, version),
1713 RequestKind::DescribeLogDirs(x) => encode(x, bytes, version),
1714 RequestKind::SaslAuthenticate(x) => encode(x, bytes, version),
1715 RequestKind::CreatePartitions(x) => encode(x, bytes, version),
1716 RequestKind::CreateDelegationToken(x) => encode(x, bytes, version),
1717 RequestKind::RenewDelegationToken(x) => encode(x, bytes, version),
1718 RequestKind::ExpireDelegationToken(x) => encode(x, bytes, version),
1719 RequestKind::DescribeDelegationToken(x) => encode(x, bytes, version),
1720 RequestKind::DeleteGroups(x) => encode(x, bytes, version),
1721 RequestKind::ElectLeaders(x) => encode(x, bytes, version),
1722 RequestKind::IncrementalAlterConfigs(x) => encode(x, bytes, version),
1723 RequestKind::AlterPartitionReassignments(x) => encode(x, bytes, version),
1724 RequestKind::ListPartitionReassignments(x) => encode(x, bytes, version),
1725 RequestKind::OffsetDelete(x) => encode(x, bytes, version),
1726 RequestKind::DescribeClientQuotas(x) => encode(x, bytes, version),
1727 RequestKind::AlterClientQuotas(x) => encode(x, bytes, version),
1728 RequestKind::DescribeUserScramCredentials(x) => encode(x, bytes, version),
1729 RequestKind::AlterUserScramCredentials(x) => encode(x, bytes, version),
1730 RequestKind::Vote(x) => encode(x, bytes, version),
1731 RequestKind::BeginQuorumEpoch(x) => encode(x, bytes, version),
1732 RequestKind::EndQuorumEpoch(x) => encode(x, bytes, version),
1733 RequestKind::DescribeQuorum(x) => encode(x, bytes, version),
1734 RequestKind::AlterPartition(x) => encode(x, bytes, version),
1735 RequestKind::UpdateFeatures(x) => encode(x, bytes, version),
1736 RequestKind::Envelope(x) => encode(x, bytes, version),
1737 RequestKind::FetchSnapshot(x) => encode(x, bytes, version),
1738 RequestKind::DescribeCluster(x) => encode(x, bytes, version),
1739 RequestKind::DescribeProducers(x) => encode(x, bytes, version),
1740 RequestKind::BrokerRegistration(x) => encode(x, bytes, version),
1741 RequestKind::BrokerHeartbeat(x) => encode(x, bytes, version),
1742 RequestKind::UnregisterBroker(x) => encode(x, bytes, version),
1743 RequestKind::DescribeTransactions(x) => encode(x, bytes, version),
1744 RequestKind::ListTransactions(x) => encode(x, bytes, version),
1745 RequestKind::AllocateProducerIds(x) => encode(x, bytes, version),
1746 RequestKind::ConsumerGroupHeartbeat(x) => encode(x, bytes, version),
1747 RequestKind::ConsumerGroupDescribe(x) => encode(x, bytes, version),
1748 RequestKind::ControllerRegistration(x) => encode(x, bytes, version),
1749 RequestKind::GetTelemetrySubscriptions(x) => encode(x, bytes, version),
1750 RequestKind::PushTelemetry(x) => encode(x, bytes, version),
1751 RequestKind::AssignReplicasToDirs(x) => encode(x, bytes, version),
1752 RequestKind::ListClientMetricsResources(x) => encode(x, bytes, version),
1753 RequestKind::DescribeTopicPartitions(x) => encode(x, bytes, version),
1754 }
1755 }
1756 #[cfg(feature = "broker")]
1758 pub fn decode(
1759 api_key: ApiKey,
1760 bytes: &mut bytes::Bytes,
1761 version: i16,
1762 ) -> anyhow::Result<RequestKind> {
1763 match api_key {
1764 ApiKey::Produce => Ok(RequestKind::Produce(decode(bytes, version)?)),
1765 ApiKey::Fetch => Ok(RequestKind::Fetch(decode(bytes, version)?)),
1766 ApiKey::ListOffsets => Ok(RequestKind::ListOffsets(decode(bytes, version)?)),
1767 ApiKey::Metadata => Ok(RequestKind::Metadata(decode(bytes, version)?)),
1768 ApiKey::LeaderAndIsr => Ok(RequestKind::LeaderAndIsr(decode(bytes, version)?)),
1769 ApiKey::StopReplica => Ok(RequestKind::StopReplica(decode(bytes, version)?)),
1770 ApiKey::UpdateMetadata => Ok(RequestKind::UpdateMetadata(decode(bytes, version)?)),
1771 ApiKey::ControlledShutdown => {
1772 Ok(RequestKind::ControlledShutdown(decode(bytes, version)?))
1773 }
1774 ApiKey::OffsetCommit => Ok(RequestKind::OffsetCommit(decode(bytes, version)?)),
1775 ApiKey::OffsetFetch => Ok(RequestKind::OffsetFetch(decode(bytes, version)?)),
1776 ApiKey::FindCoordinator => Ok(RequestKind::FindCoordinator(decode(bytes, version)?)),
1777 ApiKey::JoinGroup => Ok(RequestKind::JoinGroup(decode(bytes, version)?)),
1778 ApiKey::Heartbeat => Ok(RequestKind::Heartbeat(decode(bytes, version)?)),
1779 ApiKey::LeaveGroup => Ok(RequestKind::LeaveGroup(decode(bytes, version)?)),
1780 ApiKey::SyncGroup => Ok(RequestKind::SyncGroup(decode(bytes, version)?)),
1781 ApiKey::DescribeGroups => Ok(RequestKind::DescribeGroups(decode(bytes, version)?)),
1782 ApiKey::ListGroups => Ok(RequestKind::ListGroups(decode(bytes, version)?)),
1783 ApiKey::SaslHandshake => Ok(RequestKind::SaslHandshake(decode(bytes, version)?)),
1784 ApiKey::ApiVersions => Ok(RequestKind::ApiVersions(decode(bytes, version)?)),
1785 ApiKey::CreateTopics => Ok(RequestKind::CreateTopics(decode(bytes, version)?)),
1786 ApiKey::DeleteTopics => Ok(RequestKind::DeleteTopics(decode(bytes, version)?)),
1787 ApiKey::DeleteRecords => Ok(RequestKind::DeleteRecords(decode(bytes, version)?)),
1788 ApiKey::InitProducerId => Ok(RequestKind::InitProducerId(decode(bytes, version)?)),
1789 ApiKey::OffsetForLeaderEpoch => {
1790 Ok(RequestKind::OffsetForLeaderEpoch(decode(bytes, version)?))
1791 }
1792 ApiKey::AddPartitionsToTxn => {
1793 Ok(RequestKind::AddPartitionsToTxn(decode(bytes, version)?))
1794 }
1795 ApiKey::AddOffsetsToTxn => Ok(RequestKind::AddOffsetsToTxn(decode(bytes, version)?)),
1796 ApiKey::EndTxn => Ok(RequestKind::EndTxn(decode(bytes, version)?)),
1797 ApiKey::WriteTxnMarkers => Ok(RequestKind::WriteTxnMarkers(decode(bytes, version)?)),
1798 ApiKey::TxnOffsetCommit => Ok(RequestKind::TxnOffsetCommit(decode(bytes, version)?)),
1799 ApiKey::DescribeAcls => Ok(RequestKind::DescribeAcls(decode(bytes, version)?)),
1800 ApiKey::CreateAcls => Ok(RequestKind::CreateAcls(decode(bytes, version)?)),
1801 ApiKey::DeleteAcls => Ok(RequestKind::DeleteAcls(decode(bytes, version)?)),
1802 ApiKey::DescribeConfigs => Ok(RequestKind::DescribeConfigs(decode(bytes, version)?)),
1803 ApiKey::AlterConfigs => Ok(RequestKind::AlterConfigs(decode(bytes, version)?)),
1804 ApiKey::AlterReplicaLogDirs => {
1805 Ok(RequestKind::AlterReplicaLogDirs(decode(bytes, version)?))
1806 }
1807 ApiKey::DescribeLogDirs => Ok(RequestKind::DescribeLogDirs(decode(bytes, version)?)),
1808 ApiKey::SaslAuthenticate => Ok(RequestKind::SaslAuthenticate(decode(bytes, version)?)),
1809 ApiKey::CreatePartitions => Ok(RequestKind::CreatePartitions(decode(bytes, version)?)),
1810 ApiKey::CreateDelegationToken => {
1811 Ok(RequestKind::CreateDelegationToken(decode(bytes, version)?))
1812 }
1813 ApiKey::RenewDelegationToken => {
1814 Ok(RequestKind::RenewDelegationToken(decode(bytes, version)?))
1815 }
1816 ApiKey::ExpireDelegationToken => {
1817 Ok(RequestKind::ExpireDelegationToken(decode(bytes, version)?))
1818 }
1819 ApiKey::DescribeDelegationToken => Ok(RequestKind::DescribeDelegationToken(decode(
1820 bytes, version,
1821 )?)),
1822 ApiKey::DeleteGroups => Ok(RequestKind::DeleteGroups(decode(bytes, version)?)),
1823 ApiKey::ElectLeaders => Ok(RequestKind::ElectLeaders(decode(bytes, version)?)),
1824 ApiKey::IncrementalAlterConfigs => Ok(RequestKind::IncrementalAlterConfigs(decode(
1825 bytes, version,
1826 )?)),
1827 ApiKey::AlterPartitionReassignments => Ok(RequestKind::AlterPartitionReassignments(
1828 decode(bytes, version)?,
1829 )),
1830 ApiKey::ListPartitionReassignments => Ok(RequestKind::ListPartitionReassignments(
1831 decode(bytes, version)?,
1832 )),
1833 ApiKey::OffsetDelete => Ok(RequestKind::OffsetDelete(decode(bytes, version)?)),
1834 ApiKey::DescribeClientQuotas => {
1835 Ok(RequestKind::DescribeClientQuotas(decode(bytes, version)?))
1836 }
1837 ApiKey::AlterClientQuotas => {
1838 Ok(RequestKind::AlterClientQuotas(decode(bytes, version)?))
1839 }
1840 ApiKey::DescribeUserScramCredentials => Ok(RequestKind::DescribeUserScramCredentials(
1841 decode(bytes, version)?,
1842 )),
1843 ApiKey::AlterUserScramCredentials => Ok(RequestKind::AlterUserScramCredentials(
1844 decode(bytes, version)?,
1845 )),
1846 ApiKey::Vote => Ok(RequestKind::Vote(decode(bytes, version)?)),
1847 ApiKey::BeginQuorumEpoch => Ok(RequestKind::BeginQuorumEpoch(decode(bytes, version)?)),
1848 ApiKey::EndQuorumEpoch => Ok(RequestKind::EndQuorumEpoch(decode(bytes, version)?)),
1849 ApiKey::DescribeQuorum => Ok(RequestKind::DescribeQuorum(decode(bytes, version)?)),
1850 ApiKey::AlterPartition => Ok(RequestKind::AlterPartition(decode(bytes, version)?)),
1851 ApiKey::UpdateFeatures => Ok(RequestKind::UpdateFeatures(decode(bytes, version)?)),
1852 ApiKey::Envelope => Ok(RequestKind::Envelope(decode(bytes, version)?)),
1853 ApiKey::FetchSnapshot => Ok(RequestKind::FetchSnapshot(decode(bytes, version)?)),
1854 ApiKey::DescribeCluster => Ok(RequestKind::DescribeCluster(decode(bytes, version)?)),
1855 ApiKey::DescribeProducers => {
1856 Ok(RequestKind::DescribeProducers(decode(bytes, version)?))
1857 }
1858 ApiKey::BrokerRegistration => {
1859 Ok(RequestKind::BrokerRegistration(decode(bytes, version)?))
1860 }
1861 ApiKey::BrokerHeartbeat => Ok(RequestKind::BrokerHeartbeat(decode(bytes, version)?)),
1862 ApiKey::UnregisterBroker => Ok(RequestKind::UnregisterBroker(decode(bytes, version)?)),
1863 ApiKey::DescribeTransactions => {
1864 Ok(RequestKind::DescribeTransactions(decode(bytes, version)?))
1865 }
1866 ApiKey::ListTransactions => Ok(RequestKind::ListTransactions(decode(bytes, version)?)),
1867 ApiKey::AllocateProducerIds => {
1868 Ok(RequestKind::AllocateProducerIds(decode(bytes, version)?))
1869 }
1870 ApiKey::ConsumerGroupHeartbeat => {
1871 Ok(RequestKind::ConsumerGroupHeartbeat(decode(bytes, version)?))
1872 }
1873 ApiKey::ConsumerGroupDescribe => {
1874 Ok(RequestKind::ConsumerGroupDescribe(decode(bytes, version)?))
1875 }
1876 ApiKey::ControllerRegistration => {
1877 Ok(RequestKind::ControllerRegistration(decode(bytes, version)?))
1878 }
1879 ApiKey::GetTelemetrySubscriptions => Ok(RequestKind::GetTelemetrySubscriptions(
1880 decode(bytes, version)?,
1881 )),
1882 ApiKey::PushTelemetry => Ok(RequestKind::PushTelemetry(decode(bytes, version)?)),
1883 ApiKey::AssignReplicasToDirs => {
1884 Ok(RequestKind::AssignReplicasToDirs(decode(bytes, version)?))
1885 }
1886 ApiKey::ListClientMetricsResources => Ok(RequestKind::ListClientMetricsResources(
1887 decode(bytes, version)?,
1888 )),
1889 ApiKey::DescribeTopicPartitions => Ok(RequestKind::DescribeTopicPartitions(decode(
1890 bytes, version,
1891 )?)),
1892 }
1893 }
1894}
1895#[cfg(feature = "messages_enums")]
1896impl From<ProduceRequest> for RequestKind {
1897 fn from(value: ProduceRequest) -> RequestKind {
1898 RequestKind::Produce(value)
1899 }
1900}
1901
1902#[cfg(feature = "messages_enums")]
1903impl From<FetchRequest> for RequestKind {
1904 fn from(value: FetchRequest) -> RequestKind {
1905 RequestKind::Fetch(value)
1906 }
1907}
1908
1909#[cfg(feature = "messages_enums")]
1910impl From<ListOffsetsRequest> for RequestKind {
1911 fn from(value: ListOffsetsRequest) -> RequestKind {
1912 RequestKind::ListOffsets(value)
1913 }
1914}
1915
1916#[cfg(feature = "messages_enums")]
1917impl From<MetadataRequest> for RequestKind {
1918 fn from(value: MetadataRequest) -> RequestKind {
1919 RequestKind::Metadata(value)
1920 }
1921}
1922
1923#[cfg(feature = "messages_enums")]
1924impl From<LeaderAndIsrRequest> for RequestKind {
1925 fn from(value: LeaderAndIsrRequest) -> RequestKind {
1926 RequestKind::LeaderAndIsr(value)
1927 }
1928}
1929
1930#[cfg(feature = "messages_enums")]
1931impl From<StopReplicaRequest> for RequestKind {
1932 fn from(value: StopReplicaRequest) -> RequestKind {
1933 RequestKind::StopReplica(value)
1934 }
1935}
1936
1937#[cfg(feature = "messages_enums")]
1938impl From<UpdateMetadataRequest> for RequestKind {
1939 fn from(value: UpdateMetadataRequest) -> RequestKind {
1940 RequestKind::UpdateMetadata(value)
1941 }
1942}
1943
1944#[cfg(feature = "messages_enums")]
1945impl From<ControlledShutdownRequest> for RequestKind {
1946 fn from(value: ControlledShutdownRequest) -> RequestKind {
1947 RequestKind::ControlledShutdown(value)
1948 }
1949}
1950
1951#[cfg(feature = "messages_enums")]
1952impl From<OffsetCommitRequest> for RequestKind {
1953 fn from(value: OffsetCommitRequest) -> RequestKind {
1954 RequestKind::OffsetCommit(value)
1955 }
1956}
1957
1958#[cfg(feature = "messages_enums")]
1959impl From<OffsetFetchRequest> for RequestKind {
1960 fn from(value: OffsetFetchRequest) -> RequestKind {
1961 RequestKind::OffsetFetch(value)
1962 }
1963}
1964
1965#[cfg(feature = "messages_enums")]
1966impl From<FindCoordinatorRequest> for RequestKind {
1967 fn from(value: FindCoordinatorRequest) -> RequestKind {
1968 RequestKind::FindCoordinator(value)
1969 }
1970}
1971
1972#[cfg(feature = "messages_enums")]
1973impl From<JoinGroupRequest> for RequestKind {
1974 fn from(value: JoinGroupRequest) -> RequestKind {
1975 RequestKind::JoinGroup(value)
1976 }
1977}
1978
1979#[cfg(feature = "messages_enums")]
1980impl From<HeartbeatRequest> for RequestKind {
1981 fn from(value: HeartbeatRequest) -> RequestKind {
1982 RequestKind::Heartbeat(value)
1983 }
1984}
1985
1986#[cfg(feature = "messages_enums")]
1987impl From<LeaveGroupRequest> for RequestKind {
1988 fn from(value: LeaveGroupRequest) -> RequestKind {
1989 RequestKind::LeaveGroup(value)
1990 }
1991}
1992
1993#[cfg(feature = "messages_enums")]
1994impl From<SyncGroupRequest> for RequestKind {
1995 fn from(value: SyncGroupRequest) -> RequestKind {
1996 RequestKind::SyncGroup(value)
1997 }
1998}
1999
2000#[cfg(feature = "messages_enums")]
2001impl From<DescribeGroupsRequest> for RequestKind {
2002 fn from(value: DescribeGroupsRequest) -> RequestKind {
2003 RequestKind::DescribeGroups(value)
2004 }
2005}
2006
2007#[cfg(feature = "messages_enums")]
2008impl From<ListGroupsRequest> for RequestKind {
2009 fn from(value: ListGroupsRequest) -> RequestKind {
2010 RequestKind::ListGroups(value)
2011 }
2012}
2013
2014#[cfg(feature = "messages_enums")]
2015impl From<SaslHandshakeRequest> for RequestKind {
2016 fn from(value: SaslHandshakeRequest) -> RequestKind {
2017 RequestKind::SaslHandshake(value)
2018 }
2019}
2020
2021#[cfg(feature = "messages_enums")]
2022impl From<ApiVersionsRequest> for RequestKind {
2023 fn from(value: ApiVersionsRequest) -> RequestKind {
2024 RequestKind::ApiVersions(value)
2025 }
2026}
2027
2028#[cfg(feature = "messages_enums")]
2029impl From<CreateTopicsRequest> for RequestKind {
2030 fn from(value: CreateTopicsRequest) -> RequestKind {
2031 RequestKind::CreateTopics(value)
2032 }
2033}
2034
2035#[cfg(feature = "messages_enums")]
2036impl From<DeleteTopicsRequest> for RequestKind {
2037 fn from(value: DeleteTopicsRequest) -> RequestKind {
2038 RequestKind::DeleteTopics(value)
2039 }
2040}
2041
2042#[cfg(feature = "messages_enums")]
2043impl From<DeleteRecordsRequest> for RequestKind {
2044 fn from(value: DeleteRecordsRequest) -> RequestKind {
2045 RequestKind::DeleteRecords(value)
2046 }
2047}
2048
2049#[cfg(feature = "messages_enums")]
2050impl From<InitProducerIdRequest> for RequestKind {
2051 fn from(value: InitProducerIdRequest) -> RequestKind {
2052 RequestKind::InitProducerId(value)
2053 }
2054}
2055
2056#[cfg(feature = "messages_enums")]
2057impl From<OffsetForLeaderEpochRequest> for RequestKind {
2058 fn from(value: OffsetForLeaderEpochRequest) -> RequestKind {
2059 RequestKind::OffsetForLeaderEpoch(value)
2060 }
2061}
2062
2063#[cfg(feature = "messages_enums")]
2064impl From<AddPartitionsToTxnRequest> for RequestKind {
2065 fn from(value: AddPartitionsToTxnRequest) -> RequestKind {
2066 RequestKind::AddPartitionsToTxn(value)
2067 }
2068}
2069
2070#[cfg(feature = "messages_enums")]
2071impl From<AddOffsetsToTxnRequest> for RequestKind {
2072 fn from(value: AddOffsetsToTxnRequest) -> RequestKind {
2073 RequestKind::AddOffsetsToTxn(value)
2074 }
2075}
2076
2077#[cfg(feature = "messages_enums")]
2078impl From<EndTxnRequest> for RequestKind {
2079 fn from(value: EndTxnRequest) -> RequestKind {
2080 RequestKind::EndTxn(value)
2081 }
2082}
2083
2084#[cfg(feature = "messages_enums")]
2085impl From<WriteTxnMarkersRequest> for RequestKind {
2086 fn from(value: WriteTxnMarkersRequest) -> RequestKind {
2087 RequestKind::WriteTxnMarkers(value)
2088 }
2089}
2090
2091#[cfg(feature = "messages_enums")]
2092impl From<TxnOffsetCommitRequest> for RequestKind {
2093 fn from(value: TxnOffsetCommitRequest) -> RequestKind {
2094 RequestKind::TxnOffsetCommit(value)
2095 }
2096}
2097
2098#[cfg(feature = "messages_enums")]
2099impl From<DescribeAclsRequest> for RequestKind {
2100 fn from(value: DescribeAclsRequest) -> RequestKind {
2101 RequestKind::DescribeAcls(value)
2102 }
2103}
2104
2105#[cfg(feature = "messages_enums")]
2106impl From<CreateAclsRequest> for RequestKind {
2107 fn from(value: CreateAclsRequest) -> RequestKind {
2108 RequestKind::CreateAcls(value)
2109 }
2110}
2111
2112#[cfg(feature = "messages_enums")]
2113impl From<DeleteAclsRequest> for RequestKind {
2114 fn from(value: DeleteAclsRequest) -> RequestKind {
2115 RequestKind::DeleteAcls(value)
2116 }
2117}
2118
2119#[cfg(feature = "messages_enums")]
2120impl From<DescribeConfigsRequest> for RequestKind {
2121 fn from(value: DescribeConfigsRequest) -> RequestKind {
2122 RequestKind::DescribeConfigs(value)
2123 }
2124}
2125
2126#[cfg(feature = "messages_enums")]
2127impl From<AlterConfigsRequest> for RequestKind {
2128 fn from(value: AlterConfigsRequest) -> RequestKind {
2129 RequestKind::AlterConfigs(value)
2130 }
2131}
2132
2133#[cfg(feature = "messages_enums")]
2134impl From<AlterReplicaLogDirsRequest> for RequestKind {
2135 fn from(value: AlterReplicaLogDirsRequest) -> RequestKind {
2136 RequestKind::AlterReplicaLogDirs(value)
2137 }
2138}
2139
2140#[cfg(feature = "messages_enums")]
2141impl From<DescribeLogDirsRequest> for RequestKind {
2142 fn from(value: DescribeLogDirsRequest) -> RequestKind {
2143 RequestKind::DescribeLogDirs(value)
2144 }
2145}
2146
2147#[cfg(feature = "messages_enums")]
2148impl From<SaslAuthenticateRequest> for RequestKind {
2149 fn from(value: SaslAuthenticateRequest) -> RequestKind {
2150 RequestKind::SaslAuthenticate(value)
2151 }
2152}
2153
2154#[cfg(feature = "messages_enums")]
2155impl From<CreatePartitionsRequest> for RequestKind {
2156 fn from(value: CreatePartitionsRequest) -> RequestKind {
2157 RequestKind::CreatePartitions(value)
2158 }
2159}
2160
2161#[cfg(feature = "messages_enums")]
2162impl From<CreateDelegationTokenRequest> for RequestKind {
2163 fn from(value: CreateDelegationTokenRequest) -> RequestKind {
2164 RequestKind::CreateDelegationToken(value)
2165 }
2166}
2167
2168#[cfg(feature = "messages_enums")]
2169impl From<RenewDelegationTokenRequest> for RequestKind {
2170 fn from(value: RenewDelegationTokenRequest) -> RequestKind {
2171 RequestKind::RenewDelegationToken(value)
2172 }
2173}
2174
2175#[cfg(feature = "messages_enums")]
2176impl From<ExpireDelegationTokenRequest> for RequestKind {
2177 fn from(value: ExpireDelegationTokenRequest) -> RequestKind {
2178 RequestKind::ExpireDelegationToken(value)
2179 }
2180}
2181
2182#[cfg(feature = "messages_enums")]
2183impl From<DescribeDelegationTokenRequest> for RequestKind {
2184 fn from(value: DescribeDelegationTokenRequest) -> RequestKind {
2185 RequestKind::DescribeDelegationToken(value)
2186 }
2187}
2188
2189#[cfg(feature = "messages_enums")]
2190impl From<DeleteGroupsRequest> for RequestKind {
2191 fn from(value: DeleteGroupsRequest) -> RequestKind {
2192 RequestKind::DeleteGroups(value)
2193 }
2194}
2195
2196#[cfg(feature = "messages_enums")]
2197impl From<ElectLeadersRequest> for RequestKind {
2198 fn from(value: ElectLeadersRequest) -> RequestKind {
2199 RequestKind::ElectLeaders(value)
2200 }
2201}
2202
2203#[cfg(feature = "messages_enums")]
2204impl From<IncrementalAlterConfigsRequest> for RequestKind {
2205 fn from(value: IncrementalAlterConfigsRequest) -> RequestKind {
2206 RequestKind::IncrementalAlterConfigs(value)
2207 }
2208}
2209
2210#[cfg(feature = "messages_enums")]
2211impl From<AlterPartitionReassignmentsRequest> for RequestKind {
2212 fn from(value: AlterPartitionReassignmentsRequest) -> RequestKind {
2213 RequestKind::AlterPartitionReassignments(value)
2214 }
2215}
2216
2217#[cfg(feature = "messages_enums")]
2218impl From<ListPartitionReassignmentsRequest> for RequestKind {
2219 fn from(value: ListPartitionReassignmentsRequest) -> RequestKind {
2220 RequestKind::ListPartitionReassignments(value)
2221 }
2222}
2223
2224#[cfg(feature = "messages_enums")]
2225impl From<OffsetDeleteRequest> for RequestKind {
2226 fn from(value: OffsetDeleteRequest) -> RequestKind {
2227 RequestKind::OffsetDelete(value)
2228 }
2229}
2230
2231#[cfg(feature = "messages_enums")]
2232impl From<DescribeClientQuotasRequest> for RequestKind {
2233 fn from(value: DescribeClientQuotasRequest) -> RequestKind {
2234 RequestKind::DescribeClientQuotas(value)
2235 }
2236}
2237
2238#[cfg(feature = "messages_enums")]
2239impl From<AlterClientQuotasRequest> for RequestKind {
2240 fn from(value: AlterClientQuotasRequest) -> RequestKind {
2241 RequestKind::AlterClientQuotas(value)
2242 }
2243}
2244
2245#[cfg(feature = "messages_enums")]
2246impl From<DescribeUserScramCredentialsRequest> for RequestKind {
2247 fn from(value: DescribeUserScramCredentialsRequest) -> RequestKind {
2248 RequestKind::DescribeUserScramCredentials(value)
2249 }
2250}
2251
2252#[cfg(feature = "messages_enums")]
2253impl From<AlterUserScramCredentialsRequest> for RequestKind {
2254 fn from(value: AlterUserScramCredentialsRequest) -> RequestKind {
2255 RequestKind::AlterUserScramCredentials(value)
2256 }
2257}
2258
2259#[cfg(feature = "messages_enums")]
2260impl From<VoteRequest> for RequestKind {
2261 fn from(value: VoteRequest) -> RequestKind {
2262 RequestKind::Vote(value)
2263 }
2264}
2265
2266#[cfg(feature = "messages_enums")]
2267impl From<BeginQuorumEpochRequest> for RequestKind {
2268 fn from(value: BeginQuorumEpochRequest) -> RequestKind {
2269 RequestKind::BeginQuorumEpoch(value)
2270 }
2271}
2272
2273#[cfg(feature = "messages_enums")]
2274impl From<EndQuorumEpochRequest> for RequestKind {
2275 fn from(value: EndQuorumEpochRequest) -> RequestKind {
2276 RequestKind::EndQuorumEpoch(value)
2277 }
2278}
2279
2280#[cfg(feature = "messages_enums")]
2281impl From<DescribeQuorumRequest> for RequestKind {
2282 fn from(value: DescribeQuorumRequest) -> RequestKind {
2283 RequestKind::DescribeQuorum(value)
2284 }
2285}
2286
2287#[cfg(feature = "messages_enums")]
2288impl From<AlterPartitionRequest> for RequestKind {
2289 fn from(value: AlterPartitionRequest) -> RequestKind {
2290 RequestKind::AlterPartition(value)
2291 }
2292}
2293
2294#[cfg(feature = "messages_enums")]
2295impl From<UpdateFeaturesRequest> for RequestKind {
2296 fn from(value: UpdateFeaturesRequest) -> RequestKind {
2297 RequestKind::UpdateFeatures(value)
2298 }
2299}
2300
2301#[cfg(feature = "messages_enums")]
2302impl From<EnvelopeRequest> for RequestKind {
2303 fn from(value: EnvelopeRequest) -> RequestKind {
2304 RequestKind::Envelope(value)
2305 }
2306}
2307
2308#[cfg(feature = "messages_enums")]
2309impl From<FetchSnapshotRequest> for RequestKind {
2310 fn from(value: FetchSnapshotRequest) -> RequestKind {
2311 RequestKind::FetchSnapshot(value)
2312 }
2313}
2314
2315#[cfg(feature = "messages_enums")]
2316impl From<DescribeClusterRequest> for RequestKind {
2317 fn from(value: DescribeClusterRequest) -> RequestKind {
2318 RequestKind::DescribeCluster(value)
2319 }
2320}
2321
2322#[cfg(feature = "messages_enums")]
2323impl From<DescribeProducersRequest> for RequestKind {
2324 fn from(value: DescribeProducersRequest) -> RequestKind {
2325 RequestKind::DescribeProducers(value)
2326 }
2327}
2328
2329#[cfg(feature = "messages_enums")]
2330impl From<BrokerRegistrationRequest> for RequestKind {
2331 fn from(value: BrokerRegistrationRequest) -> RequestKind {
2332 RequestKind::BrokerRegistration(value)
2333 }
2334}
2335
2336#[cfg(feature = "messages_enums")]
2337impl From<BrokerHeartbeatRequest> for RequestKind {
2338 fn from(value: BrokerHeartbeatRequest) -> RequestKind {
2339 RequestKind::BrokerHeartbeat(value)
2340 }
2341}
2342
2343#[cfg(feature = "messages_enums")]
2344impl From<UnregisterBrokerRequest> for RequestKind {
2345 fn from(value: UnregisterBrokerRequest) -> RequestKind {
2346 RequestKind::UnregisterBroker(value)
2347 }
2348}
2349
2350#[cfg(feature = "messages_enums")]
2351impl From<DescribeTransactionsRequest> for RequestKind {
2352 fn from(value: DescribeTransactionsRequest) -> RequestKind {
2353 RequestKind::DescribeTransactions(value)
2354 }
2355}
2356
2357#[cfg(feature = "messages_enums")]
2358impl From<ListTransactionsRequest> for RequestKind {
2359 fn from(value: ListTransactionsRequest) -> RequestKind {
2360 RequestKind::ListTransactions(value)
2361 }
2362}
2363
2364#[cfg(feature = "messages_enums")]
2365impl From<AllocateProducerIdsRequest> for RequestKind {
2366 fn from(value: AllocateProducerIdsRequest) -> RequestKind {
2367 RequestKind::AllocateProducerIds(value)
2368 }
2369}
2370
2371#[cfg(feature = "messages_enums")]
2372impl From<ConsumerGroupHeartbeatRequest> for RequestKind {
2373 fn from(value: ConsumerGroupHeartbeatRequest) -> RequestKind {
2374 RequestKind::ConsumerGroupHeartbeat(value)
2375 }
2376}
2377
2378#[cfg(feature = "messages_enums")]
2379impl From<ConsumerGroupDescribeRequest> for RequestKind {
2380 fn from(value: ConsumerGroupDescribeRequest) -> RequestKind {
2381 RequestKind::ConsumerGroupDescribe(value)
2382 }
2383}
2384
2385#[cfg(feature = "messages_enums")]
2386impl From<ControllerRegistrationRequest> for RequestKind {
2387 fn from(value: ControllerRegistrationRequest) -> RequestKind {
2388 RequestKind::ControllerRegistration(value)
2389 }
2390}
2391
2392#[cfg(feature = "messages_enums")]
2393impl From<GetTelemetrySubscriptionsRequest> for RequestKind {
2394 fn from(value: GetTelemetrySubscriptionsRequest) -> RequestKind {
2395 RequestKind::GetTelemetrySubscriptions(value)
2396 }
2397}
2398
2399#[cfg(feature = "messages_enums")]
2400impl From<PushTelemetryRequest> for RequestKind {
2401 fn from(value: PushTelemetryRequest) -> RequestKind {
2402 RequestKind::PushTelemetry(value)
2403 }
2404}
2405
2406#[cfg(feature = "messages_enums")]
2407impl From<AssignReplicasToDirsRequest> for RequestKind {
2408 fn from(value: AssignReplicasToDirsRequest) -> RequestKind {
2409 RequestKind::AssignReplicasToDirs(value)
2410 }
2411}
2412
2413#[cfg(feature = "messages_enums")]
2414impl From<ListClientMetricsResourcesRequest> for RequestKind {
2415 fn from(value: ListClientMetricsResourcesRequest) -> RequestKind {
2416 RequestKind::ListClientMetricsResources(value)
2417 }
2418}
2419
2420#[cfg(feature = "messages_enums")]
2421impl From<DescribeTopicPartitionsRequest> for RequestKind {
2422 fn from(value: DescribeTopicPartitionsRequest) -> RequestKind {
2423 RequestKind::DescribeTopicPartitions(value)
2424 }
2425}
2426
2427#[cfg(feature = "messages_enums")]
2428#[cfg(any(feature = "client", feature = "broker"))]
2429fn decode<T: Decodable>(bytes: &mut bytes::Bytes, version: i16) -> Result<T> {
2430 T::decode(bytes, version).with_context(|| {
2431 format!(
2432 "Failed to decode {} v{} body",
2433 std::any::type_name::<T>(),
2434 version
2435 )
2436 })
2437}
2438
2439#[cfg(feature = "messages_enums")]
2440#[cfg(any(feature = "client", feature = "broker"))]
2441fn encode<T: Encodable>(encodable: &T, bytes: &mut bytes::BytesMut, version: i16) -> Result<()> {
2442 encodable.encode(bytes, version).with_context(|| {
2443 format!(
2444 "Failed to encode {} v{} body",
2445 std::any::type_name::<T>(),
2446 version
2447 )
2448 })
2449}
2450
2451#[non_exhaustive]
2453#[derive(Debug, Clone, PartialEq)]
2454#[cfg(feature = "messages_enums")]
2455pub enum ResponseKind {
2456 Produce(ProduceResponse),
2458 Fetch(FetchResponse),
2460 ListOffsets(ListOffsetsResponse),
2462 Metadata(MetadataResponse),
2464 LeaderAndIsr(LeaderAndIsrResponse),
2466 StopReplica(StopReplicaResponse),
2468 UpdateMetadata(UpdateMetadataResponse),
2470 ControlledShutdown(ControlledShutdownResponse),
2472 OffsetCommit(OffsetCommitResponse),
2474 OffsetFetch(OffsetFetchResponse),
2476 FindCoordinator(FindCoordinatorResponse),
2478 JoinGroup(JoinGroupResponse),
2480 Heartbeat(HeartbeatResponse),
2482 LeaveGroup(LeaveGroupResponse),
2484 SyncGroup(SyncGroupResponse),
2486 DescribeGroups(DescribeGroupsResponse),
2488 ListGroups(ListGroupsResponse),
2490 SaslHandshake(SaslHandshakeResponse),
2492 ApiVersions(ApiVersionsResponse),
2494 CreateTopics(CreateTopicsResponse),
2496 DeleteTopics(DeleteTopicsResponse),
2498 DeleteRecords(DeleteRecordsResponse),
2500 InitProducerId(InitProducerIdResponse),
2502 OffsetForLeaderEpoch(OffsetForLeaderEpochResponse),
2504 AddPartitionsToTxn(AddPartitionsToTxnResponse),
2506 AddOffsetsToTxn(AddOffsetsToTxnResponse),
2508 EndTxn(EndTxnResponse),
2510 WriteTxnMarkers(WriteTxnMarkersResponse),
2512 TxnOffsetCommit(TxnOffsetCommitResponse),
2514 DescribeAcls(DescribeAclsResponse),
2516 CreateAcls(CreateAclsResponse),
2518 DeleteAcls(DeleteAclsResponse),
2520 DescribeConfigs(DescribeConfigsResponse),
2522 AlterConfigs(AlterConfigsResponse),
2524 AlterReplicaLogDirs(AlterReplicaLogDirsResponse),
2526 DescribeLogDirs(DescribeLogDirsResponse),
2528 SaslAuthenticate(SaslAuthenticateResponse),
2530 CreatePartitions(CreatePartitionsResponse),
2532 CreateDelegationToken(CreateDelegationTokenResponse),
2534 RenewDelegationToken(RenewDelegationTokenResponse),
2536 ExpireDelegationToken(ExpireDelegationTokenResponse),
2538 DescribeDelegationToken(DescribeDelegationTokenResponse),
2540 DeleteGroups(DeleteGroupsResponse),
2542 ElectLeaders(ElectLeadersResponse),
2544 IncrementalAlterConfigs(IncrementalAlterConfigsResponse),
2546 AlterPartitionReassignments(AlterPartitionReassignmentsResponse),
2548 ListPartitionReassignments(ListPartitionReassignmentsResponse),
2550 OffsetDelete(OffsetDeleteResponse),
2552 DescribeClientQuotas(DescribeClientQuotasResponse),
2554 AlterClientQuotas(AlterClientQuotasResponse),
2556 DescribeUserScramCredentials(DescribeUserScramCredentialsResponse),
2558 AlterUserScramCredentials(AlterUserScramCredentialsResponse),
2560 Vote(VoteResponse),
2562 BeginQuorumEpoch(BeginQuorumEpochResponse),
2564 EndQuorumEpoch(EndQuorumEpochResponse),
2566 DescribeQuorum(DescribeQuorumResponse),
2568 AlterPartition(AlterPartitionResponse),
2570 UpdateFeatures(UpdateFeaturesResponse),
2572 Envelope(EnvelopeResponse),
2574 FetchSnapshot(FetchSnapshotResponse),
2576 DescribeCluster(DescribeClusterResponse),
2578 DescribeProducers(DescribeProducersResponse),
2580 BrokerRegistration(BrokerRegistrationResponse),
2582 BrokerHeartbeat(BrokerHeartbeatResponse),
2584 UnregisterBroker(UnregisterBrokerResponse),
2586 DescribeTransactions(DescribeTransactionsResponse),
2588 ListTransactions(ListTransactionsResponse),
2590 AllocateProducerIds(AllocateProducerIdsResponse),
2592 ConsumerGroupHeartbeat(ConsumerGroupHeartbeatResponse),
2594 ConsumerGroupDescribe(ConsumerGroupDescribeResponse),
2596 ControllerRegistration(ControllerRegistrationResponse),
2598 GetTelemetrySubscriptions(GetTelemetrySubscriptionsResponse),
2600 PushTelemetry(PushTelemetryResponse),
2602 AssignReplicasToDirs(AssignReplicasToDirsResponse),
2604 ListClientMetricsResources(ListClientMetricsResourcesResponse),
2606 DescribeTopicPartitions(DescribeTopicPartitionsResponse),
2608}
2609
2610#[cfg(feature = "messages_enums")]
2611impl ResponseKind {
2612 #[cfg(feature = "broker")]
2614 pub fn encode(&self, bytes: &mut bytes::BytesMut, version: i16) -> anyhow::Result<()> {
2615 match self {
2616 ResponseKind::Produce(x) => encode(x, bytes, version),
2617 ResponseKind::Fetch(x) => encode(x, bytes, version),
2618 ResponseKind::ListOffsets(x) => encode(x, bytes, version),
2619 ResponseKind::Metadata(x) => encode(x, bytes, version),
2620 ResponseKind::LeaderAndIsr(x) => encode(x, bytes, version),
2621 ResponseKind::StopReplica(x) => encode(x, bytes, version),
2622 ResponseKind::UpdateMetadata(x) => encode(x, bytes, version),
2623 ResponseKind::ControlledShutdown(x) => encode(x, bytes, version),
2624 ResponseKind::OffsetCommit(x) => encode(x, bytes, version),
2625 ResponseKind::OffsetFetch(x) => encode(x, bytes, version),
2626 ResponseKind::FindCoordinator(x) => encode(x, bytes, version),
2627 ResponseKind::JoinGroup(x) => encode(x, bytes, version),
2628 ResponseKind::Heartbeat(x) => encode(x, bytes, version),
2629 ResponseKind::LeaveGroup(x) => encode(x, bytes, version),
2630 ResponseKind::SyncGroup(x) => encode(x, bytes, version),
2631 ResponseKind::DescribeGroups(x) => encode(x, bytes, version),
2632 ResponseKind::ListGroups(x) => encode(x, bytes, version),
2633 ResponseKind::SaslHandshake(x) => encode(x, bytes, version),
2634 ResponseKind::ApiVersions(x) => encode(x, bytes, version),
2635 ResponseKind::CreateTopics(x) => encode(x, bytes, version),
2636 ResponseKind::DeleteTopics(x) => encode(x, bytes, version),
2637 ResponseKind::DeleteRecords(x) => encode(x, bytes, version),
2638 ResponseKind::InitProducerId(x) => encode(x, bytes, version),
2639 ResponseKind::OffsetForLeaderEpoch(x) => encode(x, bytes, version),
2640 ResponseKind::AddPartitionsToTxn(x) => encode(x, bytes, version),
2641 ResponseKind::AddOffsetsToTxn(x) => encode(x, bytes, version),
2642 ResponseKind::EndTxn(x) => encode(x, bytes, version),
2643 ResponseKind::WriteTxnMarkers(x) => encode(x, bytes, version),
2644 ResponseKind::TxnOffsetCommit(x) => encode(x, bytes, version),
2645 ResponseKind::DescribeAcls(x) => encode(x, bytes, version),
2646 ResponseKind::CreateAcls(x) => encode(x, bytes, version),
2647 ResponseKind::DeleteAcls(x) => encode(x, bytes, version),
2648 ResponseKind::DescribeConfigs(x) => encode(x, bytes, version),
2649 ResponseKind::AlterConfigs(x) => encode(x, bytes, version),
2650 ResponseKind::AlterReplicaLogDirs(x) => encode(x, bytes, version),
2651 ResponseKind::DescribeLogDirs(x) => encode(x, bytes, version),
2652 ResponseKind::SaslAuthenticate(x) => encode(x, bytes, version),
2653 ResponseKind::CreatePartitions(x) => encode(x, bytes, version),
2654 ResponseKind::CreateDelegationToken(x) => encode(x, bytes, version),
2655 ResponseKind::RenewDelegationToken(x) => encode(x, bytes, version),
2656 ResponseKind::ExpireDelegationToken(x) => encode(x, bytes, version),
2657 ResponseKind::DescribeDelegationToken(x) => encode(x, bytes, version),
2658 ResponseKind::DeleteGroups(x) => encode(x, bytes, version),
2659 ResponseKind::ElectLeaders(x) => encode(x, bytes, version),
2660 ResponseKind::IncrementalAlterConfigs(x) => encode(x, bytes, version),
2661 ResponseKind::AlterPartitionReassignments(x) => encode(x, bytes, version),
2662 ResponseKind::ListPartitionReassignments(x) => encode(x, bytes, version),
2663 ResponseKind::OffsetDelete(x) => encode(x, bytes, version),
2664 ResponseKind::DescribeClientQuotas(x) => encode(x, bytes, version),
2665 ResponseKind::AlterClientQuotas(x) => encode(x, bytes, version),
2666 ResponseKind::DescribeUserScramCredentials(x) => encode(x, bytes, version),
2667 ResponseKind::AlterUserScramCredentials(x) => encode(x, bytes, version),
2668 ResponseKind::Vote(x) => encode(x, bytes, version),
2669 ResponseKind::BeginQuorumEpoch(x) => encode(x, bytes, version),
2670 ResponseKind::EndQuorumEpoch(x) => encode(x, bytes, version),
2671 ResponseKind::DescribeQuorum(x) => encode(x, bytes, version),
2672 ResponseKind::AlterPartition(x) => encode(x, bytes, version),
2673 ResponseKind::UpdateFeatures(x) => encode(x, bytes, version),
2674 ResponseKind::Envelope(x) => encode(x, bytes, version),
2675 ResponseKind::FetchSnapshot(x) => encode(x, bytes, version),
2676 ResponseKind::DescribeCluster(x) => encode(x, bytes, version),
2677 ResponseKind::DescribeProducers(x) => encode(x, bytes, version),
2678 ResponseKind::BrokerRegistration(x) => encode(x, bytes, version),
2679 ResponseKind::BrokerHeartbeat(x) => encode(x, bytes, version),
2680 ResponseKind::UnregisterBroker(x) => encode(x, bytes, version),
2681 ResponseKind::DescribeTransactions(x) => encode(x, bytes, version),
2682 ResponseKind::ListTransactions(x) => encode(x, bytes, version),
2683 ResponseKind::AllocateProducerIds(x) => encode(x, bytes, version),
2684 ResponseKind::ConsumerGroupHeartbeat(x) => encode(x, bytes, version),
2685 ResponseKind::ConsumerGroupDescribe(x) => encode(x, bytes, version),
2686 ResponseKind::ControllerRegistration(x) => encode(x, bytes, version),
2687 ResponseKind::GetTelemetrySubscriptions(x) => encode(x, bytes, version),
2688 ResponseKind::PushTelemetry(x) => encode(x, bytes, version),
2689 ResponseKind::AssignReplicasToDirs(x) => encode(x, bytes, version),
2690 ResponseKind::ListClientMetricsResources(x) => encode(x, bytes, version),
2691 ResponseKind::DescribeTopicPartitions(x) => encode(x, bytes, version),
2692 }
2693 }
2694 #[cfg(feature = "client")]
2696 pub fn decode(
2697 api_key: ApiKey,
2698 bytes: &mut bytes::Bytes,
2699 version: i16,
2700 ) -> anyhow::Result<ResponseKind> {
2701 match api_key {
2702 ApiKey::Produce => Ok(ResponseKind::Produce(decode(bytes, version)?)),
2703 ApiKey::Fetch => Ok(ResponseKind::Fetch(decode(bytes, version)?)),
2704 ApiKey::ListOffsets => Ok(ResponseKind::ListOffsets(decode(bytes, version)?)),
2705 ApiKey::Metadata => Ok(ResponseKind::Metadata(decode(bytes, version)?)),
2706 ApiKey::LeaderAndIsr => Ok(ResponseKind::LeaderAndIsr(decode(bytes, version)?)),
2707 ApiKey::StopReplica => Ok(ResponseKind::StopReplica(decode(bytes, version)?)),
2708 ApiKey::UpdateMetadata => Ok(ResponseKind::UpdateMetadata(decode(bytes, version)?)),
2709 ApiKey::ControlledShutdown => {
2710 Ok(ResponseKind::ControlledShutdown(decode(bytes, version)?))
2711 }
2712 ApiKey::OffsetCommit => Ok(ResponseKind::OffsetCommit(decode(bytes, version)?)),
2713 ApiKey::OffsetFetch => Ok(ResponseKind::OffsetFetch(decode(bytes, version)?)),
2714 ApiKey::FindCoordinator => Ok(ResponseKind::FindCoordinator(decode(bytes, version)?)),
2715 ApiKey::JoinGroup => Ok(ResponseKind::JoinGroup(decode(bytes, version)?)),
2716 ApiKey::Heartbeat => Ok(ResponseKind::Heartbeat(decode(bytes, version)?)),
2717 ApiKey::LeaveGroup => Ok(ResponseKind::LeaveGroup(decode(bytes, version)?)),
2718 ApiKey::SyncGroup => Ok(ResponseKind::SyncGroup(decode(bytes, version)?)),
2719 ApiKey::DescribeGroups => Ok(ResponseKind::DescribeGroups(decode(bytes, version)?)),
2720 ApiKey::ListGroups => Ok(ResponseKind::ListGroups(decode(bytes, version)?)),
2721 ApiKey::SaslHandshake => Ok(ResponseKind::SaslHandshake(decode(bytes, version)?)),
2722 ApiKey::ApiVersions => Ok(ResponseKind::ApiVersions(decode(bytes, version)?)),
2723 ApiKey::CreateTopics => Ok(ResponseKind::CreateTopics(decode(bytes, version)?)),
2724 ApiKey::DeleteTopics => Ok(ResponseKind::DeleteTopics(decode(bytes, version)?)),
2725 ApiKey::DeleteRecords => Ok(ResponseKind::DeleteRecords(decode(bytes, version)?)),
2726 ApiKey::InitProducerId => Ok(ResponseKind::InitProducerId(decode(bytes, version)?)),
2727 ApiKey::OffsetForLeaderEpoch => {
2728 Ok(ResponseKind::OffsetForLeaderEpoch(decode(bytes, version)?))
2729 }
2730 ApiKey::AddPartitionsToTxn => {
2731 Ok(ResponseKind::AddPartitionsToTxn(decode(bytes, version)?))
2732 }
2733 ApiKey::AddOffsetsToTxn => Ok(ResponseKind::AddOffsetsToTxn(decode(bytes, version)?)),
2734 ApiKey::EndTxn => Ok(ResponseKind::EndTxn(decode(bytes, version)?)),
2735 ApiKey::WriteTxnMarkers => Ok(ResponseKind::WriteTxnMarkers(decode(bytes, version)?)),
2736 ApiKey::TxnOffsetCommit => Ok(ResponseKind::TxnOffsetCommit(decode(bytes, version)?)),
2737 ApiKey::DescribeAcls => Ok(ResponseKind::DescribeAcls(decode(bytes, version)?)),
2738 ApiKey::CreateAcls => Ok(ResponseKind::CreateAcls(decode(bytes, version)?)),
2739 ApiKey::DeleteAcls => Ok(ResponseKind::DeleteAcls(decode(bytes, version)?)),
2740 ApiKey::DescribeConfigs => Ok(ResponseKind::DescribeConfigs(decode(bytes, version)?)),
2741 ApiKey::AlterConfigs => Ok(ResponseKind::AlterConfigs(decode(bytes, version)?)),
2742 ApiKey::AlterReplicaLogDirs => {
2743 Ok(ResponseKind::AlterReplicaLogDirs(decode(bytes, version)?))
2744 }
2745 ApiKey::DescribeLogDirs => Ok(ResponseKind::DescribeLogDirs(decode(bytes, version)?)),
2746 ApiKey::SaslAuthenticate => Ok(ResponseKind::SaslAuthenticate(decode(bytes, version)?)),
2747 ApiKey::CreatePartitions => Ok(ResponseKind::CreatePartitions(decode(bytes, version)?)),
2748 ApiKey::CreateDelegationToken => {
2749 Ok(ResponseKind::CreateDelegationToken(decode(bytes, version)?))
2750 }
2751 ApiKey::RenewDelegationToken => {
2752 Ok(ResponseKind::RenewDelegationToken(decode(bytes, version)?))
2753 }
2754 ApiKey::ExpireDelegationToken => {
2755 Ok(ResponseKind::ExpireDelegationToken(decode(bytes, version)?))
2756 }
2757 ApiKey::DescribeDelegationToken => Ok(ResponseKind::DescribeDelegationToken(decode(
2758 bytes, version,
2759 )?)),
2760 ApiKey::DeleteGroups => Ok(ResponseKind::DeleteGroups(decode(bytes, version)?)),
2761 ApiKey::ElectLeaders => Ok(ResponseKind::ElectLeaders(decode(bytes, version)?)),
2762 ApiKey::IncrementalAlterConfigs => Ok(ResponseKind::IncrementalAlterConfigs(decode(
2763 bytes, version,
2764 )?)),
2765 ApiKey::AlterPartitionReassignments => Ok(ResponseKind::AlterPartitionReassignments(
2766 decode(bytes, version)?,
2767 )),
2768 ApiKey::ListPartitionReassignments => Ok(ResponseKind::ListPartitionReassignments(
2769 decode(bytes, version)?,
2770 )),
2771 ApiKey::OffsetDelete => Ok(ResponseKind::OffsetDelete(decode(bytes, version)?)),
2772 ApiKey::DescribeClientQuotas => {
2773 Ok(ResponseKind::DescribeClientQuotas(decode(bytes, version)?))
2774 }
2775 ApiKey::AlterClientQuotas => {
2776 Ok(ResponseKind::AlterClientQuotas(decode(bytes, version)?))
2777 }
2778 ApiKey::DescribeUserScramCredentials => Ok(ResponseKind::DescribeUserScramCredentials(
2779 decode(bytes, version)?,
2780 )),
2781 ApiKey::AlterUserScramCredentials => Ok(ResponseKind::AlterUserScramCredentials(
2782 decode(bytes, version)?,
2783 )),
2784 ApiKey::Vote => Ok(ResponseKind::Vote(decode(bytes, version)?)),
2785 ApiKey::BeginQuorumEpoch => Ok(ResponseKind::BeginQuorumEpoch(decode(bytes, version)?)),
2786 ApiKey::EndQuorumEpoch => Ok(ResponseKind::EndQuorumEpoch(decode(bytes, version)?)),
2787 ApiKey::DescribeQuorum => Ok(ResponseKind::DescribeQuorum(decode(bytes, version)?)),
2788 ApiKey::AlterPartition => Ok(ResponseKind::AlterPartition(decode(bytes, version)?)),
2789 ApiKey::UpdateFeatures => Ok(ResponseKind::UpdateFeatures(decode(bytes, version)?)),
2790 ApiKey::Envelope => Ok(ResponseKind::Envelope(decode(bytes, version)?)),
2791 ApiKey::FetchSnapshot => Ok(ResponseKind::FetchSnapshot(decode(bytes, version)?)),
2792 ApiKey::DescribeCluster => Ok(ResponseKind::DescribeCluster(decode(bytes, version)?)),
2793 ApiKey::DescribeProducers => {
2794 Ok(ResponseKind::DescribeProducers(decode(bytes, version)?))
2795 }
2796 ApiKey::BrokerRegistration => {
2797 Ok(ResponseKind::BrokerRegistration(decode(bytes, version)?))
2798 }
2799 ApiKey::BrokerHeartbeat => Ok(ResponseKind::BrokerHeartbeat(decode(bytes, version)?)),
2800 ApiKey::UnregisterBroker => Ok(ResponseKind::UnregisterBroker(decode(bytes, version)?)),
2801 ApiKey::DescribeTransactions => {
2802 Ok(ResponseKind::DescribeTransactions(decode(bytes, version)?))
2803 }
2804 ApiKey::ListTransactions => Ok(ResponseKind::ListTransactions(decode(bytes, version)?)),
2805 ApiKey::AllocateProducerIds => {
2806 Ok(ResponseKind::AllocateProducerIds(decode(bytes, version)?))
2807 }
2808 ApiKey::ConsumerGroupHeartbeat => Ok(ResponseKind::ConsumerGroupHeartbeat(decode(
2809 bytes, version,
2810 )?)),
2811 ApiKey::ConsumerGroupDescribe => {
2812 Ok(ResponseKind::ConsumerGroupDescribe(decode(bytes, version)?))
2813 }
2814 ApiKey::ControllerRegistration => Ok(ResponseKind::ControllerRegistration(decode(
2815 bytes, version,
2816 )?)),
2817 ApiKey::GetTelemetrySubscriptions => Ok(ResponseKind::GetTelemetrySubscriptions(
2818 decode(bytes, version)?,
2819 )),
2820 ApiKey::PushTelemetry => Ok(ResponseKind::PushTelemetry(decode(bytes, version)?)),
2821 ApiKey::AssignReplicasToDirs => {
2822 Ok(ResponseKind::AssignReplicasToDirs(decode(bytes, version)?))
2823 }
2824 ApiKey::ListClientMetricsResources => Ok(ResponseKind::ListClientMetricsResources(
2825 decode(bytes, version)?,
2826 )),
2827 ApiKey::DescribeTopicPartitions => Ok(ResponseKind::DescribeTopicPartitions(decode(
2828 bytes, version,
2829 )?)),
2830 }
2831 }
2832 pub fn header_version(&self, version: i16) -> i16 {
2834 match self {
2835 ResponseKind::Produce(_) => ProduceResponse::header_version(version),
2836 ResponseKind::Fetch(_) => FetchResponse::header_version(version),
2837 ResponseKind::ListOffsets(_) => ListOffsetsResponse::header_version(version),
2838 ResponseKind::Metadata(_) => MetadataResponse::header_version(version),
2839 ResponseKind::LeaderAndIsr(_) => LeaderAndIsrResponse::header_version(version),
2840 ResponseKind::StopReplica(_) => StopReplicaResponse::header_version(version),
2841 ResponseKind::UpdateMetadata(_) => UpdateMetadataResponse::header_version(version),
2842 ResponseKind::ControlledShutdown(_) => {
2843 ControlledShutdownResponse::header_version(version)
2844 }
2845 ResponseKind::OffsetCommit(_) => OffsetCommitResponse::header_version(version),
2846 ResponseKind::OffsetFetch(_) => OffsetFetchResponse::header_version(version),
2847 ResponseKind::FindCoordinator(_) => FindCoordinatorResponse::header_version(version),
2848 ResponseKind::JoinGroup(_) => JoinGroupResponse::header_version(version),
2849 ResponseKind::Heartbeat(_) => HeartbeatResponse::header_version(version),
2850 ResponseKind::LeaveGroup(_) => LeaveGroupResponse::header_version(version),
2851 ResponseKind::SyncGroup(_) => SyncGroupResponse::header_version(version),
2852 ResponseKind::DescribeGroups(_) => DescribeGroupsResponse::header_version(version),
2853 ResponseKind::ListGroups(_) => ListGroupsResponse::header_version(version),
2854 ResponseKind::SaslHandshake(_) => SaslHandshakeResponse::header_version(version),
2855 ResponseKind::ApiVersions(_) => ApiVersionsResponse::header_version(version),
2856 ResponseKind::CreateTopics(_) => CreateTopicsResponse::header_version(version),
2857 ResponseKind::DeleteTopics(_) => DeleteTopicsResponse::header_version(version),
2858 ResponseKind::DeleteRecords(_) => DeleteRecordsResponse::header_version(version),
2859 ResponseKind::InitProducerId(_) => InitProducerIdResponse::header_version(version),
2860 ResponseKind::OffsetForLeaderEpoch(_) => {
2861 OffsetForLeaderEpochResponse::header_version(version)
2862 }
2863 ResponseKind::AddPartitionsToTxn(_) => {
2864 AddPartitionsToTxnResponse::header_version(version)
2865 }
2866 ResponseKind::AddOffsetsToTxn(_) => AddOffsetsToTxnResponse::header_version(version),
2867 ResponseKind::EndTxn(_) => EndTxnResponse::header_version(version),
2868 ResponseKind::WriteTxnMarkers(_) => WriteTxnMarkersResponse::header_version(version),
2869 ResponseKind::TxnOffsetCommit(_) => TxnOffsetCommitResponse::header_version(version),
2870 ResponseKind::DescribeAcls(_) => DescribeAclsResponse::header_version(version),
2871 ResponseKind::CreateAcls(_) => CreateAclsResponse::header_version(version),
2872 ResponseKind::DeleteAcls(_) => DeleteAclsResponse::header_version(version),
2873 ResponseKind::DescribeConfigs(_) => DescribeConfigsResponse::header_version(version),
2874 ResponseKind::AlterConfigs(_) => AlterConfigsResponse::header_version(version),
2875 ResponseKind::AlterReplicaLogDirs(_) => {
2876 AlterReplicaLogDirsResponse::header_version(version)
2877 }
2878 ResponseKind::DescribeLogDirs(_) => DescribeLogDirsResponse::header_version(version),
2879 ResponseKind::SaslAuthenticate(_) => SaslAuthenticateResponse::header_version(version),
2880 ResponseKind::CreatePartitions(_) => CreatePartitionsResponse::header_version(version),
2881 ResponseKind::CreateDelegationToken(_) => {
2882 CreateDelegationTokenResponse::header_version(version)
2883 }
2884 ResponseKind::RenewDelegationToken(_) => {
2885 RenewDelegationTokenResponse::header_version(version)
2886 }
2887 ResponseKind::ExpireDelegationToken(_) => {
2888 ExpireDelegationTokenResponse::header_version(version)
2889 }
2890 ResponseKind::DescribeDelegationToken(_) => {
2891 DescribeDelegationTokenResponse::header_version(version)
2892 }
2893 ResponseKind::DeleteGroups(_) => DeleteGroupsResponse::header_version(version),
2894 ResponseKind::ElectLeaders(_) => ElectLeadersResponse::header_version(version),
2895 ResponseKind::IncrementalAlterConfigs(_) => {
2896 IncrementalAlterConfigsResponse::header_version(version)
2897 }
2898 ResponseKind::AlterPartitionReassignments(_) => {
2899 AlterPartitionReassignmentsResponse::header_version(version)
2900 }
2901 ResponseKind::ListPartitionReassignments(_) => {
2902 ListPartitionReassignmentsResponse::header_version(version)
2903 }
2904 ResponseKind::OffsetDelete(_) => OffsetDeleteResponse::header_version(version),
2905 ResponseKind::DescribeClientQuotas(_) => {
2906 DescribeClientQuotasResponse::header_version(version)
2907 }
2908 ResponseKind::AlterClientQuotas(_) => {
2909 AlterClientQuotasResponse::header_version(version)
2910 }
2911 ResponseKind::DescribeUserScramCredentials(_) => {
2912 DescribeUserScramCredentialsResponse::header_version(version)
2913 }
2914 ResponseKind::AlterUserScramCredentials(_) => {
2915 AlterUserScramCredentialsResponse::header_version(version)
2916 }
2917 ResponseKind::Vote(_) => VoteResponse::header_version(version),
2918 ResponseKind::BeginQuorumEpoch(_) => BeginQuorumEpochResponse::header_version(version),
2919 ResponseKind::EndQuorumEpoch(_) => EndQuorumEpochResponse::header_version(version),
2920 ResponseKind::DescribeQuorum(_) => DescribeQuorumResponse::header_version(version),
2921 ResponseKind::AlterPartition(_) => AlterPartitionResponse::header_version(version),
2922 ResponseKind::UpdateFeatures(_) => UpdateFeaturesResponse::header_version(version),
2923 ResponseKind::Envelope(_) => EnvelopeResponse::header_version(version),
2924 ResponseKind::FetchSnapshot(_) => FetchSnapshotResponse::header_version(version),
2925 ResponseKind::DescribeCluster(_) => DescribeClusterResponse::header_version(version),
2926 ResponseKind::DescribeProducers(_) => {
2927 DescribeProducersResponse::header_version(version)
2928 }
2929 ResponseKind::BrokerRegistration(_) => {
2930 BrokerRegistrationResponse::header_version(version)
2931 }
2932 ResponseKind::BrokerHeartbeat(_) => BrokerHeartbeatResponse::header_version(version),
2933 ResponseKind::UnregisterBroker(_) => UnregisterBrokerResponse::header_version(version),
2934 ResponseKind::DescribeTransactions(_) => {
2935 DescribeTransactionsResponse::header_version(version)
2936 }
2937 ResponseKind::ListTransactions(_) => ListTransactionsResponse::header_version(version),
2938 ResponseKind::AllocateProducerIds(_) => {
2939 AllocateProducerIdsResponse::header_version(version)
2940 }
2941 ResponseKind::ConsumerGroupHeartbeat(_) => {
2942 ConsumerGroupHeartbeatResponse::header_version(version)
2943 }
2944 ResponseKind::ConsumerGroupDescribe(_) => {
2945 ConsumerGroupDescribeResponse::header_version(version)
2946 }
2947 ResponseKind::ControllerRegistration(_) => {
2948 ControllerRegistrationResponse::header_version(version)
2949 }
2950 ResponseKind::GetTelemetrySubscriptions(_) => {
2951 GetTelemetrySubscriptionsResponse::header_version(version)
2952 }
2953 ResponseKind::PushTelemetry(_) => PushTelemetryResponse::header_version(version),
2954 ResponseKind::AssignReplicasToDirs(_) => {
2955 AssignReplicasToDirsResponse::header_version(version)
2956 }
2957 ResponseKind::ListClientMetricsResources(_) => {
2958 ListClientMetricsResourcesResponse::header_version(version)
2959 }
2960 ResponseKind::DescribeTopicPartitions(_) => {
2961 DescribeTopicPartitionsResponse::header_version(version)
2962 }
2963 }
2964 }
2965}
2966
2967#[cfg(feature = "messages_enums")]
2968impl From<ProduceResponse> for ResponseKind {
2969 fn from(value: ProduceResponse) -> ResponseKind {
2970 ResponseKind::Produce(value)
2971 }
2972}
2973
2974#[cfg(feature = "messages_enums")]
2975impl From<FetchResponse> for ResponseKind {
2976 fn from(value: FetchResponse) -> ResponseKind {
2977 ResponseKind::Fetch(value)
2978 }
2979}
2980
2981#[cfg(feature = "messages_enums")]
2982impl From<ListOffsetsResponse> for ResponseKind {
2983 fn from(value: ListOffsetsResponse) -> ResponseKind {
2984 ResponseKind::ListOffsets(value)
2985 }
2986}
2987
2988#[cfg(feature = "messages_enums")]
2989impl From<MetadataResponse> for ResponseKind {
2990 fn from(value: MetadataResponse) -> ResponseKind {
2991 ResponseKind::Metadata(value)
2992 }
2993}
2994
2995#[cfg(feature = "messages_enums")]
2996impl From<LeaderAndIsrResponse> for ResponseKind {
2997 fn from(value: LeaderAndIsrResponse) -> ResponseKind {
2998 ResponseKind::LeaderAndIsr(value)
2999 }
3000}
3001
3002#[cfg(feature = "messages_enums")]
3003impl From<StopReplicaResponse> for ResponseKind {
3004 fn from(value: StopReplicaResponse) -> ResponseKind {
3005 ResponseKind::StopReplica(value)
3006 }
3007}
3008
3009#[cfg(feature = "messages_enums")]
3010impl From<UpdateMetadataResponse> for ResponseKind {
3011 fn from(value: UpdateMetadataResponse) -> ResponseKind {
3012 ResponseKind::UpdateMetadata(value)
3013 }
3014}
3015
3016#[cfg(feature = "messages_enums")]
3017impl From<ControlledShutdownResponse> for ResponseKind {
3018 fn from(value: ControlledShutdownResponse) -> ResponseKind {
3019 ResponseKind::ControlledShutdown(value)
3020 }
3021}
3022
3023#[cfg(feature = "messages_enums")]
3024impl From<OffsetCommitResponse> for ResponseKind {
3025 fn from(value: OffsetCommitResponse) -> ResponseKind {
3026 ResponseKind::OffsetCommit(value)
3027 }
3028}
3029
3030#[cfg(feature = "messages_enums")]
3031impl From<OffsetFetchResponse> for ResponseKind {
3032 fn from(value: OffsetFetchResponse) -> ResponseKind {
3033 ResponseKind::OffsetFetch(value)
3034 }
3035}
3036
3037#[cfg(feature = "messages_enums")]
3038impl From<FindCoordinatorResponse> for ResponseKind {
3039 fn from(value: FindCoordinatorResponse) -> ResponseKind {
3040 ResponseKind::FindCoordinator(value)
3041 }
3042}
3043
3044#[cfg(feature = "messages_enums")]
3045impl From<JoinGroupResponse> for ResponseKind {
3046 fn from(value: JoinGroupResponse) -> ResponseKind {
3047 ResponseKind::JoinGroup(value)
3048 }
3049}
3050
3051#[cfg(feature = "messages_enums")]
3052impl From<HeartbeatResponse> for ResponseKind {
3053 fn from(value: HeartbeatResponse) -> ResponseKind {
3054 ResponseKind::Heartbeat(value)
3055 }
3056}
3057
3058#[cfg(feature = "messages_enums")]
3059impl From<LeaveGroupResponse> for ResponseKind {
3060 fn from(value: LeaveGroupResponse) -> ResponseKind {
3061 ResponseKind::LeaveGroup(value)
3062 }
3063}
3064
3065#[cfg(feature = "messages_enums")]
3066impl From<SyncGroupResponse> for ResponseKind {
3067 fn from(value: SyncGroupResponse) -> ResponseKind {
3068 ResponseKind::SyncGroup(value)
3069 }
3070}
3071
3072#[cfg(feature = "messages_enums")]
3073impl From<DescribeGroupsResponse> for ResponseKind {
3074 fn from(value: DescribeGroupsResponse) -> ResponseKind {
3075 ResponseKind::DescribeGroups(value)
3076 }
3077}
3078
3079#[cfg(feature = "messages_enums")]
3080impl From<ListGroupsResponse> for ResponseKind {
3081 fn from(value: ListGroupsResponse) -> ResponseKind {
3082 ResponseKind::ListGroups(value)
3083 }
3084}
3085
3086#[cfg(feature = "messages_enums")]
3087impl From<SaslHandshakeResponse> for ResponseKind {
3088 fn from(value: SaslHandshakeResponse) -> ResponseKind {
3089 ResponseKind::SaslHandshake(value)
3090 }
3091}
3092
3093#[cfg(feature = "messages_enums")]
3094impl From<ApiVersionsResponse> for ResponseKind {
3095 fn from(value: ApiVersionsResponse) -> ResponseKind {
3096 ResponseKind::ApiVersions(value)
3097 }
3098}
3099
3100#[cfg(feature = "messages_enums")]
3101impl From<CreateTopicsResponse> for ResponseKind {
3102 fn from(value: CreateTopicsResponse) -> ResponseKind {
3103 ResponseKind::CreateTopics(value)
3104 }
3105}
3106
3107#[cfg(feature = "messages_enums")]
3108impl From<DeleteTopicsResponse> for ResponseKind {
3109 fn from(value: DeleteTopicsResponse) -> ResponseKind {
3110 ResponseKind::DeleteTopics(value)
3111 }
3112}
3113
3114#[cfg(feature = "messages_enums")]
3115impl From<DeleteRecordsResponse> for ResponseKind {
3116 fn from(value: DeleteRecordsResponse) -> ResponseKind {
3117 ResponseKind::DeleteRecords(value)
3118 }
3119}
3120
3121#[cfg(feature = "messages_enums")]
3122impl From<InitProducerIdResponse> for ResponseKind {
3123 fn from(value: InitProducerIdResponse) -> ResponseKind {
3124 ResponseKind::InitProducerId(value)
3125 }
3126}
3127
3128#[cfg(feature = "messages_enums")]
3129impl From<OffsetForLeaderEpochResponse> for ResponseKind {
3130 fn from(value: OffsetForLeaderEpochResponse) -> ResponseKind {
3131 ResponseKind::OffsetForLeaderEpoch(value)
3132 }
3133}
3134
3135#[cfg(feature = "messages_enums")]
3136impl From<AddPartitionsToTxnResponse> for ResponseKind {
3137 fn from(value: AddPartitionsToTxnResponse) -> ResponseKind {
3138 ResponseKind::AddPartitionsToTxn(value)
3139 }
3140}
3141
3142#[cfg(feature = "messages_enums")]
3143impl From<AddOffsetsToTxnResponse> for ResponseKind {
3144 fn from(value: AddOffsetsToTxnResponse) -> ResponseKind {
3145 ResponseKind::AddOffsetsToTxn(value)
3146 }
3147}
3148
3149#[cfg(feature = "messages_enums")]
3150impl From<EndTxnResponse> for ResponseKind {
3151 fn from(value: EndTxnResponse) -> ResponseKind {
3152 ResponseKind::EndTxn(value)
3153 }
3154}
3155
3156#[cfg(feature = "messages_enums")]
3157impl From<WriteTxnMarkersResponse> for ResponseKind {
3158 fn from(value: WriteTxnMarkersResponse) -> ResponseKind {
3159 ResponseKind::WriteTxnMarkers(value)
3160 }
3161}
3162
3163#[cfg(feature = "messages_enums")]
3164impl From<TxnOffsetCommitResponse> for ResponseKind {
3165 fn from(value: TxnOffsetCommitResponse) -> ResponseKind {
3166 ResponseKind::TxnOffsetCommit(value)
3167 }
3168}
3169
3170#[cfg(feature = "messages_enums")]
3171impl From<DescribeAclsResponse> for ResponseKind {
3172 fn from(value: DescribeAclsResponse) -> ResponseKind {
3173 ResponseKind::DescribeAcls(value)
3174 }
3175}
3176
3177#[cfg(feature = "messages_enums")]
3178impl From<CreateAclsResponse> for ResponseKind {
3179 fn from(value: CreateAclsResponse) -> ResponseKind {
3180 ResponseKind::CreateAcls(value)
3181 }
3182}
3183
3184#[cfg(feature = "messages_enums")]
3185impl From<DeleteAclsResponse> for ResponseKind {
3186 fn from(value: DeleteAclsResponse) -> ResponseKind {
3187 ResponseKind::DeleteAcls(value)
3188 }
3189}
3190
3191#[cfg(feature = "messages_enums")]
3192impl From<DescribeConfigsResponse> for ResponseKind {
3193 fn from(value: DescribeConfigsResponse) -> ResponseKind {
3194 ResponseKind::DescribeConfigs(value)
3195 }
3196}
3197
3198#[cfg(feature = "messages_enums")]
3199impl From<AlterConfigsResponse> for ResponseKind {
3200 fn from(value: AlterConfigsResponse) -> ResponseKind {
3201 ResponseKind::AlterConfigs(value)
3202 }
3203}
3204
3205#[cfg(feature = "messages_enums")]
3206impl From<AlterReplicaLogDirsResponse> for ResponseKind {
3207 fn from(value: AlterReplicaLogDirsResponse) -> ResponseKind {
3208 ResponseKind::AlterReplicaLogDirs(value)
3209 }
3210}
3211
3212#[cfg(feature = "messages_enums")]
3213impl From<DescribeLogDirsResponse> for ResponseKind {
3214 fn from(value: DescribeLogDirsResponse) -> ResponseKind {
3215 ResponseKind::DescribeLogDirs(value)
3216 }
3217}
3218
3219#[cfg(feature = "messages_enums")]
3220impl From<SaslAuthenticateResponse> for ResponseKind {
3221 fn from(value: SaslAuthenticateResponse) -> ResponseKind {
3222 ResponseKind::SaslAuthenticate(value)
3223 }
3224}
3225
3226#[cfg(feature = "messages_enums")]
3227impl From<CreatePartitionsResponse> for ResponseKind {
3228 fn from(value: CreatePartitionsResponse) -> ResponseKind {
3229 ResponseKind::CreatePartitions(value)
3230 }
3231}
3232
3233#[cfg(feature = "messages_enums")]
3234impl From<CreateDelegationTokenResponse> for ResponseKind {
3235 fn from(value: CreateDelegationTokenResponse) -> ResponseKind {
3236 ResponseKind::CreateDelegationToken(value)
3237 }
3238}
3239
3240#[cfg(feature = "messages_enums")]
3241impl From<RenewDelegationTokenResponse> for ResponseKind {
3242 fn from(value: RenewDelegationTokenResponse) -> ResponseKind {
3243 ResponseKind::RenewDelegationToken(value)
3244 }
3245}
3246
3247#[cfg(feature = "messages_enums")]
3248impl From<ExpireDelegationTokenResponse> for ResponseKind {
3249 fn from(value: ExpireDelegationTokenResponse) -> ResponseKind {
3250 ResponseKind::ExpireDelegationToken(value)
3251 }
3252}
3253
3254#[cfg(feature = "messages_enums")]
3255impl From<DescribeDelegationTokenResponse> for ResponseKind {
3256 fn from(value: DescribeDelegationTokenResponse) -> ResponseKind {
3257 ResponseKind::DescribeDelegationToken(value)
3258 }
3259}
3260
3261#[cfg(feature = "messages_enums")]
3262impl From<DeleteGroupsResponse> for ResponseKind {
3263 fn from(value: DeleteGroupsResponse) -> ResponseKind {
3264 ResponseKind::DeleteGroups(value)
3265 }
3266}
3267
3268#[cfg(feature = "messages_enums")]
3269impl From<ElectLeadersResponse> for ResponseKind {
3270 fn from(value: ElectLeadersResponse) -> ResponseKind {
3271 ResponseKind::ElectLeaders(value)
3272 }
3273}
3274
3275#[cfg(feature = "messages_enums")]
3276impl From<IncrementalAlterConfigsResponse> for ResponseKind {
3277 fn from(value: IncrementalAlterConfigsResponse) -> ResponseKind {
3278 ResponseKind::IncrementalAlterConfigs(value)
3279 }
3280}
3281
3282#[cfg(feature = "messages_enums")]
3283impl From<AlterPartitionReassignmentsResponse> for ResponseKind {
3284 fn from(value: AlterPartitionReassignmentsResponse) -> ResponseKind {
3285 ResponseKind::AlterPartitionReassignments(value)
3286 }
3287}
3288
3289#[cfg(feature = "messages_enums")]
3290impl From<ListPartitionReassignmentsResponse> for ResponseKind {
3291 fn from(value: ListPartitionReassignmentsResponse) -> ResponseKind {
3292 ResponseKind::ListPartitionReassignments(value)
3293 }
3294}
3295
3296#[cfg(feature = "messages_enums")]
3297impl From<OffsetDeleteResponse> for ResponseKind {
3298 fn from(value: OffsetDeleteResponse) -> ResponseKind {
3299 ResponseKind::OffsetDelete(value)
3300 }
3301}
3302
3303#[cfg(feature = "messages_enums")]
3304impl From<DescribeClientQuotasResponse> for ResponseKind {
3305 fn from(value: DescribeClientQuotasResponse) -> ResponseKind {
3306 ResponseKind::DescribeClientQuotas(value)
3307 }
3308}
3309
3310#[cfg(feature = "messages_enums")]
3311impl From<AlterClientQuotasResponse> for ResponseKind {
3312 fn from(value: AlterClientQuotasResponse) -> ResponseKind {
3313 ResponseKind::AlterClientQuotas(value)
3314 }
3315}
3316
3317#[cfg(feature = "messages_enums")]
3318impl From<DescribeUserScramCredentialsResponse> for ResponseKind {
3319 fn from(value: DescribeUserScramCredentialsResponse) -> ResponseKind {
3320 ResponseKind::DescribeUserScramCredentials(value)
3321 }
3322}
3323
3324#[cfg(feature = "messages_enums")]
3325impl From<AlterUserScramCredentialsResponse> for ResponseKind {
3326 fn from(value: AlterUserScramCredentialsResponse) -> ResponseKind {
3327 ResponseKind::AlterUserScramCredentials(value)
3328 }
3329}
3330
3331#[cfg(feature = "messages_enums")]
3332impl From<VoteResponse> for ResponseKind {
3333 fn from(value: VoteResponse) -> ResponseKind {
3334 ResponseKind::Vote(value)
3335 }
3336}
3337
3338#[cfg(feature = "messages_enums")]
3339impl From<BeginQuorumEpochResponse> for ResponseKind {
3340 fn from(value: BeginQuorumEpochResponse) -> ResponseKind {
3341 ResponseKind::BeginQuorumEpoch(value)
3342 }
3343}
3344
3345#[cfg(feature = "messages_enums")]
3346impl From<EndQuorumEpochResponse> for ResponseKind {
3347 fn from(value: EndQuorumEpochResponse) -> ResponseKind {
3348 ResponseKind::EndQuorumEpoch(value)
3349 }
3350}
3351
3352#[cfg(feature = "messages_enums")]
3353impl From<DescribeQuorumResponse> for ResponseKind {
3354 fn from(value: DescribeQuorumResponse) -> ResponseKind {
3355 ResponseKind::DescribeQuorum(value)
3356 }
3357}
3358
3359#[cfg(feature = "messages_enums")]
3360impl From<AlterPartitionResponse> for ResponseKind {
3361 fn from(value: AlterPartitionResponse) -> ResponseKind {
3362 ResponseKind::AlterPartition(value)
3363 }
3364}
3365
3366#[cfg(feature = "messages_enums")]
3367impl From<UpdateFeaturesResponse> for ResponseKind {
3368 fn from(value: UpdateFeaturesResponse) -> ResponseKind {
3369 ResponseKind::UpdateFeatures(value)
3370 }
3371}
3372
3373#[cfg(feature = "messages_enums")]
3374impl From<EnvelopeResponse> for ResponseKind {
3375 fn from(value: EnvelopeResponse) -> ResponseKind {
3376 ResponseKind::Envelope(value)
3377 }
3378}
3379
3380#[cfg(feature = "messages_enums")]
3381impl From<FetchSnapshotResponse> for ResponseKind {
3382 fn from(value: FetchSnapshotResponse) -> ResponseKind {
3383 ResponseKind::FetchSnapshot(value)
3384 }
3385}
3386
3387#[cfg(feature = "messages_enums")]
3388impl From<DescribeClusterResponse> for ResponseKind {
3389 fn from(value: DescribeClusterResponse) -> ResponseKind {
3390 ResponseKind::DescribeCluster(value)
3391 }
3392}
3393
3394#[cfg(feature = "messages_enums")]
3395impl From<DescribeProducersResponse> for ResponseKind {
3396 fn from(value: DescribeProducersResponse) -> ResponseKind {
3397 ResponseKind::DescribeProducers(value)
3398 }
3399}
3400
3401#[cfg(feature = "messages_enums")]
3402impl From<BrokerRegistrationResponse> for ResponseKind {
3403 fn from(value: BrokerRegistrationResponse) -> ResponseKind {
3404 ResponseKind::BrokerRegistration(value)
3405 }
3406}
3407
3408#[cfg(feature = "messages_enums")]
3409impl From<BrokerHeartbeatResponse> for ResponseKind {
3410 fn from(value: BrokerHeartbeatResponse) -> ResponseKind {
3411 ResponseKind::BrokerHeartbeat(value)
3412 }
3413}
3414
3415#[cfg(feature = "messages_enums")]
3416impl From<UnregisterBrokerResponse> for ResponseKind {
3417 fn from(value: UnregisterBrokerResponse) -> ResponseKind {
3418 ResponseKind::UnregisterBroker(value)
3419 }
3420}
3421
3422#[cfg(feature = "messages_enums")]
3423impl From<DescribeTransactionsResponse> for ResponseKind {
3424 fn from(value: DescribeTransactionsResponse) -> ResponseKind {
3425 ResponseKind::DescribeTransactions(value)
3426 }
3427}
3428
3429#[cfg(feature = "messages_enums")]
3430impl From<ListTransactionsResponse> for ResponseKind {
3431 fn from(value: ListTransactionsResponse) -> ResponseKind {
3432 ResponseKind::ListTransactions(value)
3433 }
3434}
3435
3436#[cfg(feature = "messages_enums")]
3437impl From<AllocateProducerIdsResponse> for ResponseKind {
3438 fn from(value: AllocateProducerIdsResponse) -> ResponseKind {
3439 ResponseKind::AllocateProducerIds(value)
3440 }
3441}
3442
3443#[cfg(feature = "messages_enums")]
3444impl From<ConsumerGroupHeartbeatResponse> for ResponseKind {
3445 fn from(value: ConsumerGroupHeartbeatResponse) -> ResponseKind {
3446 ResponseKind::ConsumerGroupHeartbeat(value)
3447 }
3448}
3449
3450#[cfg(feature = "messages_enums")]
3451impl From<ConsumerGroupDescribeResponse> for ResponseKind {
3452 fn from(value: ConsumerGroupDescribeResponse) -> ResponseKind {
3453 ResponseKind::ConsumerGroupDescribe(value)
3454 }
3455}
3456
3457#[cfg(feature = "messages_enums")]
3458impl From<ControllerRegistrationResponse> for ResponseKind {
3459 fn from(value: ControllerRegistrationResponse) -> ResponseKind {
3460 ResponseKind::ControllerRegistration(value)
3461 }
3462}
3463
3464#[cfg(feature = "messages_enums")]
3465impl From<GetTelemetrySubscriptionsResponse> for ResponseKind {
3466 fn from(value: GetTelemetrySubscriptionsResponse) -> ResponseKind {
3467 ResponseKind::GetTelemetrySubscriptions(value)
3468 }
3469}
3470
3471#[cfg(feature = "messages_enums")]
3472impl From<PushTelemetryResponse> for ResponseKind {
3473 fn from(value: PushTelemetryResponse) -> ResponseKind {
3474 ResponseKind::PushTelemetry(value)
3475 }
3476}
3477
3478#[cfg(feature = "messages_enums")]
3479impl From<AssignReplicasToDirsResponse> for ResponseKind {
3480 fn from(value: AssignReplicasToDirsResponse) -> ResponseKind {
3481 ResponseKind::AssignReplicasToDirs(value)
3482 }
3483}
3484
3485#[cfg(feature = "messages_enums")]
3486impl From<ListClientMetricsResourcesResponse> for ResponseKind {
3487 fn from(value: ListClientMetricsResourcesResponse) -> ResponseKind {
3488 ResponseKind::ListClientMetricsResources(value)
3489 }
3490}
3491
3492#[cfg(feature = "messages_enums")]
3493impl From<DescribeTopicPartitionsResponse> for ResponseKind {
3494 fn from(value: DescribeTopicPartitionsResponse) -> ResponseKind {
3495 ResponseKind::DescribeTopicPartitions(value)
3496 }
3497}
3498
3499#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default, Copy)]
3501pub struct BrokerId(pub i32);
3502
3503impl From<i32> for BrokerId {
3504 fn from(other: i32) -> Self {
3505 Self(other)
3506 }
3507}
3508impl From<BrokerId> for i32 {
3509 fn from(other: BrokerId) -> Self {
3510 other.0
3511 }
3512}
3513impl std::borrow::Borrow<i32> for BrokerId {
3514 fn borrow(&self) -> &i32 {
3515 &self.0
3516 }
3517}
3518impl std::ops::Deref for BrokerId {
3519 type Target = i32;
3520 fn deref(&self) -> &Self::Target {
3521 &self.0
3522 }
3523}
3524impl std::cmp::PartialEq<i32> for BrokerId {
3525 fn eq(&self, other: &i32) -> bool {
3526 &self.0 == other
3527 }
3528}
3529impl std::cmp::PartialEq<BrokerId> for i32 {
3530 fn eq(&self, other: &BrokerId) -> bool {
3531 self == &other.0
3532 }
3533}
3534impl std::fmt::Debug for BrokerId {
3535 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3536 self.0.fmt(f)
3537 }
3538}
3539impl NewType<i32> for BrokerId {}
3540
3541#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default)]
3543pub struct GroupId(pub StrBytes);
3544
3545impl From<StrBytes> for GroupId {
3546 fn from(other: StrBytes) -> Self {
3547 Self(other)
3548 }
3549}
3550impl From<GroupId> for StrBytes {
3551 fn from(other: GroupId) -> Self {
3552 other.0
3553 }
3554}
3555impl std::borrow::Borrow<StrBytes> for GroupId {
3556 fn borrow(&self) -> &StrBytes {
3557 &self.0
3558 }
3559}
3560impl std::ops::Deref for GroupId {
3561 type Target = StrBytes;
3562 fn deref(&self) -> &Self::Target {
3563 &self.0
3564 }
3565}
3566impl std::cmp::PartialEq<StrBytes> for GroupId {
3567 fn eq(&self, other: &StrBytes) -> bool {
3568 &self.0 == other
3569 }
3570}
3571impl std::cmp::PartialEq<GroupId> for StrBytes {
3572 fn eq(&self, other: &GroupId) -> bool {
3573 self == &other.0
3574 }
3575}
3576impl std::fmt::Debug for GroupId {
3577 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3578 self.0.fmt(f)
3579 }
3580}
3581impl NewType<StrBytes> for GroupId {}
3582
3583#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default, Copy)]
3585pub struct ProducerId(pub i64);
3586
3587impl From<i64> for ProducerId {
3588 fn from(other: i64) -> Self {
3589 Self(other)
3590 }
3591}
3592impl From<ProducerId> for i64 {
3593 fn from(other: ProducerId) -> Self {
3594 other.0
3595 }
3596}
3597impl std::borrow::Borrow<i64> for ProducerId {
3598 fn borrow(&self) -> &i64 {
3599 &self.0
3600 }
3601}
3602impl std::ops::Deref for ProducerId {
3603 type Target = i64;
3604 fn deref(&self) -> &Self::Target {
3605 &self.0
3606 }
3607}
3608impl std::cmp::PartialEq<i64> for ProducerId {
3609 fn eq(&self, other: &i64) -> bool {
3610 &self.0 == other
3611 }
3612}
3613impl std::cmp::PartialEq<ProducerId> for i64 {
3614 fn eq(&self, other: &ProducerId) -> bool {
3615 self == &other.0
3616 }
3617}
3618impl std::fmt::Debug for ProducerId {
3619 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3620 self.0.fmt(f)
3621 }
3622}
3623impl NewType<i64> for ProducerId {}
3624
3625#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default)]
3627pub struct TopicName(pub StrBytes);
3628
3629impl From<StrBytes> for TopicName {
3630 fn from(other: StrBytes) -> Self {
3631 Self(other)
3632 }
3633}
3634impl From<TopicName> for StrBytes {
3635 fn from(other: TopicName) -> Self {
3636 other.0
3637 }
3638}
3639impl std::borrow::Borrow<StrBytes> for TopicName {
3640 fn borrow(&self) -> &StrBytes {
3641 &self.0
3642 }
3643}
3644impl std::ops::Deref for TopicName {
3645 type Target = StrBytes;
3646 fn deref(&self) -> &Self::Target {
3647 &self.0
3648 }
3649}
3650impl std::cmp::PartialEq<StrBytes> for TopicName {
3651 fn eq(&self, other: &StrBytes) -> bool {
3652 &self.0 == other
3653 }
3654}
3655impl std::cmp::PartialEq<TopicName> for StrBytes {
3656 fn eq(&self, other: &TopicName) -> bool {
3657 self == &other.0
3658 }
3659}
3660impl std::fmt::Debug for TopicName {
3661 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3662 self.0.fmt(f)
3663 }
3664}
3665impl NewType<StrBytes> for TopicName {}
3666
3667#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default)]
3669pub struct TransactionalId(pub StrBytes);
3670
3671impl From<StrBytes> for TransactionalId {
3672 fn from(other: StrBytes) -> Self {
3673 Self(other)
3674 }
3675}
3676impl From<TransactionalId> for StrBytes {
3677 fn from(other: TransactionalId) -> Self {
3678 other.0
3679 }
3680}
3681impl std::borrow::Borrow<StrBytes> for TransactionalId {
3682 fn borrow(&self) -> &StrBytes {
3683 &self.0
3684 }
3685}
3686impl std::ops::Deref for TransactionalId {
3687 type Target = StrBytes;
3688 fn deref(&self) -> &Self::Target {
3689 &self.0
3690 }
3691}
3692impl std::cmp::PartialEq<StrBytes> for TransactionalId {
3693 fn eq(&self, other: &StrBytes) -> bool {
3694 &self.0 == other
3695 }
3696}
3697impl std::cmp::PartialEq<TransactionalId> for StrBytes {
3698 fn eq(&self, other: &TransactionalId) -> bool {
3699 self == &other.0
3700 }
3701}
3702impl std::fmt::Debug for TransactionalId {
3703 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3704 self.0.fmt(f)
3705 }
3706}
3707impl NewType<StrBytes> for TransactionalId {}