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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <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> and <code>description</code>.</p>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StringCondition {
    /// <p>The name of the field in the string condition.</p>
    pub field_name: ::std::option::Option<::std::string::String>,
    /// <p>The value of the string.</p>
    pub value: ::std::option::Option<::std::string::String>,
    /// <p>The type of comparison to be made when evaluating the string condition.</p>
    pub comparison_type: ::std::option::Option<crate::types::StringComparisonType>,
}
impl StringCondition {
    /// <p>The name of the field in the string condition.</p>
    pub fn field_name(&self) -> ::std::option::Option<&str> {
        self.field_name.as_deref()
    }
    /// <p>The value of the string.</p>
    pub fn value(&self) -> ::std::option::Option<&str> {
        self.value.as_deref()
    }
    /// <p>The type of comparison to be made when evaluating the string condition.</p>
    pub fn comparison_type(&self) -> ::std::option::Option<&crate::types::StringComparisonType> {
        self.comparison_type.as_ref()
    }
}
impl StringCondition {
    /// Creates a new builder-style object to manufacture [`StringCondition`](crate::types::StringCondition).
    pub fn builder() -> crate::types::builders::StringConditionBuilder {
        crate::types::builders::StringConditionBuilder::default()
    }
}

/// A builder for [`StringCondition`](crate::types::StringCondition).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct StringConditionBuilder {
    pub(crate) field_name: ::std::option::Option<::std::string::String>,
    pub(crate) value: ::std::option::Option<::std::string::String>,
    pub(crate) comparison_type: ::std::option::Option<crate::types::StringComparisonType>,
}
impl StringConditionBuilder {
    /// <p>The name of the field in the string condition.</p>
    pub fn field_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.field_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the field in the string condition.</p>
    pub fn set_field_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.field_name = input;
        self
    }
    /// <p>The name of the field in the string condition.</p>
    pub fn get_field_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.field_name
    }
    /// <p>The value of the string.</p>
    pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The value of the string.</p>
    pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.value = input;
        self
    }
    /// <p>The value of the string.</p>
    pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.value
    }
    /// <p>The type of comparison to be made when evaluating the string condition.</p>
    pub fn comparison_type(mut self, input: crate::types::StringComparisonType) -> Self {
        self.comparison_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of comparison to be made when evaluating the string condition.</p>
    pub fn set_comparison_type(mut self, input: ::std::option::Option<crate::types::StringComparisonType>) -> Self {
        self.comparison_type = input;
        self
    }
    /// <p>The type of comparison to be made when evaluating the string condition.</p>
    pub fn get_comparison_type(&self) -> &::std::option::Option<crate::types::StringComparisonType> {
        &self.comparison_type
    }
    /// Consumes the builder and constructs a [`StringCondition`](crate::types::StringCondition).
    pub fn build(self) -> crate::types::StringCondition {
        crate::types::StringCondition {
            field_name: self.field_name,
            value: self.value,
            comparison_type: self.comparison_type,
        }
    }
}