aws_sdk_cloudfront/operation/list_cache_policies/
_list_cache_policies_input.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 ListCachePoliciesInput {
6    /// <p>A filter to return only the specified kinds of cache policies. Valid values are:</p>
7    /// <ul>
8    /// <li>
9    /// <p><code>managed</code> – Returns only the managed policies created by Amazon Web Services.</p></li>
10    /// <li>
11    /// <p><code>custom</code> – Returns only the custom policies created in your Amazon Web Services account.</p></li>
12    /// </ul>
13    pub r#type: ::std::option::Option<crate::types::CachePolicyType>,
14    /// <p>Use this field when paginating results to indicate where to begin in your list of cache policies. The response includes cache policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
15    pub marker: ::std::option::Option<::std::string::String>,
16    /// <p>The maximum number of cache policies that you want in the response.</p>
17    pub max_items: ::std::option::Option<i32>,
18}
19impl ListCachePoliciesInput {
20    /// <p>A filter to return only the specified kinds of cache policies. Valid values are:</p>
21    /// <ul>
22    /// <li>
23    /// <p><code>managed</code> – Returns only the managed policies created by Amazon Web Services.</p></li>
24    /// <li>
25    /// <p><code>custom</code> – Returns only the custom policies created in your Amazon Web Services account.</p></li>
26    /// </ul>
27    pub fn r#type(&self) -> ::std::option::Option<&crate::types::CachePolicyType> {
28        self.r#type.as_ref()
29    }
30    /// <p>Use this field when paginating results to indicate where to begin in your list of cache policies. The response includes cache policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
31    pub fn marker(&self) -> ::std::option::Option<&str> {
32        self.marker.as_deref()
33    }
34    /// <p>The maximum number of cache policies that you want in the response.</p>
35    pub fn max_items(&self) -> ::std::option::Option<i32> {
36        self.max_items
37    }
38}
39impl ListCachePoliciesInput {
40    /// Creates a new builder-style object to manufacture [`ListCachePoliciesInput`](crate::operation::list_cache_policies::ListCachePoliciesInput).
41    pub fn builder() -> crate::operation::list_cache_policies::builders::ListCachePoliciesInputBuilder {
42        crate::operation::list_cache_policies::builders::ListCachePoliciesInputBuilder::default()
43    }
44}
45
46/// A builder for [`ListCachePoliciesInput`](crate::operation::list_cache_policies::ListCachePoliciesInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct ListCachePoliciesInputBuilder {
50    pub(crate) r#type: ::std::option::Option<crate::types::CachePolicyType>,
51    pub(crate) marker: ::std::option::Option<::std::string::String>,
52    pub(crate) max_items: ::std::option::Option<i32>,
53}
54impl ListCachePoliciesInputBuilder {
55    /// <p>A filter to return only the specified kinds of cache policies. Valid values are:</p>
56    /// <ul>
57    /// <li>
58    /// <p><code>managed</code> – Returns only the managed policies created by Amazon Web Services.</p></li>
59    /// <li>
60    /// <p><code>custom</code> – Returns only the custom policies created in your Amazon Web Services account.</p></li>
61    /// </ul>
62    pub fn r#type(mut self, input: crate::types::CachePolicyType) -> Self {
63        self.r#type = ::std::option::Option::Some(input);
64        self
65    }
66    /// <p>A filter to return only the specified kinds of cache policies. Valid values are:</p>
67    /// <ul>
68    /// <li>
69    /// <p><code>managed</code> – Returns only the managed policies created by Amazon Web Services.</p></li>
70    /// <li>
71    /// <p><code>custom</code> – Returns only the custom policies created in your Amazon Web Services account.</p></li>
72    /// </ul>
73    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CachePolicyType>) -> Self {
74        self.r#type = input;
75        self
76    }
77    /// <p>A filter to return only the specified kinds of cache policies. Valid values are:</p>
78    /// <ul>
79    /// <li>
80    /// <p><code>managed</code> – Returns only the managed policies created by Amazon Web Services.</p></li>
81    /// <li>
82    /// <p><code>custom</code> – Returns only the custom policies created in your Amazon Web Services account.</p></li>
83    /// </ul>
84    pub fn get_type(&self) -> &::std::option::Option<crate::types::CachePolicyType> {
85        &self.r#type
86    }
87    /// <p>Use this field when paginating results to indicate where to begin in your list of cache policies. The response includes cache policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
88    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.marker = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>Use this field when paginating results to indicate where to begin in your list of cache policies. The response includes cache policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
93    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.marker = input;
95        self
96    }
97    /// <p>Use this field when paginating results to indicate where to begin in your list of cache policies. The response includes cache policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
98    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
99        &self.marker
100    }
101    /// <p>The maximum number of cache policies that you want in the response.</p>
102    pub fn max_items(mut self, input: i32) -> Self {
103        self.max_items = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>The maximum number of cache policies that you want in the response.</p>
107    pub fn set_max_items(mut self, input: ::std::option::Option<i32>) -> Self {
108        self.max_items = input;
109        self
110    }
111    /// <p>The maximum number of cache policies that you want in the response.</p>
112    pub fn get_max_items(&self) -> &::std::option::Option<i32> {
113        &self.max_items
114    }
115    /// Consumes the builder and constructs a [`ListCachePoliciesInput`](crate::operation::list_cache_policies::ListCachePoliciesInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::list_cache_policies::ListCachePoliciesInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::list_cache_policies::ListCachePoliciesInput {
120            r#type: self.r#type,
121            marker: self.marker,
122            max_items: self.max_items,
123        })
124    }
125}