aws_sdk_redshiftserverless/operation/create_workgroup/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_workgroup::_create_workgroup_input::CreateWorkgroupInputBuilder;
3
4pub use crate::operation::create_workgroup::_create_workgroup_output::CreateWorkgroupOutputBuilder;
5
6impl crate::operation::create_workgroup::builders::CreateWorkgroupInputBuilder {
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_workgroup::CreateWorkgroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_workgroup::CreateWorkgroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_workgroup();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateWorkgroup`.
24///
25/// <p>Creates an workgroup in Amazon Redshift Serverless.</p>
26/// <p>VPC Block Public Access (BPA) enables you to block resources in VPCs and subnets that you own in a Region from reaching or being reached from the internet through internet gateways and egress-only internet gateways. If a workgroup is in an account with VPC BPA turned on, the following capabilities are blocked:</p>
27/// <ul>
28/// <li>
29/// <p>Creating a public access workgroup</p></li>
30/// <li>
31/// <p>Modifying a private workgroup to public</p></li>
32/// <li>
33/// <p>Adding a subnet with VPC BPA turned on to the workgroup when the workgroup is public</p></li>
34/// </ul>
35/// <p>For more information about VPC BPA, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/security-vpc-bpa.html">Block public access to VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct CreateWorkgroupFluentBuilder {
38 handle: ::std::sync::Arc<crate::client::Handle>,
39 inner: crate::operation::create_workgroup::builders::CreateWorkgroupInputBuilder,
40 config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43 crate::client::customize::internal::CustomizableSend<
44 crate::operation::create_workgroup::CreateWorkgroupOutput,
45 crate::operation::create_workgroup::CreateWorkgroupError,
46 > for CreateWorkgroupFluentBuilder
47{
48 fn send(
49 self,
50 config_override: crate::config::Builder,
51 ) -> crate::client::customize::internal::BoxFuture<
52 crate::client::customize::internal::SendResult<
53 crate::operation::create_workgroup::CreateWorkgroupOutput,
54 crate::operation::create_workgroup::CreateWorkgroupError,
55 >,
56 > {
57 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58 }
59}
60impl CreateWorkgroupFluentBuilder {
61 /// Creates a new `CreateWorkgroupFluentBuilder`.
62 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63 Self {
64 handle,
65 inner: ::std::default::Default::default(),
66 config_override: ::std::option::Option::None,
67 }
68 }
69 /// Access the CreateWorkgroup as a reference.
70 pub fn as_input(&self) -> &crate::operation::create_workgroup::builders::CreateWorkgroupInputBuilder {
71 &self.inner
72 }
73 /// Sends the request and returns the response.
74 ///
75 /// If an error occurs, an `SdkError` will be returned with additional details that
76 /// can be matched against.
77 ///
78 /// By default, any retryable failures will be retried twice. Retry behavior
79 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80 /// set when configuring the client.
81 pub async fn send(
82 self,
83 ) -> ::std::result::Result<
84 crate::operation::create_workgroup::CreateWorkgroupOutput,
85 ::aws_smithy_runtime_api::client::result::SdkError<
86 crate::operation::create_workgroup::CreateWorkgroupError,
87 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88 >,
89 > {
90 let input = self
91 .inner
92 .build()
93 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94 let runtime_plugins = crate::operation::create_workgroup::CreateWorkgroup::operation_runtime_plugins(
95 self.handle.runtime_plugins.clone(),
96 &self.handle.conf,
97 self.config_override,
98 );
99 crate::operation::create_workgroup::CreateWorkgroup::orchestrate(&runtime_plugins, input).await
100 }
101
102 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103 pub fn customize(
104 self,
105 ) -> crate::client::customize::CustomizableOperation<
106 crate::operation::create_workgroup::CreateWorkgroupOutput,
107 crate::operation::create_workgroup::CreateWorkgroupError,
108 Self,
109 > {
110 crate::client::customize::CustomizableOperation::new(self)
111 }
112 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113 self.set_config_override(::std::option::Option::Some(config_override.into()));
114 self
115 }
116
117 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118 self.config_override = config_override;
119 self
120 }
121 /// <p>The name of the created workgroup.</p>
122 pub fn workgroup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.inner = self.inner.workgroup_name(input.into());
124 self
125 }
126 /// <p>The name of the created workgroup.</p>
127 pub fn set_workgroup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.inner = self.inner.set_workgroup_name(input);
129 self
130 }
131 /// <p>The name of the created workgroup.</p>
132 pub fn get_workgroup_name(&self) -> &::std::option::Option<::std::string::String> {
133 self.inner.get_workgroup_name()
134 }
135 /// <p>The name of the namespace to associate with the workgroup.</p>
136 pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.namespace_name(input.into());
138 self
139 }
140 /// <p>The name of the namespace to associate with the workgroup.</p>
141 pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_namespace_name(input);
143 self
144 }
145 /// <p>The name of the namespace to associate with the workgroup.</p>
146 pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_namespace_name()
148 }
149 /// <p>The base data warehouse capacity of the workgroup in Redshift Processing Units (RPUs).</p>
150 pub fn base_capacity(mut self, input: i32) -> Self {
151 self.inner = self.inner.base_capacity(input);
152 self
153 }
154 /// <p>The base data warehouse capacity of the workgroup in Redshift Processing Units (RPUs).</p>
155 pub fn set_base_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
156 self.inner = self.inner.set_base_capacity(input);
157 self
158 }
159 /// <p>The base data warehouse capacity of the workgroup in Redshift Processing Units (RPUs).</p>
160 pub fn get_base_capacity(&self) -> &::std::option::Option<i32> {
161 self.inner.get_base_capacity()
162 }
163 /// <p>The value that specifies whether to turn on enhanced virtual private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC instead of over the internet.</p>
164 pub fn enhanced_vpc_routing(mut self, input: bool) -> Self {
165 self.inner = self.inner.enhanced_vpc_routing(input);
166 self
167 }
168 /// <p>The value that specifies whether to turn on enhanced virtual private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC instead of over the internet.</p>
169 pub fn set_enhanced_vpc_routing(mut self, input: ::std::option::Option<bool>) -> Self {
170 self.inner = self.inner.set_enhanced_vpc_routing(input);
171 self
172 }
173 /// <p>The value that specifies whether to turn on enhanced virtual private cloud (VPC) routing, which forces Amazon Redshift Serverless to route traffic through your VPC instead of over the internet.</p>
174 pub fn get_enhanced_vpc_routing(&self) -> &::std::option::Option<bool> {
175 self.inner.get_enhanced_vpc_routing()
176 }
177 ///
178 /// Appends an item to `configParameters`.
179 ///
180 /// To override the contents of this collection use [`set_config_parameters`](Self::set_config_parameters).
181 ///
182 /// <p>An array of parameters to set for advanced control over a database. The options are <code>auto_mv</code>, <code>datestyle</code>, <code>enable_case_sensitive_identifier</code>, <code>enable_user_activity_logging</code>, <code>query_group</code>, <code>search_path</code>, <code>require_ssl</code>, <code>use_fips_ssl</code>, and either <code>wlm_json_configuration</code> or query monitoring metrics that let you define performance boundaries. You can either specify individual query monitoring metrics (such as <code>max_scan_row_count</code>, <code>max_query_execution_time</code>) or use <code>wlm_json_configuration</code> to define query queues with rules, but not both. If you're using <code>wlm_json_configuration</code>, the maximum size of <code>parameterValue</code> is 8000 characters. For more information about query monitoring rules and available metrics, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless"> Query monitoring metrics for Amazon Redshift Serverless</a>.</p>
183 pub fn config_parameters(mut self, input: crate::types::ConfigParameter) -> Self {
184 self.inner = self.inner.config_parameters(input);
185 self
186 }
187 /// <p>An array of parameters to set for advanced control over a database. The options are <code>auto_mv</code>, <code>datestyle</code>, <code>enable_case_sensitive_identifier</code>, <code>enable_user_activity_logging</code>, <code>query_group</code>, <code>search_path</code>, <code>require_ssl</code>, <code>use_fips_ssl</code>, and either <code>wlm_json_configuration</code> or query monitoring metrics that let you define performance boundaries. You can either specify individual query monitoring metrics (such as <code>max_scan_row_count</code>, <code>max_query_execution_time</code>) or use <code>wlm_json_configuration</code> to define query queues with rules, but not both. If you're using <code>wlm_json_configuration</code>, the maximum size of <code>parameterValue</code> is 8000 characters. For more information about query monitoring rules and available metrics, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless"> Query monitoring metrics for Amazon Redshift Serverless</a>.</p>
188 pub fn set_config_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConfigParameter>>) -> Self {
189 self.inner = self.inner.set_config_parameters(input);
190 self
191 }
192 /// <p>An array of parameters to set for advanced control over a database. The options are <code>auto_mv</code>, <code>datestyle</code>, <code>enable_case_sensitive_identifier</code>, <code>enable_user_activity_logging</code>, <code>query_group</code>, <code>search_path</code>, <code>require_ssl</code>, <code>use_fips_ssl</code>, and either <code>wlm_json_configuration</code> or query monitoring metrics that let you define performance boundaries. You can either specify individual query monitoring metrics (such as <code>max_scan_row_count</code>, <code>max_query_execution_time</code>) or use <code>wlm_json_configuration</code> to define query queues with rules, but not both. If you're using <code>wlm_json_configuration</code>, the maximum size of <code>parameterValue</code> is 8000 characters. For more information about query monitoring rules and available metrics, see <a href="https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless"> Query monitoring metrics for Amazon Redshift Serverless</a>.</p>
193 pub fn get_config_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConfigParameter>> {
194 self.inner.get_config_parameters()
195 }
196 ///
197 /// Appends an item to `securityGroupIds`.
198 ///
199 /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
200 ///
201 /// <p>An array of security group IDs to associate with the workgroup.</p>
202 pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203 self.inner = self.inner.security_group_ids(input.into());
204 self
205 }
206 /// <p>An array of security group IDs to associate with the workgroup.</p>
207 pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
208 self.inner = self.inner.set_security_group_ids(input);
209 self
210 }
211 /// <p>An array of security group IDs to associate with the workgroup.</p>
212 pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
213 self.inner.get_security_group_ids()
214 }
215 ///
216 /// Appends an item to `subnetIds`.
217 ///
218 /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
219 ///
220 /// <p>An array of VPC subnet IDs to associate with the workgroup.</p>
221 pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222 self.inner = self.inner.subnet_ids(input.into());
223 self
224 }
225 /// <p>An array of VPC subnet IDs to associate with the workgroup.</p>
226 pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
227 self.inner = self.inner.set_subnet_ids(input);
228 self
229 }
230 /// <p>An array of VPC subnet IDs to associate with the workgroup.</p>
231 pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
232 self.inner.get_subnet_ids()
233 }
234 /// <p>A value that specifies whether the workgroup can be accessed from a public network.</p>
235 pub fn publicly_accessible(mut self, input: bool) -> Self {
236 self.inner = self.inner.publicly_accessible(input);
237 self
238 }
239 /// <p>A value that specifies whether the workgroup can be accessed from a public network.</p>
240 pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
241 self.inner = self.inner.set_publicly_accessible(input);
242 self
243 }
244 /// <p>A value that specifies whether the workgroup can be accessed from a public network.</p>
245 pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
246 self.inner.get_publicly_accessible()
247 }
248 ///
249 /// Appends an item to `tags`.
250 ///
251 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
252 ///
253 /// <p>A array of tag instances.</p>
254 pub fn tags(mut self, input: crate::types::Tag) -> Self {
255 self.inner = self.inner.tags(input);
256 self
257 }
258 /// <p>A array of tag instances.</p>
259 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
260 self.inner = self.inner.set_tags(input);
261 self
262 }
263 /// <p>A array of tag instances.</p>
264 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
265 self.inner.get_tags()
266 }
267 /// <p>The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.</p>
268 pub fn port(mut self, input: i32) -> Self {
269 self.inner = self.inner.port(input);
270 self
271 }
272 /// <p>The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.</p>
273 pub fn set_port(mut self, input: ::std::option::Option<i32>) -> Self {
274 self.inner = self.inner.set_port(input);
275 self
276 }
277 /// <p>The custom port to use when connecting to a workgroup. Valid port ranges are 5431-5455 and 8191-8215. The default is 5439.</p>
278 pub fn get_port(&self) -> &::std::option::Option<i32> {
279 self.inner.get_port()
280 }
281 /// <p>The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve queries. The max capacity is specified in RPUs.</p>
282 pub fn max_capacity(mut self, input: i32) -> Self {
283 self.inner = self.inner.max_capacity(input);
284 self
285 }
286 /// <p>The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve queries. The max capacity is specified in RPUs.</p>
287 pub fn set_max_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
288 self.inner = self.inner.set_max_capacity(input);
289 self
290 }
291 /// <p>The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve queries. The max capacity is specified in RPUs.</p>
292 pub fn get_max_capacity(&self) -> &::std::option::Option<i32> {
293 self.inner.get_max_capacity()
294 }
295 /// <p>An object that represents the price performance target settings for the workgroup.</p>
296 pub fn price_performance_target(mut self, input: crate::types::PerformanceTarget) -> Self {
297 self.inner = self.inner.price_performance_target(input);
298 self
299 }
300 /// <p>An object that represents the price performance target settings for the workgroup.</p>
301 pub fn set_price_performance_target(mut self, input: ::std::option::Option<crate::types::PerformanceTarget>) -> Self {
302 self.inner = self.inner.set_price_performance_target(input);
303 self
304 }
305 /// <p>An object that represents the price performance target settings for the workgroup.</p>
306 pub fn get_price_performance_target(&self) -> &::std::option::Option<crate::types::PerformanceTarget> {
307 self.inner.get_price_performance_target()
308 }
309 /// <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
310 pub fn ip_address_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311 self.inner = self.inner.ip_address_type(input.into());
312 self
313 }
314 /// <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
315 pub fn set_ip_address_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316 self.inner = self.inner.set_ip_address_type(input);
317 self
318 }
319 /// <p>The IP address type that the workgroup supports. Possible values are <code>ipv4</code> and <code>dualstack</code>.</p>
320 pub fn get_ip_address_type(&self) -> &::std::option::Option<::std::string::String> {
321 self.inner.get_ip_address_type()
322 }
323 /// <p>An optional parameter for the name of the track for the workgroup. If you don't provide a track name, the workgroup is assigned to the <code>current</code> track.</p>
324 pub fn track_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
325 self.inner = self.inner.track_name(input.into());
326 self
327 }
328 /// <p>An optional parameter for the name of the track for the workgroup. If you don't provide a track name, the workgroup is assigned to the <code>current</code> track.</p>
329 pub fn set_track_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
330 self.inner = self.inner.set_track_name(input);
331 self
332 }
333 /// <p>An optional parameter for the name of the track for the workgroup. If you don't provide a track name, the workgroup is assigned to the <code>current</code> track.</p>
334 pub fn get_track_name(&self) -> &::std::option::Option<::std::string::String> {
335 self.inner.get_track_name()
336 }
337 /// <p>If <code>true</code>, allocates additional compute resources for running automatic optimization operations.</p>
338 /// <p>Default: false</p>
339 pub fn extra_compute_for_automatic_optimization(mut self, input: bool) -> Self {
340 self.inner = self.inner.extra_compute_for_automatic_optimization(input);
341 self
342 }
343 /// <p>If <code>true</code>, allocates additional compute resources for running automatic optimization operations.</p>
344 /// <p>Default: false</p>
345 pub fn set_extra_compute_for_automatic_optimization(mut self, input: ::std::option::Option<bool>) -> Self {
346 self.inner = self.inner.set_extra_compute_for_automatic_optimization(input);
347 self
348 }
349 /// <p>If <code>true</code>, allocates additional compute resources for running automatic optimization operations.</p>
350 /// <p>Default: false</p>
351 pub fn get_extra_compute_for_automatic_optimization(&self) -> &::std::option::Option<bool> {
352 self.inner.get_extra_compute_for_automatic_optimization()
353 }
354}