aws_sdk_apigateway/operation/create_model/
_create_model_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateModelInput {
7 pub rest_api_id: ::std::option::Option<::std::string::String>,
9 pub name: ::std::option::Option<::std::string::String>,
11 pub description: ::std::option::Option<::std::string::String>,
13 pub schema: ::std::option::Option<::std::string::String>,
15 pub content_type: ::std::option::Option<::std::string::String>,
17}
18impl CreateModelInput {
19 pub fn rest_api_id(&self) -> ::std::option::Option<&str> {
21 self.rest_api_id.as_deref()
22 }
23 pub fn name(&self) -> ::std::option::Option<&str> {
25 self.name.as_deref()
26 }
27 pub fn description(&self) -> ::std::option::Option<&str> {
29 self.description.as_deref()
30 }
31 pub fn schema(&self) -> ::std::option::Option<&str> {
33 self.schema.as_deref()
34 }
35 pub fn content_type(&self) -> ::std::option::Option<&str> {
37 self.content_type.as_deref()
38 }
39}
40impl CreateModelInput {
41 pub fn builder() -> crate::operation::create_model::builders::CreateModelInputBuilder {
43 crate::operation::create_model::builders::CreateModelInputBuilder::default()
44 }
45}
46
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct CreateModelInputBuilder {
51 pub(crate) rest_api_id: ::std::option::Option<::std::string::String>,
52 pub(crate) name: ::std::option::Option<::std::string::String>,
53 pub(crate) description: ::std::option::Option<::std::string::String>,
54 pub(crate) schema: ::std::option::Option<::std::string::String>,
55 pub(crate) content_type: ::std::option::Option<::std::string::String>,
56}
57impl CreateModelInputBuilder {
58 pub fn rest_api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.rest_api_id = ::std::option::Option::Some(input.into());
62 self
63 }
64 pub fn set_rest_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.rest_api_id = input;
67 self
68 }
69 pub fn get_rest_api_id(&self) -> &::std::option::Option<::std::string::String> {
71 &self.rest_api_id
72 }
73 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.name = ::std::option::Option::Some(input.into());
77 self
78 }
79 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.name = input;
82 self
83 }
84 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
86 &self.name
87 }
88 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.description = ::std::option::Option::Some(input.into());
91 self
92 }
93 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.description = input;
96 self
97 }
98 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
100 &self.description
101 }
102 pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.schema = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.schema = input;
110 self
111 }
112 pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
114 &self.schema
115 }
116 pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.content_type = ::std::option::Option::Some(input.into());
120 self
121 }
122 pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.content_type = input;
125 self
126 }
127 pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
129 &self.content_type
130 }
131 pub fn build(self) -> ::std::result::Result<crate::operation::create_model::CreateModelInput, ::aws_smithy_types::error::operation::BuildError> {
133 ::std::result::Result::Ok(crate::operation::create_model::CreateModelInput {
134 rest_api_id: self.rest_api_id,
135 name: self.name,
136 description: self.description,
137 schema: self.schema,
138 content_type: self.content_type,
139 })
140 }
141}