#[allow(unused_imports)]
use crate::NifiError;
use crate::dynamic::traits::CountersApi;
#[allow(unused_imports)]
use crate::dynamic::types;
#[allow(private_interfaces)]
#[non_exhaustive]
pub enum CountersApiDispatch<'a> {
V2_6_0(super::super::impls::v2_6_0::V2_6_0CountersApi<'a>),
V2_7_2(super::super::impls::v2_7_2::V2_7_2CountersApi<'a>),
V2_8_0(super::super::impls::v2_8_0::V2_8_0CountersApi<'a>),
}
impl CountersApi for CountersApiDispatch<'_> {
async fn get_counters(
&self,
nodewise: Option<bool>,
cluster_node_id: Option<&str>,
) -> Result<types::CountersDto, NifiError> {
match self {
Self::V2_6_0(api) => api.get_counters(nodewise, cluster_node_id).await,
Self::V2_7_2(api) => api.get_counters(nodewise, cluster_node_id).await,
Self::V2_8_0(api) => api.get_counters(nodewise, cluster_node_id).await,
}
}
async fn update_all_counters(&self) -> Result<types::CountersDto, NifiError> {
match self {
Self::V2_6_0(api) => api.update_all_counters().await,
Self::V2_7_2(api) => api.update_all_counters().await,
Self::V2_8_0(api) => api.update_all_counters().await,
}
}
async fn update_counter(&self, id: &str) -> Result<types::CounterDto, NifiError> {
match self {
Self::V2_6_0(api) => api.update_counter(id).await,
Self::V2_7_2(api) => api.update_counter(id).await,
Self::V2_8_0(api) => api.update_counter(id).await,
}
}
}