aws_sdk_elasticsearch/operation/describe_packages/
_describe_packages_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for request parameters to <code> <code>DescribePackage</code> </code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribePackagesInput {
7    /// <p>Only returns packages that match the <code>DescribePackagesFilterList</code> values.</p>
8    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::DescribePackagesFilter>>,
9    /// <p>Limits results to a maximum number of packages.</p>
10    pub max_results: ::std::option::Option<i32>,
11    /// <p>Used for pagination. Only necessary if a previous API call includes a non-null NextToken value. If provided, returns results for the next page.</p>
12    pub next_token: ::std::option::Option<::std::string::String>,
13}
14impl DescribePackagesInput {
15    /// <p>Only returns packages that match the <code>DescribePackagesFilterList</code> values.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
18    pub fn filters(&self) -> &[crate::types::DescribePackagesFilter] {
19        self.filters.as_deref().unwrap_or_default()
20    }
21    /// <p>Limits results to a maximum number of packages.</p>
22    pub fn max_results(&self) -> ::std::option::Option<i32> {
23        self.max_results
24    }
25    /// <p>Used for pagination. Only necessary if a previous API call includes a non-null NextToken value. If provided, returns results for the next page.</p>
26    pub fn next_token(&self) -> ::std::option::Option<&str> {
27        self.next_token.as_deref()
28    }
29}
30impl DescribePackagesInput {
31    /// Creates a new builder-style object to manufacture [`DescribePackagesInput`](crate::operation::describe_packages::DescribePackagesInput).
32    pub fn builder() -> crate::operation::describe_packages::builders::DescribePackagesInputBuilder {
33        crate::operation::describe_packages::builders::DescribePackagesInputBuilder::default()
34    }
35}
36
37/// A builder for [`DescribePackagesInput`](crate::operation::describe_packages::DescribePackagesInput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct DescribePackagesInputBuilder {
41    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::DescribePackagesFilter>>,
42    pub(crate) max_results: ::std::option::Option<i32>,
43    pub(crate) next_token: ::std::option::Option<::std::string::String>,
44}
45impl DescribePackagesInputBuilder {
46    /// Appends an item to `filters`.
47    ///
48    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
49    ///
50    /// <p>Only returns packages that match the <code>DescribePackagesFilterList</code> values.</p>
51    pub fn filters(mut self, input: crate::types::DescribePackagesFilter) -> Self {
52        let mut v = self.filters.unwrap_or_default();
53        v.push(input);
54        self.filters = ::std::option::Option::Some(v);
55        self
56    }
57    /// <p>Only returns packages that match the <code>DescribePackagesFilterList</code> values.</p>
58    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DescribePackagesFilter>>) -> Self {
59        self.filters = input;
60        self
61    }
62    /// <p>Only returns packages that match the <code>DescribePackagesFilterList</code> values.</p>
63    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DescribePackagesFilter>> {
64        &self.filters
65    }
66    /// <p>Limits results to a maximum number of packages.</p>
67    pub fn max_results(mut self, input: i32) -> Self {
68        self.max_results = ::std::option::Option::Some(input);
69        self
70    }
71    /// <p>Limits results to a maximum number of packages.</p>
72    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
73        self.max_results = input;
74        self
75    }
76    /// <p>Limits results to a maximum number of packages.</p>
77    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
78        &self.max_results
79    }
80    /// <p>Used for pagination. Only necessary if a previous API call includes a non-null NextToken value. If provided, returns results for the next page.</p>
81    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.next_token = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>Used for pagination. Only necessary if a previous API call includes a non-null NextToken value. If provided, returns results for the next page.</p>
86    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.next_token = input;
88        self
89    }
90    /// <p>Used for pagination. Only necessary if a previous API call includes a non-null NextToken value. If provided, returns results for the next page.</p>
91    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
92        &self.next_token
93    }
94    /// Consumes the builder and constructs a [`DescribePackagesInput`](crate::operation::describe_packages::DescribePackagesInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<crate::operation::describe_packages::DescribePackagesInput, ::aws_smithy_types::error::operation::BuildError> {
98        ::std::result::Result::Ok(crate::operation::describe_packages::DescribePackagesInput {
99            filters: self.filters,
100            max_results: self.max_results,
101            next_token: self.next_token,
102        })
103    }
104}