aws_sdk_cleanroomsml/operation/create_training_dataset/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_training_dataset::_create_training_dataset_output::CreateTrainingDatasetOutputBuilder;
3
4pub use crate::operation::create_training_dataset::_create_training_dataset_input::CreateTrainingDatasetInputBuilder;
5
6impl crate::operation::create_training_dataset::builders::CreateTrainingDatasetInputBuilder {
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_training_dataset::CreateTrainingDatasetOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_training_dataset::CreateTrainingDatasetError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_training_dataset();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateTrainingDataset`.
24///
25/// <p>Defines the information necessary to create a training dataset. In Clean Rooms ML, the <code>TrainingDataset</code> is metadata that points to a Glue table, which is read only during <code>AudienceModel</code> creation.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateTrainingDatasetFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_training_dataset::builders::CreateTrainingDatasetInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_training_dataset::CreateTrainingDatasetOutput,
35 crate::operation::create_training_dataset::CreateTrainingDatasetError,
36 > for CreateTrainingDatasetFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_training_dataset::CreateTrainingDatasetOutput,
44 crate::operation::create_training_dataset::CreateTrainingDatasetError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateTrainingDatasetFluentBuilder {
51 /// Creates a new `CreateTrainingDatasetFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateTrainingDataset as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_training_dataset::builders::CreateTrainingDatasetInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_training_dataset::CreateTrainingDatasetOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_training_dataset::CreateTrainingDatasetError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_training_dataset::CreateTrainingDataset::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_training_dataset::CreateTrainingDataset::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_training_dataset::CreateTrainingDatasetOutput,
97 crate::operation::create_training_dataset::CreateTrainingDatasetError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of the training dataset. This name must be unique in your account and region.</p>
112 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.name(input.into());
114 self
115 }
116 /// <p>The name of the training dataset. This name must be unique in your account and region.</p>
117 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_name(input);
119 self
120 }
121 /// <p>The name of the training dataset. This name must be unique in your account and region.</p>
122 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_name()
124 }
125 /// <p>The ARN of the IAM role that Clean Rooms ML can assume to read the data referred to in the <code>dataSource</code> field of each dataset.</p>
126 /// <p>Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an <code>AccessDeniedException</code> error.</p>
127 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.role_arn(input.into());
129 self
130 }
131 /// <p>The ARN of the IAM role that Clean Rooms ML can assume to read the data referred to in the <code>dataSource</code> field of each dataset.</p>
132 /// <p>Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an <code>AccessDeniedException</code> error.</p>
133 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_role_arn(input);
135 self
136 }
137 /// <p>The ARN of the IAM role that Clean Rooms ML can assume to read the data referred to in the <code>dataSource</code> field of each dataset.</p>
138 /// <p>Passing a role across AWS accounts is not allowed. If you pass a role that isn't in your account, you get an <code>AccessDeniedException</code> error.</p>
139 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_role_arn()
141 }
142 ///
143 /// Appends an item to `trainingData`.
144 ///
145 /// To override the contents of this collection use [`set_training_data`](Self::set_training_data).
146 ///
147 /// <p>An array of information that lists the Dataset objects, which specifies the dataset type and details on its location and schema. You must provide a role that has read access to these tables.</p>
148 pub fn training_data(mut self, input: crate::types::Dataset) -> Self {
149 self.inner = self.inner.training_data(input);
150 self
151 }
152 /// <p>An array of information that lists the Dataset objects, which specifies the dataset type and details on its location and schema. You must provide a role that has read access to these tables.</p>
153 pub fn set_training_data(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Dataset>>) -> Self {
154 self.inner = self.inner.set_training_data(input);
155 self
156 }
157 /// <p>An array of information that lists the Dataset objects, which specifies the dataset type and details on its location and schema. You must provide a role that has read access to these tables.</p>
158 pub fn get_training_data(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Dataset>> {
159 self.inner.get_training_data()
160 }
161 ///
162 /// Adds a key-value pair to `tags`.
163 ///
164 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
165 ///
166 /// <p>The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
167 /// <p>The following basic restrictions apply to tags:</p>
168 /// <ul>
169 /// <li>
170 /// <p>Maximum number of tags per resource - 50.</p></li>
171 /// <li>
172 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
173 /// <li>
174 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
175 /// <li>
176 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
177 /// <li>
178 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
179 /// <li>
180 /// <p>Tag keys and values are case sensitive.</p></li>
181 /// <li>
182 /// <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p></li>
183 /// </ul>
184 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.inner = self.inner.tags(k.into(), v.into());
186 self
187 }
188 /// <p>The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
189 /// <p>The following basic restrictions apply to tags:</p>
190 /// <ul>
191 /// <li>
192 /// <p>Maximum number of tags per resource - 50.</p></li>
193 /// <li>
194 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
195 /// <li>
196 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
197 /// <li>
198 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
199 /// <li>
200 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
201 /// <li>
202 /// <p>Tag keys and values are case sensitive.</p></li>
203 /// <li>
204 /// <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p></li>
205 /// </ul>
206 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
207 self.inner = self.inner.set_tags(input);
208 self
209 }
210 /// <p>The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
211 /// <p>The following basic restrictions apply to tags:</p>
212 /// <ul>
213 /// <li>
214 /// <p>Maximum number of tags per resource - 50.</p></li>
215 /// <li>
216 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
217 /// <li>
218 /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
219 /// <li>
220 /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
221 /// <li>
222 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
223 /// <li>
224 /// <p>Tag keys and values are case sensitive.</p></li>
225 /// <li>
226 /// <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p></li>
227 /// </ul>
228 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
229 self.inner.get_tags()
230 }
231 /// <p>The description of the training dataset.</p>
232 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
233 self.inner = self.inner.description(input.into());
234 self
235 }
236 /// <p>The description of the training dataset.</p>
237 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
238 self.inner = self.inner.set_description(input);
239 self
240 }
241 /// <p>The description of the training dataset.</p>
242 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
243 self.inner.get_description()
244 }
245}