kf_protocol_message/kf_code_gen/
describe_groups.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::Request;
8
9use kf_protocol_derive::Decode;
10use kf_protocol_derive::Encode;
11use kf_protocol_derive::KfDefault;
12
13// -----------------------------------
14// KfDescribeGroupsRequest
15// -----------------------------------
16
17#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
18pub struct KfDescribeGroupsRequest {
19    /// The names of the groups to describe
20    pub groups: Vec<String>,
21}
22
23// -----------------------------------
24// KfDescribeGroupsResponse
25// -----------------------------------
26
27#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
28pub struct KfDescribeGroupsResponse {
29    /// The duration in milliseconds for which the request was throttled due to a quota violation,
30    /// or zero if the request did not violate any quota.
31    #[fluvio_kf(min_version = 1, ignorable)]
32    pub throttle_time_ms: i32,
33
34    /// Each described group.
35    pub groups: Vec<DescribedGroup>,
36}
37
38#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
39pub struct DescribedGroup {
40    /// The describe error, or 0 if there was no error.
41    pub error_code: ErrorCode,
42
43    /// The group ID string.
44    pub group_id: String,
45
46    /// The group state string, or the empty string.
47    pub group_state: String,
48
49    /// The group protocol type, or the empty string.
50    pub protocol_type: String,
51
52    /// The group protocol data, or the empty string.
53    pub protocol_data: String,
54
55    /// The group members.
56    pub members: Vec<DescribedGroupMember>,
57}
58
59#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
60pub struct DescribedGroupMember {
61    /// The member ID assigned by the group coordinator.
62    pub member_id: String,
63
64    /// The client ID used in the member's latest join group request.
65    pub client_id: String,
66
67    /// The client host.
68    pub client_host: String,
69
70    /// The metadata corresponding to the current group protocol in use.
71    pub member_metadata: Vec<u8>,
72
73    /// The current assignment provided by the group leader.
74    pub member_assignment: Vec<u8>,
75}
76
77// -----------------------------------
78// Implementation - KfDescribeGroupsRequest
79// -----------------------------------
80
81impl Request for KfDescribeGroupsRequest {
82    const API_KEY: u16 = 15;
83
84    const MIN_API_VERSION: i16 = 0;
85    const MAX_API_VERSION: i16 = 2;
86    const DEFAULT_API_VERSION: i16 = 2;
87
88    type Response = KfDescribeGroupsResponse;
89}