aws_sdk_connectcases/operation/get_template/
_get_template_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetTemplateOutput {
6 pub template_id: ::std::string::String,
8 pub template_arn: ::std::string::String,
10 pub name: ::std::string::String,
12 pub description: ::std::option::Option<::std::string::String>,
14 pub layout_configuration: ::std::option::Option<crate::types::LayoutConfiguration>,
16 pub required_fields: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>,
18 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
20 pub status: crate::types::TemplateStatus,
22 pub deleted: bool,
24 pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
26 pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
28 pub rules: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>,
30 _request_id: Option<String>,
31}
32impl GetTemplateOutput {
33 pub fn template_id(&self) -> &str {
35 use std::ops::Deref;
36 self.template_id.deref()
37 }
38 pub fn template_arn(&self) -> &str {
40 use std::ops::Deref;
41 self.template_arn.deref()
42 }
43 pub fn name(&self) -> &str {
45 use std::ops::Deref;
46 self.name.deref()
47 }
48 pub fn description(&self) -> ::std::option::Option<&str> {
50 self.description.as_deref()
51 }
52 pub fn layout_configuration(&self) -> ::std::option::Option<&crate::types::LayoutConfiguration> {
54 self.layout_configuration.as_ref()
55 }
56 pub fn required_fields(&self) -> &[crate::types::RequiredField] {
60 self.required_fields.as_deref().unwrap_or_default()
61 }
62 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
64 self.tags.as_ref()
65 }
66 pub fn status(&self) -> &crate::types::TemplateStatus {
68 &self.status
69 }
70 pub fn deleted(&self) -> bool {
72 self.deleted
73 }
74 pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
76 self.created_time.as_ref()
77 }
78 pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
80 self.last_modified_time.as_ref()
81 }
82 pub fn rules(&self) -> &[crate::types::TemplateRule] {
86 self.rules.as_deref().unwrap_or_default()
87 }
88}
89impl ::aws_types::request_id::RequestId for GetTemplateOutput {
90 fn request_id(&self) -> Option<&str> {
91 self._request_id.as_deref()
92 }
93}
94impl GetTemplateOutput {
95 pub fn builder() -> crate::operation::get_template::builders::GetTemplateOutputBuilder {
97 crate::operation::get_template::builders::GetTemplateOutputBuilder::default()
98 }
99}
100
101#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
103#[non_exhaustive]
104pub struct GetTemplateOutputBuilder {
105 pub(crate) template_id: ::std::option::Option<::std::string::String>,
106 pub(crate) template_arn: ::std::option::Option<::std::string::String>,
107 pub(crate) name: ::std::option::Option<::std::string::String>,
108 pub(crate) description: ::std::option::Option<::std::string::String>,
109 pub(crate) layout_configuration: ::std::option::Option<crate::types::LayoutConfiguration>,
110 pub(crate) required_fields: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>,
111 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
112 pub(crate) status: ::std::option::Option<crate::types::TemplateStatus>,
113 pub(crate) deleted: ::std::option::Option<bool>,
114 pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
115 pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
116 pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>,
117 _request_id: Option<String>,
118}
119impl GetTemplateOutputBuilder {
120 pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.template_id = ::std::option::Option::Some(input.into());
124 self
125 }
126 pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.template_id = input;
129 self
130 }
131 pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
133 &self.template_id
134 }
135 pub fn template_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.template_arn = ::std::option::Option::Some(input.into());
139 self
140 }
141 pub fn set_template_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.template_arn = input;
144 self
145 }
146 pub fn get_template_arn(&self) -> &::std::option::Option<::std::string::String> {
148 &self.template_arn
149 }
150 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.name = ::std::option::Option::Some(input.into());
154 self
155 }
156 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.name = input;
159 self
160 }
161 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
163 &self.name
164 }
165 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.description = ::std::option::Option::Some(input.into());
168 self
169 }
170 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172 self.description = input;
173 self
174 }
175 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
177 &self.description
178 }
179 pub fn layout_configuration(mut self, input: crate::types::LayoutConfiguration) -> Self {
181 self.layout_configuration = ::std::option::Option::Some(input);
182 self
183 }
184 pub fn set_layout_configuration(mut self, input: ::std::option::Option<crate::types::LayoutConfiguration>) -> Self {
186 self.layout_configuration = input;
187 self
188 }
189 pub fn get_layout_configuration(&self) -> &::std::option::Option<crate::types::LayoutConfiguration> {
191 &self.layout_configuration
192 }
193 pub fn required_fields(mut self, input: crate::types::RequiredField) -> Self {
199 let mut v = self.required_fields.unwrap_or_default();
200 v.push(input);
201 self.required_fields = ::std::option::Option::Some(v);
202 self
203 }
204 pub fn set_required_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>) -> Self {
206 self.required_fields = input;
207 self
208 }
209 pub fn get_required_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequiredField>> {
211 &self.required_fields
212 }
213 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
219 let mut hash_map = self.tags.unwrap_or_default();
220 hash_map.insert(k.into(), v);
221 self.tags = ::std::option::Option::Some(hash_map);
222 self
223 }
224 pub fn set_tags(
226 mut self,
227 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
228 ) -> Self {
229 self.tags = input;
230 self
231 }
232 pub fn get_tags(
234 &self,
235 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
236 &self.tags
237 }
238 pub fn status(mut self, input: crate::types::TemplateStatus) -> Self {
241 self.status = ::std::option::Option::Some(input);
242 self
243 }
244 pub fn set_status(mut self, input: ::std::option::Option<crate::types::TemplateStatus>) -> Self {
246 self.status = input;
247 self
248 }
249 pub fn get_status(&self) -> &::std::option::Option<crate::types::TemplateStatus> {
251 &self.status
252 }
253 pub fn deleted(mut self, input: bool) -> Self {
255 self.deleted = ::std::option::Option::Some(input);
256 self
257 }
258 pub fn set_deleted(mut self, input: ::std::option::Option<bool>) -> Self {
260 self.deleted = input;
261 self
262 }
263 pub fn get_deleted(&self) -> &::std::option::Option<bool> {
265 &self.deleted
266 }
267 pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
269 self.created_time = ::std::option::Option::Some(input);
270 self
271 }
272 pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
274 self.created_time = input;
275 self
276 }
277 pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
279 &self.created_time
280 }
281 pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
283 self.last_modified_time = ::std::option::Option::Some(input);
284 self
285 }
286 pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
288 self.last_modified_time = input;
289 self
290 }
291 pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
293 &self.last_modified_time
294 }
295 pub fn rules(mut self, input: crate::types::TemplateRule) -> Self {
301 let mut v = self.rules.unwrap_or_default();
302 v.push(input);
303 self.rules = ::std::option::Option::Some(v);
304 self
305 }
306 pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>) -> Self {
308 self.rules = input;
309 self
310 }
311 pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>> {
313 &self.rules
314 }
315 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
316 self._request_id = Some(request_id.into());
317 self
318 }
319
320 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
321 self._request_id = request_id;
322 self
323 }
324 pub fn build(self) -> ::std::result::Result<crate::operation::get_template::GetTemplateOutput, ::aws_smithy_types::error::operation::BuildError> {
331 ::std::result::Result::Ok(crate::operation::get_template::GetTemplateOutput {
332 template_id: self.template_id.ok_or_else(|| {
333 ::aws_smithy_types::error::operation::BuildError::missing_field(
334 "template_id",
335 "template_id was not specified but it is required when building GetTemplateOutput",
336 )
337 })?,
338 template_arn: self.template_arn.ok_or_else(|| {
339 ::aws_smithy_types::error::operation::BuildError::missing_field(
340 "template_arn",
341 "template_arn was not specified but it is required when building GetTemplateOutput",
342 )
343 })?,
344 name: self.name.ok_or_else(|| {
345 ::aws_smithy_types::error::operation::BuildError::missing_field(
346 "name",
347 "name was not specified but it is required when building GetTemplateOutput",
348 )
349 })?,
350 description: self.description,
351 layout_configuration: self.layout_configuration,
352 required_fields: self.required_fields,
353 tags: self.tags,
354 status: self.status.ok_or_else(|| {
355 ::aws_smithy_types::error::operation::BuildError::missing_field(
356 "status",
357 "status was not specified but it is required when building GetTemplateOutput",
358 )
359 })?,
360 deleted: self.deleted.unwrap_or_default(),
361 created_time: self.created_time,
362 last_modified_time: self.last_modified_time,
363 rules: self.rules,
364 _request_id: self._request_id,
365 })
366 }
367}