aws_sdk_apigatewayv2/operation/create_model/
_create_model_input.rs

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