aws_sdk_lightsail/operation/get_disks/_get_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 GetDisksOutput {
6 /// <p>An array of objects containing information about all block storage disks.</p>
7 pub disks: ::std::option::Option<::std::vec::Vec<crate::types::Disk>>,
8 /// <p>The token to advance to the next page of results from your request.</p>
9 /// <p>A next page token is not returned if there are no more results to display.</p>
10 /// <p>To get the next page of results, perform another <code>GetDisks</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
11 pub next_page_token: ::std::option::Option<::std::string::String>,
12 _request_id: Option<String>,
13}
14impl GetDisksOutput {
15 /// <p>An array of objects containing information about all block storage disks.</p>
16 ///
17 /// 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()`.
18 pub fn disks(&self) -> &[crate::types::Disk] {
19 self.disks.as_deref().unwrap_or_default()
20 }
21 /// <p>The token to advance to the next page of results from your request.</p>
22 /// <p>A next page token is not returned if there are no more results to display.</p>
23 /// <p>To get the next page of results, perform another <code>GetDisks</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
24 pub fn next_page_token(&self) -> ::std::option::Option<&str> {
25 self.next_page_token.as_deref()
26 }
27}
28impl ::aws_types::request_id::RequestId for GetDisksOutput {
29 fn request_id(&self) -> Option<&str> {
30 self._request_id.as_deref()
31 }
32}
33impl GetDisksOutput {
34 /// Creates a new builder-style object to manufacture [`GetDisksOutput`](crate::operation::get_disks::GetDisksOutput).
35 pub fn builder() -> crate::operation::get_disks::builders::GetDisksOutputBuilder {
36 crate::operation::get_disks::builders::GetDisksOutputBuilder::default()
37 }
38}
39
40/// A builder for [`GetDisksOutput`](crate::operation::get_disks::GetDisksOutput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct GetDisksOutputBuilder {
44 pub(crate) disks: ::std::option::Option<::std::vec::Vec<crate::types::Disk>>,
45 pub(crate) next_page_token: ::std::option::Option<::std::string::String>,
46 _request_id: Option<String>,
47}
48impl GetDisksOutputBuilder {
49 /// Appends an item to `disks`.
50 ///
51 /// To override the contents of this collection use [`set_disks`](Self::set_disks).
52 ///
53 /// <p>An array of objects containing information about all block storage disks.</p>
54 pub fn disks(mut self, input: crate::types::Disk) -> Self {
55 let mut v = self.disks.unwrap_or_default();
56 v.push(input);
57 self.disks = ::std::option::Option::Some(v);
58 self
59 }
60 /// <p>An array of objects containing information about all block storage disks.</p>
61 pub fn set_disks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Disk>>) -> Self {
62 self.disks = input;
63 self
64 }
65 /// <p>An array of objects containing information about all block storage disks.</p>
66 pub fn get_disks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Disk>> {
67 &self.disks
68 }
69 /// <p>The token to advance to the next page of results from your request.</p>
70 /// <p>A next page token is not returned if there are no more results to display.</p>
71 /// <p>To get the next page of results, perform another <code>GetDisks</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
72 pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.next_page_token = ::std::option::Option::Some(input.into());
74 self
75 }
76 /// <p>The token to advance to the next page of results from your request.</p>
77 /// <p>A next page token is not returned if there are no more results to display.</p>
78 /// <p>To get the next page of results, perform another <code>GetDisks</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
79 pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.next_page_token = input;
81 self
82 }
83 /// <p>The token to advance to the next page of results from your request.</p>
84 /// <p>A next page token is not returned if there are no more results to display.</p>
85 /// <p>To get the next page of results, perform another <code>GetDisks</code> request and specify the next page token using the <code>pageToken</code> parameter.</p>
86 pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
87 &self.next_page_token
88 }
89 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
90 self._request_id = Some(request_id.into());
91 self
92 }
93
94 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
95 self._request_id = request_id;
96 self
97 }
98 /// Consumes the builder and constructs a [`GetDisksOutput`](crate::operation::get_disks::GetDisksOutput).
99 pub fn build(self) -> crate::operation::get_disks::GetDisksOutput {
100 crate::operation::get_disks::GetDisksOutput {
101 disks: self.disks,
102 next_page_token: self.next_page_token,
103 _request_id: self._request_id,
104 }
105 }
106}