1 + | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | #[allow(missing_docs)] // documentation missing in model
|
3 + | #[derive(
|
4 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
5 + | )]
|
6 + | pub struct SomethingElse {
|
7 + | #[allow(missing_docs)] // documentation missing in model
|
8 + | pub result: ::std::option::Option<crate::model::Result>,
|
9 + | #[allow(missing_docs)] // documentation missing in model
|
10 + | pub result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
|
11 + | #[allow(missing_docs)] // documentation missing in model
|
12 + | pub option: ::std::option::Option<crate::model::Option>,
|
13 + | #[allow(missing_docs)] // documentation missing in model
|
14 + | pub option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
|
15 + | #[allow(missing_docs)] // documentation missing in model
|
16 + | pub some_union: ::std::option::Option<crate::model::SomeUnion>,
|
17 + | }
|
18 + | impl SomethingElse {
|
19 + | #[allow(missing_docs)] // documentation missing in model
|
20 + | pub fn result(&self) -> ::std::option::Option<&crate::model::Result> {
|
21 + | self.result.as_ref()
|
22 + | }
|
23 + | #[allow(missing_docs)] // documentation missing in model
|
24 + | pub fn result_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
|
25 + | self.result_list.as_deref()
|
26 + | }
|
27 + | #[allow(missing_docs)] // documentation missing in model
|
28 + | pub fn option(&self) -> ::std::option::Option<&crate::model::Option> {
|
29 + | self.option.as_ref()
|
30 + | }
|
31 + | #[allow(missing_docs)] // documentation missing in model
|
32 + | pub fn option_list(&self) -> ::std::option::Option<&[crate::model::Result]> {
|
33 + | self.option_list.as_deref()
|
34 + | }
|
35 + | #[allow(missing_docs)] // documentation missing in model
|
36 + | pub fn some_union(&self) -> ::std::option::Option<&crate::model::SomeUnion> {
|
37 + | self.some_union.as_ref()
|
38 + | }
|
39 + | }
|
40 + | impl SomethingElse {
|
41 + | /// Creates a new builder-style object to manufacture [`SomethingElse`](crate::model::SomethingElse).
|
42 + | pub fn builder() -> crate::model::something_else::Builder {
|
43 + | crate::model::something_else::Builder::default()
|
44 + | }
|
45 + | }
|
46 + | impl crate::constrained::Constrained for crate::model::SomethingElse {
|
47 + | type Unconstrained = crate::model::something_else::Builder;
|
48 + | }
|
49 + |
|
50 + | #[allow(missing_docs)] // documentation missing in model
|
51 + | #[derive(
|
52 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
53 + | )]
|
54 + | pub enum SomeUnion {
|
55 + | #[allow(missing_docs)] // documentation missing in model
|
56 + | Option(crate::model::Option),
|
57 + | #[allow(missing_docs)] // documentation missing in model
|
58 + | Result(crate::model::Result),
|
59 + | }
|
60 + | impl SomeUnion {
|
61 + | /// Tries to convert the enum instance into [`Option`](crate::model::SomeUnion::Option), extracting the inner [`Option`](crate::model::Option).
|
62 + | /// Returns `Err(&Self)` if it can't be converted.
|
63 + | pub fn as_option(&self) -> ::std::result::Result<&crate::model::Option, &Self> {
|
64 + | if let SomeUnion::Option(val) = &self {
|
65 + | ::std::result::Result::Ok(val)
|
66 + | } else {
|
67 + | ::std::result::Result::Err(self)
|
68 + | }
|
69 + | }
|
70 + | /// Returns true if this is a [`Option`](crate::model::SomeUnion::Option).
|
71 + | pub fn is_option(&self) -> bool {
|
72 + | self.as_option().is_ok()
|
73 + | }
|
74 + | /// Tries to convert the enum instance into [`Result`](crate::model::SomeUnion::Result), extracting the inner [`Result`](crate::model::Result).
|
75 + | /// Returns `Err(&Self)` if it can't be converted.
|
76 + | pub fn as_result(&self) -> ::std::result::Result<&crate::model::Result, &Self> {
|
77 + | if let SomeUnion::Result(val) = &self {
|
78 + | ::std::result::Result::Ok(val)
|
79 + | } else {
|
80 + | ::std::result::Result::Err(self)
|
81 + | }
|
82 + | }
|
83 + | /// Returns true if this is a [`Result`](crate::model::SomeUnion::Result).
|
84 + | pub fn is_result(&self) -> bool {
|
85 + | self.as_result().is_ok()
|
86 + | }
|
87 + | }
|
88 + |
|
89 + | #[allow(missing_docs)] // documentation missing in model
|
90 + | #[derive(
|
91 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
92 + | )]
|
93 + | pub struct Option {
|
94 + | #[allow(missing_docs)] // documentation missing in model
|
95 + | pub value: ::std::option::Option<::std::string::String>,
|
96 + | }
|
97 + | impl Option {
|
98 + | #[allow(missing_docs)] // documentation missing in model
|
99 + | pub fn value(&self) -> ::std::option::Option<&str> {
|
100 + | self.value.as_deref()
|
101 + | }
|
102 + | }
|
103 + | impl Option {
|
104 + | /// Creates a new builder-style object to manufacture [`Option`](crate::model::Option).
|
105 + | pub fn builder() -> crate::model::option::Builder {
|
106 + | crate::model::option::Builder::default()
|
107 + | }
|
108 + | }
|
109 + | impl crate::constrained::Constrained for crate::model::Option {
|
110 + | type Unconstrained = crate::model::option::Builder;
|
111 + | }
|
112 + |
|
113 + | #[allow(missing_docs)] // documentation missing in model
|
114 + | #[derive(
|
115 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
116 + | )]
|
117 + | pub struct Result {
|
118 + | #[allow(missing_docs)] // documentation missing in model
|
119 + | pub value: ::std::option::Option<::std::string::String>,
|
120 + | }
|
121 + | impl Result {
|
122 + | #[allow(missing_docs)] // documentation missing in model
|
123 + | pub fn value(&self) -> ::std::option::Option<&str> {
|
124 + | self.value.as_deref()
|
125 + | }
|
126 + | }
|
127 + | impl Result {
|
128 + | /// Creates a new builder-style object to manufacture [`Result`](crate::model::Result).
|
129 + | pub fn builder() -> crate::model::result::Builder {
|
130 + | crate::model::result::Builder::default()
|
131 + | }
|
132 + | }
|
133 + | impl crate::constrained::Constrained for crate::model::Result {
|
134 + | type Unconstrained = crate::model::result::Builder;
|
135 + | }
|
136 + | /// See [`SomethingElse`](crate::model::SomethingElse).
|
137 + | pub mod something_else {
|
138 + |
|
139 + | impl ::std::convert::From<Builder> for crate::model::SomethingElse {
|
140 + | fn from(builder: Builder) -> Self {
|
141 + | builder.build()
|
142 + | }
|
143 + | }
|
144 + | /// A builder for [`SomethingElse`](crate::model::SomethingElse).
|
145 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
146 + | pub struct Builder {
|
147 + | pub(crate) result: ::std::option::Option<crate::model::Result>,
|
148 + | pub(crate) result_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
|
149 + | pub(crate) option: ::std::option::Option<crate::model::Option>,
|
150 + | pub(crate) option_list: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
|
151 + | pub(crate) some_union: ::std::option::Option<crate::model::SomeUnion>,
|
152 + | }
|
153 + | impl Builder {
|
154 + | #[allow(missing_docs)] // documentation missing in model
|
155 + | pub fn result(mut self, input: ::std::option::Option<crate::model::Result>) -> Self {
|
156 + | self.result = input;
|
157 + | self
|
158 + | }
|
159 + | #[allow(missing_docs)] // documentation missing in model
|
160 + | pub(crate) fn set_result(
|
161 + | mut self,
|
162 + | input: Option<impl ::std::convert::Into<crate::model::Result>>,
|
163 + | ) -> Self {
|
164 + | self.result = input.map(|v| v.into());
|
165 + | self
|
166 + | }
|
167 + | #[allow(missing_docs)] // documentation missing in model
|
168 + | pub fn result_list(
|
169 + | mut self,
|
170 + | input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
|
171 + | ) -> Self {
|
172 + | self.result_list = input;
|
173 + | self
|
174 + | }
|
175 + | #[allow(missing_docs)] // documentation missing in model
|
176 + | pub(crate) fn set_result_list(
|
177 + | mut self,
|
178 + | input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
|
179 + | ) -> Self {
|
180 + | self.result_list = input.map(|v| v.into());
|
181 + | self
|
182 + | }
|
183 + | #[allow(missing_docs)] // documentation missing in model
|
184 + | pub fn option(mut self, input: ::std::option::Option<crate::model::Option>) -> Self {
|
185 + | self.option = input;
|
186 + | self
|
187 + | }
|
188 + | #[allow(missing_docs)] // documentation missing in model
|
189 + | pub(crate) fn set_option(
|
190 + | mut self,
|
191 + | input: Option<impl ::std::convert::Into<crate::model::Option>>,
|
192 + | ) -> Self {
|
193 + | self.option = input.map(|v| v.into());
|
194 + | self
|
195 + | }
|
196 + | #[allow(missing_docs)] // documentation missing in model
|
197 + | pub fn option_list(
|
198 + | mut self,
|
199 + | input: ::std::option::Option<::std::vec::Vec<crate::model::Result>>,
|
200 + | ) -> Self {
|
201 + | self.option_list = input;
|
202 + | self
|
203 + | }
|
204 + | #[allow(missing_docs)] // documentation missing in model
|
205 + | pub(crate) fn set_option_list(
|
206 + | mut self,
|
207 + | input: Option<impl ::std::convert::Into<::std::vec::Vec<crate::model::Result>>>,
|
208 + | ) -> Self {
|
209 + | self.option_list = input.map(|v| v.into());
|
210 + | self
|
211 + | }
|
212 + | #[allow(missing_docs)] // documentation missing in model
|
213 + | pub fn some_union(mut self, input: ::std::option::Option<crate::model::SomeUnion>) -> Self {
|
214 + | self.some_union = input;
|
215 + | self
|
216 + | }
|
217 + | #[allow(missing_docs)] // documentation missing in model
|
218 + | pub(crate) fn set_some_union(
|
219 + | mut self,
|
220 + | input: Option<impl ::std::convert::Into<crate::model::SomeUnion>>,
|
221 + | ) -> Self {
|
222 + | self.some_union = input.map(|v| v.into());
|
223 + | self
|
224 + | }
|
225 + | /// Consumes the builder and constructs a [`SomethingElse`](crate::model::SomethingElse).
|
226 + | pub fn build(self) -> crate::model::SomethingElse {
|
227 + | self.build_enforcing_all_constraints()
|
228 + | }
|
229 + | fn build_enforcing_all_constraints(self) -> crate::model::SomethingElse {
|
230 + | crate::model::SomethingElse {
|
231 + | result: self.result,
|
232 + | result_list: self.result_list,
|
233 + | option: self.option,
|
234 + | option_list: self.option_list,
|
235 + | some_union: self.some_union,
|
236 + | }
|
237 + | }
|
238 + | }
|
239 + | }
|
240 + | /// See [`Option`](crate::model::Option).
|
241 + | pub mod option {
|
242 + |
|
243 + | impl ::std::convert::From<Builder> for crate::model::Option {
|
244 + | fn from(builder: Builder) -> Self {
|
245 + | builder.build()
|
246 + | }
|
247 + | }
|
248 + | /// A builder for [`Option`](crate::model::Option).
|
249 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
250 + | pub struct Builder {
|
251 + | pub(crate) value: ::std::option::Option<::std::string::String>,
|
252 + | }
|
253 + | impl Builder {
|
254 + | #[allow(missing_docs)] // documentation missing in model
|
255 + | pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
256 + | self.value = input;
|
257 + | self
|
258 + | }
|
259 + | #[allow(missing_docs)] // documentation missing in model
|
260 + | pub(crate) fn set_value(
|
261 + | mut self,
|
262 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
263 + | ) -> Self {
|
264 + | self.value = input.map(|v| v.into());
|
265 + | self
|
266 + | }
|
267 + | /// Consumes the builder and constructs a [`Option`](crate::model::Option).
|
268 + | pub fn build(self) -> crate::model::Option {
|
269 + | self.build_enforcing_all_constraints()
|
270 + | }
|
271 + | fn build_enforcing_all_constraints(self) -> crate::model::Option {
|
272 + | crate::model::Option { value: self.value }
|
273 + | }
|
274 + | }
|
275 + | }
|
276 + | /// See [`Result`](crate::model::Result).
|
277 + | pub mod result {
|
278 + |
|
279 + | impl ::std::convert::From<Builder> for crate::model::Result {
|
280 + | fn from(builder: Builder) -> Self {
|
281 + | builder.build()
|
282 + | }
|
283 + | }
|
284 + | /// A builder for [`Result`](crate::model::Result).
|
285 + | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
286 + | pub struct Builder {
|
287 + | pub(crate) value: ::std::option::Option<::std::string::String>,
|
288 + | }
|
289 + | impl Builder {
|
290 + | #[allow(missing_docs)] // documentation missing in model
|
291 + | pub fn value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
292 + | self.value = input;
|
293 + | self
|
294 + | }
|
295 + | #[allow(missing_docs)] // documentation missing in model
|
296 + | pub(crate) fn set_value(
|
297 + | mut self,
|
298 + | input: Option<impl ::std::convert::Into<::std::string::String>>,
|
299 + | ) -> Self {
|
300 + | self.value = input.map(|v| v.into());
|
301 + | self
|
302 + | }
|
303 + | /// Consumes the builder and constructs a [`Result`](crate::model::Result).
|
304 + | pub fn build(self) -> crate::model::Result {
|
305 + | self.build_enforcing_all_constraints()
|
306 + | }
|
307 + | fn build_enforcing_all_constraints(self) -> crate::model::Result {
|
308 + | crate::model::Result { value: self.value }
|
309 + | }
|
310 + | }
|
311 + | }
|