aws_sdk_devicefarm/operation/update_device_pool/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_device_pool::_update_device_pool_output::UpdateDevicePoolOutputBuilder;
3
4pub use crate::operation::update_device_pool::_update_device_pool_input::UpdateDevicePoolInputBuilder;
5
6impl crate::operation::update_device_pool::builders::UpdateDevicePoolInputBuilder {
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::update_device_pool::UpdateDevicePoolOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_device_pool::UpdateDevicePoolError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_device_pool();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateDevicePool`.
24///
25/// <p>Modifies the name, description, and rules in a device pool given the attributes and the pool ARN. Rule updates are all-or-nothing, meaning they can only be updated as a whole (or not at all).</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateDevicePoolFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_device_pool::builders::UpdateDevicePoolInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_device_pool::UpdateDevicePoolOutput,
35        crate::operation::update_device_pool::UpdateDevicePoolError,
36    > for UpdateDevicePoolFluentBuilder
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::update_device_pool::UpdateDevicePoolOutput,
44            crate::operation::update_device_pool::UpdateDevicePoolError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateDevicePoolFluentBuilder {
51    /// Creates a new `UpdateDevicePoolFluentBuilder`.
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 UpdateDevicePool as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_device_pool::builders::UpdateDevicePoolInputBuilder {
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::update_device_pool::UpdateDevicePoolOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_device_pool::UpdateDevicePoolError,
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::update_device_pool::UpdateDevicePool::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_device_pool::UpdateDevicePool::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::update_device_pool::UpdateDevicePoolOutput,
97        crate::operation::update_device_pool::UpdateDevicePoolError,
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 Amazon Resource Name (ARN) of the Device Farm device pool to update.</p>
112    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.arn(input.into());
114        self
115    }
116    /// <p>The Amazon Resource Name (ARN) of the Device Farm device pool to update.</p>
117    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_arn(input);
119        self
120    }
121    /// <p>The Amazon Resource Name (ARN) of the Device Farm device pool to update.</p>
122    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_arn()
124    }
125    /// <p>A string that represents the name of the device pool to update.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>A string that represents the name of the device pool to update.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>A string that represents the name of the device pool to update.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>A description of the device pool to update.</p>
140    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.description(input.into());
142        self
143    }
144    /// <p>A description of the device pool to update.</p>
145    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_description(input);
147        self
148    }
149    /// <p>A description of the device pool to update.</p>
150    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_description()
152    }
153    ///
154    /// Appends an item to `rules`.
155    ///
156    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
157    ///
158    /// <p>Represents the rules to modify for the device pool. Updating rules is optional. If you update rules for your request, the update replaces the existing rules.</p>
159    pub fn rules(mut self, input: crate::types::Rule) -> Self {
160        self.inner = self.inner.rules(input);
161        self
162    }
163    /// <p>Represents the rules to modify for the device pool. Updating rules is optional. If you update rules for your request, the update replaces the existing rules.</p>
164    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
165        self.inner = self.inner.set_rules(input);
166        self
167    }
168    /// <p>Represents the rules to modify for the device pool. Updating rules is optional. If you update rules for your request, the update replaces the existing rules.</p>
169    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
170        self.inner.get_rules()
171    }
172    /// <p>The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and that meet the criteria that you assign for the <code>rules</code> parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter.</p>
173    /// <p>By specifying the maximum number of devices, you can control the costs that you incur by running tests.</p>
174    /// <p>If you use this parameter in your request, you cannot use the <code>clearMaxDevices</code> parameter in the same request.</p>
175    pub fn max_devices(mut self, input: i32) -> Self {
176        self.inner = self.inner.max_devices(input);
177        self
178    }
179    /// <p>The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and that meet the criteria that you assign for the <code>rules</code> parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter.</p>
180    /// <p>By specifying the maximum number of devices, you can control the costs that you incur by running tests.</p>
181    /// <p>If you use this parameter in your request, you cannot use the <code>clearMaxDevices</code> parameter in the same request.</p>
182    pub fn set_max_devices(mut self, input: ::std::option::Option<i32>) -> Self {
183        self.inner = self.inner.set_max_devices(input);
184        self
185    }
186    /// <p>The number of devices that Device Farm can add to your device pool. Device Farm adds devices that are available and that meet the criteria that you assign for the <code>rules</code> parameter. Depending on how many devices meet these constraints, your device pool might contain fewer devices than the value for this parameter.</p>
187    /// <p>By specifying the maximum number of devices, you can control the costs that you incur by running tests.</p>
188    /// <p>If you use this parameter in your request, you cannot use the <code>clearMaxDevices</code> parameter in the same request.</p>
189    pub fn get_max_devices(&self) -> &::std::option::Option<i32> {
190        self.inner.get_max_devices()
191    }
192    /// <p>Sets whether the <code>maxDevices</code> parameter applies to your device pool. If you set this parameter to <code>true</code>, the <code>maxDevices</code> parameter does not apply, and Device Farm does not limit the number of devices that it adds to your device pool. In this case, Device Farm adds all available devices that meet the criteria specified in the <code>rules</code> parameter.</p>
193    /// <p>If you use this parameter in your request, you cannot use the <code>maxDevices</code> parameter in the same request.</p>
194    pub fn clear_max_devices(mut self, input: bool) -> Self {
195        self.inner = self.inner.clear_max_devices(input);
196        self
197    }
198    /// <p>Sets whether the <code>maxDevices</code> parameter applies to your device pool. If you set this parameter to <code>true</code>, the <code>maxDevices</code> parameter does not apply, and Device Farm does not limit the number of devices that it adds to your device pool. In this case, Device Farm adds all available devices that meet the criteria specified in the <code>rules</code> parameter.</p>
199    /// <p>If you use this parameter in your request, you cannot use the <code>maxDevices</code> parameter in the same request.</p>
200    pub fn set_clear_max_devices(mut self, input: ::std::option::Option<bool>) -> Self {
201        self.inner = self.inner.set_clear_max_devices(input);
202        self
203    }
204    /// <p>Sets whether the <code>maxDevices</code> parameter applies to your device pool. If you set this parameter to <code>true</code>, the <code>maxDevices</code> parameter does not apply, and Device Farm does not limit the number of devices that it adds to your device pool. In this case, Device Farm adds all available devices that meet the criteria specified in the <code>rules</code> parameter.</p>
205    /// <p>If you use this parameter in your request, you cannot use the <code>maxDevices</code> parameter in the same request.</p>
206    pub fn get_clear_max_devices(&self) -> &::std::option::Option<bool> {
207        self.inner.get_clear_max_devices()
208    }
209}