aws_sdk_braket/operation/get_device/
_get_device_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetDeviceOutput {
6    /// <p>The ARN of the device.</p>
7    pub device_arn: ::std::string::String,
8    /// <p>The name of the device.</p>
9    pub device_name: ::std::string::String,
10    /// <p>The name of the partner company for the device.</p>
11    pub provider_name: ::std::string::String,
12    /// <p>The type of the device.</p>
13    pub device_type: crate::types::DeviceType,
14    /// <p>The status of the device.</p>
15    pub device_status: crate::types::DeviceStatus,
16    /// <p>Details about the capabilities of the device.</p>
17    pub device_capabilities: ::std::string::String,
18    /// <p>The number of quantum tasks and hybrid jobs currently queued on the device.</p>
19    pub device_queue_info: ::std::option::Option<::std::vec::Vec<crate::types::DeviceQueueInfo>>,
20    _request_id: Option<String>,
21}
22impl GetDeviceOutput {
23    /// <p>The ARN of the device.</p>
24    pub fn device_arn(&self) -> &str {
25        use std::ops::Deref;
26        self.device_arn.deref()
27    }
28    /// <p>The name of the device.</p>
29    pub fn device_name(&self) -> &str {
30        use std::ops::Deref;
31        self.device_name.deref()
32    }
33    /// <p>The name of the partner company for the device.</p>
34    pub fn provider_name(&self) -> &str {
35        use std::ops::Deref;
36        self.provider_name.deref()
37    }
38    /// <p>The type of the device.</p>
39    pub fn device_type(&self) -> &crate::types::DeviceType {
40        &self.device_type
41    }
42    /// <p>The status of the device.</p>
43    pub fn device_status(&self) -> &crate::types::DeviceStatus {
44        &self.device_status
45    }
46    /// <p>Details about the capabilities of the device.</p>
47    pub fn device_capabilities(&self) -> &str {
48        use std::ops::Deref;
49        self.device_capabilities.deref()
50    }
51    /// <p>The number of quantum tasks and hybrid jobs currently queued on the device.</p>
52    ///
53    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.device_queue_info.is_none()`.
54    pub fn device_queue_info(&self) -> &[crate::types::DeviceQueueInfo] {
55        self.device_queue_info.as_deref().unwrap_or_default()
56    }
57}
58impl ::aws_types::request_id::RequestId for GetDeviceOutput {
59    fn request_id(&self) -> Option<&str> {
60        self._request_id.as_deref()
61    }
62}
63impl GetDeviceOutput {
64    /// Creates a new builder-style object to manufacture [`GetDeviceOutput`](crate::operation::get_device::GetDeviceOutput).
65    pub fn builder() -> crate::operation::get_device::builders::GetDeviceOutputBuilder {
66        crate::operation::get_device::builders::GetDeviceOutputBuilder::default()
67    }
68}
69
70/// A builder for [`GetDeviceOutput`](crate::operation::get_device::GetDeviceOutput).
71#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct GetDeviceOutputBuilder {
74    pub(crate) device_arn: ::std::option::Option<::std::string::String>,
75    pub(crate) device_name: ::std::option::Option<::std::string::String>,
76    pub(crate) provider_name: ::std::option::Option<::std::string::String>,
77    pub(crate) device_type: ::std::option::Option<crate::types::DeviceType>,
78    pub(crate) device_status: ::std::option::Option<crate::types::DeviceStatus>,
79    pub(crate) device_capabilities: ::std::option::Option<::std::string::String>,
80    pub(crate) device_queue_info: ::std::option::Option<::std::vec::Vec<crate::types::DeviceQueueInfo>>,
81    _request_id: Option<String>,
82}
83impl GetDeviceOutputBuilder {
84    /// <p>The ARN of the device.</p>
85    /// This field is required.
86    pub fn device_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.device_arn = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>The ARN of the device.</p>
91    pub fn set_device_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.device_arn = input;
93        self
94    }
95    /// <p>The ARN of the device.</p>
96    pub fn get_device_arn(&self) -> &::std::option::Option<::std::string::String> {
97        &self.device_arn
98    }
99    /// <p>The name of the device.</p>
100    /// This field is required.
101    pub fn device_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.device_name = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The name of the device.</p>
106    pub fn set_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.device_name = input;
108        self
109    }
110    /// <p>The name of the device.</p>
111    pub fn get_device_name(&self) -> &::std::option::Option<::std::string::String> {
112        &self.device_name
113    }
114    /// <p>The name of the partner company for the device.</p>
115    /// This field is required.
116    pub fn provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.provider_name = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The name of the partner company for the device.</p>
121    pub fn set_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.provider_name = input;
123        self
124    }
125    /// <p>The name of the partner company for the device.</p>
126    pub fn get_provider_name(&self) -> &::std::option::Option<::std::string::String> {
127        &self.provider_name
128    }
129    /// <p>The type of the device.</p>
130    /// This field is required.
131    pub fn device_type(mut self, input: crate::types::DeviceType) -> Self {
132        self.device_type = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The type of the device.</p>
136    pub fn set_device_type(mut self, input: ::std::option::Option<crate::types::DeviceType>) -> Self {
137        self.device_type = input;
138        self
139    }
140    /// <p>The type of the device.</p>
141    pub fn get_device_type(&self) -> &::std::option::Option<crate::types::DeviceType> {
142        &self.device_type
143    }
144    /// <p>The status of the device.</p>
145    /// This field is required.
146    pub fn device_status(mut self, input: crate::types::DeviceStatus) -> Self {
147        self.device_status = ::std::option::Option::Some(input);
148        self
149    }
150    /// <p>The status of the device.</p>
151    pub fn set_device_status(mut self, input: ::std::option::Option<crate::types::DeviceStatus>) -> Self {
152        self.device_status = input;
153        self
154    }
155    /// <p>The status of the device.</p>
156    pub fn get_device_status(&self) -> &::std::option::Option<crate::types::DeviceStatus> {
157        &self.device_status
158    }
159    /// <p>Details about the capabilities of the device.</p>
160    /// This field is required.
161    pub fn device_capabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.device_capabilities = ::std::option::Option::Some(input.into());
163        self
164    }
165    /// <p>Details about the capabilities of the device.</p>
166    pub fn set_device_capabilities(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.device_capabilities = input;
168        self
169    }
170    /// <p>Details about the capabilities of the device.</p>
171    pub fn get_device_capabilities(&self) -> &::std::option::Option<::std::string::String> {
172        &self.device_capabilities
173    }
174    /// Appends an item to `device_queue_info`.
175    ///
176    /// To override the contents of this collection use [`set_device_queue_info`](Self::set_device_queue_info).
177    ///
178    /// <p>The number of quantum tasks and hybrid jobs currently queued on the device.</p>
179    pub fn device_queue_info(mut self, input: crate::types::DeviceQueueInfo) -> Self {
180        let mut v = self.device_queue_info.unwrap_or_default();
181        v.push(input);
182        self.device_queue_info = ::std::option::Option::Some(v);
183        self
184    }
185    /// <p>The number of quantum tasks and hybrid jobs currently queued on the device.</p>
186    pub fn set_device_queue_info(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeviceQueueInfo>>) -> Self {
187        self.device_queue_info = input;
188        self
189    }
190    /// <p>The number of quantum tasks and hybrid jobs currently queued on the device.</p>
191    pub fn get_device_queue_info(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeviceQueueInfo>> {
192        &self.device_queue_info
193    }
194    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
195        self._request_id = Some(request_id.into());
196        self
197    }
198
199    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
200        self._request_id = request_id;
201        self
202    }
203    /// Consumes the builder and constructs a [`GetDeviceOutput`](crate::operation::get_device::GetDeviceOutput).
204    /// This method will fail if any of the following fields are not set:
205    /// - [`device_arn`](crate::operation::get_device::builders::GetDeviceOutputBuilder::device_arn)
206    /// - [`device_name`](crate::operation::get_device::builders::GetDeviceOutputBuilder::device_name)
207    /// - [`provider_name`](crate::operation::get_device::builders::GetDeviceOutputBuilder::provider_name)
208    /// - [`device_type`](crate::operation::get_device::builders::GetDeviceOutputBuilder::device_type)
209    /// - [`device_status`](crate::operation::get_device::builders::GetDeviceOutputBuilder::device_status)
210    /// - [`device_capabilities`](crate::operation::get_device::builders::GetDeviceOutputBuilder::device_capabilities)
211    pub fn build(self) -> ::std::result::Result<crate::operation::get_device::GetDeviceOutput, ::aws_smithy_types::error::operation::BuildError> {
212        ::std::result::Result::Ok(crate::operation::get_device::GetDeviceOutput {
213            device_arn: self.device_arn.ok_or_else(|| {
214                ::aws_smithy_types::error::operation::BuildError::missing_field(
215                    "device_arn",
216                    "device_arn was not specified but it is required when building GetDeviceOutput",
217                )
218            })?,
219            device_name: self.device_name.ok_or_else(|| {
220                ::aws_smithy_types::error::operation::BuildError::missing_field(
221                    "device_name",
222                    "device_name was not specified but it is required when building GetDeviceOutput",
223                )
224            })?,
225            provider_name: self.provider_name.ok_or_else(|| {
226                ::aws_smithy_types::error::operation::BuildError::missing_field(
227                    "provider_name",
228                    "provider_name was not specified but it is required when building GetDeviceOutput",
229                )
230            })?,
231            device_type: self.device_type.ok_or_else(|| {
232                ::aws_smithy_types::error::operation::BuildError::missing_field(
233                    "device_type",
234                    "device_type was not specified but it is required when building GetDeviceOutput",
235                )
236            })?,
237            device_status: self.device_status.ok_or_else(|| {
238                ::aws_smithy_types::error::operation::BuildError::missing_field(
239                    "device_status",
240                    "device_status was not specified but it is required when building GetDeviceOutput",
241                )
242            })?,
243            device_capabilities: self.device_capabilities.ok_or_else(|| {
244                ::aws_smithy_types::error::operation::BuildError::missing_field(
245                    "device_capabilities",
246                    "device_capabilities was not specified but it is required when building GetDeviceOutput",
247                )
248            })?,
249            device_queue_info: self.device_queue_info,
250            _request_id: self._request_id,
251        })
252    }
253}