aws_sdk_databrew/types/
_dataset.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Dataset {
7 pub account_id: ::std::option::Option<::std::string::String>,
9 pub created_by: ::std::option::Option<::std::string::String>,
11 pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
13 pub name: ::std::string::String,
15 pub format: ::std::option::Option<crate::types::InputFormat>,
17 pub format_options: ::std::option::Option<crate::types::FormatOptions>,
19 pub input: ::std::option::Option<crate::types::Input>,
21 pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
23 pub last_modified_by: ::std::option::Option<::std::string::String>,
25 pub source: ::std::option::Option<crate::types::Source>,
27 pub path_options: ::std::option::Option<crate::types::PathOptions>,
29 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
31 pub resource_arn: ::std::option::Option<::std::string::String>,
33}
34impl Dataset {
35 pub fn account_id(&self) -> ::std::option::Option<&str> {
37 self.account_id.as_deref()
38 }
39 pub fn created_by(&self) -> ::std::option::Option<&str> {
41 self.created_by.as_deref()
42 }
43 pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
45 self.create_date.as_ref()
46 }
47 pub fn name(&self) -> &str {
49 use std::ops::Deref;
50 self.name.deref()
51 }
52 pub fn format(&self) -> ::std::option::Option<&crate::types::InputFormat> {
54 self.format.as_ref()
55 }
56 pub fn format_options(&self) -> ::std::option::Option<&crate::types::FormatOptions> {
58 self.format_options.as_ref()
59 }
60 pub fn input(&self) -> ::std::option::Option<&crate::types::Input> {
62 self.input.as_ref()
63 }
64 pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
66 self.last_modified_date.as_ref()
67 }
68 pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
70 self.last_modified_by.as_deref()
71 }
72 pub fn source(&self) -> ::std::option::Option<&crate::types::Source> {
74 self.source.as_ref()
75 }
76 pub fn path_options(&self) -> ::std::option::Option<&crate::types::PathOptions> {
78 self.path_options.as_ref()
79 }
80 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
82 self.tags.as_ref()
83 }
84 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
86 self.resource_arn.as_deref()
87 }
88}
89impl Dataset {
90 pub fn builder() -> crate::types::builders::DatasetBuilder {
92 crate::types::builders::DatasetBuilder::default()
93 }
94}
95
96#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
98#[non_exhaustive]
99pub struct DatasetBuilder {
100 pub(crate) account_id: ::std::option::Option<::std::string::String>,
101 pub(crate) created_by: ::std::option::Option<::std::string::String>,
102 pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
103 pub(crate) name: ::std::option::Option<::std::string::String>,
104 pub(crate) format: ::std::option::Option<crate::types::InputFormat>,
105 pub(crate) format_options: ::std::option::Option<crate::types::FormatOptions>,
106 pub(crate) input: ::std::option::Option<crate::types::Input>,
107 pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
108 pub(crate) last_modified_by: ::std::option::Option<::std::string::String>,
109 pub(crate) source: ::std::option::Option<crate::types::Source>,
110 pub(crate) path_options: ::std::option::Option<crate::types::PathOptions>,
111 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
112 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
113}
114impl DatasetBuilder {
115 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.account_id = ::std::option::Option::Some(input.into());
118 self
119 }
120 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.account_id = input;
123 self
124 }
125 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
127 &self.account_id
128 }
129 pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.created_by = ::std::option::Option::Some(input.into());
132 self
133 }
134 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.created_by = input;
137 self
138 }
139 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
141 &self.created_by
142 }
143 pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
145 self.create_date = ::std::option::Option::Some(input);
146 self
147 }
148 pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
150 self.create_date = input;
151 self
152 }
153 pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
155 &self.create_date
156 }
157 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.name = ::std::option::Option::Some(input.into());
161 self
162 }
163 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.name = input;
166 self
167 }
168 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
170 &self.name
171 }
172 pub fn format(mut self, input: crate::types::InputFormat) -> Self {
174 self.format = ::std::option::Option::Some(input);
175 self
176 }
177 pub fn set_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
179 self.format = input;
180 self
181 }
182 pub fn get_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
184 &self.format
185 }
186 pub fn format_options(mut self, input: crate::types::FormatOptions) -> Self {
188 self.format_options = ::std::option::Option::Some(input);
189 self
190 }
191 pub fn set_format_options(mut self, input: ::std::option::Option<crate::types::FormatOptions>) -> Self {
193 self.format_options = input;
194 self
195 }
196 pub fn get_format_options(&self) -> &::std::option::Option<crate::types::FormatOptions> {
198 &self.format_options
199 }
200 pub fn input(mut self, input: crate::types::Input) -> Self {
203 self.input = ::std::option::Option::Some(input);
204 self
205 }
206 pub fn set_input(mut self, input: ::std::option::Option<crate::types::Input>) -> Self {
208 self.input = input;
209 self
210 }
211 pub fn get_input(&self) -> &::std::option::Option<crate::types::Input> {
213 &self.input
214 }
215 pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
217 self.last_modified_date = ::std::option::Option::Some(input);
218 self
219 }
220 pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
222 self.last_modified_date = input;
223 self
224 }
225 pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
227 &self.last_modified_date
228 }
229 pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231 self.last_modified_by = ::std::option::Option::Some(input.into());
232 self
233 }
234 pub fn set_last_modified_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236 self.last_modified_by = input;
237 self
238 }
239 pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
241 &self.last_modified_by
242 }
243 pub fn source(mut self, input: crate::types::Source) -> Self {
245 self.source = ::std::option::Option::Some(input);
246 self
247 }
248 pub fn set_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
250 self.source = input;
251 self
252 }
253 pub fn get_source(&self) -> &::std::option::Option<crate::types::Source> {
255 &self.source
256 }
257 pub fn path_options(mut self, input: crate::types::PathOptions) -> Self {
259 self.path_options = ::std::option::Option::Some(input);
260 self
261 }
262 pub fn set_path_options(mut self, input: ::std::option::Option<crate::types::PathOptions>) -> Self {
264 self.path_options = input;
265 self
266 }
267 pub fn get_path_options(&self) -> &::std::option::Option<crate::types::PathOptions> {
269 &self.path_options
270 }
271 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
277 let mut hash_map = self.tags.unwrap_or_default();
278 hash_map.insert(k.into(), v.into());
279 self.tags = ::std::option::Option::Some(hash_map);
280 self
281 }
282 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
284 self.tags = input;
285 self
286 }
287 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
289 &self.tags
290 }
291 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293 self.resource_arn = ::std::option::Option::Some(input.into());
294 self
295 }
296 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298 self.resource_arn = input;
299 self
300 }
301 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
303 &self.resource_arn
304 }
305 pub fn build(self) -> ::std::result::Result<crate::types::Dataset, ::aws_smithy_types::error::operation::BuildError> {
309 ::std::result::Result::Ok(crate::types::Dataset {
310 account_id: self.account_id,
311 created_by: self.created_by,
312 create_date: self.create_date,
313 name: self.name.ok_or_else(|| {
314 ::aws_smithy_types::error::operation::BuildError::missing_field(
315 "name",
316 "name was not specified but it is required when building Dataset",
317 )
318 })?,
319 format: self.format,
320 format_options: self.format_options,
321 input: self.input,
322 last_modified_date: self.last_modified_date,
323 last_modified_by: self.last_modified_by,
324 source: self.source,
325 path_options: self.path_options,
326 tags: self.tags,
327 resource_arn: self.resource_arn,
328 })
329 }
330}