Skip to main content

aws_sdk_devicefarm/types/
_device_instance.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the device instance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeviceInstance {
7    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// <p>The ARN of the device.</p>
10    pub device_arn: ::std::option::Option<::std::string::String>,
11    /// <p>An array of strings that describe the device instance.</p>
12    pub labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>The status of the device instance. Valid values are listed here.</p>
14    pub status: ::std::option::Option<crate::types::InstanceStatus>,
15    /// <p>Unique device identifier for the device instance.</p>
16    pub udid: ::std::option::Option<::std::string::String>,
17    /// <p>A object that contains information about the instance profile.</p>
18    pub instance_profile: ::std::option::Option<crate::types::InstanceProfile>,
19}
20impl DeviceInstance {
21    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
22    pub fn arn(&self) -> ::std::option::Option<&str> {
23        self.arn.as_deref()
24    }
25    /// <p>The ARN of the device.</p>
26    pub fn device_arn(&self) -> ::std::option::Option<&str> {
27        self.device_arn.as_deref()
28    }
29    /// <p>An array of strings that describe the device instance.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.labels.is_none()`.
32    pub fn labels(&self) -> &[::std::string::String] {
33        self.labels.as_deref().unwrap_or_default()
34    }
35    /// <p>The status of the device instance. Valid values are listed here.</p>
36    pub fn status(&self) -> ::std::option::Option<&crate::types::InstanceStatus> {
37        self.status.as_ref()
38    }
39    /// <p>Unique device identifier for the device instance.</p>
40    pub fn udid(&self) -> ::std::option::Option<&str> {
41        self.udid.as_deref()
42    }
43    /// <p>A object that contains information about the instance profile.</p>
44    pub fn instance_profile(&self) -> ::std::option::Option<&crate::types::InstanceProfile> {
45        self.instance_profile.as_ref()
46    }
47}
48impl DeviceInstance {
49    /// Creates a new builder-style object to manufacture [`DeviceInstance`](crate::types::DeviceInstance).
50    pub fn builder() -> crate::types::builders::DeviceInstanceBuilder {
51        crate::types::builders::DeviceInstanceBuilder::default()
52    }
53}
54
55/// A builder for [`DeviceInstance`](crate::types::DeviceInstance).
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct DeviceInstanceBuilder {
59    pub(crate) arn: ::std::option::Option<::std::string::String>,
60    pub(crate) device_arn: ::std::option::Option<::std::string::String>,
61    pub(crate) labels: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
62    pub(crate) status: ::std::option::Option<crate::types::InstanceStatus>,
63    pub(crate) udid: ::std::option::Option<::std::string::String>,
64    pub(crate) instance_profile: ::std::option::Option<crate::types::InstanceProfile>,
65}
66impl DeviceInstanceBuilder {
67    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
68    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.arn = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
73    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.arn = input;
75        self
76    }
77    /// <p>The Amazon Resource Name (ARN) of the device instance.</p>
78    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
79        &self.arn
80    }
81    /// <p>The ARN of the device.</p>
82    pub fn device_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.device_arn = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The ARN of the device.</p>
87    pub fn set_device_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.device_arn = input;
89        self
90    }
91    /// <p>The ARN of the device.</p>
92    pub fn get_device_arn(&self) -> &::std::option::Option<::std::string::String> {
93        &self.device_arn
94    }
95    /// Appends an item to `labels`.
96    ///
97    /// To override the contents of this collection use [`set_labels`](Self::set_labels).
98    ///
99    /// <p>An array of strings that describe the device instance.</p>
100    pub fn labels(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        let mut v = self.labels.unwrap_or_default();
102        v.push(input.into());
103        self.labels = ::std::option::Option::Some(v);
104        self
105    }
106    /// <p>An array of strings that describe the device instance.</p>
107    pub fn set_labels(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
108        self.labels = input;
109        self
110    }
111    /// <p>An array of strings that describe the device instance.</p>
112    pub fn get_labels(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
113        &self.labels
114    }
115    /// <p>The status of the device instance. Valid values are listed here.</p>
116    pub fn status(mut self, input: crate::types::InstanceStatus) -> Self {
117        self.status = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>The status of the device instance. Valid values are listed here.</p>
121    pub fn set_status(mut self, input: ::std::option::Option<crate::types::InstanceStatus>) -> Self {
122        self.status = input;
123        self
124    }
125    /// <p>The status of the device instance. Valid values are listed here.</p>
126    pub fn get_status(&self) -> &::std::option::Option<crate::types::InstanceStatus> {
127        &self.status
128    }
129    /// <p>Unique device identifier for the device instance.</p>
130    pub fn udid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.udid = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>Unique device identifier for the device instance.</p>
135    pub fn set_udid(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.udid = input;
137        self
138    }
139    /// <p>Unique device identifier for the device instance.</p>
140    pub fn get_udid(&self) -> &::std::option::Option<::std::string::String> {
141        &self.udid
142    }
143    /// <p>A object that contains information about the instance profile.</p>
144    pub fn instance_profile(mut self, input: crate::types::InstanceProfile) -> Self {
145        self.instance_profile = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>A object that contains information about the instance profile.</p>
149    pub fn set_instance_profile(mut self, input: ::std::option::Option<crate::types::InstanceProfile>) -> Self {
150        self.instance_profile = input;
151        self
152    }
153    /// <p>A object that contains information about the instance profile.</p>
154    pub fn get_instance_profile(&self) -> &::std::option::Option<crate::types::InstanceProfile> {
155        &self.instance_profile
156    }
157    /// Consumes the builder and constructs a [`DeviceInstance`](crate::types::DeviceInstance).
158    pub fn build(self) -> crate::types::DeviceInstance {
159        crate::types::DeviceInstance {
160            arn: self.arn,
161            device_arn: self.device_arn,
162            labels: self.labels,
163            status: self.status,
164            udid: self.udid,
165            instance_profile: self.instance_profile,
166        }
167    }
168}