aws_sdk_comprehend/operation/create_flywheel/
_create_flywheel_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 CreateFlywheelInput {
6    /// <p>Name for the flywheel.</p>
7    pub flywheel_name: ::std::option::Option<::std::string::String>,
8    /// <p>To associate an existing model with the flywheel, specify the Amazon Resource Number (ARN) of the model version. Do not set <code>TaskConfig</code> or <code>ModelType</code> if you specify an <code>ActiveModelArn</code>.</p>
9    pub active_model_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend the permissions required to access the flywheel data in the data lake.</p>
11    pub data_access_role_arn: ::std::option::Option<::std::string::String>,
12    /// <p>Configuration about the model associated with the flywheel. You need to set <code>TaskConfig</code> if you are creating a flywheel for a new model.</p>
13    pub task_config: ::std::option::Option<crate::types::TaskConfig>,
14    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
15    pub model_type: ::std::option::Option<crate::types::ModelType>,
16    /// <p>Enter the S3 location for the data lake. You can specify a new S3 bucket or a new folder of an existing S3 bucket. The flywheel creates the data lake at this location.</p>
17    pub data_lake_s3_uri: ::std::option::Option<::std::string::String>,
18    /// <p>Data security configurations.</p>
19    pub data_security_config: ::std::option::Option<crate::types::DataSecurityConfig>,
20    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
21    pub client_request_token: ::std::option::Option<::std::string::String>,
22    /// <p>The tags to associate with this flywheel.</p>
23    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
24}
25impl CreateFlywheelInput {
26    /// <p>Name for the flywheel.</p>
27    pub fn flywheel_name(&self) -> ::std::option::Option<&str> {
28        self.flywheel_name.as_deref()
29    }
30    /// <p>To associate an existing model with the flywheel, specify the Amazon Resource Number (ARN) of the model version. Do not set <code>TaskConfig</code> or <code>ModelType</code> if you specify an <code>ActiveModelArn</code>.</p>
31    pub fn active_model_arn(&self) -> ::std::option::Option<&str> {
32        self.active_model_arn.as_deref()
33    }
34    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend the permissions required to access the flywheel data in the data lake.</p>
35    pub fn data_access_role_arn(&self) -> ::std::option::Option<&str> {
36        self.data_access_role_arn.as_deref()
37    }
38    /// <p>Configuration about the model associated with the flywheel. You need to set <code>TaskConfig</code> if you are creating a flywheel for a new model.</p>
39    pub fn task_config(&self) -> ::std::option::Option<&crate::types::TaskConfig> {
40        self.task_config.as_ref()
41    }
42    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
43    pub fn model_type(&self) -> ::std::option::Option<&crate::types::ModelType> {
44        self.model_type.as_ref()
45    }
46    /// <p>Enter the S3 location for the data lake. You can specify a new S3 bucket or a new folder of an existing S3 bucket. The flywheel creates the data lake at this location.</p>
47    pub fn data_lake_s3_uri(&self) -> ::std::option::Option<&str> {
48        self.data_lake_s3_uri.as_deref()
49    }
50    /// <p>Data security configurations.</p>
51    pub fn data_security_config(&self) -> ::std::option::Option<&crate::types::DataSecurityConfig> {
52        self.data_security_config.as_ref()
53    }
54    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
55    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
56        self.client_request_token.as_deref()
57    }
58    /// <p>The tags to associate with this flywheel.</p>
59    ///
60    /// 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()`.
61    pub fn tags(&self) -> &[crate::types::Tag] {
62        self.tags.as_deref().unwrap_or_default()
63    }
64}
65impl CreateFlywheelInput {
66    /// Creates a new builder-style object to manufacture [`CreateFlywheelInput`](crate::operation::create_flywheel::CreateFlywheelInput).
67    pub fn builder() -> crate::operation::create_flywheel::builders::CreateFlywheelInputBuilder {
68        crate::operation::create_flywheel::builders::CreateFlywheelInputBuilder::default()
69    }
70}
71
72/// A builder for [`CreateFlywheelInput`](crate::operation::create_flywheel::CreateFlywheelInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct CreateFlywheelInputBuilder {
76    pub(crate) flywheel_name: ::std::option::Option<::std::string::String>,
77    pub(crate) active_model_arn: ::std::option::Option<::std::string::String>,
78    pub(crate) data_access_role_arn: ::std::option::Option<::std::string::String>,
79    pub(crate) task_config: ::std::option::Option<crate::types::TaskConfig>,
80    pub(crate) model_type: ::std::option::Option<crate::types::ModelType>,
81    pub(crate) data_lake_s3_uri: ::std::option::Option<::std::string::String>,
82    pub(crate) data_security_config: ::std::option::Option<crate::types::DataSecurityConfig>,
83    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
84    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
85}
86impl CreateFlywheelInputBuilder {
87    /// <p>Name for the flywheel.</p>
88    /// This field is required.
89    pub fn flywheel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.flywheel_name = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>Name for the flywheel.</p>
94    pub fn set_flywheel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.flywheel_name = input;
96        self
97    }
98    /// <p>Name for the flywheel.</p>
99    pub fn get_flywheel_name(&self) -> &::std::option::Option<::std::string::String> {
100        &self.flywheel_name
101    }
102    /// <p>To associate an existing model with the flywheel, specify the Amazon Resource Number (ARN) of the model version. Do not set <code>TaskConfig</code> or <code>ModelType</code> if you specify an <code>ActiveModelArn</code>.</p>
103    pub fn active_model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.active_model_arn = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>To associate an existing model with the flywheel, specify the Amazon Resource Number (ARN) of the model version. Do not set <code>TaskConfig</code> or <code>ModelType</code> if you specify an <code>ActiveModelArn</code>.</p>
108    pub fn set_active_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.active_model_arn = input;
110        self
111    }
112    /// <p>To associate an existing model with the flywheel, specify the Amazon Resource Number (ARN) of the model version. Do not set <code>TaskConfig</code> or <code>ModelType</code> if you specify an <code>ActiveModelArn</code>.</p>
113    pub fn get_active_model_arn(&self) -> &::std::option::Option<::std::string::String> {
114        &self.active_model_arn
115    }
116    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend the permissions required to access the flywheel data in the data lake.</p>
117    /// This field is required.
118    pub fn data_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.data_access_role_arn = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend the permissions required to access the flywheel data in the data lake.</p>
123    pub fn set_data_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.data_access_role_arn = input;
125        self
126    }
127    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend the permissions required to access the flywheel data in the data lake.</p>
128    pub fn get_data_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
129        &self.data_access_role_arn
130    }
131    /// <p>Configuration about the model associated with the flywheel. You need to set <code>TaskConfig</code> if you are creating a flywheel for a new model.</p>
132    pub fn task_config(mut self, input: crate::types::TaskConfig) -> Self {
133        self.task_config = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>Configuration about the model associated with the flywheel. You need to set <code>TaskConfig</code> if you are creating a flywheel for a new model.</p>
137    pub fn set_task_config(mut self, input: ::std::option::Option<crate::types::TaskConfig>) -> Self {
138        self.task_config = input;
139        self
140    }
141    /// <p>Configuration about the model associated with the flywheel. You need to set <code>TaskConfig</code> if you are creating a flywheel for a new model.</p>
142    pub fn get_task_config(&self) -> &::std::option::Option<crate::types::TaskConfig> {
143        &self.task_config
144    }
145    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
146    pub fn model_type(mut self, input: crate::types::ModelType) -> Self {
147        self.model_type = ::std::option::Option::Some(input);
148        self
149    }
150    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
151    pub fn set_model_type(mut self, input: ::std::option::Option<crate::types::ModelType>) -> Self {
152        self.model_type = input;
153        self
154    }
155    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
156    pub fn get_model_type(&self) -> &::std::option::Option<crate::types::ModelType> {
157        &self.model_type
158    }
159    /// <p>Enter the S3 location for the data lake. You can specify a new S3 bucket or a new folder of an existing S3 bucket. The flywheel creates the data lake at this location.</p>
160    /// This field is required.
161    pub fn data_lake_s3_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.data_lake_s3_uri = ::std::option::Option::Some(input.into());
163        self
164    }
165    /// <p>Enter the S3 location for the data lake. You can specify a new S3 bucket or a new folder of an existing S3 bucket. The flywheel creates the data lake at this location.</p>
166    pub fn set_data_lake_s3_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.data_lake_s3_uri = input;
168        self
169    }
170    /// <p>Enter the S3 location for the data lake. You can specify a new S3 bucket or a new folder of an existing S3 bucket. The flywheel creates the data lake at this location.</p>
171    pub fn get_data_lake_s3_uri(&self) -> &::std::option::Option<::std::string::String> {
172        &self.data_lake_s3_uri
173    }
174    /// <p>Data security configurations.</p>
175    pub fn data_security_config(mut self, input: crate::types::DataSecurityConfig) -> Self {
176        self.data_security_config = ::std::option::Option::Some(input);
177        self
178    }
179    /// <p>Data security configurations.</p>
180    pub fn set_data_security_config(mut self, input: ::std::option::Option<crate::types::DataSecurityConfig>) -> Self {
181        self.data_security_config = input;
182        self
183    }
184    /// <p>Data security configurations.</p>
185    pub fn get_data_security_config(&self) -> &::std::option::Option<crate::types::DataSecurityConfig> {
186        &self.data_security_config
187    }
188    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
189    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.client_request_token = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
194    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.client_request_token = input;
196        self
197    }
198    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
199    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
200        &self.client_request_token
201    }
202    /// Appends an item to `tags`.
203    ///
204    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
205    ///
206    /// <p>The tags to associate with this flywheel.</p>
207    pub fn tags(mut self, input: crate::types::Tag) -> Self {
208        let mut v = self.tags.unwrap_or_default();
209        v.push(input);
210        self.tags = ::std::option::Option::Some(v);
211        self
212    }
213    /// <p>The tags to associate with this flywheel.</p>
214    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
215        self.tags = input;
216        self
217    }
218    /// <p>The tags to associate with this flywheel.</p>
219    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
220        &self.tags
221    }
222    /// Consumes the builder and constructs a [`CreateFlywheelInput`](crate::operation::create_flywheel::CreateFlywheelInput).
223    pub fn build(
224        self,
225    ) -> ::std::result::Result<crate::operation::create_flywheel::CreateFlywheelInput, ::aws_smithy_types::error::operation::BuildError> {
226        ::std::result::Result::Ok(crate::operation::create_flywheel::CreateFlywheelInput {
227            flywheel_name: self.flywheel_name,
228            active_model_arn: self.active_model_arn,
229            data_access_role_arn: self.data_access_role_arn,
230            task_config: self.task_config,
231            model_type: self.model_type,
232            data_lake_s3_uri: self.data_lake_s3_uri,
233            data_security_config: self.data_security_config,
234            client_request_token: self.client_request_token,
235            tags: self.tags,
236        })
237    }
238}