aws_sdk_iot/operation/list_policies/
_list_policies_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output from the ListPolicies operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListPoliciesOutput {
7    /// <p>The descriptions of the policies.</p>
8    pub policies: ::std::option::Option<::std::vec::Vec<crate::types::Policy>>,
9    /// <p>The marker for the next set of results, or null if there are no additional results.</p>
10    pub next_marker: ::std::option::Option<::std::string::String>,
11    _request_id: Option<String>,
12}
13impl ListPoliciesOutput {
14    /// <p>The descriptions of the policies.</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 `.policies.is_none()`.
17    pub fn policies(&self) -> &[crate::types::Policy] {
18        self.policies.as_deref().unwrap_or_default()
19    }
20    /// <p>The marker for the next set of results, or null if there are no additional results.</p>
21    pub fn next_marker(&self) -> ::std::option::Option<&str> {
22        self.next_marker.as_deref()
23    }
24}
25impl ::aws_types::request_id::RequestId for ListPoliciesOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl ListPoliciesOutput {
31    /// Creates a new builder-style object to manufacture [`ListPoliciesOutput`](crate::operation::list_policies::ListPoliciesOutput).
32    pub fn builder() -> crate::operation::list_policies::builders::ListPoliciesOutputBuilder {
33        crate::operation::list_policies::builders::ListPoliciesOutputBuilder::default()
34    }
35}
36
37/// A builder for [`ListPoliciesOutput`](crate::operation::list_policies::ListPoliciesOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct ListPoliciesOutputBuilder {
41    pub(crate) policies: ::std::option::Option<::std::vec::Vec<crate::types::Policy>>,
42    pub(crate) next_marker: ::std::option::Option<::std::string::String>,
43    _request_id: Option<String>,
44}
45impl ListPoliciesOutputBuilder {
46    /// Appends an item to `policies`.
47    ///
48    /// To override the contents of this collection use [`set_policies`](Self::set_policies).
49    ///
50    /// <p>The descriptions of the policies.</p>
51    pub fn policies(mut self, input: crate::types::Policy) -> Self {
52        let mut v = self.policies.unwrap_or_default();
53        v.push(input);
54        self.policies = ::std::option::Option::Some(v);
55        self
56    }
57    /// <p>The descriptions of the policies.</p>
58    pub fn set_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Policy>>) -> Self {
59        self.policies = input;
60        self
61    }
62    /// <p>The descriptions of the policies.</p>
63    pub fn get_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Policy>> {
64        &self.policies
65    }
66    /// <p>The marker for the next set of results, or null if there are no additional results.</p>
67    pub fn next_marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.next_marker = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The marker for the next set of results, or null if there are no additional results.</p>
72    pub fn set_next_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.next_marker = input;
74        self
75    }
76    /// <p>The marker for the next set of results, or null if there are no additional results.</p>
77    pub fn get_next_marker(&self) -> &::std::option::Option<::std::string::String> {
78        &self.next_marker
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 [`ListPoliciesOutput`](crate::operation::list_policies::ListPoliciesOutput).
90    pub fn build(self) -> crate::operation::list_policies::ListPoliciesOutput {
91        crate::operation::list_policies::ListPoliciesOutput {
92            policies: self.policies,
93            next_marker: self.next_marker,
94            _request_id: self._request_id,
95        }
96    }
97}