aws_sdk_personalize/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 for the dataset.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
9 pub schema_arn: ::std::option::Option<::std::string::String>,
10 /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
11 pub dataset_group_arn: ::std::option::Option<::std::string::String>,
12 /// <p>The type of dataset.</p>
13 /// <p>One of the following (case insensitive) values:</p>
14 /// <ul>
15 /// <li>
16 /// <p>Interactions</p></li>
17 /// <li>
18 /// <p>Items</p></li>
19 /// <li>
20 /// <p>Users</p></li>
21 /// <li>
22 /// <p>Actions</p></li>
23 /// <li>
24 /// <p>Action_Interactions</p></li>
25 /// </ul>
26 pub dataset_type: ::std::option::Option<::std::string::String>,
27 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
28 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
29}
30impl CreateDatasetInput {
31 /// <p>The name for the dataset.</p>
32 pub fn name(&self) -> ::std::option::Option<&str> {
33 self.name.as_deref()
34 }
35 /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
36 pub fn schema_arn(&self) -> ::std::option::Option<&str> {
37 self.schema_arn.as_deref()
38 }
39 /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
40 pub fn dataset_group_arn(&self) -> ::std::option::Option<&str> {
41 self.dataset_group_arn.as_deref()
42 }
43 /// <p>The type of dataset.</p>
44 /// <p>One of the following (case insensitive) values:</p>
45 /// <ul>
46 /// <li>
47 /// <p>Interactions</p></li>
48 /// <li>
49 /// <p>Items</p></li>
50 /// <li>
51 /// <p>Users</p></li>
52 /// <li>
53 /// <p>Actions</p></li>
54 /// <li>
55 /// <p>Action_Interactions</p></li>
56 /// </ul>
57 pub fn dataset_type(&self) -> ::std::option::Option<&str> {
58 self.dataset_type.as_deref()
59 }
60 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
61 ///
62 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
63 pub fn tags(&self) -> &[crate::types::Tag] {
64 self.tags.as_deref().unwrap_or_default()
65 }
66}
67impl CreateDatasetInput {
68 /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
69 pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
70 crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
71 }
72}
73
74/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct CreateDatasetInputBuilder {
78 pub(crate) name: ::std::option::Option<::std::string::String>,
79 pub(crate) schema_arn: ::std::option::Option<::std::string::String>,
80 pub(crate) dataset_group_arn: ::std::option::Option<::std::string::String>,
81 pub(crate) dataset_type: ::std::option::Option<::std::string::String>,
82 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
83}
84impl CreateDatasetInputBuilder {
85 /// <p>The name for the dataset.</p>
86 /// This field is required.
87 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88 self.name = ::std::option::Option::Some(input.into());
89 self
90 }
91 /// <p>The name for the dataset.</p>
92 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93 self.name = input;
94 self
95 }
96 /// <p>The name for the dataset.</p>
97 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
98 &self.name
99 }
100 /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
101 /// This field is required.
102 pub fn schema_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.schema_arn = ::std::option::Option::Some(input.into());
104 self
105 }
106 /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
107 pub fn set_schema_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.schema_arn = input;
109 self
110 }
111 /// <p>The ARN of the schema to associate with the dataset. The schema defines the dataset fields.</p>
112 pub fn get_schema_arn(&self) -> &::std::option::Option<::std::string::String> {
113 &self.schema_arn
114 }
115 /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
116 /// This field is required.
117 pub fn dataset_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.dataset_group_arn = ::std::option::Option::Some(input.into());
119 self
120 }
121 /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
122 pub fn set_dataset_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.dataset_group_arn = input;
124 self
125 }
126 /// <p>The Amazon Resource Name (ARN) of the dataset group to add the dataset to.</p>
127 pub fn get_dataset_group_arn(&self) -> &::std::option::Option<::std::string::String> {
128 &self.dataset_group_arn
129 }
130 /// <p>The type of dataset.</p>
131 /// <p>One of the following (case insensitive) values:</p>
132 /// <ul>
133 /// <li>
134 /// <p>Interactions</p></li>
135 /// <li>
136 /// <p>Items</p></li>
137 /// <li>
138 /// <p>Users</p></li>
139 /// <li>
140 /// <p>Actions</p></li>
141 /// <li>
142 /// <p>Action_Interactions</p></li>
143 /// </ul>
144 /// This field is required.
145 pub fn dataset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.dataset_type = ::std::option::Option::Some(input.into());
147 self
148 }
149 /// <p>The type of dataset.</p>
150 /// <p>One of the following (case insensitive) values:</p>
151 /// <ul>
152 /// <li>
153 /// <p>Interactions</p></li>
154 /// <li>
155 /// <p>Items</p></li>
156 /// <li>
157 /// <p>Users</p></li>
158 /// <li>
159 /// <p>Actions</p></li>
160 /// <li>
161 /// <p>Action_Interactions</p></li>
162 /// </ul>
163 pub fn set_dataset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.dataset_type = input;
165 self
166 }
167 /// <p>The type of dataset.</p>
168 /// <p>One of the following (case insensitive) values:</p>
169 /// <ul>
170 /// <li>
171 /// <p>Interactions</p></li>
172 /// <li>
173 /// <p>Items</p></li>
174 /// <li>
175 /// <p>Users</p></li>
176 /// <li>
177 /// <p>Actions</p></li>
178 /// <li>
179 /// <p>Action_Interactions</p></li>
180 /// </ul>
181 pub fn get_dataset_type(&self) -> &::std::option::Option<::std::string::String> {
182 &self.dataset_type
183 }
184 /// Appends an item to `tags`.
185 ///
186 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
187 ///
188 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
189 pub fn tags(mut self, input: crate::types::Tag) -> Self {
190 let mut v = self.tags.unwrap_or_default();
191 v.push(input);
192 self.tags = ::std::option::Option::Some(v);
193 self
194 }
195 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
196 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
197 self.tags = input;
198 self
199 }
200 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the dataset.</p>
201 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
202 &self.tags
203 }
204 /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
205 pub fn build(
206 self,
207 ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
208 ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
209 name: self.name,
210 schema_arn: self.schema_arn,
211 dataset_group_arn: self.dataset_group_arn,
212 dataset_type: self.dataset_type,
213 tags: self.tags,
214 })
215 }
216}