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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents a single network-level configuration setting with its name, value, and data type. Settings control network-wide behaviors and features.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Setting {
/// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
pub option_name: ::std::string::String,
/// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
pub value: ::std::string::String,
/// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
pub r#type: ::std::string::String,
}
impl Setting {
/// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
pub fn option_name(&self) -> &str {
use std::ops::Deref;
self.option_name.deref()
}
/// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
pub fn value(&self) -> &str {
use std::ops::Deref;
self.value.deref()
}
/// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
pub fn r#type(&self) -> &str {
use std::ops::Deref;
self.r#type.deref()
}
}
impl Setting {
/// Creates a new builder-style object to manufacture [`Setting`](crate::types::Setting).
pub fn builder() -> crate::types::builders::SettingBuilder {
crate::types::builders::SettingBuilder::default()
}
}
/// A builder for [`Setting`](crate::types::Setting).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SettingBuilder {
pub(crate) option_name: ::std::option::Option<::std::string::String>,
pub(crate) value: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
}
impl SettingBuilder {
/// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
/// This field is required.
pub fn option_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.option_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
pub fn set_option_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.option_name = input;
self
}
/// <p>The name of the network setting (e.g., 'enableClientMetrics', 'dataRetention').</p>
pub fn get_option_name(&self) -> &::std::option::Option<::std::string::String> {
&self.option_name
}
/// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
/// This field is required.
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 current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.value = input;
self
}
/// <p>The current value of the setting as a string. Boolean values are represented as 'true' or 'false'.</p>
pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
&self.value
}
/// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
/// This field is required.
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
/// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The data type of the setting value (e.g., 'boolean', 'string', 'number').</p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// Consumes the builder and constructs a [`Setting`](crate::types::Setting).
/// This method will fail if any of the following fields are not set:
/// - [`option_name`](crate::types::builders::SettingBuilder::option_name)
/// - [`value`](crate::types::builders::SettingBuilder::value)
/// - [`r#type`](crate::types::builders::SettingBuilder::type)
pub fn build(self) -> ::std::result::Result<crate::types::Setting, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Setting {
option_name: self.option_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"option_name",
"option_name was not specified but it is required when building Setting",
)
})?,
value: self.value.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"value",
"value was not specified but it is required when building Setting",
)
})?,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Setting",
)
})?,
})
}
}