kf_protocol_message/kf_code_gen/
list_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// KfListGroupsRequest
15// -----------------------------------
16
17#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
18pub struct KfListGroupsRequest {}
19
20// -----------------------------------
21// KfListGroupsResponse
22// -----------------------------------
23
24#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
25pub struct KfListGroupsResponse {
26    /// The duration in milliseconds for which the request was throttled due to a quota violation,
27    /// or zero if the request did not violate any quota.
28    #[fluvio_kf(min_version = 1, ignorable)]
29    pub throttle_time_ms: i32,
30
31    /// The error code, or 0 if there was no error.
32    pub error_code: ErrorCode,
33
34    /// Each group in the response.
35    pub groups: Vec<ListedGroup>,
36}
37
38#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
39pub struct ListedGroup {
40    /// The group ID.
41    pub group_id: String,
42
43    /// The group protocol type.
44    pub protocol_type: String,
45}
46
47// -----------------------------------
48// Implementation - KfListGroupsRequest
49// -----------------------------------
50
51impl Request for KfListGroupsRequest {
52    const API_KEY: u16 = 16;
53
54    const MIN_API_VERSION: i16 = 0;
55    const MAX_API_VERSION: i16 = 2;
56    const DEFAULT_API_VERSION: i16 = 2;
57
58    type Response = KfListGroupsResponse;
59}