kf_protocol_message/kf_code_gen/
delete_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// KfDeleteGroupsRequest
15// -----------------------------------
16
17#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
18pub struct KfDeleteGroupsRequest {
19    /// The group names to delete.
20    pub groups_names: Vec<String>,
21}
22
23// -----------------------------------
24// KfDeleteGroupsResponse
25// -----------------------------------
26
27#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
28pub struct KfDeleteGroupsResponse {
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    pub throttle_time_ms: i32,
32
33    /// The deletion results
34    pub results: Vec<DeletableGroupResult>,
35}
36
37#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
38pub struct DeletableGroupResult {
39    /// The group id
40    pub group_id: String,
41
42    /// The deletion error, or 0 if the deletion succeeded.
43    pub error_code: ErrorCode,
44}
45
46// -----------------------------------
47// Implementation - KfDeleteGroupsRequest
48// -----------------------------------
49
50impl Request for KfDeleteGroupsRequest {
51    const API_KEY: u16 = 42;
52
53    const MIN_API_VERSION: i16 = 0;
54    const MAX_API_VERSION: i16 = 1;
55    const DEFAULT_API_VERSION: i16 = 1;
56
57    type Response = KfDeleteGroupsResponse;
58}