aws_sdk_apigateway/operation/get_resources/
_get_resources_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request to list information about a collection of resources.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetResourcesInput {
7    /// <p>The string identifier of the associated RestApi.</p>
8    pub rest_api_id: ::std::option::Option<::std::string::String>,
9    /// <p>The current pagination position in the paged result set.</p>
10    pub position: ::std::option::Option<::std::string::String>,
11    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
12    pub limit: ::std::option::Option<i32>,
13    /// <p>A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>"methods"</code> string. For example, <code>GET /restapis/{restapi_id}/resources?embed=methods</code>.</p>
14    pub embed: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15}
16impl GetResourcesInput {
17    /// <p>The string identifier of the associated RestApi.</p>
18    pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
19        self.rest_api_id.as_deref()
20    }
21    /// <p>The current pagination position in the paged result set.</p>
22    pub fn position(&self) -> ::std::option::Option<&str> {
23        self.position.as_deref()
24    }
25    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
26    pub fn limit(&self) -> ::std::option::Option<i32> {
27        self.limit
28    }
29    /// <p>A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>"methods"</code> string. For example, <code>GET /restapis/{restapi_id}/resources?embed=methods</code>.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.embed.is_none()`.
32    pub fn embed(&self) -> &[::std::string::String] {
33        self.embed.as_deref().unwrap_or_default()
34    }
35}
36impl GetResourcesInput {
37    /// Creates a new builder-style object to manufacture [`GetResourcesInput`](crate::operation::get_resources::GetResourcesInput).
38    pub fn builder() -> crate::operation::get_resources::builders::GetResourcesInputBuilder {
39        crate::operation::get_resources::builders::GetResourcesInputBuilder::default()
40    }
41}
42
43/// A builder for [`GetResourcesInput`](crate::operation::get_resources::GetResourcesInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct GetResourcesInputBuilder {
47    pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
48    pub(crate) position: ::std::option::Option<::std::string::String>,
49    pub(crate) limit: ::std::option::Option<i32>,
50    pub(crate) embed: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
51}
52impl GetResourcesInputBuilder {
53    /// <p>The string identifier of the associated RestApi.</p>
54    /// This field is required.
55    pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.rest_api_id = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The string identifier of the associated RestApi.</p>
60    pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.rest_api_id = input;
62        self
63    }
64    /// <p>The string identifier of the associated RestApi.</p>
65    pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
66        &self.rest_api_id
67    }
68    /// <p>The current pagination position in the paged result set.</p>
69    pub fn position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.position = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The current pagination position in the paged result set.</p>
74    pub fn set_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.position = input;
76        self
77    }
78    /// <p>The current pagination position in the paged result set.</p>
79    pub fn get_position(&self) -> &::std::option::Option<::std::string::String> {
80        &self.position
81    }
82    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
83    pub fn limit(mut self, input: i32) -> Self {
84        self.limit = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
88    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
89        self.limit = input;
90        self
91    }
92    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
93    pub fn get_limit(&self) -> &::std::option::Option<i32> {
94        &self.limit
95    }
96    /// Appends an item to `embed`.
97    ///
98    /// To override the contents of this collection use [`set_embed`](Self::set_embed).
99    ///
100    /// <p>A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>"methods"</code> string. For example, <code>GET /restapis/{restapi_id}/resources?embed=methods</code>.</p>
101    pub fn embed(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        let mut v = self.embed.unwrap_or_default();
103        v.push(input.into());
104        self.embed = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>"methods"</code> string. For example, <code>GET /restapis/{restapi_id}/resources?embed=methods</code>.</p>
108    pub fn set_embed(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
109        self.embed = input;
110        self
111    }
112    /// <p>A query parameter used to retrieve the specified resources embedded in the returned Resources resource in the response. This <code>embed</code> parameter value is a list of comma-separated strings. Currently, the request supports only retrieval of the embedded Method resources this way. The query parameter value must be a single-valued list and contain the <code>"methods"</code> string. For example, <code>GET /restapis/{restapi_id}/resources?embed=methods</code>.</p>
113    pub fn get_embed(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
114        &self.embed
115    }
116    /// Consumes the builder and constructs a [`GetResourcesInput`](crate::operation::get_resources::GetResourcesInput).
117    pub fn build(
118        self,
119    ) -> ::std::result::Result<crate::operation::get_resources::GetResourcesInput, ::aws_smithy_types::error::operation::BuildError> {
120        ::std::result::Result::Ok(crate::operation::get_resources::GetResourcesInput {
121            rest_api_id: self.rest_api_id,
122            position: self.position,
123            limit: self.limit,
124            embed: self.embed,
125        })
126    }
127}