kf_protocol_message/kf_code_gen/
find_coordinator.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// KfFindCoordinatorRequest
15// -----------------------------------
16
17#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
18pub struct KfFindCoordinatorRequest {
19    /// The coordinator key.
20    pub key: String,
21
22    /// The coordinator key type.  (Group, transaction, etc.)
23    #[fluvio_kf(min_version = 1)]
24    pub key_type: i8,
25}
26
27// -----------------------------------
28// KfFindCoordinatorResponse
29// -----------------------------------
30
31#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
32pub struct KfFindCoordinatorResponse {
33    /// The duration in milliseconds for which the request was throttled due to a quota violation,
34    /// or zero if the request did not violate any quota.
35    #[fluvio_kf(min_version = 1, ignorable)]
36    pub throttle_time_ms: i32,
37
38    /// The error code, or 0 if there was no error.
39    pub error_code: ErrorCode,
40
41    /// The error message, or null if there was no error.
42    #[fluvio_kf(min_version = 1, ignorable)]
43    pub error_message: Option<String>,
44
45    /// The node id.
46    pub node_id: i32,
47
48    /// The host name.
49    pub host: String,
50
51    /// The port.
52    pub port: i32,
53}
54
55// -----------------------------------
56// Implementation - KfFindCoordinatorRequest
57// -----------------------------------
58
59impl Request for KfFindCoordinatorRequest {
60    const API_KEY: u16 = 10;
61
62    const MIN_API_VERSION: i16 = 0;
63    const MAX_API_VERSION: i16 = 2;
64    const DEFAULT_API_VERSION: i16 = 2;
65
66    type Response = KfFindCoordinatorResponse;
67}