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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Request to list information about a model in an existing RestApi resource.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetModelInput {
/// <p>The RestApi identifier under which the Model exists.</p>
pub rest_api_id: ::std::option::Option<::std::string::String>,
/// <p>The name of the model as an identifier.</p>
pub model_name: ::std::option::Option<::std::string::String>,
/// <p>A query parameter of a Boolean value to resolve (<code>true</code>) all external model references and returns a flattened model schema or not (<code>false</code>) The default is <code>false</code>.</p>
pub flatten: ::std::option::Option<bool>,
}
impl GetModelInput {
/// <p>The RestApi identifier under which the Model exists.</p>
pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
self.rest_api_id.as_deref()
}
/// <p>The name of the model as an identifier.</p>
pub fn model_name(&self) -> ::std::option::Option<&str> {
self.model_name.as_deref()
}
/// <p>A query parameter of a Boolean value to resolve (<code>true</code>) all external model references and returns a flattened model schema or not (<code>false</code>) The default is <code>false</code>.</p>
pub fn flatten(&self) -> ::std::option::Option<bool> {
self.flatten
}
}
impl GetModelInput {
/// Creates a new builder-style object to manufacture [`GetModelInput`](crate::operation::get_model::GetModelInput).
pub fn builder() -> crate::operation::get_model::builders::GetModelInputBuilder {
crate::operation::get_model::builders::GetModelInputBuilder::default()
}
}
/// A builder for [`GetModelInput`](crate::operation::get_model::GetModelInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetModelInputBuilder {
pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
pub(crate) model_name: ::std::option::Option<::std::string::String>,
pub(crate) flatten: ::std::option::Option<bool>,
}
impl GetModelInputBuilder {
/// <p>The RestApi identifier under which the Model exists.</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 RestApi identifier under which the Model exists.</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 RestApi identifier under which the Model exists.</p>
pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
&self.rest_api_id
}
/// <p>The name of the model as an identifier.</p>
/// This field is required.
pub fn model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.model_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the model as an identifier.</p>
pub fn set_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.model_name = input;
self
}
/// <p>The name of the model as an identifier.</p>
pub fn get_model_name(&self) -> &::std::option::Option<::std::string::String> {
&self.model_name
}
/// <p>A query parameter of a Boolean value to resolve (<code>true</code>) all external model references and returns a flattened model schema or not (<code>false</code>) The default is <code>false</code>.</p>
pub fn flatten(mut self, input: bool) -> Self {
self.flatten = ::std::option::Option::Some(input);
self
}
/// <p>A query parameter of a Boolean value to resolve (<code>true</code>) all external model references and returns a flattened model schema or not (<code>false</code>) The default is <code>false</code>.</p>
pub fn set_flatten(mut self, input: ::std::option::Option<bool>) -> Self {
self.flatten = input;
self
}
/// <p>A query parameter of a Boolean value to resolve (<code>true</code>) all external model references and returns a flattened model schema or not (<code>false</code>) The default is <code>false</code>.</p>
pub fn get_flatten(&self) -> &::std::option::Option<bool> {
&self.flatten
}
/// Consumes the builder and constructs a [`GetModelInput`](crate::operation::get_model::GetModelInput).
pub fn build(self) -> ::std::result::Result<crate::operation::get_model::GetModelInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_model::GetModelInput {
rest_api_id: self.rest_api_id,
model_name: self.model_name,
flatten: self.flatten,
})
}
}