Skip to main content

aws_sdk_cloudfront/operation/list_connection_groups/
_list_connection_groups_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 ListConnectionGroupsOutput {
6    /// <p>A token used for pagination of results returned in the response. You can use the token from the previous request to define where the current request should begin.</p>
7    pub next_marker: ::std::option::Option<::std::string::String>,
8    /// <p>The list of connection groups that you retrieved.</p>
9    pub connection_groups: ::std::option::Option<::std::vec::Vec<crate::types::ConnectionGroupSummary>>,
10    _request_id: Option<String>,
11}
12impl ListConnectionGroupsOutput {
13    /// <p>A token used for pagination of results returned in the response. You can use the token from the previous request to define where the current request should begin.</p>
14    pub fn next_marker(&self) -> ::std::option::Option<&str> {
15        self.next_marker.as_deref()
16    }
17    /// <p>The list of connection groups that you retrieved.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.connection_groups.is_none()`.
20    pub fn connection_groups(&self) -> &[crate::types::ConnectionGroupSummary] {
21        self.connection_groups.as_deref().unwrap_or_default()
22    }
23}
24impl ::aws_types::request_id::RequestId for ListConnectionGroupsOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl ListConnectionGroupsOutput {
30    /// Creates a new builder-style object to manufacture [`ListConnectionGroupsOutput`](crate::operation::list_connection_groups::ListConnectionGroupsOutput).
31    pub fn builder() -> crate::operation::list_connection_groups::builders::ListConnectionGroupsOutputBuilder {
32        crate::operation::list_connection_groups::builders::ListConnectionGroupsOutputBuilder::default()
33    }
34}
35
36/// A builder for [`ListConnectionGroupsOutput`](crate::operation::list_connection_groups::ListConnectionGroupsOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ListConnectionGroupsOutputBuilder {
40    pub(crate) next_marker: ::std::option::Option<::std::string::String>,
41    pub(crate) connection_groups: ::std::option::Option<::std::vec::Vec<crate::types::ConnectionGroupSummary>>,
42    _request_id: Option<String>,
43}
44impl ListConnectionGroupsOutputBuilder {
45    /// <p>A token used for pagination of results returned in the response. You can use the token from the previous request to define where the current request should begin.</p>
46    pub fn next_marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.next_marker = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>A token used for pagination of results returned in the response. You can use the token from the previous request to define where the current request should begin.</p>
51    pub fn set_next_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.next_marker = input;
53        self
54    }
55    /// <p>A token used for pagination of results returned in the response. You can use the token from the previous request to define where the current request should begin.</p>
56    pub fn get_next_marker(&self) -> &::std::option::Option<::std::string::String> {
57        &self.next_marker
58    }
59    /// Appends an item to `connection_groups`.
60    ///
61    /// To override the contents of this collection use [`set_connection_groups`](Self::set_connection_groups).
62    ///
63    /// <p>The list of connection groups that you retrieved.</p>
64    pub fn connection_groups(mut self, input: crate::types::ConnectionGroupSummary) -> Self {
65        let mut v = self.connection_groups.unwrap_or_default();
66        v.push(input);
67        self.connection_groups = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The list of connection groups that you retrieved.</p>
71    pub fn set_connection_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConnectionGroupSummary>>) -> Self {
72        self.connection_groups = input;
73        self
74    }
75    /// <p>The list of connection groups that you retrieved.</p>
76    pub fn get_connection_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConnectionGroupSummary>> {
77        &self.connection_groups
78    }
79    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
80        self._request_id = Some(request_id.into());
81        self
82    }
83
84    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
85        self._request_id = request_id;
86        self
87    }
88    /// Consumes the builder and constructs a [`ListConnectionGroupsOutput`](crate::operation::list_connection_groups::ListConnectionGroupsOutput).
89    pub fn build(self) -> crate::operation::list_connection_groups::ListConnectionGroupsOutput {
90        crate::operation::list_connection_groups::ListConnectionGroupsOutput {
91            next_marker: self.next_marker,
92            connection_groups: self.connection_groups,
93            _request_id: self._request_id,
94        }
95    }
96}