aws_sdk_deadline/operation/get_farm/
_get_farm_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)]
5pub struct GetFarmOutput {
6    /// <p>The farm ID of the farm to get.</p>
7    pub farm_id: ::std::string::String,
8    /// <p>The display name of the farm.</p><important>
9    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
10    /// </important>
11    pub display_name: ::std::string::String,
12    /// <p>The description of the farm.</p><important>
13    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
14    /// </important>
15    pub description: ::std::option::Option<::std::string::String>,
16    /// <p>The ARN of the KMS key used on the farm.</p>
17    pub kms_key_arn: ::std::string::String,
18    /// <p>The date and time the resource was created.</p>
19    pub created_at: ::aws_smithy_types::DateTime,
20    /// <p>The user or system that created this resource.</p>
21    pub created_by: ::std::string::String,
22    /// <p>The date and time the resource was updated.</p>
23    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24    /// <p>The user or system that updated this resource.</p>
25    pub updated_by: ::std::option::Option<::std::string::String>,
26    _request_id: Option<String>,
27}
28impl GetFarmOutput {
29    /// <p>The farm ID of the farm to get.</p>
30    pub fn farm_id(&self) -> &str {
31        use std::ops::Deref;
32        self.farm_id.deref()
33    }
34    /// <p>The display name of the farm.</p><important>
35    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
36    /// </important>
37    pub fn display_name(&self) -> &str {
38        use std::ops::Deref;
39        self.display_name.deref()
40    }
41    /// <p>The description of the farm.</p><important>
42    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
43    /// </important>
44    pub fn description(&self) -> ::std::option::Option<&str> {
45        self.description.as_deref()
46    }
47    /// <p>The ARN of the KMS key used on the farm.</p>
48    pub fn kms_key_arn(&self) -> &str {
49        use std::ops::Deref;
50        self.kms_key_arn.deref()
51    }
52    /// <p>The date and time the resource was created.</p>
53    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
54        &self.created_at
55    }
56    /// <p>The user or system that created this resource.</p>
57    pub fn created_by(&self) -> &str {
58        use std::ops::Deref;
59        self.created_by.deref()
60    }
61    /// <p>The date and time the resource was updated.</p>
62    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
63        self.updated_at.as_ref()
64    }
65    /// <p>The user or system that updated this resource.</p>
66    pub fn updated_by(&self) -> ::std::option::Option<&str> {
67        self.updated_by.as_deref()
68    }
69}
70impl ::std::fmt::Debug for GetFarmOutput {
71    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
72        let mut formatter = f.debug_struct("GetFarmOutput");
73        formatter.field("farm_id", &self.farm_id);
74        formatter.field("display_name", &self.display_name);
75        formatter.field("description", &"*** Sensitive Data Redacted ***");
76        formatter.field("kms_key_arn", &self.kms_key_arn);
77        formatter.field("created_at", &self.created_at);
78        formatter.field("created_by", &self.created_by);
79        formatter.field("updated_at", &self.updated_at);
80        formatter.field("updated_by", &self.updated_by);
81        formatter.field("_request_id", &self._request_id);
82        formatter.finish()
83    }
84}
85impl ::aws_types::request_id::RequestId for GetFarmOutput {
86    fn request_id(&self) -> Option<&str> {
87        self._request_id.as_deref()
88    }
89}
90impl GetFarmOutput {
91    /// Creates a new builder-style object to manufacture [`GetFarmOutput`](crate::operation::get_farm::GetFarmOutput).
92    pub fn builder() -> crate::operation::get_farm::builders::GetFarmOutputBuilder {
93        crate::operation::get_farm::builders::GetFarmOutputBuilder::default()
94    }
95}
96
97/// A builder for [`GetFarmOutput`](crate::operation::get_farm::GetFarmOutput).
98#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
99#[non_exhaustive]
100pub struct GetFarmOutputBuilder {
101    pub(crate) farm_id: ::std::option::Option<::std::string::String>,
102    pub(crate) display_name: ::std::option::Option<::std::string::String>,
103    pub(crate) description: ::std::option::Option<::std::string::String>,
104    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
105    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
106    pub(crate) created_by: ::std::option::Option<::std::string::String>,
107    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
108    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
109    _request_id: Option<String>,
110}
111impl GetFarmOutputBuilder {
112    /// <p>The farm ID of the farm to get.</p>
113    /// This field is required.
114    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.farm_id = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The farm ID of the farm to get.</p>
119    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.farm_id = input;
121        self
122    }
123    /// <p>The farm ID of the farm to get.</p>
124    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
125        &self.farm_id
126    }
127    /// <p>The display name of the farm.</p><important>
128    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
129    /// </important>
130    /// This field is required.
131    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.display_name = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The display name of the farm.</p><important>
136    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
137    /// </important>
138    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.display_name = input;
140        self
141    }
142    /// <p>The display name of the farm.</p><important>
143    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
144    /// </important>
145    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
146        &self.display_name
147    }
148    /// <p>The description of the farm.</p><important>
149    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
150    /// </important>
151    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.description = ::std::option::Option::Some(input.into());
153        self
154    }
155    /// <p>The description of the farm.</p><important>
156    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
157    /// </important>
158    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.description = input;
160        self
161    }
162    /// <p>The description of the farm.</p><important>
163    /// <p>This field can store any content. Escape or encode this content before displaying it on a webpage or any other system that might interpret the content of this field.</p>
164    /// </important>
165    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
166        &self.description
167    }
168    /// <p>The ARN of the KMS key used on the farm.</p>
169    /// This field is required.
170    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.kms_key_arn = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>The ARN of the KMS key used on the farm.</p>
175    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.kms_key_arn = input;
177        self
178    }
179    /// <p>The ARN of the KMS key used on the farm.</p>
180    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
181        &self.kms_key_arn
182    }
183    /// <p>The date and time the resource was created.</p>
184    /// This field is required.
185    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
186        self.created_at = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>The date and time the resource was created.</p>
190    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
191        self.created_at = input;
192        self
193    }
194    /// <p>The date and time the resource was created.</p>
195    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
196        &self.created_at
197    }
198    /// <p>The user or system that created this resource.</p>
199    /// This field is required.
200    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.created_by = ::std::option::Option::Some(input.into());
202        self
203    }
204    /// <p>The user or system that created this resource.</p>
205    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.created_by = input;
207        self
208    }
209    /// <p>The user or system that created this resource.</p>
210    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
211        &self.created_by
212    }
213    /// <p>The date and time the resource was updated.</p>
214    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
215        self.updated_at = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>The date and time the resource was updated.</p>
219    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
220        self.updated_at = input;
221        self
222    }
223    /// <p>The date and time the resource was updated.</p>
224    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
225        &self.updated_at
226    }
227    /// <p>The user or system that updated this resource.</p>
228    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.updated_by = ::std::option::Option::Some(input.into());
230        self
231    }
232    /// <p>The user or system that updated this resource.</p>
233    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.updated_by = input;
235        self
236    }
237    /// <p>The user or system that updated this resource.</p>
238    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
239        &self.updated_by
240    }
241    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
242        self._request_id = Some(request_id.into());
243        self
244    }
245
246    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
247        self._request_id = request_id;
248        self
249    }
250    /// Consumes the builder and constructs a [`GetFarmOutput`](crate::operation::get_farm::GetFarmOutput).
251    /// This method will fail if any of the following fields are not set:
252    /// - [`farm_id`](crate::operation::get_farm::builders::GetFarmOutputBuilder::farm_id)
253    /// - [`display_name`](crate::operation::get_farm::builders::GetFarmOutputBuilder::display_name)
254    /// - [`kms_key_arn`](crate::operation::get_farm::builders::GetFarmOutputBuilder::kms_key_arn)
255    /// - [`created_at`](crate::operation::get_farm::builders::GetFarmOutputBuilder::created_at)
256    /// - [`created_by`](crate::operation::get_farm::builders::GetFarmOutputBuilder::created_by)
257    pub fn build(self) -> ::std::result::Result<crate::operation::get_farm::GetFarmOutput, ::aws_smithy_types::error::operation::BuildError> {
258        ::std::result::Result::Ok(crate::operation::get_farm::GetFarmOutput {
259            farm_id: self.farm_id.ok_or_else(|| {
260                ::aws_smithy_types::error::operation::BuildError::missing_field(
261                    "farm_id",
262                    "farm_id was not specified but it is required when building GetFarmOutput",
263                )
264            })?,
265            display_name: self.display_name.ok_or_else(|| {
266                ::aws_smithy_types::error::operation::BuildError::missing_field(
267                    "display_name",
268                    "display_name was not specified but it is required when building GetFarmOutput",
269                )
270            })?,
271            description: self.description,
272            kms_key_arn: self.kms_key_arn.ok_or_else(|| {
273                ::aws_smithy_types::error::operation::BuildError::missing_field(
274                    "kms_key_arn",
275                    "kms_key_arn was not specified but it is required when building GetFarmOutput",
276                )
277            })?,
278            created_at: self.created_at.ok_or_else(|| {
279                ::aws_smithy_types::error::operation::BuildError::missing_field(
280                    "created_at",
281                    "created_at was not specified but it is required when building GetFarmOutput",
282                )
283            })?,
284            created_by: self.created_by.ok_or_else(|| {
285                ::aws_smithy_types::error::operation::BuildError::missing_field(
286                    "created_by",
287                    "created_by was not specified but it is required when building GetFarmOutput",
288                )
289            })?,
290            updated_at: self.updated_at,
291            updated_by: self.updated_by,
292            _request_id: self._request_id,
293        })
294    }
295}
296impl ::std::fmt::Debug for GetFarmOutputBuilder {
297    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
298        let mut formatter = f.debug_struct("GetFarmOutputBuilder");
299        formatter.field("farm_id", &self.farm_id);
300        formatter.field("display_name", &self.display_name);
301        formatter.field("description", &"*** Sensitive Data Redacted ***");
302        formatter.field("kms_key_arn", &self.kms_key_arn);
303        formatter.field("created_at", &self.created_at);
304        formatter.field("created_by", &self.created_by);
305        formatter.field("updated_at", &self.updated_at);
306        formatter.field("updated_by", &self.updated_by);
307        formatter.field("_request_id", &self._request_id);
308        formatter.finish()
309    }
310}