aws_sdk_comprehend/operation/create_flywheel/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_flywheel::_create_flywheel_output::CreateFlywheelOutputBuilder;
3
4pub use crate::operation::create_flywheel::_create_flywheel_input::CreateFlywheelInputBuilder;
5
6impl crate::operation::create_flywheel::builders::CreateFlywheelInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_flywheel::CreateFlywheelOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_flywheel::CreateFlywheelError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_flywheel();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateFlywheel`.
24///
25/// <p>A flywheel is an Amazon Web Services resource that orchestrates the ongoing training of a model for custom classification or custom entity recognition. You can create a flywheel to start with an existing trained model, or Comprehend can create and train a new model.</p>
26/// <p>When you create the flywheel, Comprehend creates a data lake in your account. The data lake holds the training data and test data for all versions of the model.</p>
27/// <p>To use a flywheel with an existing trained model, you specify the active model version. Comprehend copies the model's training data and test data into the flywheel's data lake.</p>
28/// <p>To use the flywheel with a new model, you need to provide a dataset for training data (and optional test data) when you create the flywheel.</p>
29/// <p>For more information about flywheels, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/flywheels-about.html"> Flywheel overview</a> in the <i>Amazon Comprehend Developer Guide</i>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateFlywheelFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::create_flywheel::builders::CreateFlywheelInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::create_flywheel::CreateFlywheelOutput,
39        crate::operation::create_flywheel::CreateFlywheelError,
40    > for CreateFlywheelFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::create_flywheel::CreateFlywheelOutput,
48            crate::operation::create_flywheel::CreateFlywheelError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl CreateFlywheelFluentBuilder {
55    /// Creates a new `CreateFlywheelFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the CreateFlywheel as a reference.
64    pub fn as_input(&self) -> &crate::operation::create_flywheel::builders::CreateFlywheelInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::create_flywheel::CreateFlywheelOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::create_flywheel::CreateFlywheelError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::create_flywheel::CreateFlywheel::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::create_flywheel::CreateFlywheel::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::create_flywheel::CreateFlywheelOutput,
101        crate::operation::create_flywheel::CreateFlywheelError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>Name for the flywheel.</p>
116    pub fn flywheel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.flywheel_name(input.into());
118        self
119    }
120    /// <p>Name for the flywheel.</p>
121    pub fn set_flywheel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_flywheel_name(input);
123        self
124    }
125    /// <p>Name for the flywheel.</p>
126    pub fn get_flywheel_name(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_flywheel_name()
128    }
129    /// <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>
130    pub fn active_model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.active_model_arn(input.into());
132        self
133    }
134    /// <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>
135    pub fn set_active_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_active_model_arn(input);
137        self
138    }
139    /// <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>
140    pub fn get_active_model_arn(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_active_model_arn()
142    }
143    /// <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>
144    pub fn data_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.data_access_role_arn(input.into());
146        self
147    }
148    /// <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>
149    pub fn set_data_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_data_access_role_arn(input);
151        self
152    }
153    /// <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>
154    pub fn get_data_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_data_access_role_arn()
156    }
157    /// <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>
158    pub fn task_config(mut self, input: crate::types::TaskConfig) -> Self {
159        self.inner = self.inner.task_config(input);
160        self
161    }
162    /// <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>
163    pub fn set_task_config(mut self, input: ::std::option::Option<crate::types::TaskConfig>) -> Self {
164        self.inner = self.inner.set_task_config(input);
165        self
166    }
167    /// <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>
168    pub fn get_task_config(&self) -> &::std::option::Option<crate::types::TaskConfig> {
169        self.inner.get_task_config()
170    }
171    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
172    pub fn model_type(mut self, input: crate::types::ModelType) -> Self {
173        self.inner = self.inner.model_type(input);
174        self
175    }
176    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
177    pub fn set_model_type(mut self, input: ::std::option::Option<crate::types::ModelType>) -> Self {
178        self.inner = self.inner.set_model_type(input);
179        self
180    }
181    /// <p>The model type. You need to set <code>ModelType</code> if you are creating a flywheel for a new model.</p>
182    pub fn get_model_type(&self) -> &::std::option::Option<crate::types::ModelType> {
183        self.inner.get_model_type()
184    }
185    /// <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>
186    pub fn data_lake_s3_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.data_lake_s3_uri(input.into());
188        self
189    }
190    /// <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>
191    pub fn set_data_lake_s3_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.inner = self.inner.set_data_lake_s3_uri(input);
193        self
194    }
195    /// <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>
196    pub fn get_data_lake_s3_uri(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_data_lake_s3_uri()
198    }
199    /// <p>Data security configurations.</p>
200    pub fn data_security_config(mut self, input: crate::types::DataSecurityConfig) -> Self {
201        self.inner = self.inner.data_security_config(input);
202        self
203    }
204    /// <p>Data security configurations.</p>
205    pub fn set_data_security_config(mut self, input: ::std::option::Option<crate::types::DataSecurityConfig>) -> Self {
206        self.inner = self.inner.set_data_security_config(input);
207        self
208    }
209    /// <p>Data security configurations.</p>
210    pub fn get_data_security_config(&self) -> &::std::option::Option<crate::types::DataSecurityConfig> {
211        self.inner.get_data_security_config()
212    }
213    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
214    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
215        self.inner = self.inner.client_request_token(input.into());
216        self
217    }
218    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
219    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
220        self.inner = self.inner.set_client_request_token(input);
221        self
222    }
223    /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
224    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
225        self.inner.get_client_request_token()
226    }
227    ///
228    /// Appends an item to `Tags`.
229    ///
230    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
231    ///
232    /// <p>The tags to associate with this flywheel.</p>
233    pub fn tags(mut self, input: crate::types::Tag) -> Self {
234        self.inner = self.inner.tags(input);
235        self
236    }
237    /// <p>The tags to associate with this flywheel.</p>
238    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
239        self.inner = self.inner.set_tags(input);
240        self
241    }
242    /// <p>The tags to associate with this flywheel.</p>
243    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
244        self.inner.get_tags()
245    }
246}