aws_sdk_connectcases/operation/get_layout/
_get_layout_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetLayoutOutput {
6    /// <p>The unique identifier of the layout.</p>
7    pub layout_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the newly created layout.</p>
9    pub layout_arn: ::std::string::String,
10    /// <p>The name of the layout. It must be unique.</p>
11    pub name: ::std::string::String,
12    /// <p>Information about which fields will be present in the layout, the order of the fields, and read-only attribute of the field.</p>
13    pub content: ::std::option::Option<crate::types::LayoutContent>,
14    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
16    /// <p>Denotes whether or not the resource has been deleted.</p>
17    pub deleted: bool,
18    /// <p>Timestamp at which the resource was created.</p>
19    pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>Timestamp at which the resource was created or last modified.</p>
21    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
22    _request_id: Option<String>,
23}
24impl GetLayoutOutput {
25    /// <p>The unique identifier of the layout.</p>
26    pub fn layout_id(&self) -> &str {
27        use std::ops::Deref;
28        self.layout_id.deref()
29    }
30    /// <p>The Amazon Resource Name (ARN) of the newly created layout.</p>
31    pub fn layout_arn(&self) -> &str {
32        use std::ops::Deref;
33        self.layout_arn.deref()
34    }
35    /// <p>The name of the layout. It must be unique.</p>
36    pub fn name(&self) -> &str {
37        use std::ops::Deref;
38        self.name.deref()
39    }
40    /// <p>Information about which fields will be present in the layout, the order of the fields, and read-only attribute of the field.</p>
41    pub fn content(&self) -> ::std::option::Option<&crate::types::LayoutContent> {
42        self.content.as_ref()
43    }
44    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
45    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
46        self.tags.as_ref()
47    }
48    /// <p>Denotes whether or not the resource has been deleted.</p>
49    pub fn deleted(&self) -> bool {
50        self.deleted
51    }
52    /// <p>Timestamp at which the resource was created.</p>
53    pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
54        self.created_time.as_ref()
55    }
56    /// <p>Timestamp at which the resource was created or last modified.</p>
57    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
58        self.last_modified_time.as_ref()
59    }
60}
61impl ::aws_types::request_id::RequestId for GetLayoutOutput {
62    fn request_id(&self) -> Option<&str> {
63        self._request_id.as_deref()
64    }
65}
66impl GetLayoutOutput {
67    /// Creates a new builder-style object to manufacture [`GetLayoutOutput`](crate::operation::get_layout::GetLayoutOutput).
68    pub fn builder() -> crate::operation::get_layout::builders::GetLayoutOutputBuilder {
69        crate::operation::get_layout::builders::GetLayoutOutputBuilder::default()
70    }
71}
72
73/// A builder for [`GetLayoutOutput`](crate::operation::get_layout::GetLayoutOutput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct GetLayoutOutputBuilder {
77    pub(crate) layout_id: ::std::option::Option<::std::string::String>,
78    pub(crate) layout_arn: ::std::option::Option<::std::string::String>,
79    pub(crate) name: ::std::option::Option<::std::string::String>,
80    pub(crate) content: ::std::option::Option<crate::types::LayoutContent>,
81    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
82    pub(crate) deleted: ::std::option::Option<bool>,
83    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
84    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
85    _request_id: Option<String>,
86}
87impl GetLayoutOutputBuilder {
88    /// <p>The unique identifier of the layout.</p>
89    /// This field is required.
90    pub fn layout_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.layout_id = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The unique identifier of the layout.</p>
95    pub fn set_layout_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.layout_id = input;
97        self
98    }
99    /// <p>The unique identifier of the layout.</p>
100    pub fn get_layout_id(&self) -> &::std::option::Option<::std::string::String> {
101        &self.layout_id
102    }
103    /// <p>The Amazon Resource Name (ARN) of the newly created layout.</p>
104    /// This field is required.
105    pub fn layout_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.layout_arn = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The Amazon Resource Name (ARN) of the newly created layout.</p>
110    pub fn set_layout_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.layout_arn = input;
112        self
113    }
114    /// <p>The Amazon Resource Name (ARN) of the newly created layout.</p>
115    pub fn get_layout_arn(&self) -> &::std::option::Option<::std::string::String> {
116        &self.layout_arn
117    }
118    /// <p>The name of the layout. It must be unique.</p>
119    /// This field is required.
120    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.name = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The name of the layout. It must be unique.</p>
125    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.name = input;
127        self
128    }
129    /// <p>The name of the layout. It must be unique.</p>
130    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
131        &self.name
132    }
133    /// <p>Information about which fields will be present in the layout, the order of the fields, and read-only attribute of the field.</p>
134    /// This field is required.
135    pub fn content(mut self, input: crate::types::LayoutContent) -> Self {
136        self.content = ::std::option::Option::Some(input);
137        self
138    }
139    /// <p>Information about which fields will be present in the layout, the order of the fields, and read-only attribute of the field.</p>
140    pub fn set_content(mut self, input: ::std::option::Option<crate::types::LayoutContent>) -> Self {
141        self.content = input;
142        self
143    }
144    /// <p>Information about which fields will be present in the layout, the order of the fields, and read-only attribute of the field.</p>
145    pub fn get_content(&self) -> &::std::option::Option<crate::types::LayoutContent> {
146        &self.content
147    }
148    /// Adds a key-value pair to `tags`.
149    ///
150    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
151    ///
152    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
153    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
154        let mut hash_map = self.tags.unwrap_or_default();
155        hash_map.insert(k.into(), v);
156        self.tags = ::std::option::Option::Some(hash_map);
157        self
158    }
159    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
160    pub fn set_tags(
161        mut self,
162        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
163    ) -> Self {
164        self.tags = input;
165        self
166    }
167    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
168    pub fn get_tags(
169        &self,
170    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
171        &self.tags
172    }
173    /// <p>Denotes whether or not the resource has been deleted.</p>
174    pub fn deleted(mut self, input: bool) -> Self {
175        self.deleted = ::std::option::Option::Some(input);
176        self
177    }
178    /// <p>Denotes whether or not the resource has been deleted.</p>
179    pub fn set_deleted(mut self, input: ::std::option::Option<bool>) -> Self {
180        self.deleted = input;
181        self
182    }
183    /// <p>Denotes whether or not the resource has been deleted.</p>
184    pub fn get_deleted(&self) -> &::std::option::Option<bool> {
185        &self.deleted
186    }
187    /// <p>Timestamp at which the resource was created.</p>
188    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
189        self.created_time = ::std::option::Option::Some(input);
190        self
191    }
192    /// <p>Timestamp at which the resource was created.</p>
193    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
194        self.created_time = input;
195        self
196    }
197    /// <p>Timestamp at which the resource was created.</p>
198    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
199        &self.created_time
200    }
201    /// <p>Timestamp at which the resource was created or last modified.</p>
202    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
203        self.last_modified_time = ::std::option::Option::Some(input);
204        self
205    }
206    /// <p>Timestamp at which the resource was created or last modified.</p>
207    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
208        self.last_modified_time = input;
209        self
210    }
211    /// <p>Timestamp at which the resource was created or last modified.</p>
212    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
213        &self.last_modified_time
214    }
215    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
216        self._request_id = Some(request_id.into());
217        self
218    }
219
220    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
221        self._request_id = request_id;
222        self
223    }
224    /// Consumes the builder and constructs a [`GetLayoutOutput`](crate::operation::get_layout::GetLayoutOutput).
225    /// This method will fail if any of the following fields are not set:
226    /// - [`layout_id`](crate::operation::get_layout::builders::GetLayoutOutputBuilder::layout_id)
227    /// - [`layout_arn`](crate::operation::get_layout::builders::GetLayoutOutputBuilder::layout_arn)
228    /// - [`name`](crate::operation::get_layout::builders::GetLayoutOutputBuilder::name)
229    pub fn build(self) -> ::std::result::Result<crate::operation::get_layout::GetLayoutOutput, ::aws_smithy_types::error::operation::BuildError> {
230        ::std::result::Result::Ok(crate::operation::get_layout::GetLayoutOutput {
231            layout_id: self.layout_id.ok_or_else(|| {
232                ::aws_smithy_types::error::operation::BuildError::missing_field(
233                    "layout_id",
234                    "layout_id was not specified but it is required when building GetLayoutOutput",
235                )
236            })?,
237            layout_arn: self.layout_arn.ok_or_else(|| {
238                ::aws_smithy_types::error::operation::BuildError::missing_field(
239                    "layout_arn",
240                    "layout_arn was not specified but it is required when building GetLayoutOutput",
241                )
242            })?,
243            name: self.name.ok_or_else(|| {
244                ::aws_smithy_types::error::operation::BuildError::missing_field(
245                    "name",
246                    "name was not specified but it is required when building GetLayoutOutput",
247                )
248            })?,
249            content: self.content,
250            tags: self.tags,
251            deleted: self.deleted.unwrap_or_default(),
252            created_time: self.created_time,
253            last_modified_time: self.last_modified_time,
254            _request_id: self._request_id,
255        })
256    }
257}