aws_sdk_mediaconnect/operation/list_flows/
_list_flows_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 ListFlowsOutput {
6    /// <p>A list of flow summaries.</p>
7    pub flows: ::std::option::Option<::std::vec::Vec<crate::types::ListedFlow>>,
8    /// <p>The token that identifies the batch of results that you want to see.</p>
9    /// <p>For example, you submit a <code>ListFlows</code> request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListFlows</code> request a second time and specify the <code>NextToken</code> value.</p>
10    pub next_token: ::std::option::Option<::std::string::String>,
11    _request_id: Option<String>,
12}
13impl ListFlowsOutput {
14    /// <p>A list of flow summaries.</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 `.flows.is_none()`.
17    pub fn flows(&self) -> &[crate::types::ListedFlow] {
18        self.flows.as_deref().unwrap_or_default()
19    }
20    /// <p>The token that identifies the batch of results that you want to see.</p>
21    /// <p>For example, you submit a <code>ListFlows</code> request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListFlows</code> request a second time and specify the <code>NextToken</code> value.</p>
22    pub fn next_token(&self) -> ::std::option::Option<&str> {
23        self.next_token.as_deref()
24    }
25}
26impl ::aws_types::request_id::RequestId for ListFlowsOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl ListFlowsOutput {
32    /// Creates a new builder-style object to manufacture [`ListFlowsOutput`](crate::operation::list_flows::ListFlowsOutput).
33    pub fn builder() -> crate::operation::list_flows::builders::ListFlowsOutputBuilder {
34        crate::operation::list_flows::builders::ListFlowsOutputBuilder::default()
35    }
36}
37
38/// A builder for [`ListFlowsOutput`](crate::operation::list_flows::ListFlowsOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct ListFlowsOutputBuilder {
42    pub(crate) flows: ::std::option::Option<::std::vec::Vec<crate::types::ListedFlow>>,
43    pub(crate) next_token: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl ListFlowsOutputBuilder {
47    /// Appends an item to `flows`.
48    ///
49    /// To override the contents of this collection use [`set_flows`](Self::set_flows).
50    ///
51    /// <p>A list of flow summaries.</p>
52    pub fn flows(mut self, input: crate::types::ListedFlow) -> Self {
53        let mut v = self.flows.unwrap_or_default();
54        v.push(input);
55        self.flows = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>A list of flow summaries.</p>
59    pub fn set_flows(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ListedFlow>>) -> Self {
60        self.flows = input;
61        self
62    }
63    /// <p>A list of flow summaries.</p>
64    pub fn get_flows(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ListedFlow>> {
65        &self.flows
66    }
67    /// <p>The token that identifies the batch of results that you want to see.</p>
68    /// <p>For example, you submit a <code>ListFlows</code> request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListFlows</code> request a second time and specify the <code>NextToken</code> value.</p>
69    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.next_token = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The token that identifies the batch of results that you want to see.</p>
74    /// <p>For example, you submit a <code>ListFlows</code> request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListFlows</code> request a second time and specify the <code>NextToken</code> value.</p>
75    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.next_token = input;
77        self
78    }
79    /// <p>The token that identifies the batch of results that you want to see.</p>
80    /// <p>For example, you submit a <code>ListFlows</code> request with MaxResults set at 5. The service returns the first batch of results (up to 5) and a <code>NextToken</code> value. To see the next batch of results, you can submit the <code>ListFlows</code> request a second time and specify the <code>NextToken</code> value.</p>
81    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
82        &self.next_token
83    }
84    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
85        self._request_id = Some(request_id.into());
86        self
87    }
88
89    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
90        self._request_id = request_id;
91        self
92    }
93    /// Consumes the builder and constructs a [`ListFlowsOutput`](crate::operation::list_flows::ListFlowsOutput).
94    pub fn build(self) -> crate::operation::list_flows::ListFlowsOutput {
95        crate::operation::list_flows::ListFlowsOutput {
96            flows: self.flows,
97            next_token: self.next_token,
98            _request_id: self._request_id,
99        }
100    }
101}