aws_sdk_databrew/operation/create_dataset/
_create_dataset_input.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 CreateDatasetInput {
6    /// <p>The name of the dataset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
9    pub format: ::std::option::Option<crate::types::InputFormat>,
10    /// <p>Represents a set of options that define the structure of either comma-separated value (CSV), Excel, or JSON input.</p>
11    pub format_options: ::std::option::Option<crate::types::FormatOptions>,
12    /// <p>Represents information on how DataBrew can find data, in either the Glue Data Catalog or Amazon S3.</p>
13    pub input: ::std::option::Option<crate::types::Input>,
14    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
15    pub path_options: ::std::option::Option<crate::types::PathOptions>,
16    /// <p>Metadata tags to apply to this dataset.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateDatasetInput {
20    /// <p>The name of the dataset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
25    pub fn format(&self) -> ::std::option::Option<&crate::types::InputFormat> {
26        self.format.as_ref()
27    }
28    /// <p>Represents a set of options that define the structure of either comma-separated value (CSV), Excel, or JSON input.</p>
29    pub fn format_options(&self) -> ::std::option::Option<&crate::types::FormatOptions> {
30        self.format_options.as_ref()
31    }
32    /// <p>Represents information on how DataBrew can find data, in either the Glue Data Catalog or Amazon S3.</p>
33    pub fn input(&self) -> ::std::option::Option<&crate::types::Input> {
34        self.input.as_ref()
35    }
36    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
37    pub fn path_options(&self) -> ::std::option::Option<&crate::types::PathOptions> {
38        self.path_options.as_ref()
39    }
40    /// <p>Metadata tags to apply to this dataset.</p>
41    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
42        self.tags.as_ref()
43    }
44}
45impl CreateDatasetInput {
46    /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
47    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
48        crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateDatasetInputBuilder {
56    pub(crate) name: ::std::option::Option<::std::string::String>,
57    pub(crate) format: ::std::option::Option<crate::types::InputFormat>,
58    pub(crate) format_options: ::std::option::Option<crate::types::FormatOptions>,
59    pub(crate) input: ::std::option::Option<crate::types::Input>,
60    pub(crate) path_options: ::std::option::Option<crate::types::PathOptions>,
61    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
62}
63impl CreateDatasetInputBuilder {
64    /// <p>The name of the dataset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
65    /// This field is required.
66    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The name of the dataset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
71    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.name = input;
73        self
74    }
75    /// <p>The name of the dataset to be created. Valid characters are alphanumeric (A-Z, a-z, 0-9), hyphen (-), period (.), and space.</p>
76    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.name
78    }
79    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
80    pub fn format(mut self, input: crate::types::InputFormat) -> Self {
81        self.format = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
85    pub fn set_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
86        self.format = input;
87        self
88    }
89    /// <p>The file format of a dataset that is created from an Amazon S3 file or folder.</p>
90    pub fn get_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
91        &self.format
92    }
93    /// <p>Represents a set of options that define the structure of either comma-separated value (CSV), Excel, or JSON input.</p>
94    pub fn format_options(mut self, input: crate::types::FormatOptions) -> Self {
95        self.format_options = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>Represents a set of options that define the structure of either comma-separated value (CSV), Excel, or JSON input.</p>
99    pub fn set_format_options(mut self, input: ::std::option::Option<crate::types::FormatOptions>) -> Self {
100        self.format_options = input;
101        self
102    }
103    /// <p>Represents a set of options that define the structure of either comma-separated value (CSV), Excel, or JSON input.</p>
104    pub fn get_format_options(&self) -> &::std::option::Option<crate::types::FormatOptions> {
105        &self.format_options
106    }
107    /// <p>Represents information on how DataBrew can find data, in either the Glue Data Catalog or Amazon S3.</p>
108    /// This field is required.
109    pub fn input(mut self, input: crate::types::Input) -> Self {
110        self.input = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>Represents information on how DataBrew can find data, in either the Glue Data Catalog or Amazon S3.</p>
114    pub fn set_input(mut self, input: ::std::option::Option<crate::types::Input>) -> Self {
115        self.input = input;
116        self
117    }
118    /// <p>Represents information on how DataBrew can find data, in either the Glue Data Catalog or Amazon S3.</p>
119    pub fn get_input(&self) -> &::std::option::Option<crate::types::Input> {
120        &self.input
121    }
122    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
123    pub fn path_options(mut self, input: crate::types::PathOptions) -> Self {
124        self.path_options = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
128    pub fn set_path_options(mut self, input: ::std::option::Option<crate::types::PathOptions>) -> Self {
129        self.path_options = input;
130        self
131    }
132    /// <p>A set of options that defines how DataBrew interprets an Amazon S3 path of the dataset.</p>
133    pub fn get_path_options(&self) -> &::std::option::Option<crate::types::PathOptions> {
134        &self.path_options
135    }
136    /// Adds a key-value pair to `tags`.
137    ///
138    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
139    ///
140    /// <p>Metadata tags to apply to this dataset.</p>
141    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
142        let mut hash_map = self.tags.unwrap_or_default();
143        hash_map.insert(k.into(), v.into());
144        self.tags = ::std::option::Option::Some(hash_map);
145        self
146    }
147    /// <p>Metadata tags to apply to this dataset.</p>
148    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
149        self.tags = input;
150        self
151    }
152    /// <p>Metadata tags to apply to this dataset.</p>
153    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
154        &self.tags
155    }
156    /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
157    pub fn build(
158        self,
159    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
160        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
161            name: self.name,
162            format: self.format,
163            format_options: self.format_options,
164            input: self.input,
165            path_options: self.path_options,
166            tags: self.tags,
167        })
168    }
169}