kf_protocol_message/kf_code_gen/
delete_topics.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// KfDeleteTopicsRequest
15// -----------------------------------
16
17#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
18pub struct KfDeleteTopicsRequest {
19    /// The names of the topics to delete
20    pub topic_names: Vec<String>,
21
22    /// The length of time in milliseconds to wait for the deletions to complete.
23    pub timeout_ms: i32,
24}
25
26// -----------------------------------
27// KfDeleteTopicsResponse
28// -----------------------------------
29
30#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
31pub struct KfDeleteTopicsResponse {
32    /// The duration in milliseconds for which the request was throttled due to a quota violation,
33    /// or zero if the request did not violate any quota.
34    #[fluvio_kf(min_version = 1)]
35    pub throttle_time_ms: i32,
36
37    /// The results for each topic.
38    pub responses: Vec<DeletableTopicResult>,
39}
40
41#[derive(Encode, Decode, Serialize, Deserialize, KfDefault, Debug)]
42pub struct DeletableTopicResult {
43    /// The topic name
44    pub name: String,
45
46    /// The deletion error, or 0 if the deletion succeeded.
47    pub error_code: ErrorCode,
48}
49
50// -----------------------------------
51// Implementation - KfDeleteTopicsRequest
52// -----------------------------------
53
54impl Request for KfDeleteTopicsRequest {
55    const API_KEY: u16 = 20;
56
57    const MIN_API_VERSION: i16 = 0;
58    const MAX_API_VERSION: i16 = 3;
59    const DEFAULT_API_VERSION: i16 = 3;
60
61    type Response = KfDeleteTopicsResponse;
62}