aws_sdk_databrew/operation/create_dataset/
_create_dataset_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDatasetInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub format: ::std::option::Option<crate::types::InputFormat>,
10 pub format_options: ::std::option::Option<crate::types::FormatOptions>,
12 pub input: ::std::option::Option<crate::types::Input>,
14 pub path_options: ::std::option::Option<crate::types::PathOptions>,
16 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateDatasetInput {
20 pub fn name(&self) -> ::std::option::Option<&str> {
22 self.name.as_deref()
23 }
24 pub fn format(&self) -> ::std::option::Option<&crate::types::InputFormat> {
26 self.format.as_ref()
27 }
28 pub fn format_options(&self) -> ::std::option::Option<&crate::types::FormatOptions> {
30 self.format_options.as_ref()
31 }
32 pub fn input(&self) -> ::std::option::Option<&crate::types::Input> {
34 self.input.as_ref()
35 }
36 pub fn path_options(&self) -> ::std::option::Option<&crate::types::PathOptions> {
38 self.path_options.as_ref()
39 }
40 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 pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
48 crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
49 }
50}
51
52#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.name = input;
73 self
74 }
75 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
77 &self.name
78 }
79 pub fn format(mut self, input: crate::types::InputFormat) -> Self {
81 self.format = ::std::option::Option::Some(input);
82 self
83 }
84 pub fn set_format(mut self, input: ::std::option::Option<crate::types::InputFormat>) -> Self {
86 self.format = input;
87 self
88 }
89 pub fn get_format(&self) -> &::std::option::Option<crate::types::InputFormat> {
91 &self.format
92 }
93 pub fn format_options(mut self, input: crate::types::FormatOptions) -> Self {
95 self.format_options = ::std::option::Option::Some(input);
96 self
97 }
98 pub fn set_format_options(mut self, input: ::std::option::Option<crate::types::FormatOptions>) -> Self {
100 self.format_options = input;
101 self
102 }
103 pub fn get_format_options(&self) -> &::std::option::Option<crate::types::FormatOptions> {
105 &self.format_options
106 }
107 pub fn input(mut self, input: crate::types::Input) -> Self {
110 self.input = ::std::option::Option::Some(input);
111 self
112 }
113 pub fn set_input(mut self, input: ::std::option::Option<crate::types::Input>) -> Self {
115 self.input = input;
116 self
117 }
118 pub fn get_input(&self) -> &::std::option::Option<crate::types::Input> {
120 &self.input
121 }
122 pub fn path_options(mut self, input: crate::types::PathOptions) -> Self {
124 self.path_options = ::std::option::Option::Some(input);
125 self
126 }
127 pub fn set_path_options(mut self, input: ::std::option::Option<crate::types::PathOptions>) -> Self {
129 self.path_options = input;
130 self
131 }
132 pub fn get_path_options(&self) -> &::std::option::Option<crate::types::PathOptions> {
134 &self.path_options
135 }
136 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
154 &self.tags
155 }
156 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}