pub struct RefsClient<T> {
client: T,
path: String,
}
impl<T> RefsClient<T>
where
T: crate::client::Client,
{
pub fn new(client: T, parent_path: &str) -> Self {
Self {
client,
path: format!("{}{}", parent_path, "/refs"),
}
}
}
impl<T> RefsClient<T>
where
T: crate::client::Client,
{
#[doc = "Lists possible IPSet/Alias reference which are allowed in source/dest properties."]
pub fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
let path = self.path.to_string();
self.client.get(&path, ¶ms)
}
}
impl GetOutputItems {
pub fn new(name: String, reference: String, scope: String, ty: Type) -> Self {
Self {
name,
reference,
scope,
ty,
comment: Default::default(),
additional_properties: Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutputItems {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub comment: Option<String>,
pub name: String,
#[serde(rename = "ref")]
pub reference: String,
pub scope: String,
#[serde(rename = "type")]
pub ty: Type,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
pub struct GetParams {
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Only list references of specified type."]
pub ty: Option<Type>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub enum Type {
#[serde(rename = "alias")]
Alias,
#[serde(rename = "ipset")]
Ipset,
}