aws_sdk_connect/types/
_list_condition.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A leaf node condition which can be used to specify a List condition to search users with attributes included in Lists like Proficiencies.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListCondition {
7    /// <p>The type of target list that will be used to filter the users.</p>
8    pub target_list_type: ::std::option::Option<crate::types::TargetListType>,
9    /// <p>A list of Condition objects which would be applied together with an AND condition.</p>
10    pub conditions: ::std::option::Option<::std::vec::Vec<crate::types::Condition>>,
11}
12impl ListCondition {
13    /// <p>The type of target list that will be used to filter the users.</p>
14    pub fn target_list_type(&self) -> ::std::option::Option<&crate::types::TargetListType> {
15        self.target_list_type.as_ref()
16    }
17    /// <p>A list of Condition objects which would be applied together with an AND condition.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.conditions.is_none()`.
20    pub fn conditions(&self) -> &[crate::types::Condition] {
21        self.conditions.as_deref().unwrap_or_default()
22    }
23}
24impl ListCondition {
25    /// Creates a new builder-style object to manufacture [`ListCondition`](crate::types::ListCondition).
26    pub fn builder() -> crate::types::builders::ListConditionBuilder {
27        crate::types::builders::ListConditionBuilder::default()
28    }
29}
30
31/// A builder for [`ListCondition`](crate::types::ListCondition).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct ListConditionBuilder {
35    pub(crate) target_list_type: ::std::option::Option<crate::types::TargetListType>,
36    pub(crate) conditions: ::std::option::Option<::std::vec::Vec<crate::types::Condition>>,
37}
38impl ListConditionBuilder {
39    /// <p>The type of target list that will be used to filter the users.</p>
40    pub fn target_list_type(mut self, input: crate::types::TargetListType) -> Self {
41        self.target_list_type = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>The type of target list that will be used to filter the users.</p>
45    pub fn set_target_list_type(mut self, input: ::std::option::Option<crate::types::TargetListType>) -> Self {
46        self.target_list_type = input;
47        self
48    }
49    /// <p>The type of target list that will be used to filter the users.</p>
50    pub fn get_target_list_type(&self) -> &::std::option::Option<crate::types::TargetListType> {
51        &self.target_list_type
52    }
53    /// Appends an item to `conditions`.
54    ///
55    /// To override the contents of this collection use [`set_conditions`](Self::set_conditions).
56    ///
57    /// <p>A list of Condition objects which would be applied together with an AND condition.</p>
58    pub fn conditions(mut self, input: crate::types::Condition) -> Self {
59        let mut v = self.conditions.unwrap_or_default();
60        v.push(input);
61        self.conditions = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>A list of Condition objects which would be applied together with an AND condition.</p>
65    pub fn set_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Condition>>) -> Self {
66        self.conditions = input;
67        self
68    }
69    /// <p>A list of Condition objects which would be applied together with an AND condition.</p>
70    pub fn get_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Condition>> {
71        &self.conditions
72    }
73    /// Consumes the builder and constructs a [`ListCondition`](crate::types::ListCondition).
74    pub fn build(self) -> crate::types::ListCondition {
75        crate::types::ListCondition {
76            target_list_type: self.target_list_type,
77            conditions: self.conditions,
78        }
79    }
80}