aws_sdk_deadline/operation/get_farm/
_get_farm_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetFarmOutput {
6 pub farm_id: ::std::string::String,
8 pub display_name: ::std::string::String,
12 pub description: ::std::option::Option<::std::string::String>,
16 pub kms_key_arn: ::std::string::String,
18 pub created_at: ::aws_smithy_types::DateTime,
20 pub created_by: ::std::string::String,
22 pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24 pub updated_by: ::std::option::Option<::std::string::String>,
26 _request_id: Option<String>,
27}
28impl GetFarmOutput {
29 pub fn farm_id(&self) -> &str {
31 use std::ops::Deref;
32 self.farm_id.deref()
33 }
34 pub fn display_name(&self) -> &str {
38 use std::ops::Deref;
39 self.display_name.deref()
40 }
41 pub fn description(&self) -> ::std::option::Option<&str> {
45 self.description.as_deref()
46 }
47 pub fn kms_key_arn(&self) -> &str {
49 use std::ops::Deref;
50 self.kms_key_arn.deref()
51 }
52 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
54 &self.created_at
55 }
56 pub fn created_by(&self) -> &str {
58 use std::ops::Deref;
59 self.created_by.deref()
60 }
61 pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
63 self.updated_at.as_ref()
64 }
65 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 pub fn builder() -> crate::operation::get_farm::builders::GetFarmOutputBuilder {
93 crate::operation::get_farm::builders::GetFarmOutputBuilder::default()
94 }
95}
96
97#[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 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 pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.farm_id = input;
121 self
122 }
123 pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
125 &self.farm_id
126 }
127 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 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.display_name = input;
140 self
141 }
142 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
146 &self.display_name
147 }
148 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.description = input;
160 self
161 }
162 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
166 &self.description
167 }
168 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 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 pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
181 &self.kms_key_arn
182 }
183 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
196 &self.created_at
197 }
198 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206 self.created_by = input;
207 self
208 }
209 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
211 &self.created_by
212 }
213 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
225 &self.updated_at
226 }
227 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 pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234 self.updated_by = input;
235 self
236 }
237 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 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}