aws_sdk_storagegateway/operation/list_local_disks/
_list_local_disks_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 ListLocalDisksOutput {
6    /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
7    pub gateway_arn: ::std::option::Option<::std::string::String>,
8    /// <p>A JSON object containing the following fields:</p>
9    /// <ul>
10    /// <li>
11    /// <p><code>ListLocalDisksOutput$Disks</code></p></li>
12    /// </ul>
13    pub disks: ::std::option::Option<::std::vec::Vec<crate::types::Disk>>,
14    _request_id: Option<String>,
15}
16impl ListLocalDisksOutput {
17    /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
18    pub fn gateway_arn(&self) -> ::std::option::Option<&str> {
19        self.gateway_arn.as_deref()
20    }
21    /// <p>A JSON object containing the following fields:</p>
22    /// <ul>
23    /// <li>
24    /// <p><code>ListLocalDisksOutput$Disks</code></p></li>
25    /// </ul>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.disks.is_none()`.
28    pub fn disks(&self) -> &[crate::types::Disk] {
29        self.disks.as_deref().unwrap_or_default()
30    }
31}
32impl ::aws_types::request_id::RequestId for ListLocalDisksOutput {
33    fn request_id(&self) -> Option<&str> {
34        self._request_id.as_deref()
35    }
36}
37impl ListLocalDisksOutput {
38    /// Creates a new builder-style object to manufacture [`ListLocalDisksOutput`](crate::operation::list_local_disks::ListLocalDisksOutput).
39    pub fn builder() -> crate::operation::list_local_disks::builders::ListLocalDisksOutputBuilder {
40        crate::operation::list_local_disks::builders::ListLocalDisksOutputBuilder::default()
41    }
42}
43
44/// A builder for [`ListLocalDisksOutput`](crate::operation::list_local_disks::ListLocalDisksOutput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct ListLocalDisksOutputBuilder {
48    pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
49    pub(crate) disks: ::std::option::Option<::std::vec::Vec<crate::types::Disk>>,
50    _request_id: Option<String>,
51}
52impl ListLocalDisksOutputBuilder {
53    /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
54    pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.gateway_arn = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
59    pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.gateway_arn = input;
61        self
62    }
63    /// <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
64    pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
65        &self.gateway_arn
66    }
67    /// Appends an item to `disks`.
68    ///
69    /// To override the contents of this collection use [`set_disks`](Self::set_disks).
70    ///
71    /// <p>A JSON object containing the following fields:</p>
72    /// <ul>
73    /// <li>
74    /// <p><code>ListLocalDisksOutput$Disks</code></p></li>
75    /// </ul>
76    pub fn disks(mut self, input: crate::types::Disk) -> Self {
77        let mut v = self.disks.unwrap_or_default();
78        v.push(input);
79        self.disks = ::std::option::Option::Some(v);
80        self
81    }
82    /// <p>A JSON object containing the following fields:</p>
83    /// <ul>
84    /// <li>
85    /// <p><code>ListLocalDisksOutput$Disks</code></p></li>
86    /// </ul>
87    pub fn set_disks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Disk>>) -> Self {
88        self.disks = input;
89        self
90    }
91    /// <p>A JSON object containing the following fields:</p>
92    /// <ul>
93    /// <li>
94    /// <p><code>ListLocalDisksOutput$Disks</code></p></li>
95    /// </ul>
96    pub fn get_disks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Disk>> {
97        &self.disks
98    }
99    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
100        self._request_id = Some(request_id.into());
101        self
102    }
103
104    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
105        self._request_id = request_id;
106        self
107    }
108    /// Consumes the builder and constructs a [`ListLocalDisksOutput`](crate::operation::list_local_disks::ListLocalDisksOutput).
109    pub fn build(self) -> crate::operation::list_local_disks::ListLocalDisksOutput {
110        crate::operation::list_local_disks::ListLocalDisksOutput {
111            gateway_arn: self.gateway_arn,
112            disks: self.disks,
113            _request_id: self._request_id,
114        }
115    }
116}