1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The search criteria to be used to return routing profiles.</p> <note>
/// <p>The <code>name</code> and <code>description</code> fields support "contains" queries with a minimum of 2 characters and a maximum of 25 characters. Any queries with character lengths outside of this range will throw invalid results. </p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RoutingProfileSearchCriteria {
/// <p>A list of conditions which would be applied together with an OR condition.</p>
pub or_conditions: ::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>>,
/// <p>A list of conditions which would be applied together with an AND condition.</p>
pub and_conditions: ::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>>,
/// <p>A leaf node condition which can be used to specify a string condition.</p> <note>
/// <p>The currently supported values for <code>FieldName</code> are <code>name</code>, <code>description</code>, and <code>resourceID</code>.</p>
/// </note>
pub string_condition: ::std::option::Option<crate::types::StringCondition>,
}
impl RoutingProfileSearchCriteria {
/// <p>A list of conditions which would be applied together with an OR condition.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.or_conditions.is_none()`.
pub fn or_conditions(&self) -> &[crate::types::RoutingProfileSearchCriteria] {
self.or_conditions.as_deref().unwrap_or_default()
}
/// <p>A list of conditions which would be applied together with an AND condition.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.and_conditions.is_none()`.
pub fn and_conditions(&self) -> &[crate::types::RoutingProfileSearchCriteria] {
self.and_conditions.as_deref().unwrap_or_default()
}
/// <p>A leaf node condition which can be used to specify a string condition.</p> <note>
/// <p>The currently supported values for <code>FieldName</code> are <code>name</code>, <code>description</code>, and <code>resourceID</code>.</p>
/// </note>
pub fn string_condition(&self) -> ::std::option::Option<&crate::types::StringCondition> {
self.string_condition.as_ref()
}
}
impl RoutingProfileSearchCriteria {
/// Creates a new builder-style object to manufacture [`RoutingProfileSearchCriteria`](crate::types::RoutingProfileSearchCriteria).
pub fn builder() -> crate::types::builders::RoutingProfileSearchCriteriaBuilder {
crate::types::builders::RoutingProfileSearchCriteriaBuilder::default()
}
}
/// A builder for [`RoutingProfileSearchCriteria`](crate::types::RoutingProfileSearchCriteria).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RoutingProfileSearchCriteriaBuilder {
pub(crate) or_conditions: ::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>>,
pub(crate) and_conditions: ::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>>,
pub(crate) string_condition: ::std::option::Option<crate::types::StringCondition>,
}
impl RoutingProfileSearchCriteriaBuilder {
/// Appends an item to `or_conditions`.
///
/// To override the contents of this collection use [`set_or_conditions`](Self::set_or_conditions).
///
/// <p>A list of conditions which would be applied together with an OR condition.</p>
pub fn or_conditions(mut self, input: crate::types::RoutingProfileSearchCriteria) -> Self {
let mut v = self.or_conditions.unwrap_or_default();
v.push(input);
self.or_conditions = ::std::option::Option::Some(v);
self
}
/// <p>A list of conditions which would be applied together with an OR condition.</p>
pub fn set_or_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>>) -> Self {
self.or_conditions = input;
self
}
/// <p>A list of conditions which would be applied together with an OR condition.</p>
pub fn get_or_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>> {
&self.or_conditions
}
/// Appends an item to `and_conditions`.
///
/// To override the contents of this collection use [`set_and_conditions`](Self::set_and_conditions).
///
/// <p>A list of conditions which would be applied together with an AND condition.</p>
pub fn and_conditions(mut self, input: crate::types::RoutingProfileSearchCriteria) -> Self {
let mut v = self.and_conditions.unwrap_or_default();
v.push(input);
self.and_conditions = ::std::option::Option::Some(v);
self
}
/// <p>A list of conditions which would be applied together with an AND condition.</p>
pub fn set_and_conditions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>>) -> Self {
self.and_conditions = input;
self
}
/// <p>A list of conditions which would be applied together with an AND condition.</p>
pub fn get_and_conditions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RoutingProfileSearchCriteria>> {
&self.and_conditions
}
/// <p>A leaf node condition which can be used to specify a string condition.</p> <note>
/// <p>The currently supported values for <code>FieldName</code> are <code>name</code>, <code>description</code>, and <code>resourceID</code>.</p>
/// </note>
pub fn string_condition(mut self, input: crate::types::StringCondition) -> Self {
self.string_condition = ::std::option::Option::Some(input);
self
}
/// <p>A leaf node condition which can be used to specify a string condition.</p> <note>
/// <p>The currently supported values for <code>FieldName</code> are <code>name</code>, <code>description</code>, and <code>resourceID</code>.</p>
/// </note>
pub fn set_string_condition(mut self, input: ::std::option::Option<crate::types::StringCondition>) -> Self {
self.string_condition = input;
self
}
/// <p>A leaf node condition which can be used to specify a string condition.</p> <note>
/// <p>The currently supported values for <code>FieldName</code> are <code>name</code>, <code>description</code>, and <code>resourceID</code>.</p>
/// </note>
pub fn get_string_condition(&self) -> &::std::option::Option<crate::types::StringCondition> {
&self.string_condition
}
/// Consumes the builder and constructs a [`RoutingProfileSearchCriteria`](crate::types::RoutingProfileSearchCriteria).
pub fn build(self) -> crate::types::RoutingProfileSearchCriteria {
crate::types::RoutingProfileSearchCriteria {
or_conditions: self.or_conditions,
and_conditions: self.and_conditions,
string_condition: self.string_condition,
}
}
}