aws_sdk_lookoutvision/operation/delete_dataset/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_dataset::_delete_dataset_output::DeleteDatasetOutputBuilder;
3
4pub use crate::operation::delete_dataset::_delete_dataset_input::DeleteDatasetInputBuilder;
5
6impl crate::operation::delete_dataset::builders::DeleteDatasetInputBuilder {
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::delete_dataset::DeleteDatasetOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_dataset::DeleteDatasetError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_dataset();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteDataset`.
24///
25/// <p>Deletes an existing Amazon Lookout for Vision <code>dataset</code>.</p>
26/// <p>If your the project has a single dataset, you must create a new dataset before you can create a model.</p>
27/// <p>If you project has a training dataset and a test dataset consider the following.</p>
28/// <ul>
29/// <li>
30/// <p>If you delete the test dataset, your project reverts to a single dataset project. If you then train the model, Amazon Lookout for Vision internally splits the remaining dataset into a training and test dataset.</p></li>
31/// <li>
32/// <p>If you delete the training dataset, you must create a training dataset before you can create a model.</p></li>
33/// </ul>
34/// <p>This operation requires permissions to perform the <code>lookoutvision:DeleteDataset</code> operation.</p>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct DeleteDatasetFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::delete_dataset::builders::DeleteDatasetInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::delete_dataset::DeleteDatasetOutput,
44 crate::operation::delete_dataset::DeleteDatasetError,
45 > for DeleteDatasetFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::delete_dataset::DeleteDatasetOutput,
53 crate::operation::delete_dataset::DeleteDatasetError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl DeleteDatasetFluentBuilder {
60 /// Creates a new `DeleteDatasetFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the DeleteDataset as a reference.
69 pub fn as_input(&self) -> &crate::operation::delete_dataset::builders::DeleteDatasetInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::delete_dataset::DeleteDatasetOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::delete_dataset::DeleteDatasetError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::delete_dataset::DeleteDataset::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::delete_dataset::DeleteDataset::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::delete_dataset::DeleteDatasetOutput,
106 crate::operation::delete_dataset::DeleteDatasetError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// <p>The name of the project that contains the dataset that you want to delete.</p>
121 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.project_name(input.into());
123 self
124 }
125 /// <p>The name of the project that contains the dataset that you want to delete.</p>
126 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_project_name(input);
128 self
129 }
130 /// <p>The name of the project that contains the dataset that you want to delete.</p>
131 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_project_name()
133 }
134 /// <p>The type of the dataset to delete. Specify <code>train</code> to delete the training dataset. Specify <code>test</code> to delete the test dataset. To delete the dataset in a single dataset project, specify <code>train</code>.</p>
135 pub fn dataset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.dataset_type(input.into());
137 self
138 }
139 /// <p>The type of the dataset to delete. Specify <code>train</code> to delete the training dataset. Specify <code>test</code> to delete the test dataset. To delete the dataset in a single dataset project, specify <code>train</code>.</p>
140 pub fn set_dataset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_dataset_type(input);
142 self
143 }
144 /// <p>The type of the dataset to delete. Specify <code>train</code> to delete the training dataset. Specify <code>test</code> to delete the test dataset. To delete the dataset in a single dataset project, specify <code>train</code>.</p>
145 pub fn get_dataset_type(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_dataset_type()
147 }
148 /// <p>ClientToken is an idempotency token that ensures a call to <code>DeleteDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>DeleteDataset</code>. In this case, safely retry your call to <code>DeleteDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
149 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from making multiple deletetion requests. You'll need to provide your own value for other use cases.</p>
150 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>DeleteDataset</code>. An idempotency token is active for 8 hours.</p>
151 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.inner = self.inner.client_token(input.into());
153 self
154 }
155 /// <p>ClientToken is an idempotency token that ensures a call to <code>DeleteDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>DeleteDataset</code>. In this case, safely retry your call to <code>DeleteDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
156 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from making multiple deletetion requests. You'll need to provide your own value for other use cases.</p>
157 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>DeleteDataset</code>. An idempotency token is active for 8 hours.</p>
158 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.inner = self.inner.set_client_token(input);
160 self
161 }
162 /// <p>ClientToken is an idempotency token that ensures a call to <code>DeleteDataset</code> completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from <code>DeleteDataset</code>. In this case, safely retry your call to <code>DeleteDataset</code> by using the same <code>ClientToken</code> parameter value.</p>
163 /// <p>If you don't supply a value for <code>ClientToken</code>, the AWS SDK you are using inserts a value for you. This prevents retries after a network error from making multiple deletetion requests. You'll need to provide your own value for other use cases.</p>
164 /// <p>An error occurs if the other input parameters are not the same as in the first request. Using a different value for <code>ClientToken</code> is considered a new call to <code>DeleteDataset</code>. An idempotency token is active for 8 hours.</p>
165 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
166 self.inner.get_client_token()
167 }
168}