aws_sdk_devicefarm/operation/list_devices/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_devices::_list_devices_output::ListDevicesOutputBuilder;
3
4pub use crate::operation::list_devices::_list_devices_input::ListDevicesInputBuilder;
5
6impl crate::operation::list_devices::builders::ListDevicesInputBuilder {
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::list_devices::ListDevicesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_devices::ListDevicesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_devices();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListDevices`.
24///
25/// <p>Gets information about unique device types.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListDevicesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_devices::builders::ListDevicesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_devices::ListDevicesOutput,
35        crate::operation::list_devices::ListDevicesError,
36    > for ListDevicesFluentBuilder
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::list_devices::ListDevicesOutput,
44            crate::operation::list_devices::ListDevicesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListDevicesFluentBuilder {
51    /// Creates a new `ListDevicesFluentBuilder`.
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 ListDevices as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_devices::builders::ListDevicesInputBuilder {
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::list_devices::ListDevicesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_devices::ListDevicesError,
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::list_devices::ListDevices::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_devices::ListDevices::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::list_devices::ListDevicesOutput,
97        crate::operation::list_devices::ListDevicesError,
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    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::list_devices::paginator::ListDevicesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_devices::paginator::ListDevicesPaginator {
115        crate::operation::list_devices::paginator::ListDevicesPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The Amazon Resource Name (ARN) of the project.</p>
118    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.arn(input.into());
120        self
121    }
122    /// <p>The Amazon Resource Name (ARN) of the project.</p>
123    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_arn(input);
125        self
126    }
127    /// <p>The Amazon Resource Name (ARN) of the project.</p>
128    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_arn()
130    }
131    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
132    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.next_token(input.into());
134        self
135    }
136    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
137    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_next_token(input);
139        self
140    }
141    /// <p>An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.</p>
142    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_next_token()
144    }
145    ///
146    /// Appends an item to `filters`.
147    ///
148    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
149    ///
150    /// <p>Used to select a set of devices. A filter is made up of an attribute, an operator, and one or more values.</p>
151    /// <ul>
152    /// <li>
153    /// <p>Attribute: The aspect of a device such as platform or model used as the selection criteria in a device filter.</p>
154    /// <p>Allowed values include:</p>
155    /// <ul>
156    /// <li>
157    /// <p>ARN: The Amazon Resource Name (ARN) of the device (for example, <code>arn:aws:devicefarm:us-west-2::device:12345Example</code>).</p></li>
158    /// <li>
159    /// <p>PLATFORM: The device platform. Valid values are ANDROID or IOS.</p></li>
160    /// <li>
161    /// <p>OS_VERSION: The operating system version (for example, 10.3.2).</p></li>
162    /// <li>
163    /// <p>MODEL: The device model (for example, iPad 5th Gen).</p></li>
164    /// <li>
165    /// <p>AVAILABILITY: The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.</p></li>
166    /// <li>
167    /// <p>FORM_FACTOR: The device form factor. Valid values are PHONE or TABLET.</p></li>
168    /// <li>
169    /// <p>MANUFACTURER: The device manufacturer (for example, Apple).</p></li>
170    /// <li>
171    /// <p>REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote access. Valid values are TRUE or FALSE.</p></li>
172    /// <li>
173    /// <p>REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote debugging. Valid values are TRUE or FALSE. Because remote debugging is <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html">no longer supported</a>, this attribute is ignored.</p></li>
174    /// <li>
175    /// <p>INSTANCE_ARN: The Amazon Resource Name (ARN) of the device instance.</p></li>
176    /// <li>
177    /// <p>INSTANCE_LABELS: The label of the device instance.</p></li>
178    /// <li>
179    /// <p>FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.</p></li>
180    /// </ul></li>
181    /// <li>
182    /// <p>Operator: The filter operator.</p>
183    /// <ul>
184    /// <li>
185    /// <p>The EQUALS operator is available for every attribute except INSTANCE_LABELS.</p></li>
186    /// <li>
187    /// <p>The CONTAINS operator is available for the INSTANCE_LABELS and MODEL attributes.</p></li>
188    /// <li>
189    /// <p>The IN and NOT_IN operators are available for the ARN, OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.</p></li>
190    /// <li>
191    /// <p>The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and GREATER_THAN_OR_EQUALS operators are also available for the OS_VERSION attribute.</p></li>
192    /// </ul></li>
193    /// <li>
194    /// <p>Values: An array of one or more filter values.</p>
195    /// <ul>
196    /// <li>
197    /// <p>The IN and NOT_IN operators take a values array that has one or more elements.</p></li>
198    /// <li>
199    /// <p>The other operators require an array with a single element.</p></li>
200    /// <li>
201    /// <p>In a request, the AVAILABILITY attribute takes the following values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.</p></li>
202    /// </ul></li>
203    /// </ul>
204    pub fn filters(mut self, input: crate::types::DeviceFilter) -> Self {
205        self.inner = self.inner.filters(input);
206        self
207    }
208    /// <p>Used to select a set of devices. A filter is made up of an attribute, an operator, and one or more values.</p>
209    /// <ul>
210    /// <li>
211    /// <p>Attribute: The aspect of a device such as platform or model used as the selection criteria in a device filter.</p>
212    /// <p>Allowed values include:</p>
213    /// <ul>
214    /// <li>
215    /// <p>ARN: The Amazon Resource Name (ARN) of the device (for example, <code>arn:aws:devicefarm:us-west-2::device:12345Example</code>).</p></li>
216    /// <li>
217    /// <p>PLATFORM: The device platform. Valid values are ANDROID or IOS.</p></li>
218    /// <li>
219    /// <p>OS_VERSION: The operating system version (for example, 10.3.2).</p></li>
220    /// <li>
221    /// <p>MODEL: The device model (for example, iPad 5th Gen).</p></li>
222    /// <li>
223    /// <p>AVAILABILITY: The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.</p></li>
224    /// <li>
225    /// <p>FORM_FACTOR: The device form factor. Valid values are PHONE or TABLET.</p></li>
226    /// <li>
227    /// <p>MANUFACTURER: The device manufacturer (for example, Apple).</p></li>
228    /// <li>
229    /// <p>REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote access. Valid values are TRUE or FALSE.</p></li>
230    /// <li>
231    /// <p>REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote debugging. Valid values are TRUE or FALSE. Because remote debugging is <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html">no longer supported</a>, this attribute is ignored.</p></li>
232    /// <li>
233    /// <p>INSTANCE_ARN: The Amazon Resource Name (ARN) of the device instance.</p></li>
234    /// <li>
235    /// <p>INSTANCE_LABELS: The label of the device instance.</p></li>
236    /// <li>
237    /// <p>FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.</p></li>
238    /// </ul></li>
239    /// <li>
240    /// <p>Operator: The filter operator.</p>
241    /// <ul>
242    /// <li>
243    /// <p>The EQUALS operator is available for every attribute except INSTANCE_LABELS.</p></li>
244    /// <li>
245    /// <p>The CONTAINS operator is available for the INSTANCE_LABELS and MODEL attributes.</p></li>
246    /// <li>
247    /// <p>The IN and NOT_IN operators are available for the ARN, OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.</p></li>
248    /// <li>
249    /// <p>The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and GREATER_THAN_OR_EQUALS operators are also available for the OS_VERSION attribute.</p></li>
250    /// </ul></li>
251    /// <li>
252    /// <p>Values: An array of one or more filter values.</p>
253    /// <ul>
254    /// <li>
255    /// <p>The IN and NOT_IN operators take a values array that has one or more elements.</p></li>
256    /// <li>
257    /// <p>The other operators require an array with a single element.</p></li>
258    /// <li>
259    /// <p>In a request, the AVAILABILITY attribute takes the following values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.</p></li>
260    /// </ul></li>
261    /// </ul>
262    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeviceFilter>>) -> Self {
263        self.inner = self.inner.set_filters(input);
264        self
265    }
266    /// <p>Used to select a set of devices. A filter is made up of an attribute, an operator, and one or more values.</p>
267    /// <ul>
268    /// <li>
269    /// <p>Attribute: The aspect of a device such as platform or model used as the selection criteria in a device filter.</p>
270    /// <p>Allowed values include:</p>
271    /// <ul>
272    /// <li>
273    /// <p>ARN: The Amazon Resource Name (ARN) of the device (for example, <code>arn:aws:devicefarm:us-west-2::device:12345Example</code>).</p></li>
274    /// <li>
275    /// <p>PLATFORM: The device platform. Valid values are ANDROID or IOS.</p></li>
276    /// <li>
277    /// <p>OS_VERSION: The operating system version (for example, 10.3.2).</p></li>
278    /// <li>
279    /// <p>MODEL: The device model (for example, iPad 5th Gen).</p></li>
280    /// <li>
281    /// <p>AVAILABILITY: The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.</p></li>
282    /// <li>
283    /// <p>FORM_FACTOR: The device form factor. Valid values are PHONE or TABLET.</p></li>
284    /// <li>
285    /// <p>MANUFACTURER: The device manufacturer (for example, Apple).</p></li>
286    /// <li>
287    /// <p>REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote access. Valid values are TRUE or FALSE.</p></li>
288    /// <li>
289    /// <p>REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote debugging. Valid values are TRUE or FALSE. Because remote debugging is <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html">no longer supported</a>, this attribute is ignored.</p></li>
290    /// <li>
291    /// <p>INSTANCE_ARN: The Amazon Resource Name (ARN) of the device instance.</p></li>
292    /// <li>
293    /// <p>INSTANCE_LABELS: The label of the device instance.</p></li>
294    /// <li>
295    /// <p>FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.</p></li>
296    /// </ul></li>
297    /// <li>
298    /// <p>Operator: The filter operator.</p>
299    /// <ul>
300    /// <li>
301    /// <p>The EQUALS operator is available for every attribute except INSTANCE_LABELS.</p></li>
302    /// <li>
303    /// <p>The CONTAINS operator is available for the INSTANCE_LABELS and MODEL attributes.</p></li>
304    /// <li>
305    /// <p>The IN and NOT_IN operators are available for the ARN, OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.</p></li>
306    /// <li>
307    /// <p>The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and GREATER_THAN_OR_EQUALS operators are also available for the OS_VERSION attribute.</p></li>
308    /// </ul></li>
309    /// <li>
310    /// <p>Values: An array of one or more filter values.</p>
311    /// <ul>
312    /// <li>
313    /// <p>The IN and NOT_IN operators take a values array that has one or more elements.</p></li>
314    /// <li>
315    /// <p>The other operators require an array with a single element.</p></li>
316    /// <li>
317    /// <p>In a request, the AVAILABILITY attribute takes the following values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE.</p></li>
318    /// </ul></li>
319    /// </ul>
320    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeviceFilter>> {
321        self.inner.get_filters()
322    }
323}