aws_sdk_fsx/operation/describe_backups/
_describe_backups_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Response object for the <code>DescribeBackups</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeBackupsOutput {
7    /// <p>An array of backups.</p>
8    pub backups: ::std::option::Option<::std::vec::Vec<crate::types::Backup>>,
9    /// <p>A <code>NextToken</code> value is present if there are more backups than returned in the response. You can use the <code>NextToken</code> value in the subsequent request to fetch the backups.</p>
10    pub next_token: ::std::option::Option<::std::string::String>,
11    _request_id: Option<String>,
12}
13impl DescribeBackupsOutput {
14    /// <p>An array of backups.</p>
15    ///
16    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.backups.is_none()`.
17    pub fn backups(&self) -> &[crate::types::Backup] {
18        self.backups.as_deref().unwrap_or_default()
19    }
20    /// <p>A <code>NextToken</code> value is present if there are more backups than returned in the response. You can use the <code>NextToken</code> value in the subsequent request to fetch the backups.</p>
21    pub fn next_token(&self) -> ::std::option::Option<&str> {
22        self.next_token.as_deref()
23    }
24}
25impl ::aws_types::request_id::RequestId for DescribeBackupsOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl DescribeBackupsOutput {
31    /// Creates a new builder-style object to manufacture [`DescribeBackupsOutput`](crate::operation::describe_backups::DescribeBackupsOutput).
32    pub fn builder() -> crate::operation::describe_backups::builders::DescribeBackupsOutputBuilder {
33        crate::operation::describe_backups::builders::DescribeBackupsOutputBuilder::default()
34    }
35}
36
37/// A builder for [`DescribeBackupsOutput`](crate::operation::describe_backups::DescribeBackupsOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct DescribeBackupsOutputBuilder {
41    pub(crate) backups: ::std::option::Option<::std::vec::Vec<crate::types::Backup>>,
42    pub(crate) next_token: ::std::option::Option<::std::string::String>,
43    _request_id: Option<String>,
44}
45impl DescribeBackupsOutputBuilder {
46    /// Appends an item to `backups`.
47    ///
48    /// To override the contents of this collection use [`set_backups`](Self::set_backups).
49    ///
50    /// <p>An array of backups.</p>
51    pub fn backups(mut self, input: crate::types::Backup) -> Self {
52        let mut v = self.backups.unwrap_or_default();
53        v.push(input);
54        self.backups = ::std::option::Option::Some(v);
55        self
56    }
57    /// <p>An array of backups.</p>
58    pub fn set_backups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Backup>>) -> Self {
59        self.backups = input;
60        self
61    }
62    /// <p>An array of backups.</p>
63    pub fn get_backups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Backup>> {
64        &self.backups
65    }
66    /// <p>A <code>NextToken</code> value is present if there are more backups than returned in the response. You can use the <code>NextToken</code> value in the subsequent request to fetch the backups.</p>
67    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.next_token = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>A <code>NextToken</code> value is present if there are more backups than returned in the response. You can use the <code>NextToken</code> value in the subsequent request to fetch the backups.</p>
72    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.next_token = input;
74        self
75    }
76    /// <p>A <code>NextToken</code> value is present if there are more backups than returned in the response. You can use the <code>NextToken</code> value in the subsequent request to fetch the backups.</p>
77    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
78        &self.next_token
79    }
80    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81        self._request_id = Some(request_id.into());
82        self
83    }
84
85    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86        self._request_id = request_id;
87        self
88    }
89    /// Consumes the builder and constructs a [`DescribeBackupsOutput`](crate::operation::describe_backups::DescribeBackupsOutput).
90    pub fn build(self) -> crate::operation::describe_backups::DescribeBackupsOutput {
91        crate::operation::describe_backups::DescribeBackupsOutput {
92            backups: self.backups,
93            next_token: self.next_token,
94            _request_id: self._request_id,
95        }
96    }
97}