aws_sdk_dataexchange/types/
_import_asset_from_api_gateway_api_request_details.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ImportAssetFromApiGatewayApiRequestDetails {
7 pub api_description: ::std::option::Option<::std::string::String>,
9 pub api_id: ::std::string::String,
11 pub api_key: ::std::option::Option<::std::string::String>,
13 pub api_name: ::std::string::String,
15 pub api_specification_md5_hash: ::std::string::String,
17 pub data_set_id: ::std::string::String,
19 pub protocol_type: crate::types::ProtocolType,
21 pub revision_id: ::std::string::String,
23 pub stage: ::std::string::String,
25}
26impl ImportAssetFromApiGatewayApiRequestDetails {
27 pub fn api_description(&self) -> ::std::option::Option<&str> {
29 self.api_description.as_deref()
30 }
31 pub fn api_id(&self) -> &str {
33 use std::ops::Deref;
34 self.api_id.deref()
35 }
36 pub fn api_key(&self) -> ::std::option::Option<&str> {
38 self.api_key.as_deref()
39 }
40 pub fn api_name(&self) -> &str {
42 use std::ops::Deref;
43 self.api_name.deref()
44 }
45 pub fn api_specification_md5_hash(&self) -> &str {
47 use std::ops::Deref;
48 self.api_specification_md5_hash.deref()
49 }
50 pub fn data_set_id(&self) -> &str {
52 use std::ops::Deref;
53 self.data_set_id.deref()
54 }
55 pub fn protocol_type(&self) -> &crate::types::ProtocolType {
57 &self.protocol_type
58 }
59 pub fn revision_id(&self) -> &str {
61 use std::ops::Deref;
62 self.revision_id.deref()
63 }
64 pub fn stage(&self) -> &str {
66 use std::ops::Deref;
67 self.stage.deref()
68 }
69}
70impl ImportAssetFromApiGatewayApiRequestDetails {
71 pub fn builder() -> crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder {
73 crate::types::builders::ImportAssetFromApiGatewayApiRequestDetailsBuilder::default()
74 }
75}
76
77#[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 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 pub fn set_api_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.api_description = input;
100 self
101 }
102 pub fn get_api_description(&self) -> &::std::option::Option<::std::string::String> {
104 &self.api_description
105 }
106 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 pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.api_id = input;
115 self
116 }
117 pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
119 &self.api_id
120 }
121 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 pub fn set_api_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.api_key = input;
129 self
130 }
131 pub fn get_api_key(&self) -> &::std::option::Option<::std::string::String> {
133 &self.api_key
134 }
135 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 pub fn set_api_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.api_name = input;
144 self
145 }
146 pub fn get_api_name(&self) -> &::std::option::Option<::std::string::String> {
148 &self.api_name
149 }
150 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 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 pub fn get_api_specification_md5_hash(&self) -> &::std::option::Option<::std::string::String> {
163 &self.api_specification_md5_hash
164 }
165 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 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 pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
178 &self.data_set_id
179 }
180 pub fn protocol_type(mut self, input: crate::types::ProtocolType) -> Self {
183 self.protocol_type = ::std::option::Option::Some(input);
184 self
185 }
186 pub fn set_protocol_type(mut self, input: ::std::option::Option<crate::types::ProtocolType>) -> Self {
188 self.protocol_type = input;
189 self
190 }
191 pub fn get_protocol_type(&self) -> &::std::option::Option<crate::types::ProtocolType> {
193 &self.protocol_type
194 }
195 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 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203 self.revision_id = input;
204 self
205 }
206 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
208 &self.revision_id
209 }
210 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 pub fn set_stage(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218 self.stage = input;
219 self
220 }
221 pub fn get_stage(&self) -> &::std::option::Option<::std::string::String> {
223 &self.stage
224 }
225 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}