use crate::operation_handler::core::ScimQuery;
use serde_json::Value;
impl ScimQuery {
pub fn new() -> Self {
Self {
count: None,
start_index: None,
filter: None,
attributes: None,
excluded_attributes: None,
search_attribute: None,
search_value: None,
}
}
pub fn with_pagination(mut self, start_index: usize, count: usize) -> Self {
self.start_index = Some(start_index);
self.count = Some(count);
self
}
pub fn with_filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn with_search(mut self, attribute: impl Into<String>, value: Value) -> Self {
self.search_attribute = Some(attribute.into());
self.search_value = Some(value);
self
}
pub fn with_attributes(mut self, attributes: Vec<String>) -> Self {
self.attributes = Some(attributes);
self
}
pub fn with_excluded_attributes(mut self, excluded_attributes: Vec<String>) -> Self {
self.excluded_attributes = Some(excluded_attributes);
self
}
}
impl Default for ScimQuery {
fn default() -> Self {
Self::new()
}
}