aws_sdk_braket/operation/get_device/
_get_device_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetDeviceOutput {
6 pub device_arn: ::std::string::String,
8 pub device_name: ::std::string::String,
10 pub provider_name: ::std::string::String,
12 pub device_type: crate::types::DeviceType,
14 pub device_status: crate::types::DeviceStatus,
16 pub device_capabilities: ::std::string::String,
18 pub device_queue_info: ::std::option::Option<::std::vec::Vec<crate::types::DeviceQueueInfo>>,
20 _request_id: Option<String>,
21}
22impl GetDeviceOutput {
23 pub fn device_arn(&self) -> &str {
25 use std::ops::Deref;
26 self.device_arn.deref()
27 }
28 pub fn device_name(&self) -> &str {
30 use std::ops::Deref;
31 self.device_name.deref()
32 }
33 pub fn provider_name(&self) -> &str {
35 use std::ops::Deref;
36 self.provider_name.deref()
37 }
38 pub fn device_type(&self) -> &crate::types::DeviceType {
40 &self.device_type
41 }
42 pub fn device_status(&self) -> &crate::types::DeviceStatus {
44 &self.device_status
45 }
46 pub fn device_capabilities(&self) -> &str {
48 use std::ops::Deref;
49 self.device_capabilities.deref()
50 }
51 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 pub fn builder() -> crate::operation::get_device::builders::GetDeviceOutputBuilder {
66 crate::operation::get_device::builders::GetDeviceOutputBuilder::default()
67 }
68}
69
70#[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 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 pub fn set_device_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.device_arn = input;
93 self
94 }
95 pub fn get_device_arn(&self) -> &::std::option::Option<::std::string::String> {
97 &self.device_arn
98 }
99 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 pub fn set_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107 self.device_name = input;
108 self
109 }
110 pub fn get_device_name(&self) -> &::std::option::Option<::std::string::String> {
112 &self.device_name
113 }
114 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 pub fn set_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.provider_name = input;
123 self
124 }
125 pub fn get_provider_name(&self) -> &::std::option::Option<::std::string::String> {
127 &self.provider_name
128 }
129 pub fn device_type(mut self, input: crate::types::DeviceType) -> Self {
132 self.device_type = ::std::option::Option::Some(input);
133 self
134 }
135 pub fn set_device_type(mut self, input: ::std::option::Option<crate::types::DeviceType>) -> Self {
137 self.device_type = input;
138 self
139 }
140 pub fn get_device_type(&self) -> &::std::option::Option<crate::types::DeviceType> {
142 &self.device_type
143 }
144 pub fn device_status(mut self, input: crate::types::DeviceStatus) -> Self {
147 self.device_status = ::std::option::Option::Some(input);
148 self
149 }
150 pub fn set_device_status(mut self, input: ::std::option::Option<crate::types::DeviceStatus>) -> Self {
152 self.device_status = input;
153 self
154 }
155 pub fn get_device_status(&self) -> &::std::option::Option<crate::types::DeviceStatus> {
157 &self.device_status
158 }
159 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 pub fn set_device_capabilities(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.device_capabilities = input;
168 self
169 }
170 pub fn get_device_capabilities(&self) -> &::std::option::Option<::std::string::String> {
172 &self.device_capabilities
173 }
174 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 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 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 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}