aws_sdk_redshift/operation/describe_clusters/_describe_clusters_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output from the <code>DescribeClusters</code> action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeClustersOutput {
7 /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the <code>Marker</code> parameter and retrying the command. If the <code>Marker</code> field is empty, all response records have been retrieved for the request.</p>
8 pub marker: ::std::option::Option<::std::string::String>,
9 /// <p>A list of <code>Cluster</code> objects, where each object describes one cluster.</p>
10 pub clusters: ::std::option::Option<::std::vec::Vec<crate::types::Cluster>>,
11 _request_id: Option<String>,
12}
13impl DescribeClustersOutput {
14 /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the <code>Marker</code> parameter and retrying the command. If the <code>Marker</code> field is empty, all response records have been retrieved for the request.</p>
15 pub fn marker(&self) -> ::std::option::Option<&str> {
16 self.marker.as_deref()
17 }
18 /// <p>A list of <code>Cluster</code> objects, where each object describes one cluster.</p>
19 ///
20 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.clusters.is_none()`.
21 pub fn clusters(&self) -> &[crate::types::Cluster] {
22 self.clusters.as_deref().unwrap_or_default()
23 }
24}
25impl ::aws_types::request_id::RequestId for DescribeClustersOutput {
26 fn request_id(&self) -> Option<&str> {
27 self._request_id.as_deref()
28 }
29}
30impl DescribeClustersOutput {
31 /// Creates a new builder-style object to manufacture [`DescribeClustersOutput`](crate::operation::describe_clusters::DescribeClustersOutput).
32 pub fn builder() -> crate::operation::describe_clusters::builders::DescribeClustersOutputBuilder {
33 crate::operation::describe_clusters::builders::DescribeClustersOutputBuilder::default()
34 }
35}
36
37/// A builder for [`DescribeClustersOutput`](crate::operation::describe_clusters::DescribeClustersOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct DescribeClustersOutputBuilder {
41 pub(crate) marker: ::std::option::Option<::std::string::String>,
42 pub(crate) clusters: ::std::option::Option<::std::vec::Vec<crate::types::Cluster>>,
43 _request_id: Option<String>,
44}
45impl DescribeClustersOutputBuilder {
46 /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the <code>Marker</code> parameter and retrying the command. If the <code>Marker</code> field is empty, all response records have been retrieved for the request.</p>
47 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.marker = ::std::option::Option::Some(input.into());
49 self
50 }
51 /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the <code>Marker</code> parameter and retrying the command. If the <code>Marker</code> field is empty, all response records have been retrieved for the request.</p>
52 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.marker = input;
54 self
55 }
56 /// <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the <code>Marker</code> parameter and retrying the command. If the <code>Marker</code> field is empty, all response records have been retrieved for the request.</p>
57 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
58 &self.marker
59 }
60 /// Appends an item to `clusters`.
61 ///
62 /// To override the contents of this collection use [`set_clusters`](Self::set_clusters).
63 ///
64 /// <p>A list of <code>Cluster</code> objects, where each object describes one cluster.</p>
65 pub fn clusters(mut self, input: crate::types::Cluster) -> Self {
66 let mut v = self.clusters.unwrap_or_default();
67 v.push(input);
68 self.clusters = ::std::option::Option::Some(v);
69 self
70 }
71 /// <p>A list of <code>Cluster</code> objects, where each object describes one cluster.</p>
72 pub fn set_clusters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Cluster>>) -> Self {
73 self.clusters = input;
74 self
75 }
76 /// <p>A list of <code>Cluster</code> objects, where each object describes one cluster.</p>
77 pub fn get_clusters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Cluster>> {
78 &self.clusters
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 [`DescribeClustersOutput`](crate::operation::describe_clusters::DescribeClustersOutput).
90 pub fn build(self) -> crate::operation::describe_clusters::DescribeClustersOutput {
91 crate::operation::describe_clusters::DescribeClustersOutput {
92 marker: self.marker,
93 clusters: self.clusters,
94 _request_id: self._request_id,
95 }
96 }
97}