kf_protocol_message/kf_code_gen/join_group.rs
1/// WARNING: CODE GENERATED FILE
2/// * This file is generated by kfspec2code.
3/// * Any changes applied to this file will be lost when a new spec is generated.
4use serde::{Deserialize, Serialize};
5
6use kf_protocol_api::ErrorCode;
7use kf_protocol_api::ProtocolMetadata;
8use kf_protocol_api::Request;
9
10use kf_protocol_derive::Decode;
11use kf_protocol_derive::Encode;
12use kf_protocol_derive::KfDefault;
13
14// -----------------------------------
15// KfJoinGroupRequest
16// -----------------------------------
17
18#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
19pub struct KfJoinGroupRequest {
20 /// The group identifier.
21 pub group_id: String,
22
23 /// The coordinator considers the consumer dead if it receives no heartbeat after this timeout
24 /// in milliseconds.
25 pub session_timeout_ms: i32,
26
27 /// The maximum time in milliseconds that the coordinator will wait for each member to rejoin
28 /// when rebalancing the group.
29 #[fluvio_kf(min_version = 1, ignorable)]
30 pub rebalance_timeout_ms: i32,
31
32 /// The member id assigned by the group coordinator.
33 pub member_id: String,
34
35 /// The unique name the for class of protocols implemented by the group we want to join.
36 pub protocol_type: String,
37
38 /// The list of protocols that the member supports.
39 pub protocols: Vec<JoinGroupRequestProtocol>,
40}
41
42#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
43pub struct JoinGroupRequestProtocol {
44 /// The protocol name.
45 pub name: String,
46
47 /// The protocol metadata.
48 pub metadata: ProtocolMetadata,
49}
50
51// -----------------------------------
52// KfJoinGroupResponse
53// -----------------------------------
54
55#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
56pub struct KfJoinGroupResponse {
57 /// The duration in milliseconds for which the request was throttled due to a quota violation,
58 /// or zero if the request did not violate any quota.
59 #[fluvio_kf(min_version = 2, ignorable)]
60 pub throttle_time_ms: i32,
61
62 /// The error code, or 0 if there was no error.
63 pub error_code: ErrorCode,
64
65 /// The generation ID of the group.
66 pub generation_id: i32,
67
68 /// The group protocol selected by the coordinator.
69 pub protocol_name: String,
70
71 /// The leader of the group.
72 pub leader: String,
73
74 /// The member ID assigned by the group coordinator.
75 pub member_id: String,
76
77 pub members: Vec<JoinGroupResponseMember>,
78}
79
80#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
81pub struct JoinGroupResponseMember {
82 /// The group member ID.
83 pub member_id: String,
84
85 /// The group member metadata.
86 pub metadata: ProtocolMetadata,
87}
88
89// -----------------------------------
90// Implementation - KfJoinGroupRequest
91// -----------------------------------
92
93impl Request for KfJoinGroupRequest {
94 const API_KEY: u16 = 11;
95
96 const MIN_API_VERSION: i16 = 0;
97 const MAX_API_VERSION: i16 = 4;
98 const DEFAULT_API_VERSION: i16 = 4;
99
100 type Response = KfJoinGroupResponse;
101}