aws_sdk_apigateway/operation/get_model/
_get_model_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 model in an existing RestApi resource.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetModelInput {
7    /// <p>The RestApi identifier under which the Model exists.</p>
8    pub rest_api_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the model as an identifier.</p>
10    pub model_name: ::std::option::Option<::std::string::String>,
11    /// <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>
12    pub flatten: ::std::option::Option<bool>,
13}
14impl GetModelInput {
15    /// <p>The RestApi identifier under which the Model exists.</p>
16    pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
17        self.rest_api_id.as_deref()
18    }
19    /// <p>The name of the model as an identifier.</p>
20    pub fn model_name(&self) -> ::std::option::Option<&str> {
21        self.model_name.as_deref()
22    }
23    /// <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>
24    pub fn flatten(&self) -> ::std::option::Option<bool> {
25        self.flatten
26    }
27}
28impl GetModelInput {
29    /// Creates a new builder-style object to manufacture [`GetModelInput`](crate::operation::get_model::GetModelInput).
30    pub fn builder() -> crate::operation::get_model::builders::GetModelInputBuilder {
31        crate::operation::get_model::builders::GetModelInputBuilder::default()
32    }
33}
34
35/// A builder for [`GetModelInput`](crate::operation::get_model::GetModelInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct GetModelInputBuilder {
39    pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
40    pub(crate) model_name: ::std::option::Option<::std::string::String>,
41    pub(crate) flatten: ::std::option::Option<bool>,
42}
43impl GetModelInputBuilder {
44    /// <p>The RestApi identifier under which the Model exists.</p>
45    /// This field is required.
46    pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.rest_api_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The RestApi identifier under which the Model exists.</p>
51    pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.rest_api_id = input;
53        self
54    }
55    /// <p>The RestApi identifier under which the Model exists.</p>
56    pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.rest_api_id
58    }
59    /// <p>The name of the model as an identifier.</p>
60    /// This field is required.
61    pub fn model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.model_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the model as an identifier.</p>
66    pub fn set_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.model_name = input;
68        self
69    }
70    /// <p>The name of the model as an identifier.</p>
71    pub fn get_model_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.model_name
73    }
74    /// <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>
75    pub fn flatten(mut self, input: bool) -> Self {
76        self.flatten = ::std::option::Option::Some(input);
77        self
78    }
79    /// <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>
80    pub fn set_flatten(mut self, input: ::std::option::Option<bool>) -> Self {
81        self.flatten = input;
82        self
83    }
84    /// <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>
85    pub fn get_flatten(&self) -> &::std::option::Option<bool> {
86        &self.flatten
87    }
88    /// Consumes the builder and constructs a [`GetModelInput`](crate::operation::get_model::GetModelInput).
89    pub fn build(self) -> ::std::result::Result<crate::operation::get_model::GetModelInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::get_model::GetModelInput {
91            rest_api_id: self.rest_api_id,
92            model_name: self.model_name,
93            flatten: self.flatten,
94        })
95    }
96}