kf_protocol_message/kf_code_gen/
sync_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::GroupAssignment;
8use kf_protocol_api::Request;
9
10use kf_protocol_derive::Decode;
11use kf_protocol_derive::Encode;
12use kf_protocol_derive::KfDefault;
13
14// -----------------------------------
15// KfSyncGroupRequest
16// -----------------------------------
17
18#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
19pub struct KfSyncGroupRequest {
20    /// The unique group identifier.
21    pub group_id: String,
22
23    /// The generation of the group.
24    pub generation_id: i32,
25
26    /// The member ID assigned by the group.
27    pub member_id: String,
28
29    /// Each assignment.
30    pub assignments: Vec<SyncGroupRequestAssignment>,
31}
32
33#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
34pub struct SyncGroupRequestAssignment {
35    /// The ID of the member to assign.
36    pub member_id: String,
37
38    /// The member assignment.
39    pub assignment: GroupAssignment,
40}
41
42// -----------------------------------
43// KfSyncGroupResponse
44// -----------------------------------
45
46#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
47pub struct KfSyncGroupResponse {
48    /// The duration in milliseconds for which the request was throttled due to a quota violation,
49    /// or zero if the request did not violate any quota.
50    #[fluvio_kf(min_version = 1, ignorable)]
51    pub throttle_time_ms: i32,
52
53    /// The error code, or 0 if there was no error.
54    pub error_code: ErrorCode,
55
56    /// The member assignment.
57    pub assignment: GroupAssignment,
58}
59
60// -----------------------------------
61// Implementation - KfSyncGroupRequest
62// -----------------------------------
63
64impl Request for KfSyncGroupRequest {
65    const API_KEY: u16 = 14;
66
67    const MIN_API_VERSION: i16 = 0;
68    const MAX_API_VERSION: i16 = 2;
69    const DEFAULT_API_VERSION: i16 = 2;
70
71    type Response = KfSyncGroupResponse;
72}