1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Request to list information about a resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetResourceInput {
/// <p>The string identifier of the associated RestApi.</p>
pub rest_api_id: ::std::option::Option<::std::string::String>,
/// <p>The identifier for the Resource resource.</p>
pub resource_id: ::std::option::Option<::std::string::String>,
/// <p>A query parameter to retrieve the specified resources embedded in the returned Resource representation 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/{resource_id}?embed=methods</code>.</p>
pub embed: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl GetResourceInput {
/// <p>The string identifier of the associated RestApi.</p>
pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
self.rest_api_id.as_deref()
}
/// <p>The identifier for the Resource resource.</p>
pub fn resource_id(&self) -> ::std::option::Option<&str> {
self.resource_id.as_deref()
}
/// <p>A query parameter to retrieve the specified resources embedded in the returned Resource representation 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/{resource_id}?embed=methods</code>.</p>
///
/// 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()`.
pub fn embed(&self) -> &[::std::string::String] {
self.embed.as_deref().unwrap_or_default()
}
}
impl GetResourceInput {
/// Creates a new builder-style object to manufacture [`GetResourceInput`](crate::operation::get_resource::GetResourceInput).
pub fn builder() -> crate::operation::get_resource::builders::GetResourceInputBuilder {
crate::operation::get_resource::builders::GetResourceInputBuilder::default()
}
}
/// A builder for [`GetResourceInput`](crate::operation::get_resource::GetResourceInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetResourceInputBuilder {
pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
pub(crate) resource_id: ::std::option::Option<::std::string::String>,
pub(crate) embed: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl GetResourceInputBuilder {
/// <p>The string identifier of the associated RestApi.</p>
/// This field is required.
pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.rest_api_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The string identifier of the associated RestApi.</p>
pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.rest_api_id = input;
self
}
/// <p>The string identifier of the associated RestApi.</p>
pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
&self.rest_api_id
}
/// <p>The identifier for the Resource resource.</p>
/// This field is required.
pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier for the Resource resource.</p>
pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_id = input;
self
}
/// <p>The identifier for the Resource resource.</p>
pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_id
}
/// Appends an item to `embed`.
///
/// To override the contents of this collection use [`set_embed`](Self::set_embed).
///
/// <p>A query parameter to retrieve the specified resources embedded in the returned Resource representation 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/{resource_id}?embed=methods</code>.</p>
pub fn embed(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.embed.unwrap_or_default();
v.push(input.into());
self.embed = ::std::option::Option::Some(v);
self
}
/// <p>A query parameter to retrieve the specified resources embedded in the returned Resource representation 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/{resource_id}?embed=methods</code>.</p>
pub fn set_embed(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.embed = input;
self
}
/// <p>A query parameter to retrieve the specified resources embedded in the returned Resource representation 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/{resource_id}?embed=methods</code>.</p>
pub fn get_embed(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.embed
}
/// Consumes the builder and constructs a [`GetResourceInput`](crate::operation::get_resource::GetResourceInput).
pub fn build(self) -> ::std::result::Result<crate::operation::get_resource::GetResourceInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_resource::GetResourceInput {
rest_api_id: self.rest_api_id,
resource_id: self.resource_id,
embed: self.embed,
})
}
}