aws_sdk_comprehend/operation/start_entities_detection_job/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_entities_detection_job::_start_entities_detection_job_output::StartEntitiesDetectionJobOutputBuilder;
3
4pub use crate::operation::start_entities_detection_job::_start_entities_detection_job_input::StartEntitiesDetectionJobInputBuilder;
5
6impl crate::operation::start_entities_detection_job::builders::StartEntitiesDetectionJobInputBuilder {
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::start_entities_detection_job::StartEntitiesDetectionJobOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_entities_detection_job();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartEntitiesDetectionJob`.
24///
25/// <p>Starts an asynchronous entity detection job for a collection of documents. Use the operation to track the status of a job.</p>
26/// <p>This API can be used for either standard entity detection or custom entity recognition. In order to be used for custom entity recognition, the optional <code>EntityRecognizerArn</code> must be used in order to provide access to the recognizer being used to detect the custom entity.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct StartEntitiesDetectionJobFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::start_entities_detection_job::builders::StartEntitiesDetectionJobInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobOutput,
36 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobError,
37 > for StartEntitiesDetectionJobFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobOutput,
45 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl StartEntitiesDetectionJobFluentBuilder {
52 /// Creates a new `StartEntitiesDetectionJobFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the StartEntitiesDetectionJob as a reference.
61 pub fn as_input(&self) -> &crate::operation::start_entities_detection_job::builders::StartEntitiesDetectionJobInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::start_entities_detection_job::StartEntitiesDetectionJob::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::start_entities_detection_job::StartEntitiesDetectionJob::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobOutput,
98 crate::operation::start_entities_detection_job::StartEntitiesDetectionJobError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>Specifies the format and location of the input data for the job.</p>
113 pub fn input_data_config(mut self, input: crate::types::InputDataConfig) -> Self {
114 self.inner = self.inner.input_data_config(input);
115 self
116 }
117 /// <p>Specifies the format and location of the input data for the job.</p>
118 pub fn set_input_data_config(mut self, input: ::std::option::Option<crate::types::InputDataConfig>) -> Self {
119 self.inner = self.inner.set_input_data_config(input);
120 self
121 }
122 /// <p>Specifies the format and location of the input data for the job.</p>
123 pub fn get_input_data_config(&self) -> &::std::option::Option<crate::types::InputDataConfig> {
124 self.inner.get_input_data_config()
125 }
126 /// <p>Specifies where to send the output files.</p>
127 pub fn output_data_config(mut self, input: crate::types::OutputDataConfig) -> Self {
128 self.inner = self.inner.output_data_config(input);
129 self
130 }
131 /// <p>Specifies where to send the output files.</p>
132 pub fn set_output_data_config(mut self, input: ::std::option::Option<crate::types::OutputDataConfig>) -> Self {
133 self.inner = self.inner.set_output_data_config(input);
134 self
135 }
136 /// <p>Specifies where to send the output files.</p>
137 pub fn get_output_data_config(&self) -> &::std::option::Option<crate::types::OutputDataConfig> {
138 self.inner.get_output_data_config()
139 }
140 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data. For more information, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/security_iam_id-based-policy-examples.html#auth-role-permissions">Role-based permissions</a>.</p>
141 pub fn data_access_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.data_access_role_arn(input.into());
143 self
144 }
145 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data. For more information, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/security_iam_id-based-policy-examples.html#auth-role-permissions">Role-based permissions</a>.</p>
146 pub fn set_data_access_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.inner = self.inner.set_data_access_role_arn(input);
148 self
149 }
150 /// <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data. For more information, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/security_iam_id-based-policy-examples.html#auth-role-permissions">Role-based permissions</a>.</p>
151 pub fn get_data_access_role_arn(&self) -> &::std::option::Option<::std::string::String> {
152 self.inner.get_data_access_role_arn()
153 }
154 /// <p>The identifier of the job.</p>
155 pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.job_name(input.into());
157 self
158 }
159 /// <p>The identifier of the job.</p>
160 pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.inner = self.inner.set_job_name(input);
162 self
163 }
164 /// <p>The identifier of the job.</p>
165 pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
166 self.inner.get_job_name()
167 }
168 /// <p>The Amazon Resource Name (ARN) that identifies the specific entity recognizer to be used by the <code>StartEntitiesDetectionJob</code>. This ARN is optional and is only used for a custom entity recognition job.</p>
169 pub fn entity_recognizer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170 self.inner = self.inner.entity_recognizer_arn(input.into());
171 self
172 }
173 /// <p>The Amazon Resource Name (ARN) that identifies the specific entity recognizer to be used by the <code>StartEntitiesDetectionJob</code>. This ARN is optional and is only used for a custom entity recognition job.</p>
174 pub fn set_entity_recognizer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175 self.inner = self.inner.set_entity_recognizer_arn(input);
176 self
177 }
178 /// <p>The Amazon Resource Name (ARN) that identifies the specific entity recognizer to be used by the <code>StartEntitiesDetectionJob</code>. This ARN is optional and is only used for a custom entity recognition job.</p>
179 pub fn get_entity_recognizer_arn(&self) -> &::std::option::Option<::std::string::String> {
180 self.inner.get_entity_recognizer_arn()
181 }
182 /// <p>The language of the input documents. All documents must be in the same language. You can specify any of the languages supported by Amazon Comprehend. If custom entities recognition is used, this parameter is ignored and the language used for training the model is used instead.</p>
183 pub fn language_code(mut self, input: crate::types::LanguageCode) -> Self {
184 self.inner = self.inner.language_code(input);
185 self
186 }
187 /// <p>The language of the input documents. All documents must be in the same language. You can specify any of the languages supported by Amazon Comprehend. If custom entities recognition is used, this parameter is ignored and the language used for training the model is used instead.</p>
188 pub fn set_language_code(mut self, input: ::std::option::Option<crate::types::LanguageCode>) -> Self {
189 self.inner = self.inner.set_language_code(input);
190 self
191 }
192 /// <p>The language of the input documents. All documents must be in the same language. You can specify any of the languages supported by Amazon Comprehend. If custom entities recognition is used, this parameter is ignored and the language used for training the model is used instead.</p>
193 pub fn get_language_code(&self) -> &::std::option::Option<crate::types::LanguageCode> {
194 self.inner.get_language_code()
195 }
196 /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
197 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198 self.inner = self.inner.client_request_token(input.into());
199 self
200 }
201 /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
202 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.inner = self.inner.set_client_request_token(input);
204 self
205 }
206 /// <p>A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.</p>
207 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
208 self.inner.get_client_request_token()
209 }
210 /// <p>ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats:</p>
211 /// <ul>
212 /// <li>
213 /// <p>KMS Key ID: <code>"1234abcd-12ab-34cd-56ef-1234567890ab"</code></p></li>
214 /// <li>
215 /// <p>Amazon Resource Name (ARN) of a KMS Key: <code>"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"</code></p></li>
216 /// </ul>
217 pub fn volume_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.inner = self.inner.volume_kms_key_id(input.into());
219 self
220 }
221 /// <p>ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats:</p>
222 /// <ul>
223 /// <li>
224 /// <p>KMS Key ID: <code>"1234abcd-12ab-34cd-56ef-1234567890ab"</code></p></li>
225 /// <li>
226 /// <p>Amazon Resource Name (ARN) of a KMS Key: <code>"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"</code></p></li>
227 /// </ul>
228 pub fn set_volume_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229 self.inner = self.inner.set_volume_kms_key_id(input);
230 self
231 }
232 /// <p>ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats:</p>
233 /// <ul>
234 /// <li>
235 /// <p>KMS Key ID: <code>"1234abcd-12ab-34cd-56ef-1234567890ab"</code></p></li>
236 /// <li>
237 /// <p>Amazon Resource Name (ARN) of a KMS Key: <code>"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"</code></p></li>
238 /// </ul>
239 pub fn get_volume_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
240 self.inner.get_volume_kms_key_id()
241 }
242 /// <p>Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your entity detection job. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">Amazon VPC</a>.</p>
243 pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
244 self.inner = self.inner.vpc_config(input);
245 self
246 }
247 /// <p>Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your entity detection job. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">Amazon VPC</a>.</p>
248 pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
249 self.inner = self.inner.set_vpc_config(input);
250 self
251 }
252 /// <p>Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your entity detection job. For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">Amazon VPC</a>.</p>
253 pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
254 self.inner.get_vpc_config()
255 }
256 ///
257 /// Appends an item to `Tags`.
258 ///
259 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
260 ///
261 /// <p>Tags to associate with the entities detection job. A tag is a key-value pair that adds metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.</p>
262 pub fn tags(mut self, input: crate::types::Tag) -> Self {
263 self.inner = self.inner.tags(input);
264 self
265 }
266 /// <p>Tags to associate with the entities detection job. A tag is a key-value pair that adds metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.</p>
267 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
268 self.inner = self.inner.set_tags(input);
269 self
270 }
271 /// <p>Tags to associate with the entities detection job. A tag is a key-value pair that adds metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.</p>
272 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
273 self.inner.get_tags()
274 }
275 /// <p>The Amazon Resource Number (ARN) of the flywheel associated with the model to use.</p>
276 pub fn flywheel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
277 self.inner = self.inner.flywheel_arn(input.into());
278 self
279 }
280 /// <p>The Amazon Resource Number (ARN) of the flywheel associated with the model to use.</p>
281 pub fn set_flywheel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
282 self.inner = self.inner.set_flywheel_arn(input);
283 self
284 }
285 /// <p>The Amazon Resource Number (ARN) of the flywheel associated with the model to use.</p>
286 pub fn get_flywheel_arn(&self) -> &::std::option::Option<::std::string::String> {
287 self.inner.get_flywheel_arn()
288 }
289}