Skip to main content

aws_sdk_dataexchange/types/
_import_asset_from_api_gateway_api_request_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request details.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ImportAssetFromApiGatewayApiRequestDetails {
7    /// <p>The API description. Markdown supported.</p>
8    pub api_description: ::std::option::Option<::std::string::String>,
9    /// <p>The API Gateway API ID.</p>
10    pub api_id: ::std::string::String,
11    /// <p>The API Gateway API key.</p>
12    pub api_key: ::std::option::Option<::std::string::String>,
13    /// <p>The API name.</p>
14    pub api_name: ::std::string::String,
15    /// <p>The Base64-encoded MD5 hash of the OpenAPI 3.0 JSON API specification file. It is used to ensure the integrity of the file.</p>
16    pub api_specification_md5_hash: ::std::string::String,
17    /// <p>The data set ID.</p>
18    pub data_set_id: ::std::string::String,
19    /// <p>The protocol type.</p>
20    pub protocol_type: crate::types::ProtocolType,
21    /// <p>The revision ID.</p>
22    pub revision_id: ::std::string::String,
23    /// <p>The API stage.</p>
24    pub stage: ::std::string::String,
25}
26impl ImportAssetFromApiGatewayApiRequestDetails {
27    /// <p>The API description. Markdown supported.</p>
28    pub fn api_description(&self) -> ::std::option::Option<&str> {
29        self.api_description.as_deref()
30    }
31    /// <p>The API Gateway API ID.</p>
32    pub fn api_id(&self) -> &str {
33        use std::ops::Deref;
34        self.api_id.deref()
35    }
36    /// <p>The API Gateway API key.</p>
37    pub fn api_key(&self) -> ::std::option::Option<&str> {
38        self.api_key.as_deref()
39    }
40    /// <p>The API name.</p>
41    pub fn api_name(&self) -> &str {
42        use std::ops::Deref;
43        self.api_name.deref()
44    }
45    /// <p>The Base64-encoded MD5 hash of the OpenAPI 3.0 JSON API specification file. It is used to ensure the integrity of the file.</p>
46    pub fn api_specification_md5_hash(&self) -> &str {
47        use std::ops::Deref;
48        self.api_specification_md5_hash.deref()
49    }
50    /// <p>The data set ID.</p>
51    pub fn data_set_id(&self) -> &str {
52        use std::ops::Deref;
53        self.data_set_id.deref()
54    }
55    /// <p>The protocol type.</p>
56    pub fn protocol_type(&self) -> &crate::types::ProtocolType {
57        &self.protocol_type
58    }
59    /// <p>The revision ID.</p>
60    pub fn revision_id(&self) -> &str {
61        use std::ops::Deref;
62        self.revision_id.deref()
63    }
64    /// <p>The API stage.</p>
65    pub fn stage(&self) -> &str {
66        use std::ops::Deref;
67        self.stage.deref()
68    }
69}
70impl ImportAssetFromApiGatewayApiRequestDetails {
71    /// Creates a new builder-style object to manufacture [`ImportAssetFromApiGatewayApiRequestDetails`](crate::types::ImportAssetFromApiGatewayApiRequestDetails).
72    pub fn builder() -> crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder {
73        crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::default()
74    }
75}
76
77/// A builder for [`ImportAssetFromApiGatewayApiRequestDetails`](crate::types::ImportAssetFromApiGatewayApiRequestDetails).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct ImportAssetFromApiGatewayApiRequestDetailsBuilder {
81    pub(crate) api_description: ::std::option::Option<::std::string::String>,
82    pub(crate) api_id: ::std::option::Option<::std::string::String>,
83    pub(crate) api_key: ::std::option::Option<::std::string::String>,
84    pub(crate) api_name: ::std::option::Option<::std::string::String>,
85    pub(crate) api_specification_md5_hash: ::std::option::Option<::std::string::String>,
86    pub(crate) data_set_id: ::std::option::Option<::std::string::String>,
87    pub(crate) protocol_type: ::std::option::Option<crate::types::ProtocolType>,
88    pub(crate) revision_id: ::std::option::Option<::std::string::String>,
89    pub(crate) stage: ::std::option::Option<::std::string::String>,
90}
91impl ImportAssetFromApiGatewayApiRequestDetailsBuilder {
92    /// <p>The API description. Markdown supported.</p>
93    pub fn api_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.api_description = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The API description. Markdown supported.</p>
98    pub fn set_api_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.api_description = input;
100        self
101    }
102    /// <p>The API description. Markdown supported.</p>
103    pub fn get_api_description(&self) -> &::std::option::Option<::std::string::String> {
104        &self.api_description
105    }
106    /// <p>The API Gateway API ID.</p>
107    /// This field is required.
108    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.api_id = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The API Gateway API ID.</p>
113    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.api_id = input;
115        self
116    }
117    /// <p>The API Gateway API ID.</p>
118    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
119        &self.api_id
120    }
121    /// <p>The API Gateway API key.</p>
122    pub fn api_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.api_key = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The API Gateway API key.</p>
127    pub fn set_api_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.api_key = input;
129        self
130    }
131    /// <p>The API Gateway API key.</p>
132    pub fn get_api_key(&self) -> &::std::option::Option<::std::string::String> {
133        &self.api_key
134    }
135    /// <p>The API name.</p>
136    /// This field is required.
137    pub fn api_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.api_name = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The API name.</p>
142    pub fn set_api_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.api_name = input;
144        self
145    }
146    /// <p>The API name.</p>
147    pub fn get_api_name(&self) -> &::std::option::Option<::std::string::String> {
148        &self.api_name
149    }
150    /// <p>The Base64-encoded MD5 hash of the OpenAPI 3.0 JSON API specification file. It is used to ensure the integrity of the file.</p>
151    /// This field is required.
152    pub fn api_specification_md5_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.api_specification_md5_hash = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The Base64-encoded MD5 hash of the OpenAPI 3.0 JSON API specification file. It is used to ensure the integrity of the file.</p>
157    pub fn set_api_specification_md5_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.api_specification_md5_hash = input;
159        self
160    }
161    /// <p>The Base64-encoded MD5 hash of the OpenAPI 3.0 JSON API specification file. It is used to ensure the integrity of the file.</p>
162    pub fn get_api_specification_md5_hash(&self) -> &::std::option::Option<::std::string::String> {
163        &self.api_specification_md5_hash
164    }
165    /// <p>The data set ID.</p>
166    /// This field is required.
167    pub fn data_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.data_set_id = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>The data set ID.</p>
172    pub fn set_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.data_set_id = input;
174        self
175    }
176    /// <p>The data set ID.</p>
177    pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
178        &self.data_set_id
179    }
180    /// <p>The protocol type.</p>
181    /// This field is required.
182    pub fn protocol_type(mut self, input: crate::types::ProtocolType) -> Self {
183        self.protocol_type = ::std::option::Option::Some(input);
184        self
185    }
186    /// <p>The protocol type.</p>
187    pub fn set_protocol_type(mut self, input: ::std::option::Option<crate::types::ProtocolType>) -> Self {
188        self.protocol_type = input;
189        self
190    }
191    /// <p>The protocol type.</p>
192    pub fn get_protocol_type(&self) -> &::std::option::Option<crate::types::ProtocolType> {
193        &self.protocol_type
194    }
195    /// <p>The revision ID.</p>
196    /// This field is required.
197    pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.revision_id = ::std::option::Option::Some(input.into());
199        self
200    }
201    /// <p>The revision ID.</p>
202    pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.revision_id = input;
204        self
205    }
206    /// <p>The revision ID.</p>
207    pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
208        &self.revision_id
209    }
210    /// <p>The API stage.</p>
211    /// This field is required.
212    pub fn stage(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.stage = ::std::option::Option::Some(input.into());
214        self
215    }
216    /// <p>The API stage.</p>
217    pub fn set_stage(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.stage = input;
219        self
220    }
221    /// <p>The API stage.</p>
222    pub fn get_stage(&self) -> &::std::option::Option<::std::string::String> {
223        &self.stage
224    }
225    /// Consumes the builder and constructs a [`ImportAssetFromApiGatewayApiRequestDetails`](crate::types::ImportAssetFromApiGatewayApiRequestDetails).
226    /// This method will fail if any of the following fields are not set:
227    /// - [`api_id`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::api_id)
228    /// - [`api_name`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::api_name)
229    /// - [`api_specification_md5_hash`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::api_specification_md5_hash)
230    /// - [`data_set_id`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::data_set_id)
231    /// - [`protocol_type`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::protocol_type)
232    /// - [`revision_id`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::revision_id)
233    /// - [`stage`](crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::stage)
234    pub fn build(
235        self,
236    ) -> ::std::result::Result<crate::types::ImportAssetFromApiGatewayApiRequestDetails, ::aws_smithy_types::error::operation::BuildError> {
237        ::std::result::Result::Ok(crate::types::ImportAssetFromApiGatewayApiRequestDetails {
238            api_description: self.api_description,
239            api_id: self.api_id.ok_or_else(|| {
240                ::aws_smithy_types::error::operation::BuildError::missing_field(
241                    "api_id",
242                    "api_id was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
243                )
244            })?,
245            api_key: self.api_key,
246            api_name: self.api_name.ok_or_else(|| {
247                ::aws_smithy_types::error::operation::BuildError::missing_field(
248                    "api_name",
249                    "api_name was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
250                )
251            })?,
252            api_specification_md5_hash: self.api_specification_md5_hash.ok_or_else(|| {
253                ::aws_smithy_types::error::operation::BuildError::missing_field(
254                    "api_specification_md5_hash",
255                    "api_specification_md5_hash was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
256                )
257            })?,
258            data_set_id: self.data_set_id.ok_or_else(|| {
259                ::aws_smithy_types::error::operation::BuildError::missing_field(
260                    "data_set_id",
261                    "data_set_id was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
262                )
263            })?,
264            protocol_type: self.protocol_type.ok_or_else(|| {
265                ::aws_smithy_types::error::operation::BuildError::missing_field(
266                    "protocol_type",
267                    "protocol_type was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
268                )
269            })?,
270            revision_id: self.revision_id.ok_or_else(|| {
271                ::aws_smithy_types::error::operation::BuildError::missing_field(
272                    "revision_id",
273                    "revision_id was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
274                )
275            })?,
276            stage: self.stage.ok_or_else(|| {
277                ::aws_smithy_types::error::operation::BuildError::missing_field(
278                    "stage",
279                    "stage was not specified but it is required when building ImportAssetFromApiGatewayApiRequestDetails",
280                )
281            })?,
282        })
283    }
284}