aws_sdk_apigateway/operation/get_model/
_get_model_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the data structure of a method's request or response payload.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetModelOutput {
7    /// <p>The identifier for the model resource.</p>
8    pub id: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the model. Must be an alphanumeric string.</p>
10    pub name: ::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 schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model. Do not include "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.</p>
14    pub schema: ::std::option::Option<::std::string::String>,
15    /// <p>The content-type for the model.</p>
16    pub content_type: ::std::option::Option<::std::string::String>,
17    _request_id: Option<String>,
18}
19impl GetModelOutput {
20    /// <p>The identifier for the model resource.</p>
21    pub fn id(&self) -> ::std::option::Option<&str> {
22        self.id.as_deref()
23    }
24    /// <p>The name of the model. Must be an alphanumeric string.</p>
25    pub fn name(&self) -> ::std::option::Option<&str> {
26        self.name.as_deref()
27    }
28    /// <p>The description of the model.</p>
29    pub fn description(&self) -> ::std::option::Option<&str> {
30        self.description.as_deref()
31    }
32    /// <p>The schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model. Do not include "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.</p>
33    pub fn schema(&self) -> ::std::option::Option<&str> {
34        self.schema.as_deref()
35    }
36    /// <p>The content-type for the model.</p>
37    pub fn content_type(&self) -> ::std::option::Option<&str> {
38        self.content_type.as_deref()
39    }
40}
41impl ::aws_types::request_id::RequestId for GetModelOutput {
42    fn request_id(&self) -> Option<&str> {
43        self._request_id.as_deref()
44    }
45}
46impl GetModelOutput {
47    /// Creates a new builder-style object to manufacture [`GetModelOutput`](crate::operation::get_model::GetModelOutput).
48    pub fn builder() -> crate::operation::get_model::builders::GetModelOutputBuilder {
49        crate::operation::get_model::builders::GetModelOutputBuilder::default()
50    }
51}
52
53/// A builder for [`GetModelOutput`](crate::operation::get_model::GetModelOutput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct GetModelOutputBuilder {
57    pub(crate) id: ::std::option::Option<::std::string::String>,
58    pub(crate) name: ::std::option::Option<::std::string::String>,
59    pub(crate) description: ::std::option::Option<::std::string::String>,
60    pub(crate) schema: ::std::option::Option<::std::string::String>,
61    pub(crate) content_type: ::std::option::Option<::std::string::String>,
62    _request_id: Option<String>,
63}
64impl GetModelOutputBuilder {
65    /// <p>The identifier for the model resource.</p>
66    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The identifier for the model resource.</p>
71    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.id = input;
73        self
74    }
75    /// <p>The identifier for the model resource.</p>
76    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.id
78    }
79    /// <p>The name of the model. Must be an alphanumeric string.</p>
80    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the model. Must be an alphanumeric string.</p>
85    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.name = input;
87        self
88    }
89    /// <p>The name of the model. Must be an alphanumeric string.</p>
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// <p>The description of the model.</p>
94    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.description = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The description of the model.</p>
99    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.description = input;
101        self
102    }
103    /// <p>The description of the model.</p>
104    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
105        &self.description
106    }
107    /// <p>The schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model. Do not include "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.</p>
108    pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.schema = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model. Do not include "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.</p>
113    pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.schema = input;
115        self
116    }
117    /// <p>The schema for the model. For <code>application/json</code> models, this should be JSON schema draft 4 model. Do not include "\*/" characters in the description of any properties because such "\*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.</p>
118    pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
119        &self.schema
120    }
121    /// <p>The content-type for the model.</p>
122    pub fn content_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.content_type = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The content-type for the model.</p>
127    pub fn set_content_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.content_type = input;
129        self
130    }
131    /// <p>The content-type for the model.</p>
132    pub fn get_content_type(&self) -> &::std::option::Option<::std::string::String> {
133        &self.content_type
134    }
135    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
136        self._request_id = Some(request_id.into());
137        self
138    }
139
140    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
141        self._request_id = request_id;
142        self
143    }
144    /// Consumes the builder and constructs a [`GetModelOutput`](crate::operation::get_model::GetModelOutput).
145    pub fn build(self) -> crate::operation::get_model::GetModelOutput {
146        crate::operation::get_model::GetModelOutput {
147            id: self.id,
148            name: self.name,
149            description: self.description,
150            schema: self.schema,
151            content_type: self.content_type,
152            _request_id: self._request_id,
153        }
154    }
155}