1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct Topics {
    pub id: Option<String>,
    pub name: Option<String>,
    #[serde(flatten)]
    pub extra: std::collections::HashMap<String, serde_json::Value>,
}

impl Topics {
    pub fn is_empty_extra(&self) -> bool {
        let res = self.extra.is_empty();
        if !res {
            println!("Topics {:?}", self.extra);
        }
        res
    }
}