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
123
124
125
126
127
128
129
130
131
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A range of attribute values. For more information, see <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_range_filters.html">Range Filters</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TypedAttributeValueRange {
    /// <p>The inclusive or exclusive range start.</p>
    pub start_mode: crate::types::RangeMode,
    /// <p>The value to start the range at.</p>
    pub start_value: ::std::option::Option<crate::types::TypedAttributeValue>,
    /// <p>The inclusive or exclusive range end.</p>
    pub end_mode: crate::types::RangeMode,
    /// <p>The attribute value to terminate the range at.</p>
    pub end_value: ::std::option::Option<crate::types::TypedAttributeValue>,
}
impl TypedAttributeValueRange {
    /// <p>The inclusive or exclusive range start.</p>
    pub fn start_mode(&self) -> &crate::types::RangeMode {
        &self.start_mode
    }
    /// <p>The value to start the range at.</p>
    pub fn start_value(&self) -> ::std::option::Option<&crate::types::TypedAttributeValue> {
        self.start_value.as_ref()
    }
    /// <p>The inclusive or exclusive range end.</p>
    pub fn end_mode(&self) -> &crate::types::RangeMode {
        &self.end_mode
    }
    /// <p>The attribute value to terminate the range at.</p>
    pub fn end_value(&self) -> ::std::option::Option<&crate::types::TypedAttributeValue> {
        self.end_value.as_ref()
    }
}
impl TypedAttributeValueRange {
    /// Creates a new builder-style object to manufacture [`TypedAttributeValueRange`](crate::types::TypedAttributeValueRange).
    pub fn builder() -> crate::types::builders::TypedAttributeValueRangeBuilder {
        crate::types::builders::TypedAttributeValueRangeBuilder::default()
    }
}

/// A builder for [`TypedAttributeValueRange`](crate::types::TypedAttributeValueRange).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TypedAttributeValueRangeBuilder {
    pub(crate) start_mode: ::std::option::Option<crate::types::RangeMode>,
    pub(crate) start_value: ::std::option::Option<crate::types::TypedAttributeValue>,
    pub(crate) end_mode: ::std::option::Option<crate::types::RangeMode>,
    pub(crate) end_value: ::std::option::Option<crate::types::TypedAttributeValue>,
}
impl TypedAttributeValueRangeBuilder {
    /// <p>The inclusive or exclusive range start.</p>
    /// This field is required.
    pub fn start_mode(mut self, input: crate::types::RangeMode) -> Self {
        self.start_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The inclusive or exclusive range start.</p>
    pub fn set_start_mode(mut self, input: ::std::option::Option<crate::types::RangeMode>) -> Self {
        self.start_mode = input;
        self
    }
    /// <p>The inclusive or exclusive range start.</p>
    pub fn get_start_mode(&self) -> &::std::option::Option<crate::types::RangeMode> {
        &self.start_mode
    }
    /// <p>The value to start the range at.</p>
    pub fn start_value(mut self, input: crate::types::TypedAttributeValue) -> Self {
        self.start_value = ::std::option::Option::Some(input);
        self
    }
    /// <p>The value to start the range at.</p>
    pub fn set_start_value(mut self, input: ::std::option::Option<crate::types::TypedAttributeValue>) -> Self {
        self.start_value = input;
        self
    }
    /// <p>The value to start the range at.</p>
    pub fn get_start_value(&self) -> &::std::option::Option<crate::types::TypedAttributeValue> {
        &self.start_value
    }
    /// <p>The inclusive or exclusive range end.</p>
    /// This field is required.
    pub fn end_mode(mut self, input: crate::types::RangeMode) -> Self {
        self.end_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The inclusive or exclusive range end.</p>
    pub fn set_end_mode(mut self, input: ::std::option::Option<crate::types::RangeMode>) -> Self {
        self.end_mode = input;
        self
    }
    /// <p>The inclusive or exclusive range end.</p>
    pub fn get_end_mode(&self) -> &::std::option::Option<crate::types::RangeMode> {
        &self.end_mode
    }
    /// <p>The attribute value to terminate the range at.</p>
    pub fn end_value(mut self, input: crate::types::TypedAttributeValue) -> Self {
        self.end_value = ::std::option::Option::Some(input);
        self
    }
    /// <p>The attribute value to terminate the range at.</p>
    pub fn set_end_value(mut self, input: ::std::option::Option<crate::types::TypedAttributeValue>) -> Self {
        self.end_value = input;
        self
    }
    /// <p>The attribute value to terminate the range at.</p>
    pub fn get_end_value(&self) -> &::std::option::Option<crate::types::TypedAttributeValue> {
        &self.end_value
    }
    /// Consumes the builder and constructs a [`TypedAttributeValueRange`](crate::types::TypedAttributeValueRange).
    /// This method will fail if any of the following fields are not set:
    /// - [`start_mode`](crate::types::builders::TypedAttributeValueRangeBuilder::start_mode)
    /// - [`end_mode`](crate::types::builders::TypedAttributeValueRangeBuilder::end_mode)
    pub fn build(self) -> ::std::result::Result<crate::types::TypedAttributeValueRange, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::TypedAttributeValueRange {
            start_mode: self.start_mode.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "start_mode",
                    "start_mode was not specified but it is required when building TypedAttributeValueRange",
                )
            })?,
            start_value: self.start_value,
            end_mode: self.end_mode.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "end_mode",
                    "end_mode was not specified but it is required when building TypedAttributeValueRange",
                )
            })?,
            end_value: self.end_value,
        })
    }
}