Skip to main content

aws_sdk_databrew/types/
_dataset.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a dataset that can be processed by DataBrew.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Dataset {
7    /// <p>The ID of the Amazon Web Services account that owns the dataset.</p>
8    pub account_id: ::std::option::Option<::std::string::String>,
9    /// <p>The Amazon Resource Name (ARN) of the user who created the dataset.</p>
10    pub created_by: ::std::option::Option<::std::string::String>,
11    /// <p>The date and time that the dataset was created.</p>
12    pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
13    /// <p>The unique name of the dataset.</p>
14    pub name: ::std::string::String,
15    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
16    pub format: ::std::option::Option<crate::types::InputFormat>,
17    /// <p>A set of options that define how DataBrew interprets the data in the dataset.</p>
18    pub format_options: ::std::option::Option<crate::types::FormatOptions>,
19    /// <p>Information on how DataBrew can find the dataset, in either the Glue Data Catalog or Amazon S3.</p>
20    pub input: ::std::option::Option<crate::types::Input>,
21    /// <p>The last modification date and time of the dataset.</p>
22    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
23    /// <p>The Amazon Resource Name (ARN) of the user who last modified the dataset.</p>
24    pub last_modified_by: ::std::option::Option<::std::string::String>,
25    /// <p>The location of the data for the dataset, either Amazon S3 or the Glue Data Catalog.</p>
26    pub source: ::std::option::Option<crate::types::Source>,
27    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
28    pub path_options: ::std::option::Option<crate::types::PathOptions>,
29    /// <p>Metadata tags that have been applied to the dataset.</p>
30    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
31    /// <p>The unique Amazon Resource Name (ARN) for the dataset.</p>
32    pub resource_arn: ::std::option::Option<::std::string::String>,
33}
34impl Dataset {
35    /// <p>The ID of the Amazon Web Services account that owns the dataset.</p>
36    pub fn account_id(&self) -> ::std::option::Option<&str> {
37        self.account_id.as_deref()
38    }
39    /// <p>The Amazon Resource Name (ARN) of the user who created the dataset.</p>
40    pub fn created_by(&self) -> ::std::option::Option<&str> {
41        self.created_by.as_deref()
42    }
43    /// <p>The date and time that the dataset was created.</p>
44    pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
45        self.create_date.as_ref()
46    }
47    /// <p>The unique name of the dataset.</p>
48    pub fn name(&self) -> &str {
49        use std::ops::Deref;
50        self.name.deref()
51    }
52    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
53    pub fn format(&self) -> ::std::option::Option<&crate::types::InputFormat> {
54        self.format.as_ref()
55    }
56    /// <p>A set of options that define how DataBrew interprets the data in the dataset.</p>
57    pub fn format_options(&self) -> ::std::option::Option<&crate::types::FormatOptions> {
58        self.format_options.as_ref()
59    }
60    /// <p>Information on how DataBrew can find the dataset, in either the Glue Data Catalog or Amazon S3.</p>
61    pub fn input(&self) -> ::std::option::Option<&crate::types::Input> {
62        self.input.as_ref()
63    }
64    /// <p>The last modification date and time of the dataset.</p>
65    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
66        self.last_modified_date.as_ref()
67    }
68    /// <p>The Amazon Resource Name (ARN) of the user who last modified the dataset.</p>
69    pub fn last_modified_by(&self) -> ::std::option::Option<&str> {
70        self.last_modified_by.as_deref()
71    }
72    /// <p>The location of the data for the dataset, either Amazon S3 or the Glue Data Catalog.</p>
73    pub fn source(&self) -> ::std::option::Option<&crate::types::Source> {
74        self.source.as_ref()
75    }
76    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
77    pub fn path_options(&self) -> ::std::option::Option<&crate::types::PathOptions> {
78        self.path_options.as_ref()
79    }
80    /// <p>Metadata tags that have been applied to the dataset.</p>
81    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
82        self.tags.as_ref()
83    }
84    /// <p>The unique Amazon Resource Name (ARN) for the dataset.</p>
85    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
86        self.resource_arn.as_deref()
87    }
88}
89impl Dataset {
90    /// Creates a new builder-style object to manufacture [`Dataset`](crate::types::Dataset).
91    pub fn builder() -> crate::types::builders::DatasetBuilder {
92        crate::types::builders::DatasetBuilder::default()
93    }
94}
95
96/// A builder for [`Dataset`](crate::types::Dataset).
97#[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    /// <p>The ID of the Amazon Web Services account that owns the dataset.</p>
116    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    /// <p>The ID of the Amazon Web Services account that owns the dataset.</p>
121    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.account_id = input;
123        self
124    }
125    /// <p>The ID of the Amazon Web Services account that owns the dataset.</p>
126    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
127        &self.account_id
128    }
129    /// <p>The Amazon Resource Name (ARN) of the user who created the dataset.</p>
130    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    /// <p>The Amazon Resource Name (ARN) of the user who created the dataset.</p>
135    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.created_by = input;
137        self
138    }
139    /// <p>The Amazon Resource Name (ARN) of the user who created the dataset.</p>
140    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
141        &self.created_by
142    }
143    /// <p>The date and time that the dataset was created.</p>
144    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    /// <p>The date and time that the dataset was created.</p>
149    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    /// <p>The date and time that the dataset was created.</p>
154    pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
155        &self.create_date
156    }
157    /// <p>The unique name of the dataset.</p>
158    /// This field is required.
159    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    /// <p>The unique name of the dataset.</p>
164    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.name = input;
166        self
167    }
168    /// <p>The unique name of the dataset.</p>
169    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
170        &self.name
171    }
172    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
173    pub fn format(mut self, input: crate::types::InputFormat) -> Self {
174        self.format = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
178    pub fn set_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
179        self.format = input;
180        self
181    }
182    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
183    pub fn get_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
184        &self.format
185    }
186    /// <p>A set of options that define how DataBrew interprets the data in the dataset.</p>
187    pub fn format_options(mut self, input: crate::types::FormatOptions) -> Self {
188        self.format_options = ::std::option::Option::Some(input);
189        self
190    }
191    /// <p>A set of options that define how DataBrew interprets the data in the dataset.</p>
192    pub fn set_format_options(mut self, input: ::std::option::Option<crate::types::FormatOptions>) -> Self {
193        self.format_options = input;
194        self
195    }
196    /// <p>A set of options that define how DataBrew interprets the data in the dataset.</p>
197    pub fn get_format_options(&self) -> &::std::option::Option<crate::types::FormatOptions> {
198        &self.format_options
199    }
200    /// <p>Information on how DataBrew can find the dataset, in either the Glue Data Catalog or Amazon S3.</p>
201    /// This field is required.
202    pub fn input(mut self, input: crate::types::Input) -> Self {
203        self.input = ::std::option::Option::Some(input);
204        self
205    }
206    /// <p>Information on how DataBrew can find the dataset, in either the Glue Data Catalog or Amazon S3.</p>
207    pub fn set_input(mut self, input: ::std::option::Option<crate::types::Input>) -> Self {
208        self.input = input;
209        self
210    }
211    /// <p>Information on how DataBrew can find the dataset, in either the Glue Data Catalog or Amazon S3.</p>
212    pub fn get_input(&self) -> &::std::option::Option<crate::types::Input> {
213        &self.input
214    }
215    /// <p>The last modification date and time of the dataset.</p>
216    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    /// <p>The last modification date and time of the dataset.</p>
221    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    /// <p>The last modification date and time of the dataset.</p>
226    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
227        &self.last_modified_date
228    }
229    /// <p>The Amazon Resource Name (ARN) of the user who last modified the dataset.</p>
230    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    /// <p>The Amazon Resource Name (ARN) of the user who last modified the dataset.</p>
235    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    /// <p>The Amazon Resource Name (ARN) of the user who last modified the dataset.</p>
240    pub fn get_last_modified_by(&self) -> &::std::option::Option<::std::string::String> {
241        &self.last_modified_by
242    }
243    /// <p>The location of the data for the dataset, either Amazon S3 or the Glue Data Catalog.</p>
244    pub fn source(mut self, input: crate::types::Source) -> Self {
245        self.source = ::std::option::Option::Some(input);
246        self
247    }
248    /// <p>The location of the data for the dataset, either Amazon S3 or the Glue Data Catalog.</p>
249    pub fn set_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
250        self.source = input;
251        self
252    }
253    /// <p>The location of the data for the dataset, either Amazon S3 or the Glue Data Catalog.</p>
254    pub fn get_source(&self) -> &::std::option::Option<crate::types::Source> {
255        &self.source
256    }
257    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
258    pub fn path_options(mut self, input: crate::types::PathOptions) -> Self {
259        self.path_options = ::std::option::Option::Some(input);
260        self
261    }
262    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
263    pub fn set_path_options(mut self, input: ::std::option::Option<crate::types::PathOptions>) -> Self {
264        self.path_options = input;
265        self
266    }
267    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
268    pub fn get_path_options(&self) -> &::std::option::Option<crate::types::PathOptions> {
269        &self.path_options
270    }
271    /// Adds a key-value pair to `tags`.
272    ///
273    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
274    ///
275    /// <p>Metadata tags that have been applied to the dataset.</p>
276    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    /// <p>Metadata tags that have been applied to the dataset.</p>
283    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    /// <p>Metadata tags that have been applied to the dataset.</p>
288    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
289        &self.tags
290    }
291    /// <p>The unique Amazon Resource Name (ARN) for the dataset.</p>
292    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    /// <p>The unique Amazon Resource Name (ARN) for the dataset.</p>
297    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298        self.resource_arn = input;
299        self
300    }
301    /// <p>The unique Amazon Resource Name (ARN) for the dataset.</p>
302    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
303        &self.resource_arn
304    }
305    /// Consumes the builder and constructs a [`Dataset`](crate::types::Dataset).
306    /// This method will fail if any of the following fields are not set:
307    /// - [`name`](crate::types::builders::DatasetBuilder::name)
308    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}