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