Skip to main content

aws_sdk_swf/operation/list_workflow_types/
_list_workflow_types_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains a paginated list of information structures about workflow types.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ListWorkflowTypesOutput {
7    /// <p>The list of workflow type information.</p>
8    pub type_infos: ::std::vec::Vec<crate::types::WorkflowTypeInfo>,
9    /// <p>If a <code>NextPageToken</code> was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in <code>nextPageToken</code>. Keep all other arguments unchanged.</p>
10    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
11    pub next_page_token: ::std::option::Option<::std::string::String>,
12    _request_id: Option<String>,
13}
14impl ListWorkflowTypesOutput {
15    /// <p>The list of workflow type information.</p>
16    pub fn type_infos(&self) -> &[crate::types::WorkflowTypeInfo] {
17        use std::ops::Deref;
18        self.type_infos.deref()
19    }
20    /// <p>If a <code>NextPageToken</code> was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in <code>nextPageToken</code>. Keep all other arguments unchanged.</p>
21    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
22    pub fn next_page_token(&self) -> ::std::option::Option<&str> {
23        self.next_page_token.as_deref()
24    }
25}
26impl ::aws_types::request_id::RequestId for ListWorkflowTypesOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl ListWorkflowTypesOutput {
32    /// Creates a new builder-style object to manufacture [`ListWorkflowTypesOutput`](crate::operation::list_workflow_types::ListWorkflowTypesOutput).
33    pub fn builder() -> crate::operation::list_workflow_types::builders::ListWorkflowTypesOutputBuilder {
34        crate::operation::list_workflow_types::builders::ListWorkflowTypesOutputBuilder::default()
35    }
36}
37
38/// A builder for [`ListWorkflowTypesOutput`](crate::operation::list_workflow_types::ListWorkflowTypesOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct ListWorkflowTypesOutputBuilder {
42    pub(crate) type_infos: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowTypeInfo>>,
43    pub(crate) next_page_token: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl ListWorkflowTypesOutputBuilder {
47    /// Appends an item to `type_infos`.
48    ///
49    /// To override the contents of this collection use [`set_type_infos`](Self::set_type_infos).
50    ///
51    /// <p>The list of workflow type information.</p>
52    pub fn type_infos(mut self, input: crate::types::WorkflowTypeInfo) -> Self {
53        let mut v = self.type_infos.unwrap_or_default();
54        v.push(input);
55        self.type_infos = ::std::option::Option::Some(v);
56        self
57    }
58    /// <p>The list of workflow type information.</p>
59    pub fn set_type_infos(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowTypeInfo>>) -> Self {
60        self.type_infos = input;
61        self
62    }
63    /// <p>The list of workflow type information.</p>
64    pub fn get_type_infos(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WorkflowTypeInfo>> {
65        &self.type_infos
66    }
67    /// <p>If a <code>NextPageToken</code> was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in <code>nextPageToken</code>. Keep all other arguments unchanged.</p>
68    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
69    pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.next_page_token = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>If a <code>NextPageToken</code> was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in <code>nextPageToken</code>. Keep all other arguments unchanged.</p>
74    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
75    pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.next_page_token = input;
77        self
78    }
79    /// <p>If a <code>NextPageToken</code> was returned by a previous call, there are more results available. To retrieve the next page of results, make the call again using the returned token in <code>nextPageToken</code>. Keep all other arguments unchanged.</p>
80    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
81    pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
82        &self.next_page_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 [`ListWorkflowTypesOutput`](crate::operation::list_workflow_types::ListWorkflowTypesOutput).
94    /// This method will fail if any of the following fields are not set:
95    /// - [`type_infos`](crate::operation::list_workflow_types::builders::ListWorkflowTypesOutputBuilder::type_infos)
96    pub fn build(
97        self,
98    ) -> ::std::result::Result<crate::operation::list_workflow_types::ListWorkflowTypesOutput, ::aws_smithy_types::error::operation::BuildError> {
99        ::std::result::Result::Ok(crate::operation::list_workflow_types::ListWorkflowTypesOutput {
100            type_infos: self.type_infos.ok_or_else(|| {
101                ::aws_smithy_types::error::operation::BuildError::missing_field(
102                    "type_infos",
103                    "type_infos was not specified but it is required when building ListWorkflowTypesOutput",
104                )
105            })?,
106            next_page_token: self.next_page_token,
107            _request_id: self._request_id,
108        })
109    }
110}