use kafka_client_core::{
DescribeUserScramCredentialsPlan as CorePlan,
DescribeUserScramCredentialsPlanError as CorePlanError,
};
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct DescribeUserScramCredentialsRequest {
users: Option<Vec<String>>,
}
impl DescribeUserScramCredentialsRequest {
pub const fn new(users: Option<Vec<String>>) -> Self {
Self { users }
}
pub fn users(&self) -> Option<&[String]> {
self.users.as_deref()
}
pub fn into_users(self) -> Option<Vec<String>> {
self.users
}
pub(crate) fn canonicalize(mut self) -> Self {
if let Some(users) = self.users.as_mut() {
users.shrink_to_fit();
}
self
}
pub(crate) fn into_plan(self) -> Result<CorePlan, CorePlanError> {
CorePlan::new(self.into_users())
}
}