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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Defines a configurable setting that an extension exposes to deployers. Settings are part of an extension's declared configuration schema.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Setting {
/// A unique identifier for this setting within the extension's configuration.
pub id: ::std::string::String,
/// A short, human-readable label for this setting, suitable for display in a UI.
pub display_name: ::std::string::String,
/// A description of what this setting controls and how it affects the extension's behavior.
pub description: ::std::string::String,
/// Whether the deployer must provide a value for this setting. Defaults to false.
pub required: ::std::option::Option<bool>,
/// A conditional expression referencing another setting's id. When specified, this setting is only active (visible and applicable) when the referenced condition is met.
pub active_when: ::std::option::Option<::std::string::String>,
/// The type and constraints for this setting's value.
pub definition: ::std::option::Option<crate::types::SettingDefinition>,
}
impl Setting {
/// A unique identifier for this setting within the extension's configuration.
pub fn id(&self) -> &str {
use std::ops::Deref;
self.id.deref()
}
/// A short, human-readable label for this setting, suitable for display in a UI.
pub fn display_name(&self) -> &str {
use std::ops::Deref;
self.display_name.deref()
}
/// A description of what this setting controls and how it affects the extension's behavior.
pub fn description(&self) -> &str {
use std::ops::Deref;
self.description.deref()
}
/// Whether the deployer must provide a value for this setting. Defaults to false.
pub fn required(&self) -> ::std::option::Option<bool> {
self.required
}
/// A conditional expression referencing another setting's id. When specified, this setting is only active (visible and applicable) when the referenced condition is met.
pub fn active_when(&self) -> ::std::option::Option<&str> {
self.active_when.as_deref()
}
/// The type and constraints for this setting's value.
pub fn definition(&self) -> ::std::option::Option<&crate::types::SettingDefinition> {
self.definition.as_ref()
}
}
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) id: ::std::option::Option<::std::string::String>,
pub(crate) display_name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) required: ::std::option::Option<bool>,
pub(crate) active_when: ::std::option::Option<::std::string::String>,
pub(crate) definition: ::std::option::Option<crate::types::SettingDefinition>,
}
impl SettingBuilder {
/// A unique identifier for this setting within the extension's configuration.
/// This field is required.
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// A unique identifier for this setting within the extension's configuration.
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// A unique identifier for this setting within the extension's configuration.
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// A short, human-readable label for this setting, suitable for display in a UI.
/// This field is required.
pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.display_name = ::std::option::Option::Some(input.into());
self
}
/// A short, human-readable label for this setting, suitable for display in a UI.
pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.display_name = input;
self
}
/// A short, human-readable label for this setting, suitable for display in a UI.
pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
&self.display_name
}
/// A description of what this setting controls and how it affects the extension's behavior.
/// This field is required.
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// A description of what this setting controls and how it affects the extension's behavior.
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// A description of what this setting controls and how it affects the extension's behavior.
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// Whether the deployer must provide a value for this setting. Defaults to false.
pub fn required(mut self, input: bool) -> Self {
self.required = ::std::option::Option::Some(input);
self
}
/// Whether the deployer must provide a value for this setting. Defaults to false.
pub fn set_required(mut self, input: ::std::option::Option<bool>) -> Self {
self.required = input;
self
}
/// Whether the deployer must provide a value for this setting. Defaults to false.
pub fn get_required(&self) -> &::std::option::Option<bool> {
&self.required
}
/// A conditional expression referencing another setting's id. When specified, this setting is only active (visible and applicable) when the referenced condition is met.
pub fn active_when(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.active_when = ::std::option::Option::Some(input.into());
self
}
/// A conditional expression referencing another setting's id. When specified, this setting is only active (visible and applicable) when the referenced condition is met.
pub fn set_active_when(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.active_when = input;
self
}
/// A conditional expression referencing another setting's id. When specified, this setting is only active (visible and applicable) when the referenced condition is met.
pub fn get_active_when(&self) -> &::std::option::Option<::std::string::String> {
&self.active_when
}
/// The type and constraints for this setting's value.
/// This field is required.
pub fn definition(mut self, input: crate::types::SettingDefinition) -> Self {
self.definition = ::std::option::Option::Some(input);
self
}
/// The type and constraints for this setting's value.
pub fn set_definition(mut self, input: ::std::option::Option<crate::types::SettingDefinition>) -> Self {
self.definition = input;
self
}
/// The type and constraints for this setting's value.
pub fn get_definition(&self) -> &::std::option::Option<crate::types::SettingDefinition> {
&self.definition
}
/// Consumes the builder and constructs a [`Setting`](crate::types::Setting).
/// This method will fail if any of the following fields are not set:
/// - [`id`](crate::types::builders::SettingBuilder::id)
/// - [`display_name`](crate::types::builders::SettingBuilder::display_name)
/// - [`description`](crate::types::builders::SettingBuilder::description)
pub fn build(self) -> ::std::result::Result<crate::types::Setting, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Setting {
id: self.id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field("id", "id was not specified but it is required when building Setting")
})?,
display_name: self.display_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"display_name",
"display_name was not specified but it is required when building Setting",
)
})?,
description: self.description.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"description",
"description was not specified but it is required when building Setting",
)
})?,
required: self.required,
active_when: self.active_when,
definition: self.definition,
})
}
}