Skip to main content

aws_sdk_glue/operation/start_data_quality_rule_recommendation_run/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_data_quality_rule_recommendation_run::_start_data_quality_rule_recommendation_run_input::StartDataQualityRuleRecommendationRunInputBuilder;
3
4pub use crate::operation::start_data_quality_rule_recommendation_run::_start_data_quality_rule_recommendation_run_output::StartDataQualityRuleRecommendationRunOutputBuilder;
5
6impl crate::operation::start_data_quality_rule_recommendation_run::builders::StartDataQualityRuleRecommendationRunInputBuilder {
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_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.start_data_quality_rule_recommendation_run();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StartDataQualityRuleRecommendationRun`.
24///
25/// <p>Starts a recommendation run that is used to generate rules when you don't know what rules to write. Glue Data Quality analyzes the data and comes up with recommendations for a potential ruleset. You can then triage the ruleset and modify the generated ruleset to your liking.</p>
26/// <p>Recommendation runs are automatically deleted after 90 days.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct StartDataQualityRuleRecommendationRunFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::start_data_quality_rule_recommendation_run::builders::StartDataQualityRuleRecommendationRunInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunOutput,
36        crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunError,
37    > for StartDataQualityRuleRecommendationRunFluentBuilder
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_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunOutput,
45            crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl StartDataQualityRuleRecommendationRunFluentBuilder {
52    /// Creates a new `StartDataQualityRuleRecommendationRunFluentBuilder`.
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 StartDataQualityRuleRecommendationRun as a reference.
61    pub fn as_input(
62        &self,
63    ) -> &crate::operation::start_data_quality_rule_recommendation_run::builders::StartDataQualityRuleRecommendationRunInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins =
88            crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRun::operation_runtime_plugins(
89                self.handle.runtime_plugins.clone(),
90                &self.handle.conf,
91                self.config_override,
92            );
93        crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRun::orchestrate(&runtime_plugins, input)
94            .await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunOutput,
102        crate::operation::start_data_quality_rule_recommendation_run::StartDataQualityRuleRecommendationRunError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The data source (Glue table) associated with this run.</p>
117    pub fn data_source(mut self, input: crate::types::DataSource) -> Self {
118        self.inner = self.inner.data_source(input);
119        self
120    }
121    /// <p>The data source (Glue table) associated with this run.</p>
122    pub fn set_data_source(mut self, input: ::std::option::Option<crate::types::DataSource>) -> Self {
123        self.inner = self.inner.set_data_source(input);
124        self
125    }
126    /// <p>The data source (Glue table) associated with this run.</p>
127    pub fn get_data_source(&self) -> &::std::option::Option<crate::types::DataSource> {
128        self.inner.get_data_source()
129    }
130    /// <p>The IAM role that Glue assumes to access resources for the run.</p>
131    /// <p>For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/data-quality-authorization.html">Configure IAM permissions for Glue Data Quality</a>.</p>
132    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.role(input.into());
134        self
135    }
136    /// <p>The IAM role that Glue assumes to access resources for the run.</p>
137    /// <p>For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/data-quality-authorization.html">Configure IAM permissions for Glue Data Quality</a>.</p>
138    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_role(input);
140        self
141    }
142    /// <p>The IAM role that Glue assumes to access resources for the run.</p>
143    /// <p>For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/data-quality-authorization.html">Configure IAM permissions for Glue Data Quality</a>.</p>
144    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_role()
146    }
147    /// <p>The number of <code>G.1X</code> workers to be used in the run. The default is 5.</p>
148    pub fn number_of_workers(mut self, input: i32) -> Self {
149        self.inner = self.inner.number_of_workers(input);
150        self
151    }
152    /// <p>The number of <code>G.1X</code> workers to be used in the run. The default is 5.</p>
153    pub fn set_number_of_workers(mut self, input: ::std::option::Option<i32>) -> Self {
154        self.inner = self.inner.set_number_of_workers(input);
155        self
156    }
157    /// <p>The number of <code>G.1X</code> workers to be used in the run. The default is 5.</p>
158    pub fn get_number_of_workers(&self) -> &::std::option::Option<i32> {
159        self.inner.get_number_of_workers()
160    }
161    /// <p>The timeout for a run in minutes. This is the maximum time that a run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. The default is 2,880 minutes (48 hours).</p>
162    pub fn timeout(mut self, input: i32) -> Self {
163        self.inner = self.inner.timeout(input);
164        self
165    }
166    /// <p>The timeout for a run in minutes. This is the maximum time that a run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. The default is 2,880 minutes (48 hours).</p>
167    pub fn set_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
168        self.inner = self.inner.set_timeout(input);
169        self
170    }
171    /// <p>The timeout for a run in minutes. This is the maximum time that a run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. The default is 2,880 minutes (48 hours).</p>
172    pub fn get_timeout(&self) -> &::std::option::Option<i32> {
173        self.inner.get_timeout()
174    }
175    /// <p>A name for the ruleset.</p>
176    pub fn created_ruleset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.created_ruleset_name(input.into());
178        self
179    }
180    /// <p>A name for the ruleset.</p>
181    pub fn set_created_ruleset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_created_ruleset_name(input);
183        self
184    }
185    /// <p>A name for the ruleset.</p>
186    pub fn get_created_ruleset_name(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_created_ruleset_name()
188    }
189    /// <p>The name of the security configuration created with the data quality encryption option.</p>
190    pub fn data_quality_security_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.data_quality_security_configuration(input.into());
192        self
193    }
194    /// <p>The name of the security configuration created with the data quality encryption option.</p>
195    pub fn set_data_quality_security_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_data_quality_security_configuration(input);
197        self
198    }
199    /// <p>The name of the security configuration created with the data quality encryption option.</p>
200    pub fn get_data_quality_security_configuration(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_data_quality_security_configuration()
202    }
203    /// <p>Used for idempotency and is recommended to be set to a random ID (such as a UUID) to avoid creating or starting multiple instances of the same resource.</p>
204    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.client_token(input.into());
206        self
207    }
208    /// <p>Used for idempotency and is recommended to be set to a random ID (such as a UUID) to avoid creating or starting multiple instances of the same resource.</p>
209    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_client_token(input);
211        self
212    }
213    /// <p>Used for idempotency and is recommended to be set to a random ID (such as a UUID) to avoid creating or starting multiple instances of the same resource.</p>
214    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_client_token()
216    }
217    /// <p>Additional run options you can specify for a recommendation run.</p>
218    pub fn additional_run_options(mut self, input: crate::types::DataQualityRuleRecommendationRunAdditionalRunOptions) -> Self {
219        self.inner = self.inner.additional_run_options(input);
220        self
221    }
222    /// <p>Additional run options you can specify for a recommendation run.</p>
223    pub fn set_additional_run_options(
224        mut self,
225        input: ::std::option::Option<crate::types::DataQualityRuleRecommendationRunAdditionalRunOptions>,
226    ) -> Self {
227        self.inner = self.inner.set_additional_run_options(input);
228        self
229    }
230    /// <p>Additional run options you can specify for a recommendation run.</p>
231    pub fn get_additional_run_options(&self) -> &::std::option::Option<crate::types::DataQualityRuleRecommendationRunAdditionalRunOptions> {
232        self.inner.get_additional_run_options()
233    }
234    /// <p>The mode that Glue Data Quality uses to recommend rules.</p>
235    /// <p>The default is <code>BASIC</code>.</p>
236    pub fn recommendation_mode(mut self, input: crate::types::RecommendationMode) -> Self {
237        self.inner = self.inner.recommendation_mode(input);
238        self
239    }
240    /// <p>The mode that Glue Data Quality uses to recommend rules.</p>
241    /// <p>The default is <code>BASIC</code>.</p>
242    pub fn set_recommendation_mode(mut self, input: ::std::option::Option<crate::types::RecommendationMode>) -> Self {
243        self.inner = self.inner.set_recommendation_mode(input);
244        self
245    }
246    /// <p>The mode that Glue Data Quality uses to recommend rules.</p>
247    /// <p>The default is <code>BASIC</code>.</p>
248    pub fn get_recommendation_mode(&self) -> &::std::option::Option<crate::types::RecommendationMode> {
249        self.inner.get_recommendation_mode()
250    }
251}