aws_sdk_apigatewayv2/operation/update_model/
_update_model_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Updates a Model.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateModelInput {
7    /// <p>The API identifier.</p>
8    pub api_id: ::std::option::Option<::std::string::String>,
9    /// <p>The content-type for the model, for example, "application/json".</p>
10    pub content_type: ::std::option::Option<::std::string::String>,
11    /// <p>The description of the model.</p>
12    pub description: ::std::option::Option<::std::string::String>,
13    /// <p>The model ID.</p>
14    pub model_id: ::std::option::Option<::std::string::String>,
15    /// <p>The name of the model.</p>
16    pub name: ::std::option::Option<::std::string::String>,
17    /// <p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>
18    pub schema: ::std::option::Option<::std::string::String>,
19}
20impl UpdateModelInput {
21    /// <p>The API identifier.</p>
22    pub fn api_id(&self) -> ::std::option::Option<&str> {
23        self.api_id.as_deref()
24    }
25    /// <p>The content-type for the model, for example, "application/json".</p>
26    pub fn content_type(&self) -> ::std::option::Option<&str> {
27        self.content_type.as_deref()
28    }
29    /// <p>The description of the model.</p>
30    pub fn description(&self) -> ::std::option::Option<&str> {
31        self.description.as_deref()
32    }
33    /// <p>The model ID.</p>
34    pub fn model_id(&self) -> ::std::option::Option<&str> {
35        self.model_id.as_deref()
36    }
37    /// <p>The name of the model.</p>
38    pub fn name(&self) -> ::std::option::Option<&str> {
39        self.name.as_deref()
40    }
41    /// <p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>
42    pub fn schema(&self) -> ::std::option::Option<&str> {
43        self.schema.as_deref()
44    }
45}
46impl UpdateModelInput {
47    /// Creates a new builder-style object to manufacture [`UpdateModelInput`](crate::operation::update_model::UpdateModelInput).
48    pub fn builder() -> crate::operation::update_model::builders::UpdateModelInputBuilder {
49        crate::operation::update_model::builders::UpdateModelInputBuilder::default()
50    }
51}
52
53/// A builder for [`UpdateModelInput`](crate::operation::update_model::UpdateModelInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct UpdateModelInputBuilder {
57    pub(crate) api_id: ::std::option::Option<::std::string::String>,
58    pub(crate) content_type: ::std::option::Option<::std::string::String>,
59    pub(crate) description: ::std::option::Option<::std::string::String>,
60    pub(crate) model_id: ::std::option::Option<::std::string::String>,
61    pub(crate) name: ::std::option::Option<::std::string::String>,
62    pub(crate) schema: ::std::option::Option<::std::string::String>,
63}
64impl UpdateModelInputBuilder {
65    /// <p>The API identifier.</p>
66    /// This field is required.
67    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.api_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The API identifier.</p>
72    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.api_id = input;
74        self
75    }
76    /// <p>The API identifier.</p>
77    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.api_id
79    }
80    /// <p>The content-type for the model, for example, "application/json".</p>
81    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.content_type = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The content-type for the model, for example, "application/json".</p>
86    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.content_type = input;
88        self
89    }
90    /// <p>The content-type for the model, for example, "application/json".</p>
91    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
92        &self.content_type
93    }
94    /// <p>The description of the model.</p>
95    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.description = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The description of the model.</p>
100    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.description = input;
102        self
103    }
104    /// <p>The description of the model.</p>
105    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
106        &self.description
107    }
108    /// <p>The model ID.</p>
109    /// This field is required.
110    pub fn model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.model_id = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The model ID.</p>
115    pub fn set_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.model_id = input;
117        self
118    }
119    /// <p>The model ID.</p>
120    pub fn get_model_id(&self) -> &::std::option::Option<::std::string::String> {
121        &self.model_id
122    }
123    /// <p>The name of the model.</p>
124    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.name = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The name of the model.</p>
129    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.name = input;
131        self
132    }
133    /// <p>The name of the model.</p>
134    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
135        &self.name
136    }
137    /// <p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>
138    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.schema = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>
143    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.schema = input;
145        self
146    }
147    /// <p>The schema for the model. For application/json models, this should be JSON schema draft 4 model.</p>
148    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
149        &self.schema
150    }
151    /// Consumes the builder and constructs a [`UpdateModelInput`](crate::operation::update_model::UpdateModelInput).
152    pub fn build(self) -> ::std::result::Result<crate::operation::update_model::UpdateModelInput, ::aws_smithy_types::error::operation::BuildError> {
153        ::std::result::Result::Ok(crate::operation::update_model::UpdateModelInput {
154            api_id: self.api_id,
155            content_type: self.content_type,
156            description: self.description,
157            model_id: self.model_id,
158            name: self.name,
159            schema: self.schema,
160        })
161    }
162}