scim_server/operation_handler/builders/
query.rs1use crate::operation_handler::core::ScimQuery;
7use serde_json::Value;
8
9impl ScimQuery {
10 pub fn new() -> Self {
12 Self {
13 count: None,
14 start_index: None,
15 filter: None,
16 attributes: None,
17 excluded_attributes: None,
18 search_attribute: None,
19 search_value: None,
20 }
21 }
22
23 pub fn with_pagination(mut self, start_index: usize, count: usize) -> Self {
25 self.start_index = Some(start_index);
26 self.count = Some(count);
27 self
28 }
29
30 pub fn with_filter(mut self, filter: impl Into<String>) -> Self {
32 self.filter = Some(filter.into());
33 self
34 }
35
36 pub fn with_search(mut self, attribute: impl Into<String>, value: Value) -> Self {
38 self.search_attribute = Some(attribute.into());
39 self.search_value = Some(value);
40 self
41 }
42
43 pub fn with_attributes(mut self, attributes: Vec<String>) -> Self {
45 self.attributes = Some(attributes);
46 self
47 }
48
49 pub fn with_excluded_attributes(mut self, excluded_attributes: Vec<String>) -> Self {
51 self.excluded_attributes = Some(excluded_attributes);
52 self
53 }
54}
55
56impl Default for ScimQuery {
57 fn default() -> Self {
58 Self::new()
59 }
60}