aws_sdk_comprehend/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 Amazon Resource Number (ARN) of the flywheel of the flywheel to receive the data.</p>
7    pub flywheel_arn: ::std::option::Option<::std::string::String>,
8    /// <p>Name of the dataset.</p>
9    pub dataset_name: ::std::option::Option<::std::string::String>,
10    /// <p>The dataset type. You can specify that the data in a dataset is for training the model or for testing the model.</p>
11    pub dataset_type: ::std::option::Option<crate::types::DatasetType>,
12    /// <p>Description of the dataset.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>Information about the input data configuration. The type of input data varies based on the format of the input and whether the data is for a classifier model or an entity recognition model.</p>
15    pub input_data_config: ::std::option::Option<crate::types::DatasetInputDataConfig>,
16    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
17    pub client_request_token: ::std::option::Option<::std::string::String>,
18    /// <p>Tags for the dataset.</p>
19    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
20}
21impl CreateDatasetInput {
22    /// <p>The Amazon Resource Number (ARN) of the flywheel of the flywheel to receive the data.</p>
23    pub fn flywheel_arn(&self) -> ::std::option::Option<&str> {
24        self.flywheel_arn.as_deref()
25    }
26    /// <p>Name of the dataset.</p>
27    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
28        self.dataset_name.as_deref()
29    }
30    /// <p>The dataset type. You can specify that the data in a dataset is for training the model or for testing the model.</p>
31    pub fn dataset_type(&self) -> ::std::option::Option<&crate::types::DatasetType> {
32        self.dataset_type.as_ref()
33    }
34    /// <p>Description of the dataset.</p>
35    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    /// <p>Information about the input data configuration. The type of input data varies based on the format of the input and whether the data is for a classifier model or an entity recognition model.</p>
39    pub fn input_data_config(&self) -> ::std::option::Option<&crate::types::DatasetInputDataConfig> {
40        self.input_data_config.as_ref()
41    }
42    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
43    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
44        self.client_request_token.as_deref()
45    }
46    /// <p>Tags for the dataset.</p>
47    ///
48    /// 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()`.
49    pub fn tags(&self) -> &[crate::types::Tag] {
50        self.tags.as_deref().unwrap_or_default()
51    }
52}
53impl CreateDatasetInput {
54    /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
55    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
56        crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateDatasetInputBuilder {
64    pub(crate) flywheel_arn: ::std::option::Option<::std::string::String>,
65    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
66    pub(crate) dataset_type: ::std::option::Option<crate::types::DatasetType>,
67    pub(crate) description: ::std::option::Option<::std::string::String>,
68    pub(crate) input_data_config: ::std::option::Option<crate::types::DatasetInputDataConfig>,
69    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
70    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
71}
72impl CreateDatasetInputBuilder {
73    /// <p>The Amazon Resource Number (ARN) of the flywheel of the flywheel to receive the data.</p>
74    /// This field is required.
75    pub fn flywheel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.flywheel_arn = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The Amazon Resource Number (ARN) of the flywheel of the flywheel to receive the data.</p>
80    pub fn set_flywheel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.flywheel_arn = input;
82        self
83    }
84    /// <p>The Amazon Resource Number (ARN) of the flywheel of the flywheel to receive the data.</p>
85    pub fn get_flywheel_arn(&self) -> &::std::option::Option<::std::string::String> {
86        &self.flywheel_arn
87    }
88    /// <p>Name of the dataset.</p>
89    /// This field is required.
90    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.dataset_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>Name of the dataset.</p>
95    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.dataset_name = input;
97        self
98    }
99    /// <p>Name of the dataset.</p>
100    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.dataset_name
102    }
103    /// <p>The dataset type. You can specify that the data in a dataset is for training the model or for testing the model.</p>
104    pub fn dataset_type(mut self, input: crate::types::DatasetType) -> Self {
105        self.dataset_type = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The dataset type. You can specify that the data in a dataset is for training the model or for testing the model.</p>
109    pub fn set_dataset_type(mut self, input: ::std::option::Option<crate::types::DatasetType>) -> Self {
110        self.dataset_type = input;
111        self
112    }
113    /// <p>The dataset type. You can specify that the data in a dataset is for training the model or for testing the model.</p>
114    pub fn get_dataset_type(&self) -> &::std::option::Option<crate::types::DatasetType> {
115        &self.dataset_type
116    }
117    /// <p>Description of the dataset.</p>
118    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.description = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>Description of the dataset.</p>
123    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.description = input;
125        self
126    }
127    /// <p>Description of the dataset.</p>
128    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
129        &self.description
130    }
131    /// <p>Information about the input data configuration. The type of input data varies based on the format of the input and whether the data is for a classifier model or an entity recognition model.</p>
132    /// This field is required.
133    pub fn input_data_config(mut self, input: crate::types::DatasetInputDataConfig) -> Self {
134        self.input_data_config = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>Information about the input data configuration. The type of input data varies based on the format of the input and whether the data is for a classifier model or an entity recognition model.</p>
138    pub fn set_input_data_config(mut self, input: ::std::option::Option<crate::types::DatasetInputDataConfig>) -> Self {
139        self.input_data_config = input;
140        self
141    }
142    /// <p>Information about the input data configuration. The type of input data varies based on the format of the input and whether the data is for a classifier model or an entity recognition model.</p>
143    pub fn get_input_data_config(&self) -> &::std::option::Option<crate::types::DatasetInputDataConfig> {
144        &self.input_data_config
145    }
146    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
147    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.client_request_token = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
152    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.client_request_token = input;
154        self
155    }
156    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
157    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
158        &self.client_request_token
159    }
160    /// Appends an item to `tags`.
161    ///
162    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
163    ///
164    /// <p>Tags for the dataset.</p>
165    pub fn tags(mut self, input: crate::types::Tag) -> Self {
166        let mut v = self.tags.unwrap_or_default();
167        v.push(input);
168        self.tags = ::std::option::Option::Some(v);
169        self
170    }
171    /// <p>Tags for the dataset.</p>
172    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
173        self.tags = input;
174        self
175    }
176    /// <p>Tags for the dataset.</p>
177    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
178        &self.tags
179    }
180    /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
181    pub fn build(
182        self,
183    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
184        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
185            flywheel_arn: self.flywheel_arn,
186            dataset_name: self.dataset_name,
187            dataset_type: self.dataset_type,
188            description: self.description,
189            input_data_config: self.input_data_config,
190            client_request_token: self.client_request_token,
191            tags: self.tags,
192        })
193    }
194}