1use std::fmt::Write;
3
4pub mod change_guide_visibility_input {
6
7 #[non_exhaustive]
9 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
10 pub struct Builder {
11 pub(crate) id: std::option::Option<std::string::String>,
12 pub(crate) visibility: std::option::Option<crate::model::GuideVisibility>,
13 }
14 impl Builder {
15 #[allow(missing_docs)] pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
17 self.id = Some(input.into());
18 self
19 }
20 #[allow(missing_docs)] pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
22 self.id = input;
23 self
24 }
25 #[allow(missing_docs)] pub fn visibility(mut self, input: crate::model::GuideVisibility) -> Self {
27 self.visibility = Some(input);
28 self
29 }
30 #[allow(missing_docs)] pub fn set_visibility(
32 mut self,
33 input: std::option::Option<crate::model::GuideVisibility>,
34 ) -> Self {
35 self.visibility = input;
36 self
37 }
38 pub fn build(
40 self,
41 ) -> Result<
42 crate::input::ChangeGuideVisibilityInput,
43 aws_smithy_http::operation::error::BuildError,
44 > {
45 Ok(crate::input::ChangeGuideVisibilityInput {
46 id: self.id,
47 visibility: self.visibility,
48 })
49 }
50 }
51}
52impl ChangeGuideVisibilityInput {
53 #[allow(unused_mut)]
55 #[allow(clippy::let_and_return)]
56 #[allow(clippy::needless_borrow)]
57 pub async fn make_operation(
58 &self,
59 _config: &crate::config::Config,
60 ) -> std::result::Result<
61 aws_smithy_http::operation::Operation<
62 crate::operation::ChangeGuideVisibility,
63 aws_http::retry::AwsResponseRetryClassifier,
64 >,
65 aws_smithy_http::operation::error::BuildError,
66 > {
67 let params_result = crate::endpoint::Params::builder()
68 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
69 .set_endpoint(_config.endpoint_url.clone())
70 .set_stage(_config.stage.clone())
71 .build()
72 .map_err(|err| {
73 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
74 "could not construct endpoint parameters",
75 err,
76 )
77 });
78 let (endpoint_result, params) = match params_result {
79 Ok(params) => (
80 _config.endpoint_resolver.resolve_endpoint(¶ms),
81 Some(params),
82 ),
83 Err(e) => (Err(e), None),
84 };
85 let mut request = {
86 fn uri_base(
87 _input: &crate::input::ChangeGuideVisibilityInput,
88 output: &mut String,
89 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
90 let input_1 = &_input.id;
91 let input_1 = input_1.as_ref().ok_or_else(|| {
92 aws_smithy_http::operation::error::BuildError::missing_field(
93 "id",
94 "cannot be empty or unset",
95 )
96 })?;
97 let id = aws_smithy_http::label::fmt_string(
98 input_1,
99 aws_smithy_http::label::EncodingStrategy::Default,
100 );
101 if id.is_empty() {
102 return Err(
103 aws_smithy_http::operation::error::BuildError::missing_field(
104 "id",
105 "cannot be empty or unset",
106 ),
107 );
108 }
109 write!(output, "/guides/{id}/visibility", id = id)
110 .expect("formatting should succeed");
111 Ok(())
112 }
113 #[allow(clippy::unnecessary_wraps)]
114 fn update_http_builder(
115 input: &crate::input::ChangeGuideVisibilityInput,
116 builder: http::request::Builder,
117 ) -> std::result::Result<
118 http::request::Builder,
119 aws_smithy_http::operation::error::BuildError,
120 > {
121 let mut uri = String::new();
122 uri_base(input, &mut uri)?;
123 Ok(builder.method("PUT").uri(uri))
124 }
125 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
126 builder = aws_smithy_http::header::set_request_header_if_absent(
127 builder,
128 http::header::CONTENT_TYPE,
129 "application/json",
130 );
131 builder
132 };
133 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
134 #[allow(clippy::useless_conversion)]
135 let body = aws_smithy_http::body::SdkBody::from(
136 crate::operation_ser::serialize_operation_crate_operation_change_guide_visibility(
137 &self,
138 )?,
139 );
140 if let Some(content_length) = body.content_length() {
141 request = aws_smithy_http::header::set_request_header_if_absent(
142 request,
143 http::header::CONTENT_LENGTH,
144 content_length,
145 );
146 }
147 let request = request.body(body).expect("should be valid request");
148 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
149 if let Some(api_key_config) = _config.api_key() {
150 request.properties_mut().insert(api_key_config.clone());
151 let api_key = api_key_config.api_key();
152 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
153 "Authorization".to_owned(),
154 Some("Key".to_owned()),
155 );
156 let name = auth_definition.name();
157 let value = match auth_definition.scheme() {
158 Some(value) => format!("{value} {api_key}"),
159 None => api_key.to_owned(),
160 };
161 request.http_mut().headers_mut().insert(
162 http::header::HeaderName::from_bytes(name.as_bytes())
163 .expect("valid header name for api key auth"),
164 http::header::HeaderValue::from_bytes(value.as_bytes())
165 .expect("valid header value for api key auth"),
166 );
167 }
168 request.properties_mut().insert(endpoint_result);
169 if let Some(params) = params {
170 request.properties_mut().insert(params);
171 }
172 request
173 .properties_mut()
174 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
175 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
176 aws_types::os_shim_internal::Env::real(),
177 crate::API_METADATA.clone(),
178 );
179 if let Some(app_name) = _config.app_name() {
180 user_agent = user_agent.with_app_name(app_name.clone());
181 }
182 request.properties_mut().insert(user_agent);
183 if let Some(region) = &_config.region {
184 request.properties_mut().insert(region.clone());
185 }
186 let op = aws_smithy_http::operation::Operation::new(
187 request,
188 crate::operation::ChangeGuideVisibility::new(),
189 )
190 .with_metadata(aws_smithy_http::operation::Metadata::new(
191 "ChangeGuideVisibility",
192 "guides",
193 ));
194 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
195 Ok(op)
196 }
197 pub fn builder() -> crate::input::change_guide_visibility_input::Builder {
199 crate::input::change_guide_visibility_input::Builder::default()
200 }
201}
202
203pub mod create_guide_input {
205
206 #[non_exhaustive]
208 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
209 pub struct Builder {
210 pub(crate) name: std::option::Option<std::string::String>,
211 pub(crate) target: std::option::Option<crate::model::GuideTarget>,
212 pub(crate) definition: std::option::Option<aws_smithy_types::Document>,
213 pub(crate) x12_envelope: std::option::Option<std::string::String>,
214 pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
215 pub(crate) samples: std::option::Option<std::vec::Vec<crate::model::CreateGuideSampleData>>,
216 pub(crate) attachments:
217 std::option::Option<std::vec::Vec<crate::model::CreateGuideAttachmentData>>,
218 pub(crate) source_guide: std::option::Option<std::string::String>,
219 }
220 impl Builder {
221 #[allow(missing_docs)] pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
223 self.name = Some(input.into());
224 self
225 }
226 #[allow(missing_docs)] pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
228 self.name = input;
229 self
230 }
231 #[allow(missing_docs)] pub fn target(mut self, input: crate::model::GuideTarget) -> Self {
233 self.target = Some(input);
234 self
235 }
236 #[allow(missing_docs)] pub fn set_target(mut self, input: std::option::Option<crate::model::GuideTarget>) -> Self {
238 self.target = input;
239 self
240 }
241 #[allow(missing_docs)] pub fn definition(mut self, input: aws_smithy_types::Document) -> Self {
243 self.definition = Some(input);
244 self
245 }
246 #[allow(missing_docs)] pub fn set_definition(
248 mut self,
249 input: std::option::Option<aws_smithy_types::Document>,
250 ) -> Self {
251 self.definition = input;
252 self
253 }
254 #[allow(missing_docs)] pub fn x12_envelope(mut self, input: impl Into<std::string::String>) -> Self {
256 self.x12_envelope = Some(input.into());
257 self
258 }
259 #[allow(missing_docs)] pub fn set_x12_envelope(mut self, input: std::option::Option<std::string::String>) -> Self {
261 self.x12_envelope = input;
262 self
263 }
264 #[allow(missing_docs)] pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
266 self.output_format = Some(input);
267 self
268 }
269 #[allow(missing_docs)] pub fn set_output_format(
271 mut self,
272 input: std::option::Option<crate::model::OutputFormat>,
273 ) -> Self {
274 self.output_format = input;
275 self
276 }
277 pub fn samples(mut self, input: crate::model::CreateGuideSampleData) -> Self {
282 let mut v = self.samples.unwrap_or_default();
283 v.push(input);
284 self.samples = Some(v);
285 self
286 }
287 #[allow(missing_docs)] pub fn set_samples(
289 mut self,
290 input: std::option::Option<std::vec::Vec<crate::model::CreateGuideSampleData>>,
291 ) -> Self {
292 self.samples = input;
293 self
294 }
295 pub fn attachments(mut self, input: crate::model::CreateGuideAttachmentData) -> Self {
300 let mut v = self.attachments.unwrap_or_default();
301 v.push(input);
302 self.attachments = Some(v);
303 self
304 }
305 #[allow(missing_docs)] pub fn set_attachments(
307 mut self,
308 input: std::option::Option<std::vec::Vec<crate::model::CreateGuideAttachmentData>>,
309 ) -> Self {
310 self.attachments = input;
311 self
312 }
313 pub fn source_guide(mut self, input: impl Into<std::string::String>) -> Self {
315 self.source_guide = Some(input.into());
316 self
317 }
318 pub fn set_source_guide(mut self, input: std::option::Option<std::string::String>) -> Self {
320 self.source_guide = input;
321 self
322 }
323 pub fn build(
325 self,
326 ) -> Result<crate::input::CreateGuideInput, aws_smithy_http::operation::error::BuildError>
327 {
328 Ok(crate::input::CreateGuideInput {
329 name: self.name,
330 target: self.target,
331 definition: self.definition,
332 x12_envelope: self.x12_envelope,
333 output_format: self.output_format,
334 samples: self.samples,
335 attachments: self.attachments,
336 source_guide: self.source_guide,
337 })
338 }
339 }
340}
341impl CreateGuideInput {
342 #[allow(unused_mut)]
344 #[allow(clippy::let_and_return)]
345 #[allow(clippy::needless_borrow)]
346 pub async fn make_operation(
347 &self,
348 _config: &crate::config::Config,
349 ) -> std::result::Result<
350 aws_smithy_http::operation::Operation<
351 crate::operation::CreateGuide,
352 aws_http::retry::AwsResponseRetryClassifier,
353 >,
354 aws_smithy_http::operation::error::BuildError,
355 > {
356 let params_result = crate::endpoint::Params::builder()
357 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
358 .set_endpoint(_config.endpoint_url.clone())
359 .set_stage(_config.stage.clone())
360 .build()
361 .map_err(|err| {
362 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
363 "could not construct endpoint parameters",
364 err,
365 )
366 });
367 let (endpoint_result, params) = match params_result {
368 Ok(params) => (
369 _config.endpoint_resolver.resolve_endpoint(¶ms),
370 Some(params),
371 ),
372 Err(e) => (Err(e), None),
373 };
374 let mut request = {
375 fn uri_base(
376 _input: &crate::input::CreateGuideInput,
377 output: &mut String,
378 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
379 write!(output, "/guides").expect("formatting should succeed");
380 Ok(())
381 }
382 fn uri_query(
383 _input: &crate::input::CreateGuideInput,
384 mut output: &mut String,
385 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
386 let mut query = aws_smithy_http::query::Writer::new(&mut output);
387 if let Some(inner_2) = &_input.output_format {
388 {
389 query.push_kv(
390 "outputFormat",
391 &aws_smithy_http::query::fmt_string(&inner_2),
392 );
393 }
394 }
395 Ok(())
396 }
397 #[allow(clippy::unnecessary_wraps)]
398 fn update_http_builder(
399 input: &crate::input::CreateGuideInput,
400 builder: http::request::Builder,
401 ) -> std::result::Result<
402 http::request::Builder,
403 aws_smithy_http::operation::error::BuildError,
404 > {
405 let mut uri = String::new();
406 uri_base(input, &mut uri)?;
407 uri_query(input, &mut uri)?;
408 Ok(builder.method("POST").uri(uri))
409 }
410 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
411 builder = aws_smithy_http::header::set_request_header_if_absent(
412 builder,
413 http::header::CONTENT_TYPE,
414 "application/json",
415 );
416 builder
417 };
418 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
419 #[allow(clippy::useless_conversion)]
420 let body = aws_smithy_http::body::SdkBody::from(
421 crate::operation_ser::serialize_operation_crate_operation_create_guide(&self)?,
422 );
423 if let Some(content_length) = body.content_length() {
424 request = aws_smithy_http::header::set_request_header_if_absent(
425 request,
426 http::header::CONTENT_LENGTH,
427 content_length,
428 );
429 }
430 let request = request.body(body).expect("should be valid request");
431 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
432 if let Some(api_key_config) = _config.api_key() {
433 request.properties_mut().insert(api_key_config.clone());
434 let api_key = api_key_config.api_key();
435 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
436 "Authorization".to_owned(),
437 Some("Key".to_owned()),
438 );
439 let name = auth_definition.name();
440 let value = match auth_definition.scheme() {
441 Some(value) => format!("{value} {api_key}"),
442 None => api_key.to_owned(),
443 };
444 request.http_mut().headers_mut().insert(
445 http::header::HeaderName::from_bytes(name.as_bytes())
446 .expect("valid header name for api key auth"),
447 http::header::HeaderValue::from_bytes(value.as_bytes())
448 .expect("valid header value for api key auth"),
449 );
450 }
451 request.properties_mut().insert(endpoint_result);
452 if let Some(params) = params {
453 request.properties_mut().insert(params);
454 }
455 request
456 .properties_mut()
457 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
458 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
459 aws_types::os_shim_internal::Env::real(),
460 crate::API_METADATA.clone(),
461 );
462 if let Some(app_name) = _config.app_name() {
463 user_agent = user_agent.with_app_name(app_name.clone());
464 }
465 request.properties_mut().insert(user_agent);
466 if let Some(region) = &_config.region {
467 request.properties_mut().insert(region.clone());
468 }
469 let op = aws_smithy_http::operation::Operation::new(
470 request,
471 crate::operation::CreateGuide::new(),
472 )
473 .with_metadata(aws_smithy_http::operation::Metadata::new(
474 "CreateGuide",
475 "guides",
476 ));
477 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
478 Ok(op)
479 }
480 pub fn builder() -> crate::input::create_guide_input::Builder {
482 crate::input::create_guide_input::Builder::default()
483 }
484}
485
486pub mod create_guide_attachment_input {
488
489 #[non_exhaustive]
491 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
492 pub struct Builder {
493 pub(crate) id: std::option::Option<std::string::String>,
494 pub(crate) name: std::option::Option<std::string::String>,
495 pub(crate) filename: std::option::Option<std::string::String>,
496 pub(crate) visibility: std::option::Option<crate::model::AttachmentVisibility>,
497 pub(crate) content: std::option::Option<aws_smithy_types::Blob>,
498 }
499 impl Builder {
500 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
502 self.id = Some(input.into());
503 self
504 }
505 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
507 self.id = input;
508 self
509 }
510 #[allow(missing_docs)] pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
512 self.name = Some(input.into());
513 self
514 }
515 #[allow(missing_docs)] pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
517 self.name = input;
518 self
519 }
520 #[allow(missing_docs)] pub fn filename(mut self, input: impl Into<std::string::String>) -> Self {
522 self.filename = Some(input.into());
523 self
524 }
525 #[allow(missing_docs)] pub fn set_filename(mut self, input: std::option::Option<std::string::String>) -> Self {
527 self.filename = input;
528 self
529 }
530 #[allow(missing_docs)] pub fn visibility(mut self, input: crate::model::AttachmentVisibility) -> Self {
532 self.visibility = Some(input);
533 self
534 }
535 #[allow(missing_docs)] pub fn set_visibility(
537 mut self,
538 input: std::option::Option<crate::model::AttachmentVisibility>,
539 ) -> Self {
540 self.visibility = input;
541 self
542 }
543 #[allow(missing_docs)] pub fn content(mut self, input: aws_smithy_types::Blob) -> Self {
545 self.content = Some(input);
546 self
547 }
548 #[allow(missing_docs)] pub fn set_content(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
550 self.content = input;
551 self
552 }
553 pub fn build(
555 self,
556 ) -> Result<
557 crate::input::CreateGuideAttachmentInput,
558 aws_smithy_http::operation::error::BuildError,
559 > {
560 Ok(crate::input::CreateGuideAttachmentInput {
561 id: self.id,
562 name: self.name,
563 filename: self.filename,
564 visibility: self.visibility,
565 content: self.content,
566 })
567 }
568 }
569}
570impl CreateGuideAttachmentInput {
571 #[allow(unused_mut)]
573 #[allow(clippy::let_and_return)]
574 #[allow(clippy::needless_borrow)]
575 pub async fn make_operation(
576 &self,
577 _config: &crate::config::Config,
578 ) -> std::result::Result<
579 aws_smithy_http::operation::Operation<
580 crate::operation::CreateGuideAttachment,
581 aws_http::retry::AwsResponseRetryClassifier,
582 >,
583 aws_smithy_http::operation::error::BuildError,
584 > {
585 let params_result = crate::endpoint::Params::builder()
586 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
587 .set_endpoint(_config.endpoint_url.clone())
588 .set_stage(_config.stage.clone())
589 .build()
590 .map_err(|err| {
591 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
592 "could not construct endpoint parameters",
593 err,
594 )
595 });
596 let (endpoint_result, params) = match params_result {
597 Ok(params) => (
598 _config.endpoint_resolver.resolve_endpoint(¶ms),
599 Some(params),
600 ),
601 Err(e) => (Err(e), None),
602 };
603 let mut request = {
604 fn uri_base(
605 _input: &crate::input::CreateGuideAttachmentInput,
606 output: &mut String,
607 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
608 let input_3 = &_input.id;
609 let input_3 = input_3.as_ref().ok_or_else(|| {
610 aws_smithy_http::operation::error::BuildError::missing_field(
611 "id",
612 "cannot be empty or unset",
613 )
614 })?;
615 let id = aws_smithy_http::label::fmt_string(
616 input_3,
617 aws_smithy_http::label::EncodingStrategy::Default,
618 );
619 if id.is_empty() {
620 return Err(
621 aws_smithy_http::operation::error::BuildError::missing_field(
622 "id",
623 "cannot be empty or unset",
624 ),
625 );
626 }
627 write!(output, "/guides/{id}/attachments", id = id)
628 .expect("formatting should succeed");
629 Ok(())
630 }
631 #[allow(clippy::unnecessary_wraps)]
632 fn update_http_builder(
633 input: &crate::input::CreateGuideAttachmentInput,
634 builder: http::request::Builder,
635 ) -> std::result::Result<
636 http::request::Builder,
637 aws_smithy_http::operation::error::BuildError,
638 > {
639 let mut uri = String::new();
640 uri_base(input, &mut uri)?;
641 Ok(builder.method("POST").uri(uri))
642 }
643 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
644 builder = aws_smithy_http::header::set_request_header_if_absent(
645 builder,
646 http::header::CONTENT_TYPE,
647 "application/json",
648 );
649 builder
650 };
651 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
652 #[allow(clippy::useless_conversion)]
653 let body = aws_smithy_http::body::SdkBody::from(
654 crate::operation_ser::serialize_operation_crate_operation_create_guide_attachment(
655 &self,
656 )?,
657 );
658 if let Some(content_length) = body.content_length() {
659 request = aws_smithy_http::header::set_request_header_if_absent(
660 request,
661 http::header::CONTENT_LENGTH,
662 content_length,
663 );
664 }
665 let request = request.body(body).expect("should be valid request");
666 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
667 if let Some(api_key_config) = _config.api_key() {
668 request.properties_mut().insert(api_key_config.clone());
669 let api_key = api_key_config.api_key();
670 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
671 "Authorization".to_owned(),
672 Some("Key".to_owned()),
673 );
674 let name = auth_definition.name();
675 let value = match auth_definition.scheme() {
676 Some(value) => format!("{value} {api_key}"),
677 None => api_key.to_owned(),
678 };
679 request.http_mut().headers_mut().insert(
680 http::header::HeaderName::from_bytes(name.as_bytes())
681 .expect("valid header name for api key auth"),
682 http::header::HeaderValue::from_bytes(value.as_bytes())
683 .expect("valid header value for api key auth"),
684 );
685 }
686 request.properties_mut().insert(endpoint_result);
687 if let Some(params) = params {
688 request.properties_mut().insert(params);
689 }
690 request
691 .properties_mut()
692 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
693 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
694 aws_types::os_shim_internal::Env::real(),
695 crate::API_METADATA.clone(),
696 );
697 if let Some(app_name) = _config.app_name() {
698 user_agent = user_agent.with_app_name(app_name.clone());
699 }
700 request.properties_mut().insert(user_agent);
701 if let Some(region) = &_config.region {
702 request.properties_mut().insert(region.clone());
703 }
704 let op = aws_smithy_http::operation::Operation::new(
705 request,
706 crate::operation::CreateGuideAttachment::new(),
707 )
708 .with_metadata(aws_smithy_http::operation::Metadata::new(
709 "CreateGuideAttachment",
710 "guides",
711 ));
712 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
713 Ok(op)
714 }
715 pub fn builder() -> crate::input::create_guide_attachment_input::Builder {
717 crate::input::create_guide_attachment_input::Builder::default()
718 }
719}
720
721pub mod create_guide_sample_input {
723
724 #[non_exhaustive]
726 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
727 pub struct Builder {
728 pub(crate) id: std::option::Option<std::string::String>,
729 pub(crate) name: std::option::Option<std::string::String>,
730 pub(crate) content: std::option::Option<std::string::String>,
731 pub(crate) description: std::option::Option<std::string::String>,
732 }
733 impl Builder {
734 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
736 self.id = Some(input.into());
737 self
738 }
739 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
741 self.id = input;
742 self
743 }
744 #[allow(missing_docs)] pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
746 self.name = Some(input.into());
747 self
748 }
749 #[allow(missing_docs)] pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
751 self.name = input;
752 self
753 }
754 #[allow(missing_docs)] pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
756 self.content = Some(input.into());
757 self
758 }
759 #[allow(missing_docs)] pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
761 self.content = input;
762 self
763 }
764 #[allow(missing_docs)] pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
766 self.description = Some(input.into());
767 self
768 }
769 #[allow(missing_docs)] pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
771 self.description = input;
772 self
773 }
774 pub fn build(
776 self,
777 ) -> Result<
778 crate::input::CreateGuideSampleInput,
779 aws_smithy_http::operation::error::BuildError,
780 > {
781 Ok(crate::input::CreateGuideSampleInput {
782 id: self.id,
783 name: self.name,
784 content: self.content,
785 description: self.description,
786 })
787 }
788 }
789}
790impl CreateGuideSampleInput {
791 #[allow(unused_mut)]
793 #[allow(clippy::let_and_return)]
794 #[allow(clippy::needless_borrow)]
795 pub async fn make_operation(
796 &self,
797 _config: &crate::config::Config,
798 ) -> std::result::Result<
799 aws_smithy_http::operation::Operation<
800 crate::operation::CreateGuideSample,
801 aws_http::retry::AwsResponseRetryClassifier,
802 >,
803 aws_smithy_http::operation::error::BuildError,
804 > {
805 let params_result = crate::endpoint::Params::builder()
806 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
807 .set_endpoint(_config.endpoint_url.clone())
808 .set_stage(_config.stage.clone())
809 .build()
810 .map_err(|err| {
811 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
812 "could not construct endpoint parameters",
813 err,
814 )
815 });
816 let (endpoint_result, params) = match params_result {
817 Ok(params) => (
818 _config.endpoint_resolver.resolve_endpoint(¶ms),
819 Some(params),
820 ),
821 Err(e) => (Err(e), None),
822 };
823 let mut request = {
824 fn uri_base(
825 _input: &crate::input::CreateGuideSampleInput,
826 output: &mut String,
827 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
828 let input_4 = &_input.id;
829 let input_4 = input_4.as_ref().ok_or_else(|| {
830 aws_smithy_http::operation::error::BuildError::missing_field(
831 "id",
832 "cannot be empty or unset",
833 )
834 })?;
835 let id = aws_smithy_http::label::fmt_string(
836 input_4,
837 aws_smithy_http::label::EncodingStrategy::Default,
838 );
839 if id.is_empty() {
840 return Err(
841 aws_smithy_http::operation::error::BuildError::missing_field(
842 "id",
843 "cannot be empty or unset",
844 ),
845 );
846 }
847 write!(output, "/guides/{id}/samples", id = id).expect("formatting should succeed");
848 Ok(())
849 }
850 #[allow(clippy::unnecessary_wraps)]
851 fn update_http_builder(
852 input: &crate::input::CreateGuideSampleInput,
853 builder: http::request::Builder,
854 ) -> std::result::Result<
855 http::request::Builder,
856 aws_smithy_http::operation::error::BuildError,
857 > {
858 let mut uri = String::new();
859 uri_base(input, &mut uri)?;
860 Ok(builder.method("POST").uri(uri))
861 }
862 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
863 builder = aws_smithy_http::header::set_request_header_if_absent(
864 builder,
865 http::header::CONTENT_TYPE,
866 "application/json",
867 );
868 builder
869 };
870 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
871 #[allow(clippy::useless_conversion)]
872 let body = aws_smithy_http::body::SdkBody::from(
873 crate::operation_ser::serialize_operation_crate_operation_create_guide_sample(&self)?,
874 );
875 if let Some(content_length) = body.content_length() {
876 request = aws_smithy_http::header::set_request_header_if_absent(
877 request,
878 http::header::CONTENT_LENGTH,
879 content_length,
880 );
881 }
882 let request = request.body(body).expect("should be valid request");
883 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
884 if let Some(api_key_config) = _config.api_key() {
885 request.properties_mut().insert(api_key_config.clone());
886 let api_key = api_key_config.api_key();
887 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
888 "Authorization".to_owned(),
889 Some("Key".to_owned()),
890 );
891 let name = auth_definition.name();
892 let value = match auth_definition.scheme() {
893 Some(value) => format!("{value} {api_key}"),
894 None => api_key.to_owned(),
895 };
896 request.http_mut().headers_mut().insert(
897 http::header::HeaderName::from_bytes(name.as_bytes())
898 .expect("valid header name for api key auth"),
899 http::header::HeaderValue::from_bytes(value.as_bytes())
900 .expect("valid header value for api key auth"),
901 );
902 }
903 request.properties_mut().insert(endpoint_result);
904 if let Some(params) = params {
905 request.properties_mut().insert(params);
906 }
907 request
908 .properties_mut()
909 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
910 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
911 aws_types::os_shim_internal::Env::real(),
912 crate::API_METADATA.clone(),
913 );
914 if let Some(app_name) = _config.app_name() {
915 user_agent = user_agent.with_app_name(app_name.clone());
916 }
917 request.properties_mut().insert(user_agent);
918 if let Some(region) = &_config.region {
919 request.properties_mut().insert(region.clone());
920 }
921 let op = aws_smithy_http::operation::Operation::new(
922 request,
923 crate::operation::CreateGuideSample::new(),
924 )
925 .with_metadata(aws_smithy_http::operation::Metadata::new(
926 "CreateGuideSample",
927 "guides",
928 ));
929 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
930 Ok(op)
931 }
932 pub fn builder() -> crate::input::create_guide_sample_input::Builder {
934 crate::input::create_guide_sample_input::Builder::default()
935 }
936}
937
938pub mod delete_guide_input {
940
941 #[non_exhaustive]
943 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
944 pub struct Builder {
945 pub(crate) id: std::option::Option<std::string::String>,
946 }
947 impl Builder {
948 #[allow(missing_docs)] pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
950 self.id = Some(input.into());
951 self
952 }
953 #[allow(missing_docs)] pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
955 self.id = input;
956 self
957 }
958 pub fn build(
960 self,
961 ) -> Result<crate::input::DeleteGuideInput, aws_smithy_http::operation::error::BuildError>
962 {
963 Ok(crate::input::DeleteGuideInput { id: self.id })
964 }
965 }
966}
967impl DeleteGuideInput {
968 #[allow(unused_mut)]
970 #[allow(clippy::let_and_return)]
971 #[allow(clippy::needless_borrow)]
972 pub async fn make_operation(
973 &self,
974 _config: &crate::config::Config,
975 ) -> std::result::Result<
976 aws_smithy_http::operation::Operation<
977 crate::operation::DeleteGuide,
978 aws_http::retry::AwsResponseRetryClassifier,
979 >,
980 aws_smithy_http::operation::error::BuildError,
981 > {
982 let params_result = crate::endpoint::Params::builder()
983 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
984 .set_endpoint(_config.endpoint_url.clone())
985 .set_stage(_config.stage.clone())
986 .build()
987 .map_err(|err| {
988 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
989 "could not construct endpoint parameters",
990 err,
991 )
992 });
993 let (endpoint_result, params) = match params_result {
994 Ok(params) => (
995 _config.endpoint_resolver.resolve_endpoint(¶ms),
996 Some(params),
997 ),
998 Err(e) => (Err(e), None),
999 };
1000 let mut request = {
1001 fn uri_base(
1002 _input: &crate::input::DeleteGuideInput,
1003 output: &mut String,
1004 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1005 let input_5 = &_input.id;
1006 let input_5 = input_5.as_ref().ok_or_else(|| {
1007 aws_smithy_http::operation::error::BuildError::missing_field(
1008 "id",
1009 "cannot be empty or unset",
1010 )
1011 })?;
1012 let id = aws_smithy_http::label::fmt_string(
1013 input_5,
1014 aws_smithy_http::label::EncodingStrategy::Default,
1015 );
1016 if id.is_empty() {
1017 return Err(
1018 aws_smithy_http::operation::error::BuildError::missing_field(
1019 "id",
1020 "cannot be empty or unset",
1021 ),
1022 );
1023 }
1024 write!(output, "/guides/{id}", id = id).expect("formatting should succeed");
1025 Ok(())
1026 }
1027 #[allow(clippy::unnecessary_wraps)]
1028 fn update_http_builder(
1029 input: &crate::input::DeleteGuideInput,
1030 builder: http::request::Builder,
1031 ) -> std::result::Result<
1032 http::request::Builder,
1033 aws_smithy_http::operation::error::BuildError,
1034 > {
1035 let mut uri = String::new();
1036 uri_base(input, &mut uri)?;
1037 Ok(builder.method("DELETE").uri(uri))
1038 }
1039 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
1040 builder
1041 };
1042 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
1043 #[allow(clippy::useless_conversion)]
1044 let body = aws_smithy_http::body::SdkBody::from("");
1045 let request = request.body(body).expect("should be valid request");
1046 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
1047 if let Some(api_key_config) = _config.api_key() {
1048 request.properties_mut().insert(api_key_config.clone());
1049 let api_key = api_key_config.api_key();
1050 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
1051 "Authorization".to_owned(),
1052 Some("Key".to_owned()),
1053 );
1054 let name = auth_definition.name();
1055 let value = match auth_definition.scheme() {
1056 Some(value) => format!("{value} {api_key}"),
1057 None => api_key.to_owned(),
1058 };
1059 request.http_mut().headers_mut().insert(
1060 http::header::HeaderName::from_bytes(name.as_bytes())
1061 .expect("valid header name for api key auth"),
1062 http::header::HeaderValue::from_bytes(value.as_bytes())
1063 .expect("valid header value for api key auth"),
1064 );
1065 }
1066 request.properties_mut().insert(endpoint_result);
1067 if let Some(params) = params {
1068 request.properties_mut().insert(params);
1069 }
1070 request
1071 .properties_mut()
1072 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
1073 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
1074 aws_types::os_shim_internal::Env::real(),
1075 crate::API_METADATA.clone(),
1076 );
1077 if let Some(app_name) = _config.app_name() {
1078 user_agent = user_agent.with_app_name(app_name.clone());
1079 }
1080 request.properties_mut().insert(user_agent);
1081 if let Some(region) = &_config.region {
1082 request.properties_mut().insert(region.clone());
1083 }
1084 let op = aws_smithy_http::operation::Operation::new(
1085 request,
1086 crate::operation::DeleteGuide::new(),
1087 )
1088 .with_metadata(aws_smithy_http::operation::Metadata::new(
1089 "DeleteGuide",
1090 "guides",
1091 ));
1092 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
1093 Ok(op)
1094 }
1095 pub fn builder() -> crate::input::delete_guide_input::Builder {
1097 crate::input::delete_guide_input::Builder::default()
1098 }
1099}
1100
1101pub mod delete_guide_attachment_input {
1103
1104 #[non_exhaustive]
1106 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
1107 pub struct Builder {
1108 pub(crate) id: std::option::Option<std::string::String>,
1109 pub(crate) guide_attachment_id: std::option::Option<std::string::String>,
1110 }
1111 impl Builder {
1112 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
1114 self.id = Some(input.into());
1115 self
1116 }
1117 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1119 self.id = input;
1120 self
1121 }
1122 #[allow(missing_docs)] pub fn guide_attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
1124 self.guide_attachment_id = Some(input.into());
1125 self
1126 }
1127 #[allow(missing_docs)] pub fn set_guide_attachment_id(
1129 mut self,
1130 input: std::option::Option<std::string::String>,
1131 ) -> Self {
1132 self.guide_attachment_id = input;
1133 self
1134 }
1135 pub fn build(
1137 self,
1138 ) -> Result<
1139 crate::input::DeleteGuideAttachmentInput,
1140 aws_smithy_http::operation::error::BuildError,
1141 > {
1142 Ok(crate::input::DeleteGuideAttachmentInput {
1143 id: self.id,
1144 guide_attachment_id: self.guide_attachment_id,
1145 })
1146 }
1147 }
1148}
1149impl DeleteGuideAttachmentInput {
1150 #[allow(unused_mut)]
1152 #[allow(clippy::let_and_return)]
1153 #[allow(clippy::needless_borrow)]
1154 pub async fn make_operation(
1155 &self,
1156 _config: &crate::config::Config,
1157 ) -> std::result::Result<
1158 aws_smithy_http::operation::Operation<
1159 crate::operation::DeleteGuideAttachment,
1160 aws_http::retry::AwsResponseRetryClassifier,
1161 >,
1162 aws_smithy_http::operation::error::BuildError,
1163 > {
1164 let params_result = crate::endpoint::Params::builder()
1165 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
1166 .set_endpoint(_config.endpoint_url.clone())
1167 .set_stage(_config.stage.clone())
1168 .build()
1169 .map_err(|err| {
1170 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
1171 "could not construct endpoint parameters",
1172 err,
1173 )
1174 });
1175 let (endpoint_result, params) = match params_result {
1176 Ok(params) => (
1177 _config.endpoint_resolver.resolve_endpoint(¶ms),
1178 Some(params),
1179 ),
1180 Err(e) => (Err(e), None),
1181 };
1182 let mut request = {
1183 fn uri_base(
1184 _input: &crate::input::DeleteGuideAttachmentInput,
1185 output: &mut String,
1186 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1187 let input_6 = &_input.id;
1188 let input_6 = input_6.as_ref().ok_or_else(|| {
1189 aws_smithy_http::operation::error::BuildError::missing_field(
1190 "id",
1191 "cannot be empty or unset",
1192 )
1193 })?;
1194 let id = aws_smithy_http::label::fmt_string(
1195 input_6,
1196 aws_smithy_http::label::EncodingStrategy::Default,
1197 );
1198 if id.is_empty() {
1199 return Err(
1200 aws_smithy_http::operation::error::BuildError::missing_field(
1201 "id",
1202 "cannot be empty or unset",
1203 ),
1204 );
1205 }
1206 let input_7 = &_input.guide_attachment_id;
1207 let input_7 = input_7.as_ref().ok_or_else(|| {
1208 aws_smithy_http::operation::error::BuildError::missing_field(
1209 "guide_attachment_id",
1210 "cannot be empty or unset",
1211 )
1212 })?;
1213 let guide_attachment_id = aws_smithy_http::label::fmt_string(
1214 input_7,
1215 aws_smithy_http::label::EncodingStrategy::Default,
1216 );
1217 if guide_attachment_id.is_empty() {
1218 return Err(
1219 aws_smithy_http::operation::error::BuildError::missing_field(
1220 "guide_attachment_id",
1221 "cannot be empty or unset",
1222 ),
1223 );
1224 }
1225 write!(
1226 output,
1227 "/guides/{id}/attachments/{guideAttachmentId}",
1228 id = id,
1229 guideAttachmentId = guide_attachment_id
1230 )
1231 .expect("formatting should succeed");
1232 Ok(())
1233 }
1234 #[allow(clippy::unnecessary_wraps)]
1235 fn update_http_builder(
1236 input: &crate::input::DeleteGuideAttachmentInput,
1237 builder: http::request::Builder,
1238 ) -> std::result::Result<
1239 http::request::Builder,
1240 aws_smithy_http::operation::error::BuildError,
1241 > {
1242 let mut uri = String::new();
1243 uri_base(input, &mut uri)?;
1244 Ok(builder.method("DELETE").uri(uri))
1245 }
1246 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
1247 builder
1248 };
1249 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
1250 #[allow(clippy::useless_conversion)]
1251 let body = aws_smithy_http::body::SdkBody::from("");
1252 let request = request.body(body).expect("should be valid request");
1253 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
1254 if let Some(api_key_config) = _config.api_key() {
1255 request.properties_mut().insert(api_key_config.clone());
1256 let api_key = api_key_config.api_key();
1257 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
1258 "Authorization".to_owned(),
1259 Some("Key".to_owned()),
1260 );
1261 let name = auth_definition.name();
1262 let value = match auth_definition.scheme() {
1263 Some(value) => format!("{value} {api_key}"),
1264 None => api_key.to_owned(),
1265 };
1266 request.http_mut().headers_mut().insert(
1267 http::header::HeaderName::from_bytes(name.as_bytes())
1268 .expect("valid header name for api key auth"),
1269 http::header::HeaderValue::from_bytes(value.as_bytes())
1270 .expect("valid header value for api key auth"),
1271 );
1272 }
1273 request.properties_mut().insert(endpoint_result);
1274 if let Some(params) = params {
1275 request.properties_mut().insert(params);
1276 }
1277 request
1278 .properties_mut()
1279 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
1280 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
1281 aws_types::os_shim_internal::Env::real(),
1282 crate::API_METADATA.clone(),
1283 );
1284 if let Some(app_name) = _config.app_name() {
1285 user_agent = user_agent.with_app_name(app_name.clone());
1286 }
1287 request.properties_mut().insert(user_agent);
1288 if let Some(region) = &_config.region {
1289 request.properties_mut().insert(region.clone());
1290 }
1291 let op = aws_smithy_http::operation::Operation::new(
1292 request,
1293 crate::operation::DeleteGuideAttachment::new(),
1294 )
1295 .with_metadata(aws_smithy_http::operation::Metadata::new(
1296 "DeleteGuideAttachment",
1297 "guides",
1298 ));
1299 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
1300 Ok(op)
1301 }
1302 pub fn builder() -> crate::input::delete_guide_attachment_input::Builder {
1304 crate::input::delete_guide_attachment_input::Builder::default()
1305 }
1306}
1307
1308pub mod delete_guide_sample_input {
1310
1311 #[non_exhaustive]
1313 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
1314 pub struct Builder {
1315 pub(crate) id: std::option::Option<std::string::String>,
1316 pub(crate) guide_sample_id: std::option::Option<std::string::String>,
1317 }
1318 impl Builder {
1319 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
1321 self.id = Some(input.into());
1322 self
1323 }
1324 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1326 self.id = input;
1327 self
1328 }
1329 #[allow(missing_docs)] pub fn guide_sample_id(mut self, input: impl Into<std::string::String>) -> Self {
1331 self.guide_sample_id = Some(input.into());
1332 self
1333 }
1334 #[allow(missing_docs)] pub fn set_guide_sample_id(
1336 mut self,
1337 input: std::option::Option<std::string::String>,
1338 ) -> Self {
1339 self.guide_sample_id = input;
1340 self
1341 }
1342 pub fn build(
1344 self,
1345 ) -> Result<
1346 crate::input::DeleteGuideSampleInput,
1347 aws_smithy_http::operation::error::BuildError,
1348 > {
1349 Ok(crate::input::DeleteGuideSampleInput {
1350 id: self.id,
1351 guide_sample_id: self.guide_sample_id,
1352 })
1353 }
1354 }
1355}
1356impl DeleteGuideSampleInput {
1357 #[allow(unused_mut)]
1359 #[allow(clippy::let_and_return)]
1360 #[allow(clippy::needless_borrow)]
1361 pub async fn make_operation(
1362 &self,
1363 _config: &crate::config::Config,
1364 ) -> std::result::Result<
1365 aws_smithy_http::operation::Operation<
1366 crate::operation::DeleteGuideSample,
1367 aws_http::retry::AwsResponseRetryClassifier,
1368 >,
1369 aws_smithy_http::operation::error::BuildError,
1370 > {
1371 let params_result = crate::endpoint::Params::builder()
1372 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
1373 .set_endpoint(_config.endpoint_url.clone())
1374 .set_stage(_config.stage.clone())
1375 .build()
1376 .map_err(|err| {
1377 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
1378 "could not construct endpoint parameters",
1379 err,
1380 )
1381 });
1382 let (endpoint_result, params) = match params_result {
1383 Ok(params) => (
1384 _config.endpoint_resolver.resolve_endpoint(¶ms),
1385 Some(params),
1386 ),
1387 Err(e) => (Err(e), None),
1388 };
1389 let mut request = {
1390 fn uri_base(
1391 _input: &crate::input::DeleteGuideSampleInput,
1392 output: &mut String,
1393 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1394 let input_8 = &_input.id;
1395 let input_8 = input_8.as_ref().ok_or_else(|| {
1396 aws_smithy_http::operation::error::BuildError::missing_field(
1397 "id",
1398 "cannot be empty or unset",
1399 )
1400 })?;
1401 let id = aws_smithy_http::label::fmt_string(
1402 input_8,
1403 aws_smithy_http::label::EncodingStrategy::Default,
1404 );
1405 if id.is_empty() {
1406 return Err(
1407 aws_smithy_http::operation::error::BuildError::missing_field(
1408 "id",
1409 "cannot be empty or unset",
1410 ),
1411 );
1412 }
1413 let input_9 = &_input.guide_sample_id;
1414 let input_9 = input_9.as_ref().ok_or_else(|| {
1415 aws_smithy_http::operation::error::BuildError::missing_field(
1416 "guide_sample_id",
1417 "cannot be empty or unset",
1418 )
1419 })?;
1420 let guide_sample_id = aws_smithy_http::label::fmt_string(
1421 input_9,
1422 aws_smithy_http::label::EncodingStrategy::Default,
1423 );
1424 if guide_sample_id.is_empty() {
1425 return Err(
1426 aws_smithy_http::operation::error::BuildError::missing_field(
1427 "guide_sample_id",
1428 "cannot be empty or unset",
1429 ),
1430 );
1431 }
1432 write!(
1433 output,
1434 "/guides/{id}/samples/{guideSampleId}",
1435 id = id,
1436 guideSampleId = guide_sample_id
1437 )
1438 .expect("formatting should succeed");
1439 Ok(())
1440 }
1441 #[allow(clippy::unnecessary_wraps)]
1442 fn update_http_builder(
1443 input: &crate::input::DeleteGuideSampleInput,
1444 builder: http::request::Builder,
1445 ) -> std::result::Result<
1446 http::request::Builder,
1447 aws_smithy_http::operation::error::BuildError,
1448 > {
1449 let mut uri = String::new();
1450 uri_base(input, &mut uri)?;
1451 Ok(builder.method("DELETE").uri(uri))
1452 }
1453 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
1454 builder
1455 };
1456 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
1457 #[allow(clippy::useless_conversion)]
1458 let body = aws_smithy_http::body::SdkBody::from("");
1459 let request = request.body(body).expect("should be valid request");
1460 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
1461 if let Some(api_key_config) = _config.api_key() {
1462 request.properties_mut().insert(api_key_config.clone());
1463 let api_key = api_key_config.api_key();
1464 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
1465 "Authorization".to_owned(),
1466 Some("Key".to_owned()),
1467 );
1468 let name = auth_definition.name();
1469 let value = match auth_definition.scheme() {
1470 Some(value) => format!("{value} {api_key}"),
1471 None => api_key.to_owned(),
1472 };
1473 request.http_mut().headers_mut().insert(
1474 http::header::HeaderName::from_bytes(name.as_bytes())
1475 .expect("valid header name for api key auth"),
1476 http::header::HeaderValue::from_bytes(value.as_bytes())
1477 .expect("valid header value for api key auth"),
1478 );
1479 }
1480 request.properties_mut().insert(endpoint_result);
1481 if let Some(params) = params {
1482 request.properties_mut().insert(params);
1483 }
1484 request
1485 .properties_mut()
1486 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
1487 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
1488 aws_types::os_shim_internal::Env::real(),
1489 crate::API_METADATA.clone(),
1490 );
1491 if let Some(app_name) = _config.app_name() {
1492 user_agent = user_agent.with_app_name(app_name.clone());
1493 }
1494 request.properties_mut().insert(user_agent);
1495 if let Some(region) = &_config.region {
1496 request.properties_mut().insert(region.clone());
1497 }
1498 let op = aws_smithy_http::operation::Operation::new(
1499 request,
1500 crate::operation::DeleteGuideSample::new(),
1501 )
1502 .with_metadata(aws_smithy_http::operation::Metadata::new(
1503 "DeleteGuideSample",
1504 "guides",
1505 ));
1506 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
1507 Ok(op)
1508 }
1509 pub fn builder() -> crate::input::delete_guide_sample_input::Builder {
1511 crate::input::delete_guide_sample_input::Builder::default()
1512 }
1513}
1514
1515pub mod get_account_config_input {
1517
1518 #[non_exhaustive]
1520 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
1521 pub struct Builder {}
1522 impl Builder {
1523 pub fn build(
1525 self,
1526 ) -> Result<
1527 crate::input::GetAccountConfigInput,
1528 aws_smithy_http::operation::error::BuildError,
1529 > {
1530 Ok(crate::input::GetAccountConfigInput {})
1531 }
1532 }
1533}
1534impl GetAccountConfigInput {
1535 #[allow(unused_mut)]
1537 #[allow(clippy::let_and_return)]
1538 #[allow(clippy::needless_borrow)]
1539 pub async fn make_operation(
1540 &self,
1541 _config: &crate::config::Config,
1542 ) -> std::result::Result<
1543 aws_smithy_http::operation::Operation<
1544 crate::operation::GetAccountConfig,
1545 aws_http::retry::AwsResponseRetryClassifier,
1546 >,
1547 aws_smithy_http::operation::error::BuildError,
1548 > {
1549 let params_result = crate::endpoint::Params::builder()
1550 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
1551 .set_endpoint(_config.endpoint_url.clone())
1552 .set_stage(_config.stage.clone())
1553 .build()
1554 .map_err(|err| {
1555 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
1556 "could not construct endpoint parameters",
1557 err,
1558 )
1559 });
1560 let (endpoint_result, params) = match params_result {
1561 Ok(params) => (
1562 _config.endpoint_resolver.resolve_endpoint(¶ms),
1563 Some(params),
1564 ),
1565 Err(e) => (Err(e), None),
1566 };
1567 let mut request = {
1568 fn uri_base(
1569 _input: &crate::input::GetAccountConfigInput,
1570 output: &mut String,
1571 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1572 write!(output, "/account-config").expect("formatting should succeed");
1573 Ok(())
1574 }
1575 #[allow(clippy::unnecessary_wraps)]
1576 fn update_http_builder(
1577 input: &crate::input::GetAccountConfigInput,
1578 builder: http::request::Builder,
1579 ) -> std::result::Result<
1580 http::request::Builder,
1581 aws_smithy_http::operation::error::BuildError,
1582 > {
1583 let mut uri = String::new();
1584 uri_base(input, &mut uri)?;
1585 Ok(builder.method("GET").uri(uri))
1586 }
1587 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
1588 builder
1589 };
1590 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
1591 #[allow(clippy::useless_conversion)]
1592 let body = aws_smithy_http::body::SdkBody::from("");
1593 let request = request.body(body).expect("should be valid request");
1594 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
1595 if let Some(api_key_config) = _config.api_key() {
1596 request.properties_mut().insert(api_key_config.clone());
1597 let api_key = api_key_config.api_key();
1598 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
1599 "Authorization".to_owned(),
1600 Some("Key".to_owned()),
1601 );
1602 let name = auth_definition.name();
1603 let value = match auth_definition.scheme() {
1604 Some(value) => format!("{value} {api_key}"),
1605 None => api_key.to_owned(),
1606 };
1607 request.http_mut().headers_mut().insert(
1608 http::header::HeaderName::from_bytes(name.as_bytes())
1609 .expect("valid header name for api key auth"),
1610 http::header::HeaderValue::from_bytes(value.as_bytes())
1611 .expect("valid header value for api key auth"),
1612 );
1613 }
1614 request.properties_mut().insert(endpoint_result);
1615 if let Some(params) = params {
1616 request.properties_mut().insert(params);
1617 }
1618 request
1619 .properties_mut()
1620 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
1621 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
1622 aws_types::os_shim_internal::Env::real(),
1623 crate::API_METADATA.clone(),
1624 );
1625 if let Some(app_name) = _config.app_name() {
1626 user_agent = user_agent.with_app_name(app_name.clone());
1627 }
1628 request.properties_mut().insert(user_agent);
1629 if let Some(region) = &_config.region {
1630 request.properties_mut().insert(region.clone());
1631 }
1632 let op = aws_smithy_http::operation::Operation::new(
1633 request,
1634 crate::operation::GetAccountConfig::new(),
1635 )
1636 .with_metadata(aws_smithy_http::operation::Metadata::new(
1637 "GetAccountConfig",
1638 "guides",
1639 ));
1640 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
1641 Ok(op)
1642 }
1643 pub fn builder() -> crate::input::get_account_config_input::Builder {
1645 crate::input::get_account_config_input::Builder::default()
1646 }
1647}
1648
1649pub mod get_guide_input {
1651
1652 #[non_exhaustive]
1654 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
1655 pub struct Builder {
1656 pub(crate) id: std::option::Option<std::string::String>,
1657 pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
1658 }
1659 impl Builder {
1660 #[allow(missing_docs)] pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
1662 self.id = Some(input.into());
1663 self
1664 }
1665 #[allow(missing_docs)] pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1667 self.id = input;
1668 self
1669 }
1670 #[allow(missing_docs)] pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
1672 self.output_format = Some(input);
1673 self
1674 }
1675 #[allow(missing_docs)] pub fn set_output_format(
1677 mut self,
1678 input: std::option::Option<crate::model::OutputFormat>,
1679 ) -> Self {
1680 self.output_format = input;
1681 self
1682 }
1683 pub fn build(
1685 self,
1686 ) -> Result<crate::input::GetGuideInput, aws_smithy_http::operation::error::BuildError>
1687 {
1688 Ok(crate::input::GetGuideInput {
1689 id: self.id,
1690 output_format: self.output_format,
1691 })
1692 }
1693 }
1694}
1695impl GetGuideInput {
1696 #[allow(unused_mut)]
1698 #[allow(clippy::let_and_return)]
1699 #[allow(clippy::needless_borrow)]
1700 pub async fn make_operation(
1701 &self,
1702 _config: &crate::config::Config,
1703 ) -> std::result::Result<
1704 aws_smithy_http::operation::Operation<
1705 crate::operation::GetGuide,
1706 aws_http::retry::AwsResponseRetryClassifier,
1707 >,
1708 aws_smithy_http::operation::error::BuildError,
1709 > {
1710 let params_result = crate::endpoint::Params::builder()
1711 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
1712 .set_endpoint(_config.endpoint_url.clone())
1713 .set_stage(_config.stage.clone())
1714 .build()
1715 .map_err(|err| {
1716 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
1717 "could not construct endpoint parameters",
1718 err,
1719 )
1720 });
1721 let (endpoint_result, params) = match params_result {
1722 Ok(params) => (
1723 _config.endpoint_resolver.resolve_endpoint(¶ms),
1724 Some(params),
1725 ),
1726 Err(e) => (Err(e), None),
1727 };
1728 let mut request = {
1729 fn uri_base(
1730 _input: &crate::input::GetGuideInput,
1731 output: &mut String,
1732 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1733 let input_10 = &_input.id;
1734 let input_10 = input_10.as_ref().ok_or_else(|| {
1735 aws_smithy_http::operation::error::BuildError::missing_field(
1736 "id",
1737 "cannot be empty or unset",
1738 )
1739 })?;
1740 let id = aws_smithy_http::label::fmt_string(
1741 input_10,
1742 aws_smithy_http::label::EncodingStrategy::Default,
1743 );
1744 if id.is_empty() {
1745 return Err(
1746 aws_smithy_http::operation::error::BuildError::missing_field(
1747 "id",
1748 "cannot be empty or unset",
1749 ),
1750 );
1751 }
1752 write!(output, "/guides/{id}", id = id).expect("formatting should succeed");
1753 Ok(())
1754 }
1755 fn uri_query(
1756 _input: &crate::input::GetGuideInput,
1757 mut output: &mut String,
1758 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1759 let mut query = aws_smithy_http::query::Writer::new(&mut output);
1760 if let Some(inner_11) = &_input.output_format {
1761 {
1762 query.push_kv(
1763 "outputFormat",
1764 &aws_smithy_http::query::fmt_string(&inner_11),
1765 );
1766 }
1767 }
1768 Ok(())
1769 }
1770 #[allow(clippy::unnecessary_wraps)]
1771 fn update_http_builder(
1772 input: &crate::input::GetGuideInput,
1773 builder: http::request::Builder,
1774 ) -> std::result::Result<
1775 http::request::Builder,
1776 aws_smithy_http::operation::error::BuildError,
1777 > {
1778 let mut uri = String::new();
1779 uri_base(input, &mut uri)?;
1780 uri_query(input, &mut uri)?;
1781 Ok(builder.method("GET").uri(uri))
1782 }
1783 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
1784 builder
1785 };
1786 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
1787 #[allow(clippy::useless_conversion)]
1788 let body = aws_smithy_http::body::SdkBody::from("");
1789 let request = request.body(body).expect("should be valid request");
1790 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
1791 if let Some(api_key_config) = _config.api_key() {
1792 request.properties_mut().insert(api_key_config.clone());
1793 let api_key = api_key_config.api_key();
1794 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
1795 "Authorization".to_owned(),
1796 Some("Key".to_owned()),
1797 );
1798 let name = auth_definition.name();
1799 let value = match auth_definition.scheme() {
1800 Some(value) => format!("{value} {api_key}"),
1801 None => api_key.to_owned(),
1802 };
1803 request.http_mut().headers_mut().insert(
1804 http::header::HeaderName::from_bytes(name.as_bytes())
1805 .expect("valid header name for api key auth"),
1806 http::header::HeaderValue::from_bytes(value.as_bytes())
1807 .expect("valid header value for api key auth"),
1808 );
1809 }
1810 request.properties_mut().insert(endpoint_result);
1811 if let Some(params) = params {
1812 request.properties_mut().insert(params);
1813 }
1814 request
1815 .properties_mut()
1816 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
1817 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
1818 aws_types::os_shim_internal::Env::real(),
1819 crate::API_METADATA.clone(),
1820 );
1821 if let Some(app_name) = _config.app_name() {
1822 user_agent = user_agent.with_app_name(app_name.clone());
1823 }
1824 request.properties_mut().insert(user_agent);
1825 if let Some(region) = &_config.region {
1826 request.properties_mut().insert(region.clone());
1827 }
1828 let op =
1829 aws_smithy_http::operation::Operation::new(request, crate::operation::GetGuide::new())
1830 .with_metadata(aws_smithy_http::operation::Metadata::new(
1831 "GetGuide", "guides",
1832 ));
1833 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
1834 Ok(op)
1835 }
1836 pub fn builder() -> crate::input::get_guide_input::Builder {
1838 crate::input::get_guide_input::Builder::default()
1839 }
1840}
1841
1842pub mod get_guides_network_input {
1844
1845 #[non_exhaustive]
1847 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
1848 pub struct Builder {
1849 pub(crate) slug: std::option::Option<std::string::String>,
1850 pub(crate) guide_id: std::option::Option<std::string::String>,
1851 }
1852 impl Builder {
1853 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
1855 self.slug = Some(input.into());
1856 self
1857 }
1858 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
1860 self.slug = input;
1861 self
1862 }
1863 #[allow(missing_docs)] pub fn guide_id(mut self, input: impl Into<std::string::String>) -> Self {
1865 self.guide_id = Some(input.into());
1866 self
1867 }
1868 #[allow(missing_docs)] pub fn set_guide_id(mut self, input: std::option::Option<std::string::String>) -> Self {
1870 self.guide_id = input;
1871 self
1872 }
1873 pub fn build(
1875 self,
1876 ) -> Result<
1877 crate::input::GetGuidesNetworkInput,
1878 aws_smithy_http::operation::error::BuildError,
1879 > {
1880 Ok(crate::input::GetGuidesNetworkInput {
1881 slug: self.slug,
1882 guide_id: self.guide_id,
1883 })
1884 }
1885 }
1886}
1887impl GetGuidesNetworkInput {
1888 #[allow(unused_mut)]
1890 #[allow(clippy::let_and_return)]
1891 #[allow(clippy::needless_borrow)]
1892 pub async fn make_operation(
1893 &self,
1894 _config: &crate::config::Config,
1895 ) -> std::result::Result<
1896 aws_smithy_http::operation::Operation<
1897 crate::operation::GetGuidesNetwork,
1898 aws_http::retry::AwsResponseRetryClassifier,
1899 >,
1900 aws_smithy_http::operation::error::BuildError,
1901 > {
1902 let params_result = crate::endpoint::Params::builder()
1903 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
1904 .set_endpoint(_config.endpoint_url.clone())
1905 .set_stage(_config.stage.clone())
1906 .build()
1907 .map_err(|err| {
1908 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
1909 "could not construct endpoint parameters",
1910 err,
1911 )
1912 });
1913 let (endpoint_result, params) = match params_result {
1914 Ok(params) => (
1915 _config.endpoint_resolver.resolve_endpoint(¶ms),
1916 Some(params),
1917 ),
1918 Err(e) => (Err(e), None),
1919 };
1920 let mut request = {
1921 fn uri_base(
1922 _input: &crate::input::GetGuidesNetworkInput,
1923 output: &mut String,
1924 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1925 write!(output, "/guides-network").expect("formatting should succeed");
1926 Ok(())
1927 }
1928 fn uri_query(
1929 _input: &crate::input::GetGuidesNetworkInput,
1930 mut output: &mut String,
1931 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
1932 let mut query = aws_smithy_http::query::Writer::new(&mut output);
1933 if let Some(inner_12) = &_input.slug {
1934 {
1935 query.push_kv("slug", &aws_smithy_http::query::fmt_string(&inner_12));
1936 }
1937 }
1938 if let Some(inner_13) = &_input.guide_id {
1939 {
1940 query.push_kv("guideId", &aws_smithy_http::query::fmt_string(&inner_13));
1941 }
1942 }
1943 Ok(())
1944 }
1945 #[allow(clippy::unnecessary_wraps)]
1946 fn update_http_builder(
1947 input: &crate::input::GetGuidesNetworkInput,
1948 builder: http::request::Builder,
1949 ) -> std::result::Result<
1950 http::request::Builder,
1951 aws_smithy_http::operation::error::BuildError,
1952 > {
1953 let mut uri = String::new();
1954 uri_base(input, &mut uri)?;
1955 uri_query(input, &mut uri)?;
1956 Ok(builder.method("GET").uri(uri))
1957 }
1958 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
1959 builder
1960 };
1961 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
1962 #[allow(clippy::useless_conversion)]
1963 let body = aws_smithy_http::body::SdkBody::from("");
1964 let request = request.body(body).expect("should be valid request");
1965 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
1966 if let Some(api_key_config) = _config.api_key() {
1967 request.properties_mut().insert(api_key_config.clone());
1968 let api_key = api_key_config.api_key();
1969 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
1970 "Authorization".to_owned(),
1971 Some("Key".to_owned()),
1972 );
1973 let name = auth_definition.name();
1974 let value = match auth_definition.scheme() {
1975 Some(value) => format!("{value} {api_key}"),
1976 None => api_key.to_owned(),
1977 };
1978 request.http_mut().headers_mut().insert(
1979 http::header::HeaderName::from_bytes(name.as_bytes())
1980 .expect("valid header name for api key auth"),
1981 http::header::HeaderValue::from_bytes(value.as_bytes())
1982 .expect("valid header value for api key auth"),
1983 );
1984 }
1985 request.properties_mut().insert(endpoint_result);
1986 if let Some(params) = params {
1987 request.properties_mut().insert(params);
1988 }
1989 request
1990 .properties_mut()
1991 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
1992 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
1993 aws_types::os_shim_internal::Env::real(),
1994 crate::API_METADATA.clone(),
1995 );
1996 if let Some(app_name) = _config.app_name() {
1997 user_agent = user_agent.with_app_name(app_name.clone());
1998 }
1999 request.properties_mut().insert(user_agent);
2000 if let Some(region) = &_config.region {
2001 request.properties_mut().insert(region.clone());
2002 }
2003 let op = aws_smithy_http::operation::Operation::new(
2004 request,
2005 crate::operation::GetGuidesNetwork::new(),
2006 )
2007 .with_metadata(aws_smithy_http::operation::Metadata::new(
2008 "GetGuidesNetwork",
2009 "guides",
2010 ));
2011 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
2012 Ok(op)
2013 }
2014 pub fn builder() -> crate::input::get_guides_network_input::Builder {
2016 crate::input::get_guides_network_input::Builder::default()
2017 }
2018}
2019
2020pub mod get_public_account_config_input {
2022
2023 #[non_exhaustive]
2025 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
2026 pub struct Builder {
2027 pub(crate) slug: std::option::Option<std::string::String>,
2028 }
2029 impl Builder {
2030 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
2032 self.slug = Some(input.into());
2033 self
2034 }
2035 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
2037 self.slug = input;
2038 self
2039 }
2040 pub fn build(
2042 self,
2043 ) -> Result<
2044 crate::input::GetPublicAccountConfigInput,
2045 aws_smithy_http::operation::error::BuildError,
2046 > {
2047 Ok(crate::input::GetPublicAccountConfigInput { slug: self.slug })
2048 }
2049 }
2050}
2051impl GetPublicAccountConfigInput {
2052 #[allow(unused_mut)]
2054 #[allow(clippy::let_and_return)]
2055 #[allow(clippy::needless_borrow)]
2056 pub async fn make_operation(
2057 &self,
2058 _config: &crate::config::Config,
2059 ) -> std::result::Result<
2060 aws_smithy_http::operation::Operation<
2061 crate::operation::GetPublicAccountConfig,
2062 aws_http::retry::AwsResponseRetryClassifier,
2063 >,
2064 aws_smithy_http::operation::error::BuildError,
2065 > {
2066 let params_result = crate::endpoint::Params::builder()
2067 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
2068 .set_endpoint(_config.endpoint_url.clone())
2069 .set_stage(_config.stage.clone())
2070 .build()
2071 .map_err(|err| {
2072 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
2073 "could not construct endpoint parameters",
2074 err,
2075 )
2076 });
2077 let (endpoint_result, params) = match params_result {
2078 Ok(params) => (
2079 _config.endpoint_resolver.resolve_endpoint(¶ms),
2080 Some(params),
2081 ),
2082 Err(e) => (Err(e), None),
2083 };
2084 let mut request = {
2085 fn uri_base(
2086 _input: &crate::input::GetPublicAccountConfigInput,
2087 output: &mut String,
2088 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2089 let input_14 = &_input.slug;
2090 let input_14 = input_14.as_ref().ok_or_else(|| {
2091 aws_smithy_http::operation::error::BuildError::missing_field(
2092 "slug",
2093 "cannot be empty or unset",
2094 )
2095 })?;
2096 let slug = aws_smithy_http::label::fmt_string(
2097 input_14,
2098 aws_smithy_http::label::EncodingStrategy::Default,
2099 );
2100 if slug.is_empty() {
2101 return Err(
2102 aws_smithy_http::operation::error::BuildError::missing_field(
2103 "slug",
2104 "cannot be empty or unset",
2105 ),
2106 );
2107 }
2108 write!(output, "/public/{slug}/account-config", slug = slug)
2109 .expect("formatting should succeed");
2110 Ok(())
2111 }
2112 #[allow(clippy::unnecessary_wraps)]
2113 fn update_http_builder(
2114 input: &crate::input::GetPublicAccountConfigInput,
2115 builder: http::request::Builder,
2116 ) -> std::result::Result<
2117 http::request::Builder,
2118 aws_smithy_http::operation::error::BuildError,
2119 > {
2120 let mut uri = String::new();
2121 uri_base(input, &mut uri)?;
2122 Ok(builder.method("GET").uri(uri))
2123 }
2124 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
2125 builder
2126 };
2127 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
2128 #[allow(clippy::useless_conversion)]
2129 let body = aws_smithy_http::body::SdkBody::from("");
2130 let request = request.body(body).expect("should be valid request");
2131 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
2132 if let Some(api_key_config) = _config.api_key() {
2133 request.properties_mut().insert(api_key_config.clone());
2134 let api_key = api_key_config.api_key();
2135 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
2136 "Authorization".to_owned(),
2137 Some("Key".to_owned()),
2138 );
2139 let name = auth_definition.name();
2140 let value = match auth_definition.scheme() {
2141 Some(value) => format!("{value} {api_key}"),
2142 None => api_key.to_owned(),
2143 };
2144 request.http_mut().headers_mut().insert(
2145 http::header::HeaderName::from_bytes(name.as_bytes())
2146 .expect("valid header name for api key auth"),
2147 http::header::HeaderValue::from_bytes(value.as_bytes())
2148 .expect("valid header value for api key auth"),
2149 );
2150 }
2151 request.properties_mut().insert(endpoint_result);
2152 if let Some(params) = params {
2153 request.properties_mut().insert(params);
2154 }
2155 request
2156 .properties_mut()
2157 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
2158 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
2159 aws_types::os_shim_internal::Env::real(),
2160 crate::API_METADATA.clone(),
2161 );
2162 if let Some(app_name) = _config.app_name() {
2163 user_agent = user_agent.with_app_name(app_name.clone());
2164 }
2165 request.properties_mut().insert(user_agent);
2166 if let Some(region) = &_config.region {
2167 request.properties_mut().insert(region.clone());
2168 }
2169 let op = aws_smithy_http::operation::Operation::new(
2170 request,
2171 crate::operation::GetPublicAccountConfig::new(),
2172 )
2173 .with_metadata(aws_smithy_http::operation::Metadata::new(
2174 "GetPublicAccountConfig",
2175 "guides",
2176 ));
2177 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
2178 Ok(op)
2179 }
2180 pub fn builder() -> crate::input::get_public_account_config_input::Builder {
2182 crate::input::get_public_account_config_input::Builder::default()
2183 }
2184}
2185
2186pub mod get_public_guide_input {
2188
2189 #[non_exhaustive]
2191 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
2192 pub struct Builder {
2193 pub(crate) slug: std::option::Option<std::string::String>,
2194 pub(crate) id: std::option::Option<std::string::String>,
2195 pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
2196 }
2197 impl Builder {
2198 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
2200 self.slug = Some(input.into());
2201 self
2202 }
2203 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
2205 self.slug = input;
2206 self
2207 }
2208 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
2210 self.id = Some(input.into());
2211 self
2212 }
2213 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
2215 self.id = input;
2216 self
2217 }
2218 #[allow(missing_docs)] pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
2220 self.output_format = Some(input);
2221 self
2222 }
2223 #[allow(missing_docs)] pub fn set_output_format(
2225 mut self,
2226 input: std::option::Option<crate::model::OutputFormat>,
2227 ) -> Self {
2228 self.output_format = input;
2229 self
2230 }
2231 pub fn build(
2233 self,
2234 ) -> Result<crate::input::GetPublicGuideInput, aws_smithy_http::operation::error::BuildError>
2235 {
2236 Ok(crate::input::GetPublicGuideInput {
2237 slug: self.slug,
2238 id: self.id,
2239 output_format: self.output_format,
2240 })
2241 }
2242 }
2243}
2244impl GetPublicGuideInput {
2245 #[allow(unused_mut)]
2247 #[allow(clippy::let_and_return)]
2248 #[allow(clippy::needless_borrow)]
2249 pub async fn make_operation(
2250 &self,
2251 _config: &crate::config::Config,
2252 ) -> std::result::Result<
2253 aws_smithy_http::operation::Operation<
2254 crate::operation::GetPublicGuide,
2255 aws_http::retry::AwsResponseRetryClassifier,
2256 >,
2257 aws_smithy_http::operation::error::BuildError,
2258 > {
2259 let params_result = crate::endpoint::Params::builder()
2260 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
2261 .set_endpoint(_config.endpoint_url.clone())
2262 .set_stage(_config.stage.clone())
2263 .build()
2264 .map_err(|err| {
2265 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
2266 "could not construct endpoint parameters",
2267 err,
2268 )
2269 });
2270 let (endpoint_result, params) = match params_result {
2271 Ok(params) => (
2272 _config.endpoint_resolver.resolve_endpoint(¶ms),
2273 Some(params),
2274 ),
2275 Err(e) => (Err(e), None),
2276 };
2277 let mut request = {
2278 fn uri_base(
2279 _input: &crate::input::GetPublicGuideInput,
2280 output: &mut String,
2281 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2282 let input_15 = &_input.slug;
2283 let input_15 = input_15.as_ref().ok_or_else(|| {
2284 aws_smithy_http::operation::error::BuildError::missing_field(
2285 "slug",
2286 "cannot be empty or unset",
2287 )
2288 })?;
2289 let slug = aws_smithy_http::label::fmt_string(
2290 input_15,
2291 aws_smithy_http::label::EncodingStrategy::Default,
2292 );
2293 if slug.is_empty() {
2294 return Err(
2295 aws_smithy_http::operation::error::BuildError::missing_field(
2296 "slug",
2297 "cannot be empty or unset",
2298 ),
2299 );
2300 }
2301 let input_16 = &_input.id;
2302 let input_16 = input_16.as_ref().ok_or_else(|| {
2303 aws_smithy_http::operation::error::BuildError::missing_field(
2304 "id",
2305 "cannot be empty or unset",
2306 )
2307 })?;
2308 let id = aws_smithy_http::label::fmt_string(
2309 input_16,
2310 aws_smithy_http::label::EncodingStrategy::Default,
2311 );
2312 if id.is_empty() {
2313 return Err(
2314 aws_smithy_http::operation::error::BuildError::missing_field(
2315 "id",
2316 "cannot be empty or unset",
2317 ),
2318 );
2319 }
2320 write!(output, "/public/{slug}/guides/{id}", slug = slug, id = id)
2321 .expect("formatting should succeed");
2322 Ok(())
2323 }
2324 fn uri_query(
2325 _input: &crate::input::GetPublicGuideInput,
2326 mut output: &mut String,
2327 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2328 let mut query = aws_smithy_http::query::Writer::new(&mut output);
2329 if let Some(inner_17) = &_input.output_format {
2330 {
2331 query.push_kv(
2332 "outputFormat",
2333 &aws_smithy_http::query::fmt_string(&inner_17),
2334 );
2335 }
2336 }
2337 Ok(())
2338 }
2339 #[allow(clippy::unnecessary_wraps)]
2340 fn update_http_builder(
2341 input: &crate::input::GetPublicGuideInput,
2342 builder: http::request::Builder,
2343 ) -> std::result::Result<
2344 http::request::Builder,
2345 aws_smithy_http::operation::error::BuildError,
2346 > {
2347 let mut uri = String::new();
2348 uri_base(input, &mut uri)?;
2349 uri_query(input, &mut uri)?;
2350 Ok(builder.method("GET").uri(uri))
2351 }
2352 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
2353 builder
2354 };
2355 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
2356 #[allow(clippy::useless_conversion)]
2357 let body = aws_smithy_http::body::SdkBody::from("");
2358 let request = request.body(body).expect("should be valid request");
2359 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
2360 if let Some(api_key_config) = _config.api_key() {
2361 request.properties_mut().insert(api_key_config.clone());
2362 let api_key = api_key_config.api_key();
2363 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
2364 "Authorization".to_owned(),
2365 Some("Key".to_owned()),
2366 );
2367 let name = auth_definition.name();
2368 let value = match auth_definition.scheme() {
2369 Some(value) => format!("{value} {api_key}"),
2370 None => api_key.to_owned(),
2371 };
2372 request.http_mut().headers_mut().insert(
2373 http::header::HeaderName::from_bytes(name.as_bytes())
2374 .expect("valid header name for api key auth"),
2375 http::header::HeaderValue::from_bytes(value.as_bytes())
2376 .expect("valid header value for api key auth"),
2377 );
2378 }
2379 request.properties_mut().insert(endpoint_result);
2380 if let Some(params) = params {
2381 request.properties_mut().insert(params);
2382 }
2383 request
2384 .properties_mut()
2385 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
2386 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
2387 aws_types::os_shim_internal::Env::real(),
2388 crate::API_METADATA.clone(),
2389 );
2390 if let Some(app_name) = _config.app_name() {
2391 user_agent = user_agent.with_app_name(app_name.clone());
2392 }
2393 request.properties_mut().insert(user_agent);
2394 if let Some(region) = &_config.region {
2395 request.properties_mut().insert(region.clone());
2396 }
2397 let op = aws_smithy_http::operation::Operation::new(
2398 request,
2399 crate::operation::GetPublicGuide::new(),
2400 )
2401 .with_metadata(aws_smithy_http::operation::Metadata::new(
2402 "GetPublicGuide",
2403 "guides",
2404 ));
2405 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
2406 Ok(op)
2407 }
2408 pub fn builder() -> crate::input::get_public_guide_input::Builder {
2410 crate::input::get_public_guide_input::Builder::default()
2411 }
2412}
2413
2414pub mod get_public_shared_guide_input {
2416
2417 #[non_exhaustive]
2419 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
2420 pub struct Builder {
2421 pub(crate) id: std::option::Option<std::string::String>,
2422 pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
2423 }
2424 impl Builder {
2425 #[allow(missing_docs)] pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
2427 self.id = Some(input.into());
2428 self
2429 }
2430 #[allow(missing_docs)] pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
2432 self.id = input;
2433 self
2434 }
2435 #[allow(missing_docs)] pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
2437 self.output_format = Some(input);
2438 self
2439 }
2440 #[allow(missing_docs)] pub fn set_output_format(
2442 mut self,
2443 input: std::option::Option<crate::model::OutputFormat>,
2444 ) -> Self {
2445 self.output_format = input;
2446 self
2447 }
2448 pub fn build(
2450 self,
2451 ) -> Result<
2452 crate::input::GetPublicSharedGuideInput,
2453 aws_smithy_http::operation::error::BuildError,
2454 > {
2455 Ok(crate::input::GetPublicSharedGuideInput {
2456 id: self.id,
2457 output_format: self.output_format,
2458 })
2459 }
2460 }
2461}
2462impl GetPublicSharedGuideInput {
2463 #[allow(unused_mut)]
2465 #[allow(clippy::let_and_return)]
2466 #[allow(clippy::needless_borrow)]
2467 pub async fn make_operation(
2468 &self,
2469 _config: &crate::config::Config,
2470 ) -> std::result::Result<
2471 aws_smithy_http::operation::Operation<
2472 crate::operation::GetPublicSharedGuide,
2473 aws_http::retry::AwsResponseRetryClassifier,
2474 >,
2475 aws_smithy_http::operation::error::BuildError,
2476 > {
2477 let params_result = crate::endpoint::Params::builder()
2478 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
2479 .set_endpoint(_config.endpoint_url.clone())
2480 .set_stage(_config.stage.clone())
2481 .build()
2482 .map_err(|err| {
2483 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
2484 "could not construct endpoint parameters",
2485 err,
2486 )
2487 });
2488 let (endpoint_result, params) = match params_result {
2489 Ok(params) => (
2490 _config.endpoint_resolver.resolve_endpoint(¶ms),
2491 Some(params),
2492 ),
2493 Err(e) => (Err(e), None),
2494 };
2495 let mut request = {
2496 fn uri_base(
2497 _input: &crate::input::GetPublicSharedGuideInput,
2498 output: &mut String,
2499 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2500 let input_18 = &_input.id;
2501 let input_18 = input_18.as_ref().ok_or_else(|| {
2502 aws_smithy_http::operation::error::BuildError::missing_field(
2503 "id",
2504 "cannot be empty or unset",
2505 )
2506 })?;
2507 let id = aws_smithy_http::label::fmt_string(
2508 input_18,
2509 aws_smithy_http::label::EncodingStrategy::Default,
2510 );
2511 if id.is_empty() {
2512 return Err(
2513 aws_smithy_http::operation::error::BuildError::missing_field(
2514 "id",
2515 "cannot be empty or unset",
2516 ),
2517 );
2518 }
2519 write!(output, "/shared-guides/{id}", id = id).expect("formatting should succeed");
2520 Ok(())
2521 }
2522 fn uri_query(
2523 _input: &crate::input::GetPublicSharedGuideInput,
2524 mut output: &mut String,
2525 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2526 let mut query = aws_smithy_http::query::Writer::new(&mut output);
2527 if let Some(inner_19) = &_input.output_format {
2528 {
2529 query.push_kv(
2530 "outputFormat",
2531 &aws_smithy_http::query::fmt_string(&inner_19),
2532 );
2533 }
2534 }
2535 Ok(())
2536 }
2537 #[allow(clippy::unnecessary_wraps)]
2538 fn update_http_builder(
2539 input: &crate::input::GetPublicSharedGuideInput,
2540 builder: http::request::Builder,
2541 ) -> std::result::Result<
2542 http::request::Builder,
2543 aws_smithy_http::operation::error::BuildError,
2544 > {
2545 let mut uri = String::new();
2546 uri_base(input, &mut uri)?;
2547 uri_query(input, &mut uri)?;
2548 Ok(builder.method("GET").uri(uri))
2549 }
2550 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
2551 builder
2552 };
2553 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
2554 #[allow(clippy::useless_conversion)]
2555 let body = aws_smithy_http::body::SdkBody::from("");
2556 let request = request.body(body).expect("should be valid request");
2557 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
2558 if let Some(api_key_config) = _config.api_key() {
2559 request.properties_mut().insert(api_key_config.clone());
2560 let api_key = api_key_config.api_key();
2561 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
2562 "Authorization".to_owned(),
2563 Some("Key".to_owned()),
2564 );
2565 let name = auth_definition.name();
2566 let value = match auth_definition.scheme() {
2567 Some(value) => format!("{value} {api_key}"),
2568 None => api_key.to_owned(),
2569 };
2570 request.http_mut().headers_mut().insert(
2571 http::header::HeaderName::from_bytes(name.as_bytes())
2572 .expect("valid header name for api key auth"),
2573 http::header::HeaderValue::from_bytes(value.as_bytes())
2574 .expect("valid header value for api key auth"),
2575 );
2576 }
2577 request.properties_mut().insert(endpoint_result);
2578 if let Some(params) = params {
2579 request.properties_mut().insert(params);
2580 }
2581 request
2582 .properties_mut()
2583 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
2584 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
2585 aws_types::os_shim_internal::Env::real(),
2586 crate::API_METADATA.clone(),
2587 );
2588 if let Some(app_name) = _config.app_name() {
2589 user_agent = user_agent.with_app_name(app_name.clone());
2590 }
2591 request.properties_mut().insert(user_agent);
2592 if let Some(region) = &_config.region {
2593 request.properties_mut().insert(region.clone());
2594 }
2595 let op = aws_smithy_http::operation::Operation::new(
2596 request,
2597 crate::operation::GetPublicSharedGuide::new(),
2598 )
2599 .with_metadata(aws_smithy_http::operation::Metadata::new(
2600 "GetPublicSharedGuide",
2601 "guides",
2602 ));
2603 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
2604 Ok(op)
2605 }
2606 pub fn builder() -> crate::input::get_public_shared_guide_input::Builder {
2608 crate::input::get_public_shared_guide_input::Builder::default()
2609 }
2610}
2611
2612pub mod get_x12_transaction_set_metadata_input {
2614
2615 #[non_exhaustive]
2617 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
2618 pub struct Builder {
2619 pub(crate) version: std::option::Option<std::string::String>,
2620 pub(crate) transaction_set_id: std::option::Option<std::string::String>,
2621 }
2622 impl Builder {
2623 #[allow(missing_docs)] pub fn version(mut self, input: impl Into<std::string::String>) -> Self {
2625 self.version = Some(input.into());
2626 self
2627 }
2628 #[allow(missing_docs)] pub fn set_version(mut self, input: std::option::Option<std::string::String>) -> Self {
2630 self.version = input;
2631 self
2632 }
2633 #[allow(missing_docs)] pub fn transaction_set_id(mut self, input: impl Into<std::string::String>) -> Self {
2635 self.transaction_set_id = Some(input.into());
2636 self
2637 }
2638 #[allow(missing_docs)] pub fn set_transaction_set_id(
2640 mut self,
2641 input: std::option::Option<std::string::String>,
2642 ) -> Self {
2643 self.transaction_set_id = input;
2644 self
2645 }
2646 pub fn build(
2648 self,
2649 ) -> Result<
2650 crate::input::GetX12TransactionSetMetadataInput,
2651 aws_smithy_http::operation::error::BuildError,
2652 > {
2653 Ok(crate::input::GetX12TransactionSetMetadataInput {
2654 version: self.version,
2655 transaction_set_id: self.transaction_set_id,
2656 })
2657 }
2658 }
2659}
2660impl GetX12TransactionSetMetadataInput {
2661 #[allow(unused_mut)]
2663 #[allow(clippy::let_and_return)]
2664 #[allow(clippy::needless_borrow)]
2665 pub async fn make_operation(
2666 &self,
2667 _config: &crate::config::Config,
2668 ) -> std::result::Result<
2669 aws_smithy_http::operation::Operation<
2670 crate::operation::GetX12TransactionSetMetadata,
2671 aws_http::retry::AwsResponseRetryClassifier,
2672 >,
2673 aws_smithy_http::operation::error::BuildError,
2674 > {
2675 let params_result = crate::endpoint::Params::builder()
2676 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
2677 .set_endpoint(_config.endpoint_url.clone())
2678 .set_stage(_config.stage.clone())
2679 .build()
2680 .map_err(|err| {
2681 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
2682 "could not construct endpoint parameters",
2683 err,
2684 )
2685 });
2686 let (endpoint_result, params) = match params_result {
2687 Ok(params) => (
2688 _config.endpoint_resolver.resolve_endpoint(¶ms),
2689 Some(params),
2690 ),
2691 Err(e) => (Err(e), None),
2692 };
2693 let mut request = {
2694 fn uri_base(
2695 _input: &crate::input::GetX12TransactionSetMetadataInput,
2696 output: &mut String,
2697 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2698 let input_20 = &_input.version;
2699 let input_20 = input_20.as_ref().ok_or_else(|| {
2700 aws_smithy_http::operation::error::BuildError::missing_field(
2701 "version",
2702 "cannot be empty or unset",
2703 )
2704 })?;
2705 let version = aws_smithy_http::label::fmt_string(
2706 input_20,
2707 aws_smithy_http::label::EncodingStrategy::Default,
2708 );
2709 if version.is_empty() {
2710 return Err(
2711 aws_smithy_http::operation::error::BuildError::missing_field(
2712 "version",
2713 "cannot be empty or unset",
2714 ),
2715 );
2716 }
2717 let input_21 = &_input.transaction_set_id;
2718 let input_21 = input_21.as_ref().ok_or_else(|| {
2719 aws_smithy_http::operation::error::BuildError::missing_field(
2720 "transaction_set_id",
2721 "cannot be empty or unset",
2722 )
2723 })?;
2724 let transaction_set_id = aws_smithy_http::label::fmt_string(
2725 input_21,
2726 aws_smithy_http::label::EncodingStrategy::Default,
2727 );
2728 if transaction_set_id.is_empty() {
2729 return Err(
2730 aws_smithy_http::operation::error::BuildError::missing_field(
2731 "transaction_set_id",
2732 "cannot be empty or unset",
2733 ),
2734 );
2735 }
2736 write!(
2737 output,
2738 "/x12-release/{version}/transaction-sets/{transactionSetId}/metadata",
2739 version = version,
2740 transactionSetId = transaction_set_id
2741 )
2742 .expect("formatting should succeed");
2743 Ok(())
2744 }
2745 #[allow(clippy::unnecessary_wraps)]
2746 fn update_http_builder(
2747 input: &crate::input::GetX12TransactionSetMetadataInput,
2748 builder: http::request::Builder,
2749 ) -> std::result::Result<
2750 http::request::Builder,
2751 aws_smithy_http::operation::error::BuildError,
2752 > {
2753 let mut uri = String::new();
2754 uri_base(input, &mut uri)?;
2755 Ok(builder.method("GET").uri(uri))
2756 }
2757 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
2758 builder
2759 };
2760 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
2761 #[allow(clippy::useless_conversion)]
2762 let body = aws_smithy_http::body::SdkBody::from("");
2763 let request = request.body(body).expect("should be valid request");
2764 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
2765 if let Some(api_key_config) = _config.api_key() {
2766 request.properties_mut().insert(api_key_config.clone());
2767 let api_key = api_key_config.api_key();
2768 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
2769 "Authorization".to_owned(),
2770 Some("Key".to_owned()),
2771 );
2772 let name = auth_definition.name();
2773 let value = match auth_definition.scheme() {
2774 Some(value) => format!("{value} {api_key}"),
2775 None => api_key.to_owned(),
2776 };
2777 request.http_mut().headers_mut().insert(
2778 http::header::HeaderName::from_bytes(name.as_bytes())
2779 .expect("valid header name for api key auth"),
2780 http::header::HeaderValue::from_bytes(value.as_bytes())
2781 .expect("valid header value for api key auth"),
2782 );
2783 }
2784 request.properties_mut().insert(endpoint_result);
2785 if let Some(params) = params {
2786 request.properties_mut().insert(params);
2787 }
2788 request
2789 .properties_mut()
2790 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
2791 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
2792 aws_types::os_shim_internal::Env::real(),
2793 crate::API_METADATA.clone(),
2794 );
2795 if let Some(app_name) = _config.app_name() {
2796 user_agent = user_agent.with_app_name(app_name.clone());
2797 }
2798 request.properties_mut().insert(user_agent);
2799 if let Some(region) = &_config.region {
2800 request.properties_mut().insert(region.clone());
2801 }
2802 let op = aws_smithy_http::operation::Operation::new(
2803 request,
2804 crate::operation::GetX12TransactionSetMetadata::new(),
2805 )
2806 .with_metadata(aws_smithy_http::operation::Metadata::new(
2807 "GetX12TransactionSetMetadata",
2808 "guides",
2809 ));
2810 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
2811 Ok(op)
2812 }
2813 pub fn builder() -> crate::input::get_x12_transaction_set_metadata_input::Builder {
2815 crate::input::get_x12_transaction_set_metadata_input::Builder::default()
2816 }
2817}
2818
2819pub mod list_all_public_guides_input {
2821
2822 #[non_exhaustive]
2824 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
2825 pub struct Builder {
2826 pub(crate) next_page_token: std::option::Option<std::string::String>,
2827 pub(crate) page_size: std::option::Option<i32>,
2828 }
2829 impl Builder {
2830 pub fn next_page_token(mut self, input: impl Into<std::string::String>) -> Self {
2832 self.next_page_token = Some(input.into());
2833 self
2834 }
2835 pub fn set_next_page_token(
2837 mut self,
2838 input: std::option::Option<std::string::String>,
2839 ) -> Self {
2840 self.next_page_token = input;
2841 self
2842 }
2843 pub fn page_size(mut self, input: i32) -> Self {
2845 self.page_size = Some(input);
2846 self
2847 }
2848 pub fn set_page_size(mut self, input: std::option::Option<i32>) -> Self {
2850 self.page_size = input;
2851 self
2852 }
2853 pub fn build(
2855 self,
2856 ) -> Result<
2857 crate::input::ListAllPublicGuidesInput,
2858 aws_smithy_http::operation::error::BuildError,
2859 > {
2860 Ok(crate::input::ListAllPublicGuidesInput {
2861 next_page_token: self.next_page_token,
2862 page_size: self.page_size,
2863 })
2864 }
2865 }
2866}
2867impl ListAllPublicGuidesInput {
2868 #[allow(unused_mut)]
2870 #[allow(clippy::let_and_return)]
2871 #[allow(clippy::needless_borrow)]
2872 pub async fn make_operation(
2873 &self,
2874 _config: &crate::config::Config,
2875 ) -> std::result::Result<
2876 aws_smithy_http::operation::Operation<
2877 crate::operation::ListAllPublicGuides,
2878 aws_http::retry::AwsResponseRetryClassifier,
2879 >,
2880 aws_smithy_http::operation::error::BuildError,
2881 > {
2882 let params_result = crate::endpoint::Params::builder()
2883 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
2884 .set_endpoint(_config.endpoint_url.clone())
2885 .set_stage(_config.stage.clone())
2886 .build()
2887 .map_err(|err| {
2888 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
2889 "could not construct endpoint parameters",
2890 err,
2891 )
2892 });
2893 let (endpoint_result, params) = match params_result {
2894 Ok(params) => (
2895 _config.endpoint_resolver.resolve_endpoint(¶ms),
2896 Some(params),
2897 ),
2898 Err(e) => (Err(e), None),
2899 };
2900 let mut request = {
2901 fn uri_base(
2902 _input: &crate::input::ListAllPublicGuidesInput,
2903 output: &mut String,
2904 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2905 write!(output, "/public-guides").expect("formatting should succeed");
2906 Ok(())
2907 }
2908 fn uri_query(
2909 _input: &crate::input::ListAllPublicGuidesInput,
2910 mut output: &mut String,
2911 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
2912 let mut query = aws_smithy_http::query::Writer::new(&mut output);
2913 if let Some(inner_22) = &_input.next_page_token {
2914 {
2915 query.push_kv(
2916 "nextPageToken",
2917 &aws_smithy_http::query::fmt_string(&inner_22),
2918 );
2919 }
2920 }
2921 if let Some(inner_23) = &_input.page_size {
2922 if *inner_23 != 0 {
2923 query.push_kv(
2924 "pageSize",
2925 aws_smithy_types::primitive::Encoder::from(*inner_23).encode(),
2926 );
2927 }
2928 }
2929 Ok(())
2930 }
2931 #[allow(clippy::unnecessary_wraps)]
2932 fn update_http_builder(
2933 input: &crate::input::ListAllPublicGuidesInput,
2934 builder: http::request::Builder,
2935 ) -> std::result::Result<
2936 http::request::Builder,
2937 aws_smithy_http::operation::error::BuildError,
2938 > {
2939 let mut uri = String::new();
2940 uri_base(input, &mut uri)?;
2941 uri_query(input, &mut uri)?;
2942 Ok(builder.method("GET").uri(uri))
2943 }
2944 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
2945 builder
2946 };
2947 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
2948 #[allow(clippy::useless_conversion)]
2949 let body = aws_smithy_http::body::SdkBody::from("");
2950 let request = request.body(body).expect("should be valid request");
2951 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
2952 if let Some(api_key_config) = _config.api_key() {
2953 request.properties_mut().insert(api_key_config.clone());
2954 let api_key = api_key_config.api_key();
2955 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
2956 "Authorization".to_owned(),
2957 Some("Key".to_owned()),
2958 );
2959 let name = auth_definition.name();
2960 let value = match auth_definition.scheme() {
2961 Some(value) => format!("{value} {api_key}"),
2962 None => api_key.to_owned(),
2963 };
2964 request.http_mut().headers_mut().insert(
2965 http::header::HeaderName::from_bytes(name.as_bytes())
2966 .expect("valid header name for api key auth"),
2967 http::header::HeaderValue::from_bytes(value.as_bytes())
2968 .expect("valid header value for api key auth"),
2969 );
2970 }
2971 request.properties_mut().insert(endpoint_result);
2972 if let Some(params) = params {
2973 request.properties_mut().insert(params);
2974 }
2975 request
2976 .properties_mut()
2977 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
2978 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
2979 aws_types::os_shim_internal::Env::real(),
2980 crate::API_METADATA.clone(),
2981 );
2982 if let Some(app_name) = _config.app_name() {
2983 user_agent = user_agent.with_app_name(app_name.clone());
2984 }
2985 request.properties_mut().insert(user_agent);
2986 if let Some(region) = &_config.region {
2987 request.properties_mut().insert(region.clone());
2988 }
2989 let op = aws_smithy_http::operation::Operation::new(
2990 request,
2991 crate::operation::ListAllPublicGuides::new(),
2992 )
2993 .with_metadata(aws_smithy_http::operation::Metadata::new(
2994 "ListAllPublicGuides",
2995 "guides",
2996 ));
2997 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
2998 Ok(op)
2999 }
3000 pub fn builder() -> crate::input::list_all_public_guides_input::Builder {
3002 crate::input::list_all_public_guides_input::Builder::default()
3003 }
3004}
3005
3006pub mod list_guide_attachments_input {
3008
3009 #[non_exhaustive]
3011 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
3012 pub struct Builder {
3013 pub(crate) id: std::option::Option<std::string::String>,
3014 }
3015 impl Builder {
3016 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
3018 self.id = Some(input.into());
3019 self
3020 }
3021 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
3023 self.id = input;
3024 self
3025 }
3026 pub fn build(
3028 self,
3029 ) -> Result<
3030 crate::input::ListGuideAttachmentsInput,
3031 aws_smithy_http::operation::error::BuildError,
3032 > {
3033 Ok(crate::input::ListGuideAttachmentsInput { id: self.id })
3034 }
3035 }
3036}
3037impl ListGuideAttachmentsInput {
3038 #[allow(unused_mut)]
3040 #[allow(clippy::let_and_return)]
3041 #[allow(clippy::needless_borrow)]
3042 pub async fn make_operation(
3043 &self,
3044 _config: &crate::config::Config,
3045 ) -> std::result::Result<
3046 aws_smithy_http::operation::Operation<
3047 crate::operation::ListGuideAttachments,
3048 aws_http::retry::AwsResponseRetryClassifier,
3049 >,
3050 aws_smithy_http::operation::error::BuildError,
3051 > {
3052 let params_result = crate::endpoint::Params::builder()
3053 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
3054 .set_endpoint(_config.endpoint_url.clone())
3055 .set_stage(_config.stage.clone())
3056 .build()
3057 .map_err(|err| {
3058 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
3059 "could not construct endpoint parameters",
3060 err,
3061 )
3062 });
3063 let (endpoint_result, params) = match params_result {
3064 Ok(params) => (
3065 _config.endpoint_resolver.resolve_endpoint(¶ms),
3066 Some(params),
3067 ),
3068 Err(e) => (Err(e), None),
3069 };
3070 let mut request = {
3071 fn uri_base(
3072 _input: &crate::input::ListGuideAttachmentsInput,
3073 output: &mut String,
3074 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3075 let input_24 = &_input.id;
3076 let input_24 = input_24.as_ref().ok_or_else(|| {
3077 aws_smithy_http::operation::error::BuildError::missing_field(
3078 "id",
3079 "cannot be empty or unset",
3080 )
3081 })?;
3082 let id = aws_smithy_http::label::fmt_string(
3083 input_24,
3084 aws_smithy_http::label::EncodingStrategy::Default,
3085 );
3086 if id.is_empty() {
3087 return Err(
3088 aws_smithy_http::operation::error::BuildError::missing_field(
3089 "id",
3090 "cannot be empty or unset",
3091 ),
3092 );
3093 }
3094 write!(output, "/guides/{id}/attachments", id = id)
3095 .expect("formatting should succeed");
3096 Ok(())
3097 }
3098 #[allow(clippy::unnecessary_wraps)]
3099 fn update_http_builder(
3100 input: &crate::input::ListGuideAttachmentsInput,
3101 builder: http::request::Builder,
3102 ) -> std::result::Result<
3103 http::request::Builder,
3104 aws_smithy_http::operation::error::BuildError,
3105 > {
3106 let mut uri = String::new();
3107 uri_base(input, &mut uri)?;
3108 Ok(builder.method("GET").uri(uri))
3109 }
3110 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
3111 builder
3112 };
3113 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
3114 #[allow(clippy::useless_conversion)]
3115 let body = aws_smithy_http::body::SdkBody::from("");
3116 let request = request.body(body).expect("should be valid request");
3117 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
3118 if let Some(api_key_config) = _config.api_key() {
3119 request.properties_mut().insert(api_key_config.clone());
3120 let api_key = api_key_config.api_key();
3121 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
3122 "Authorization".to_owned(),
3123 Some("Key".to_owned()),
3124 );
3125 let name = auth_definition.name();
3126 let value = match auth_definition.scheme() {
3127 Some(value) => format!("{value} {api_key}"),
3128 None => api_key.to_owned(),
3129 };
3130 request.http_mut().headers_mut().insert(
3131 http::header::HeaderName::from_bytes(name.as_bytes())
3132 .expect("valid header name for api key auth"),
3133 http::header::HeaderValue::from_bytes(value.as_bytes())
3134 .expect("valid header value for api key auth"),
3135 );
3136 }
3137 request.properties_mut().insert(endpoint_result);
3138 if let Some(params) = params {
3139 request.properties_mut().insert(params);
3140 }
3141 request
3142 .properties_mut()
3143 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
3144 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
3145 aws_types::os_shim_internal::Env::real(),
3146 crate::API_METADATA.clone(),
3147 );
3148 if let Some(app_name) = _config.app_name() {
3149 user_agent = user_agent.with_app_name(app_name.clone());
3150 }
3151 request.properties_mut().insert(user_agent);
3152 if let Some(region) = &_config.region {
3153 request.properties_mut().insert(region.clone());
3154 }
3155 let op = aws_smithy_http::operation::Operation::new(
3156 request,
3157 crate::operation::ListGuideAttachments::new(),
3158 )
3159 .with_metadata(aws_smithy_http::operation::Metadata::new(
3160 "ListGuideAttachments",
3161 "guides",
3162 ));
3163 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
3164 Ok(op)
3165 }
3166 pub fn builder() -> crate::input::list_guide_attachments_input::Builder {
3168 crate::input::list_guide_attachments_input::Builder::default()
3169 }
3170}
3171
3172pub mod list_guides_input {
3174
3175 #[non_exhaustive]
3177 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
3178 pub struct Builder {
3179 pub(crate) status: std::option::Option<crate::model::GuideStatus>,
3180 pub(crate) next_page_token: std::option::Option<std::string::String>,
3181 pub(crate) page_size: std::option::Option<i32>,
3182 }
3183 impl Builder {
3184 #[allow(missing_docs)] pub fn status(mut self, input: crate::model::GuideStatus) -> Self {
3186 self.status = Some(input);
3187 self
3188 }
3189 #[allow(missing_docs)] pub fn set_status(mut self, input: std::option::Option<crate::model::GuideStatus>) -> Self {
3191 self.status = input;
3192 self
3193 }
3194 pub fn next_page_token(mut self, input: impl Into<std::string::String>) -> Self {
3196 self.next_page_token = Some(input.into());
3197 self
3198 }
3199 pub fn set_next_page_token(
3201 mut self,
3202 input: std::option::Option<std::string::String>,
3203 ) -> Self {
3204 self.next_page_token = input;
3205 self
3206 }
3207 pub fn page_size(mut self, input: i32) -> Self {
3209 self.page_size = Some(input);
3210 self
3211 }
3212 pub fn set_page_size(mut self, input: std::option::Option<i32>) -> Self {
3214 self.page_size = input;
3215 self
3216 }
3217 pub fn build(
3219 self,
3220 ) -> Result<crate::input::ListGuidesInput, aws_smithy_http::operation::error::BuildError>
3221 {
3222 Ok(crate::input::ListGuidesInput {
3223 status: self.status,
3224 next_page_token: self.next_page_token,
3225 page_size: self.page_size,
3226 })
3227 }
3228 }
3229}
3230impl ListGuidesInput {
3231 #[allow(unused_mut)]
3233 #[allow(clippy::let_and_return)]
3234 #[allow(clippy::needless_borrow)]
3235 pub async fn make_operation(
3236 &self,
3237 _config: &crate::config::Config,
3238 ) -> std::result::Result<
3239 aws_smithy_http::operation::Operation<
3240 crate::operation::ListGuides,
3241 aws_http::retry::AwsResponseRetryClassifier,
3242 >,
3243 aws_smithy_http::operation::error::BuildError,
3244 > {
3245 let params_result = crate::endpoint::Params::builder()
3246 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
3247 .set_endpoint(_config.endpoint_url.clone())
3248 .set_stage(_config.stage.clone())
3249 .build()
3250 .map_err(|err| {
3251 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
3252 "could not construct endpoint parameters",
3253 err,
3254 )
3255 });
3256 let (endpoint_result, params) = match params_result {
3257 Ok(params) => (
3258 _config.endpoint_resolver.resolve_endpoint(¶ms),
3259 Some(params),
3260 ),
3261 Err(e) => (Err(e), None),
3262 };
3263 let mut request = {
3264 fn uri_base(
3265 _input: &crate::input::ListGuidesInput,
3266 output: &mut String,
3267 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3268 write!(output, "/guides").expect("formatting should succeed");
3269 Ok(())
3270 }
3271 fn uri_query(
3272 _input: &crate::input::ListGuidesInput,
3273 mut output: &mut String,
3274 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3275 let mut query = aws_smithy_http::query::Writer::new(&mut output);
3276 if let Some(inner_25) = &_input.status {
3277 {
3278 query.push_kv("status", &aws_smithy_http::query::fmt_string(&inner_25));
3279 }
3280 }
3281 if let Some(inner_26) = &_input.next_page_token {
3282 {
3283 query.push_kv(
3284 "nextPageToken",
3285 &aws_smithy_http::query::fmt_string(&inner_26),
3286 );
3287 }
3288 }
3289 if let Some(inner_27) = &_input.page_size {
3290 if *inner_27 != 0 {
3291 query.push_kv(
3292 "pageSize",
3293 aws_smithy_types::primitive::Encoder::from(*inner_27).encode(),
3294 );
3295 }
3296 }
3297 Ok(())
3298 }
3299 #[allow(clippy::unnecessary_wraps)]
3300 fn update_http_builder(
3301 input: &crate::input::ListGuidesInput,
3302 builder: http::request::Builder,
3303 ) -> std::result::Result<
3304 http::request::Builder,
3305 aws_smithy_http::operation::error::BuildError,
3306 > {
3307 let mut uri = String::new();
3308 uri_base(input, &mut uri)?;
3309 uri_query(input, &mut uri)?;
3310 Ok(builder.method("GET").uri(uri))
3311 }
3312 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
3313 builder
3314 };
3315 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
3316 #[allow(clippy::useless_conversion)]
3317 let body = aws_smithy_http::body::SdkBody::from("");
3318 let request = request.body(body).expect("should be valid request");
3319 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
3320 if let Some(api_key_config) = _config.api_key() {
3321 request.properties_mut().insert(api_key_config.clone());
3322 let api_key = api_key_config.api_key();
3323 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
3324 "Authorization".to_owned(),
3325 Some("Key".to_owned()),
3326 );
3327 let name = auth_definition.name();
3328 let value = match auth_definition.scheme() {
3329 Some(value) => format!("{value} {api_key}"),
3330 None => api_key.to_owned(),
3331 };
3332 request.http_mut().headers_mut().insert(
3333 http::header::HeaderName::from_bytes(name.as_bytes())
3334 .expect("valid header name for api key auth"),
3335 http::header::HeaderValue::from_bytes(value.as_bytes())
3336 .expect("valid header value for api key auth"),
3337 );
3338 }
3339 request.properties_mut().insert(endpoint_result);
3340 if let Some(params) = params {
3341 request.properties_mut().insert(params);
3342 }
3343 request
3344 .properties_mut()
3345 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
3346 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
3347 aws_types::os_shim_internal::Env::real(),
3348 crate::API_METADATA.clone(),
3349 );
3350 if let Some(app_name) = _config.app_name() {
3351 user_agent = user_agent.with_app_name(app_name.clone());
3352 }
3353 request.properties_mut().insert(user_agent);
3354 if let Some(region) = &_config.region {
3355 request.properties_mut().insert(region.clone());
3356 }
3357 let op = aws_smithy_http::operation::Operation::new(
3358 request,
3359 crate::operation::ListGuides::new(),
3360 )
3361 .with_metadata(aws_smithy_http::operation::Metadata::new(
3362 "ListGuides",
3363 "guides",
3364 ));
3365 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
3366 Ok(op)
3367 }
3368 pub fn builder() -> crate::input::list_guides_input::Builder {
3370 crate::input::list_guides_input::Builder::default()
3371 }
3372}
3373
3374pub mod list_guide_samples_input {
3376
3377 #[non_exhaustive]
3379 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
3380 pub struct Builder {
3381 pub(crate) id: std::option::Option<std::string::String>,
3382 }
3383 impl Builder {
3384 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
3386 self.id = Some(input.into());
3387 self
3388 }
3389 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
3391 self.id = input;
3392 self
3393 }
3394 pub fn build(
3396 self,
3397 ) -> Result<
3398 crate::input::ListGuideSamplesInput,
3399 aws_smithy_http::operation::error::BuildError,
3400 > {
3401 Ok(crate::input::ListGuideSamplesInput { id: self.id })
3402 }
3403 }
3404}
3405impl ListGuideSamplesInput {
3406 #[allow(unused_mut)]
3408 #[allow(clippy::let_and_return)]
3409 #[allow(clippy::needless_borrow)]
3410 pub async fn make_operation(
3411 &self,
3412 _config: &crate::config::Config,
3413 ) -> std::result::Result<
3414 aws_smithy_http::operation::Operation<
3415 crate::operation::ListGuideSamples,
3416 aws_http::retry::AwsResponseRetryClassifier,
3417 >,
3418 aws_smithy_http::operation::error::BuildError,
3419 > {
3420 let params_result = crate::endpoint::Params::builder()
3421 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
3422 .set_endpoint(_config.endpoint_url.clone())
3423 .set_stage(_config.stage.clone())
3424 .build()
3425 .map_err(|err| {
3426 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
3427 "could not construct endpoint parameters",
3428 err,
3429 )
3430 });
3431 let (endpoint_result, params) = match params_result {
3432 Ok(params) => (
3433 _config.endpoint_resolver.resolve_endpoint(¶ms),
3434 Some(params),
3435 ),
3436 Err(e) => (Err(e), None),
3437 };
3438 let mut request = {
3439 fn uri_base(
3440 _input: &crate::input::ListGuideSamplesInput,
3441 output: &mut String,
3442 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3443 let input_28 = &_input.id;
3444 let input_28 = input_28.as_ref().ok_or_else(|| {
3445 aws_smithy_http::operation::error::BuildError::missing_field(
3446 "id",
3447 "cannot be empty or unset",
3448 )
3449 })?;
3450 let id = aws_smithy_http::label::fmt_string(
3451 input_28,
3452 aws_smithy_http::label::EncodingStrategy::Default,
3453 );
3454 if id.is_empty() {
3455 return Err(
3456 aws_smithy_http::operation::error::BuildError::missing_field(
3457 "id",
3458 "cannot be empty or unset",
3459 ),
3460 );
3461 }
3462 write!(output, "/guides/{id}/samples", id = id).expect("formatting should succeed");
3463 Ok(())
3464 }
3465 #[allow(clippy::unnecessary_wraps)]
3466 fn update_http_builder(
3467 input: &crate::input::ListGuideSamplesInput,
3468 builder: http::request::Builder,
3469 ) -> std::result::Result<
3470 http::request::Builder,
3471 aws_smithy_http::operation::error::BuildError,
3472 > {
3473 let mut uri = String::new();
3474 uri_base(input, &mut uri)?;
3475 Ok(builder.method("GET").uri(uri))
3476 }
3477 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
3478 builder
3479 };
3480 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
3481 #[allow(clippy::useless_conversion)]
3482 let body = aws_smithy_http::body::SdkBody::from("");
3483 let request = request.body(body).expect("should be valid request");
3484 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
3485 if let Some(api_key_config) = _config.api_key() {
3486 request.properties_mut().insert(api_key_config.clone());
3487 let api_key = api_key_config.api_key();
3488 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
3489 "Authorization".to_owned(),
3490 Some("Key".to_owned()),
3491 );
3492 let name = auth_definition.name();
3493 let value = match auth_definition.scheme() {
3494 Some(value) => format!("{value} {api_key}"),
3495 None => api_key.to_owned(),
3496 };
3497 request.http_mut().headers_mut().insert(
3498 http::header::HeaderName::from_bytes(name.as_bytes())
3499 .expect("valid header name for api key auth"),
3500 http::header::HeaderValue::from_bytes(value.as_bytes())
3501 .expect("valid header value for api key auth"),
3502 );
3503 }
3504 request.properties_mut().insert(endpoint_result);
3505 if let Some(params) = params {
3506 request.properties_mut().insert(params);
3507 }
3508 request
3509 .properties_mut()
3510 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
3511 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
3512 aws_types::os_shim_internal::Env::real(),
3513 crate::API_METADATA.clone(),
3514 );
3515 if let Some(app_name) = _config.app_name() {
3516 user_agent = user_agent.with_app_name(app_name.clone());
3517 }
3518 request.properties_mut().insert(user_agent);
3519 if let Some(region) = &_config.region {
3520 request.properties_mut().insert(region.clone());
3521 }
3522 let op = aws_smithy_http::operation::Operation::new(
3523 request,
3524 crate::operation::ListGuideSamples::new(),
3525 )
3526 .with_metadata(aws_smithy_http::operation::Metadata::new(
3527 "ListGuideSamples",
3528 "guides",
3529 ));
3530 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
3531 Ok(op)
3532 }
3533 pub fn builder() -> crate::input::list_guide_samples_input::Builder {
3535 crate::input::list_guide_samples_input::Builder::default()
3536 }
3537}
3538
3539pub mod list_public_guide_attachments_input {
3541
3542 #[non_exhaustive]
3544 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
3545 pub struct Builder {
3546 pub(crate) slug: std::option::Option<std::string::String>,
3547 pub(crate) id: std::option::Option<std::string::String>,
3548 }
3549 impl Builder {
3550 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
3552 self.slug = Some(input.into());
3553 self
3554 }
3555 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
3557 self.slug = input;
3558 self
3559 }
3560 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
3562 self.id = Some(input.into());
3563 self
3564 }
3565 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
3567 self.id = input;
3568 self
3569 }
3570 pub fn build(
3572 self,
3573 ) -> Result<
3574 crate::input::ListPublicGuideAttachmentsInput,
3575 aws_smithy_http::operation::error::BuildError,
3576 > {
3577 Ok(crate::input::ListPublicGuideAttachmentsInput {
3578 slug: self.slug,
3579 id: self.id,
3580 })
3581 }
3582 }
3583}
3584impl ListPublicGuideAttachmentsInput {
3585 #[allow(unused_mut)]
3587 #[allow(clippy::let_and_return)]
3588 #[allow(clippy::needless_borrow)]
3589 pub async fn make_operation(
3590 &self,
3591 _config: &crate::config::Config,
3592 ) -> std::result::Result<
3593 aws_smithy_http::operation::Operation<
3594 crate::operation::ListPublicGuideAttachments,
3595 aws_http::retry::AwsResponseRetryClassifier,
3596 >,
3597 aws_smithy_http::operation::error::BuildError,
3598 > {
3599 let params_result = crate::endpoint::Params::builder()
3600 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
3601 .set_endpoint(_config.endpoint_url.clone())
3602 .set_stage(_config.stage.clone())
3603 .build()
3604 .map_err(|err| {
3605 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
3606 "could not construct endpoint parameters",
3607 err,
3608 )
3609 });
3610 let (endpoint_result, params) = match params_result {
3611 Ok(params) => (
3612 _config.endpoint_resolver.resolve_endpoint(¶ms),
3613 Some(params),
3614 ),
3615 Err(e) => (Err(e), None),
3616 };
3617 let mut request = {
3618 fn uri_base(
3619 _input: &crate::input::ListPublicGuideAttachmentsInput,
3620 output: &mut String,
3621 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3622 let input_29 = &_input.slug;
3623 let input_29 = input_29.as_ref().ok_or_else(|| {
3624 aws_smithy_http::operation::error::BuildError::missing_field(
3625 "slug",
3626 "cannot be empty or unset",
3627 )
3628 })?;
3629 let slug = aws_smithy_http::label::fmt_string(
3630 input_29,
3631 aws_smithy_http::label::EncodingStrategy::Default,
3632 );
3633 if slug.is_empty() {
3634 return Err(
3635 aws_smithy_http::operation::error::BuildError::missing_field(
3636 "slug",
3637 "cannot be empty or unset",
3638 ),
3639 );
3640 }
3641 let input_30 = &_input.id;
3642 let input_30 = input_30.as_ref().ok_or_else(|| {
3643 aws_smithy_http::operation::error::BuildError::missing_field(
3644 "id",
3645 "cannot be empty or unset",
3646 )
3647 })?;
3648 let id = aws_smithy_http::label::fmt_string(
3649 input_30,
3650 aws_smithy_http::label::EncodingStrategy::Default,
3651 );
3652 if id.is_empty() {
3653 return Err(
3654 aws_smithy_http::operation::error::BuildError::missing_field(
3655 "id",
3656 "cannot be empty or unset",
3657 ),
3658 );
3659 }
3660 write!(
3661 output,
3662 "/public/{slug}/guides/{id}/attachments",
3663 slug = slug,
3664 id = id
3665 )
3666 .expect("formatting should succeed");
3667 Ok(())
3668 }
3669 #[allow(clippy::unnecessary_wraps)]
3670 fn update_http_builder(
3671 input: &crate::input::ListPublicGuideAttachmentsInput,
3672 builder: http::request::Builder,
3673 ) -> std::result::Result<
3674 http::request::Builder,
3675 aws_smithy_http::operation::error::BuildError,
3676 > {
3677 let mut uri = String::new();
3678 uri_base(input, &mut uri)?;
3679 Ok(builder.method("GET").uri(uri))
3680 }
3681 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
3682 builder
3683 };
3684 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
3685 #[allow(clippy::useless_conversion)]
3686 let body = aws_smithy_http::body::SdkBody::from("");
3687 let request = request.body(body).expect("should be valid request");
3688 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
3689 if let Some(api_key_config) = _config.api_key() {
3690 request.properties_mut().insert(api_key_config.clone());
3691 let api_key = api_key_config.api_key();
3692 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
3693 "Authorization".to_owned(),
3694 Some("Key".to_owned()),
3695 );
3696 let name = auth_definition.name();
3697 let value = match auth_definition.scheme() {
3698 Some(value) => format!("{value} {api_key}"),
3699 None => api_key.to_owned(),
3700 };
3701 request.http_mut().headers_mut().insert(
3702 http::header::HeaderName::from_bytes(name.as_bytes())
3703 .expect("valid header name for api key auth"),
3704 http::header::HeaderValue::from_bytes(value.as_bytes())
3705 .expect("valid header value for api key auth"),
3706 );
3707 }
3708 request.properties_mut().insert(endpoint_result);
3709 if let Some(params) = params {
3710 request.properties_mut().insert(params);
3711 }
3712 request
3713 .properties_mut()
3714 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
3715 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
3716 aws_types::os_shim_internal::Env::real(),
3717 crate::API_METADATA.clone(),
3718 );
3719 if let Some(app_name) = _config.app_name() {
3720 user_agent = user_agent.with_app_name(app_name.clone());
3721 }
3722 request.properties_mut().insert(user_agent);
3723 if let Some(region) = &_config.region {
3724 request.properties_mut().insert(region.clone());
3725 }
3726 let op = aws_smithy_http::operation::Operation::new(
3727 request,
3728 crate::operation::ListPublicGuideAttachments::new(),
3729 )
3730 .with_metadata(aws_smithy_http::operation::Metadata::new(
3731 "ListPublicGuideAttachments",
3732 "guides",
3733 ));
3734 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
3735 Ok(op)
3736 }
3737 pub fn builder() -> crate::input::list_public_guide_attachments_input::Builder {
3739 crate::input::list_public_guide_attachments_input::Builder::default()
3740 }
3741}
3742
3743pub mod list_public_guides_input {
3745
3746 #[non_exhaustive]
3748 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
3749 pub struct Builder {
3750 pub(crate) slug: std::option::Option<std::string::String>,
3751 pub(crate) next_page_token: std::option::Option<std::string::String>,
3752 pub(crate) page_size: std::option::Option<i32>,
3753 }
3754 impl Builder {
3755 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
3757 self.slug = Some(input.into());
3758 self
3759 }
3760 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
3762 self.slug = input;
3763 self
3764 }
3765 pub fn next_page_token(mut self, input: impl Into<std::string::String>) -> Self {
3767 self.next_page_token = Some(input.into());
3768 self
3769 }
3770 pub fn set_next_page_token(
3772 mut self,
3773 input: std::option::Option<std::string::String>,
3774 ) -> Self {
3775 self.next_page_token = input;
3776 self
3777 }
3778 pub fn page_size(mut self, input: i32) -> Self {
3780 self.page_size = Some(input);
3781 self
3782 }
3783 pub fn set_page_size(mut self, input: std::option::Option<i32>) -> Self {
3785 self.page_size = input;
3786 self
3787 }
3788 pub fn build(
3790 self,
3791 ) -> Result<
3792 crate::input::ListPublicGuidesInput,
3793 aws_smithy_http::operation::error::BuildError,
3794 > {
3795 Ok(crate::input::ListPublicGuidesInput {
3796 slug: self.slug,
3797 next_page_token: self.next_page_token,
3798 page_size: self.page_size,
3799 })
3800 }
3801 }
3802}
3803impl ListPublicGuidesInput {
3804 #[allow(unused_mut)]
3806 #[allow(clippy::let_and_return)]
3807 #[allow(clippy::needless_borrow)]
3808 pub async fn make_operation(
3809 &self,
3810 _config: &crate::config::Config,
3811 ) -> std::result::Result<
3812 aws_smithy_http::operation::Operation<
3813 crate::operation::ListPublicGuides,
3814 aws_http::retry::AwsResponseRetryClassifier,
3815 >,
3816 aws_smithy_http::operation::error::BuildError,
3817 > {
3818 let params_result = crate::endpoint::Params::builder()
3819 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
3820 .set_endpoint(_config.endpoint_url.clone())
3821 .set_stage(_config.stage.clone())
3822 .build()
3823 .map_err(|err| {
3824 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
3825 "could not construct endpoint parameters",
3826 err,
3827 )
3828 });
3829 let (endpoint_result, params) = match params_result {
3830 Ok(params) => (
3831 _config.endpoint_resolver.resolve_endpoint(¶ms),
3832 Some(params),
3833 ),
3834 Err(e) => (Err(e), None),
3835 };
3836 let mut request = {
3837 fn uri_base(
3838 _input: &crate::input::ListPublicGuidesInput,
3839 output: &mut String,
3840 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3841 let input_31 = &_input.slug;
3842 let input_31 = input_31.as_ref().ok_or_else(|| {
3843 aws_smithy_http::operation::error::BuildError::missing_field(
3844 "slug",
3845 "cannot be empty or unset",
3846 )
3847 })?;
3848 let slug = aws_smithy_http::label::fmt_string(
3849 input_31,
3850 aws_smithy_http::label::EncodingStrategy::Default,
3851 );
3852 if slug.is_empty() {
3853 return Err(
3854 aws_smithy_http::operation::error::BuildError::missing_field(
3855 "slug",
3856 "cannot be empty or unset",
3857 ),
3858 );
3859 }
3860 write!(output, "/public/{slug}/guides", slug = slug)
3861 .expect("formatting should succeed");
3862 Ok(())
3863 }
3864 fn uri_query(
3865 _input: &crate::input::ListPublicGuidesInput,
3866 mut output: &mut String,
3867 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
3868 let mut query = aws_smithy_http::query::Writer::new(&mut output);
3869 if let Some(inner_32) = &_input.next_page_token {
3870 {
3871 query.push_kv(
3872 "nextPageToken",
3873 &aws_smithy_http::query::fmt_string(&inner_32),
3874 );
3875 }
3876 }
3877 if let Some(inner_33) = &_input.page_size {
3878 if *inner_33 != 0 {
3879 query.push_kv(
3880 "pageSize",
3881 aws_smithy_types::primitive::Encoder::from(*inner_33).encode(),
3882 );
3883 }
3884 }
3885 Ok(())
3886 }
3887 #[allow(clippy::unnecessary_wraps)]
3888 fn update_http_builder(
3889 input: &crate::input::ListPublicGuidesInput,
3890 builder: http::request::Builder,
3891 ) -> std::result::Result<
3892 http::request::Builder,
3893 aws_smithy_http::operation::error::BuildError,
3894 > {
3895 let mut uri = String::new();
3896 uri_base(input, &mut uri)?;
3897 uri_query(input, &mut uri)?;
3898 Ok(builder.method("GET").uri(uri))
3899 }
3900 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
3901 builder
3902 };
3903 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
3904 #[allow(clippy::useless_conversion)]
3905 let body = aws_smithy_http::body::SdkBody::from("");
3906 let request = request.body(body).expect("should be valid request");
3907 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
3908 if let Some(api_key_config) = _config.api_key() {
3909 request.properties_mut().insert(api_key_config.clone());
3910 let api_key = api_key_config.api_key();
3911 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
3912 "Authorization".to_owned(),
3913 Some("Key".to_owned()),
3914 );
3915 let name = auth_definition.name();
3916 let value = match auth_definition.scheme() {
3917 Some(value) => format!("{value} {api_key}"),
3918 None => api_key.to_owned(),
3919 };
3920 request.http_mut().headers_mut().insert(
3921 http::header::HeaderName::from_bytes(name.as_bytes())
3922 .expect("valid header name for api key auth"),
3923 http::header::HeaderValue::from_bytes(value.as_bytes())
3924 .expect("valid header value for api key auth"),
3925 );
3926 }
3927 request.properties_mut().insert(endpoint_result);
3928 if let Some(params) = params {
3929 request.properties_mut().insert(params);
3930 }
3931 request
3932 .properties_mut()
3933 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
3934 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
3935 aws_types::os_shim_internal::Env::real(),
3936 crate::API_METADATA.clone(),
3937 );
3938 if let Some(app_name) = _config.app_name() {
3939 user_agent = user_agent.with_app_name(app_name.clone());
3940 }
3941 request.properties_mut().insert(user_agent);
3942 if let Some(region) = &_config.region {
3943 request.properties_mut().insert(region.clone());
3944 }
3945 let op = aws_smithy_http::operation::Operation::new(
3946 request,
3947 crate::operation::ListPublicGuides::new(),
3948 )
3949 .with_metadata(aws_smithy_http::operation::Metadata::new(
3950 "ListPublicGuides",
3951 "guides",
3952 ));
3953 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
3954 Ok(op)
3955 }
3956 pub fn builder() -> crate::input::list_public_guides_input::Builder {
3958 crate::input::list_public_guides_input::Builder::default()
3959 }
3960}
3961
3962pub mod list_public_guide_samples_input {
3964
3965 #[non_exhaustive]
3967 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
3968 pub struct Builder {
3969 pub(crate) slug: std::option::Option<std::string::String>,
3970 pub(crate) id: std::option::Option<std::string::String>,
3971 }
3972 impl Builder {
3973 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
3975 self.slug = Some(input.into());
3976 self
3977 }
3978 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
3980 self.slug = input;
3981 self
3982 }
3983 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
3985 self.id = Some(input.into());
3986 self
3987 }
3988 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
3990 self.id = input;
3991 self
3992 }
3993 pub fn build(
3995 self,
3996 ) -> Result<
3997 crate::input::ListPublicGuideSamplesInput,
3998 aws_smithy_http::operation::error::BuildError,
3999 > {
4000 Ok(crate::input::ListPublicGuideSamplesInput {
4001 slug: self.slug,
4002 id: self.id,
4003 })
4004 }
4005 }
4006}
4007impl ListPublicGuideSamplesInput {
4008 #[allow(unused_mut)]
4010 #[allow(clippy::let_and_return)]
4011 #[allow(clippy::needless_borrow)]
4012 pub async fn make_operation(
4013 &self,
4014 _config: &crate::config::Config,
4015 ) -> std::result::Result<
4016 aws_smithy_http::operation::Operation<
4017 crate::operation::ListPublicGuideSamples,
4018 aws_http::retry::AwsResponseRetryClassifier,
4019 >,
4020 aws_smithy_http::operation::error::BuildError,
4021 > {
4022 let params_result = crate::endpoint::Params::builder()
4023 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
4024 .set_endpoint(_config.endpoint_url.clone())
4025 .set_stage(_config.stage.clone())
4026 .build()
4027 .map_err(|err| {
4028 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
4029 "could not construct endpoint parameters",
4030 err,
4031 )
4032 });
4033 let (endpoint_result, params) = match params_result {
4034 Ok(params) => (
4035 _config.endpoint_resolver.resolve_endpoint(¶ms),
4036 Some(params),
4037 ),
4038 Err(e) => (Err(e), None),
4039 };
4040 let mut request = {
4041 fn uri_base(
4042 _input: &crate::input::ListPublicGuideSamplesInput,
4043 output: &mut String,
4044 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4045 let input_34 = &_input.slug;
4046 let input_34 = input_34.as_ref().ok_or_else(|| {
4047 aws_smithy_http::operation::error::BuildError::missing_field(
4048 "slug",
4049 "cannot be empty or unset",
4050 )
4051 })?;
4052 let slug = aws_smithy_http::label::fmt_string(
4053 input_34,
4054 aws_smithy_http::label::EncodingStrategy::Default,
4055 );
4056 if slug.is_empty() {
4057 return Err(
4058 aws_smithy_http::operation::error::BuildError::missing_field(
4059 "slug",
4060 "cannot be empty or unset",
4061 ),
4062 );
4063 }
4064 let input_35 = &_input.id;
4065 let input_35 = input_35.as_ref().ok_or_else(|| {
4066 aws_smithy_http::operation::error::BuildError::missing_field(
4067 "id",
4068 "cannot be empty or unset",
4069 )
4070 })?;
4071 let id = aws_smithy_http::label::fmt_string(
4072 input_35,
4073 aws_smithy_http::label::EncodingStrategy::Default,
4074 );
4075 if id.is_empty() {
4076 return Err(
4077 aws_smithy_http::operation::error::BuildError::missing_field(
4078 "id",
4079 "cannot be empty or unset",
4080 ),
4081 );
4082 }
4083 write!(
4084 output,
4085 "/public/{slug}/guides/{id}/samples",
4086 slug = slug,
4087 id = id
4088 )
4089 .expect("formatting should succeed");
4090 Ok(())
4091 }
4092 #[allow(clippy::unnecessary_wraps)]
4093 fn update_http_builder(
4094 input: &crate::input::ListPublicGuideSamplesInput,
4095 builder: http::request::Builder,
4096 ) -> std::result::Result<
4097 http::request::Builder,
4098 aws_smithy_http::operation::error::BuildError,
4099 > {
4100 let mut uri = String::new();
4101 uri_base(input, &mut uri)?;
4102 Ok(builder.method("GET").uri(uri))
4103 }
4104 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
4105 builder
4106 };
4107 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
4108 #[allow(clippy::useless_conversion)]
4109 let body = aws_smithy_http::body::SdkBody::from("");
4110 let request = request.body(body).expect("should be valid request");
4111 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
4112 if let Some(api_key_config) = _config.api_key() {
4113 request.properties_mut().insert(api_key_config.clone());
4114 let api_key = api_key_config.api_key();
4115 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
4116 "Authorization".to_owned(),
4117 Some("Key".to_owned()),
4118 );
4119 let name = auth_definition.name();
4120 let value = match auth_definition.scheme() {
4121 Some(value) => format!("{value} {api_key}"),
4122 None => api_key.to_owned(),
4123 };
4124 request.http_mut().headers_mut().insert(
4125 http::header::HeaderName::from_bytes(name.as_bytes())
4126 .expect("valid header name for api key auth"),
4127 http::header::HeaderValue::from_bytes(value.as_bytes())
4128 .expect("valid header value for api key auth"),
4129 );
4130 }
4131 request.properties_mut().insert(endpoint_result);
4132 if let Some(params) = params {
4133 request.properties_mut().insert(params);
4134 }
4135 request
4136 .properties_mut()
4137 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
4138 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
4139 aws_types::os_shim_internal::Env::real(),
4140 crate::API_METADATA.clone(),
4141 );
4142 if let Some(app_name) = _config.app_name() {
4143 user_agent = user_agent.with_app_name(app_name.clone());
4144 }
4145 request.properties_mut().insert(user_agent);
4146 if let Some(region) = &_config.region {
4147 request.properties_mut().insert(region.clone());
4148 }
4149 let op = aws_smithy_http::operation::Operation::new(
4150 request,
4151 crate::operation::ListPublicGuideSamples::new(),
4152 )
4153 .with_metadata(aws_smithy_http::operation::Metadata::new(
4154 "ListPublicGuideSamples",
4155 "guides",
4156 ));
4157 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
4158 Ok(op)
4159 }
4160 pub fn builder() -> crate::input::list_public_guide_samples_input::Builder {
4162 crate::input::list_public_guide_samples_input::Builder::default()
4163 }
4164}
4165
4166pub mod list_public_shared_guide_attachments_input {
4168
4169 #[non_exhaustive]
4171 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
4172 pub struct Builder {
4173 pub(crate) id: std::option::Option<std::string::String>,
4174 }
4175 impl Builder {
4176 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
4178 self.id = Some(input.into());
4179 self
4180 }
4181 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
4183 self.id = input;
4184 self
4185 }
4186 pub fn build(
4188 self,
4189 ) -> Result<
4190 crate::input::ListPublicSharedGuideAttachmentsInput,
4191 aws_smithy_http::operation::error::BuildError,
4192 > {
4193 Ok(crate::input::ListPublicSharedGuideAttachmentsInput { id: self.id })
4194 }
4195 }
4196}
4197impl ListPublicSharedGuideAttachmentsInput {
4198 #[allow(unused_mut)]
4200 #[allow(clippy::let_and_return)]
4201 #[allow(clippy::needless_borrow)]
4202 pub async fn make_operation(
4203 &self,
4204 _config: &crate::config::Config,
4205 ) -> std::result::Result<
4206 aws_smithy_http::operation::Operation<
4207 crate::operation::ListPublicSharedGuideAttachments,
4208 aws_http::retry::AwsResponseRetryClassifier,
4209 >,
4210 aws_smithy_http::operation::error::BuildError,
4211 > {
4212 let params_result = crate::endpoint::Params::builder()
4213 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
4214 .set_endpoint(_config.endpoint_url.clone())
4215 .set_stage(_config.stage.clone())
4216 .build()
4217 .map_err(|err| {
4218 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
4219 "could not construct endpoint parameters",
4220 err,
4221 )
4222 });
4223 let (endpoint_result, params) = match params_result {
4224 Ok(params) => (
4225 _config.endpoint_resolver.resolve_endpoint(¶ms),
4226 Some(params),
4227 ),
4228 Err(e) => (Err(e), None),
4229 };
4230 let mut request = {
4231 fn uri_base(
4232 _input: &crate::input::ListPublicSharedGuideAttachmentsInput,
4233 output: &mut String,
4234 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4235 let input_36 = &_input.id;
4236 let input_36 = input_36.as_ref().ok_or_else(|| {
4237 aws_smithy_http::operation::error::BuildError::missing_field(
4238 "id",
4239 "cannot be empty or unset",
4240 )
4241 })?;
4242 let id = aws_smithy_http::label::fmt_string(
4243 input_36,
4244 aws_smithy_http::label::EncodingStrategy::Default,
4245 );
4246 if id.is_empty() {
4247 return Err(
4248 aws_smithy_http::operation::error::BuildError::missing_field(
4249 "id",
4250 "cannot be empty or unset",
4251 ),
4252 );
4253 }
4254 write!(output, "/shared-guides/{id}/attachments", id = id)
4255 .expect("formatting should succeed");
4256 Ok(())
4257 }
4258 #[allow(clippy::unnecessary_wraps)]
4259 fn update_http_builder(
4260 input: &crate::input::ListPublicSharedGuideAttachmentsInput,
4261 builder: http::request::Builder,
4262 ) -> std::result::Result<
4263 http::request::Builder,
4264 aws_smithy_http::operation::error::BuildError,
4265 > {
4266 let mut uri = String::new();
4267 uri_base(input, &mut uri)?;
4268 Ok(builder.method("GET").uri(uri))
4269 }
4270 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
4271 builder
4272 };
4273 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
4274 #[allow(clippy::useless_conversion)]
4275 let body = aws_smithy_http::body::SdkBody::from("");
4276 let request = request.body(body).expect("should be valid request");
4277 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
4278 if let Some(api_key_config) = _config.api_key() {
4279 request.properties_mut().insert(api_key_config.clone());
4280 let api_key = api_key_config.api_key();
4281 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
4282 "Authorization".to_owned(),
4283 Some("Key".to_owned()),
4284 );
4285 let name = auth_definition.name();
4286 let value = match auth_definition.scheme() {
4287 Some(value) => format!("{value} {api_key}"),
4288 None => api_key.to_owned(),
4289 };
4290 request.http_mut().headers_mut().insert(
4291 http::header::HeaderName::from_bytes(name.as_bytes())
4292 .expect("valid header name for api key auth"),
4293 http::header::HeaderValue::from_bytes(value.as_bytes())
4294 .expect("valid header value for api key auth"),
4295 );
4296 }
4297 request.properties_mut().insert(endpoint_result);
4298 if let Some(params) = params {
4299 request.properties_mut().insert(params);
4300 }
4301 request
4302 .properties_mut()
4303 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
4304 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
4305 aws_types::os_shim_internal::Env::real(),
4306 crate::API_METADATA.clone(),
4307 );
4308 if let Some(app_name) = _config.app_name() {
4309 user_agent = user_agent.with_app_name(app_name.clone());
4310 }
4311 request.properties_mut().insert(user_agent);
4312 if let Some(region) = &_config.region {
4313 request.properties_mut().insert(region.clone());
4314 }
4315 let op = aws_smithy_http::operation::Operation::new(
4316 request,
4317 crate::operation::ListPublicSharedGuideAttachments::new(),
4318 )
4319 .with_metadata(aws_smithy_http::operation::Metadata::new(
4320 "ListPublicSharedGuideAttachments",
4321 "guides",
4322 ));
4323 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
4324 Ok(op)
4325 }
4326 pub fn builder() -> crate::input::list_public_shared_guide_attachments_input::Builder {
4328 crate::input::list_public_shared_guide_attachments_input::Builder::default()
4329 }
4330}
4331
4332pub mod list_public_shared_guide_samples_input {
4334
4335 #[non_exhaustive]
4337 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
4338 pub struct Builder {
4339 pub(crate) id: std::option::Option<std::string::String>,
4340 }
4341 impl Builder {
4342 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
4344 self.id = Some(input.into());
4345 self
4346 }
4347 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
4349 self.id = input;
4350 self
4351 }
4352 pub fn build(
4354 self,
4355 ) -> Result<
4356 crate::input::ListPublicSharedGuideSamplesInput,
4357 aws_smithy_http::operation::error::BuildError,
4358 > {
4359 Ok(crate::input::ListPublicSharedGuideSamplesInput { id: self.id })
4360 }
4361 }
4362}
4363impl ListPublicSharedGuideSamplesInput {
4364 #[allow(unused_mut)]
4366 #[allow(clippy::let_and_return)]
4367 #[allow(clippy::needless_borrow)]
4368 pub async fn make_operation(
4369 &self,
4370 _config: &crate::config::Config,
4371 ) -> std::result::Result<
4372 aws_smithy_http::operation::Operation<
4373 crate::operation::ListPublicSharedGuideSamples,
4374 aws_http::retry::AwsResponseRetryClassifier,
4375 >,
4376 aws_smithy_http::operation::error::BuildError,
4377 > {
4378 let params_result = crate::endpoint::Params::builder()
4379 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
4380 .set_endpoint(_config.endpoint_url.clone())
4381 .set_stage(_config.stage.clone())
4382 .build()
4383 .map_err(|err| {
4384 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
4385 "could not construct endpoint parameters",
4386 err,
4387 )
4388 });
4389 let (endpoint_result, params) = match params_result {
4390 Ok(params) => (
4391 _config.endpoint_resolver.resolve_endpoint(¶ms),
4392 Some(params),
4393 ),
4394 Err(e) => (Err(e), None),
4395 };
4396 let mut request = {
4397 fn uri_base(
4398 _input: &crate::input::ListPublicSharedGuideSamplesInput,
4399 output: &mut String,
4400 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4401 let input_37 = &_input.id;
4402 let input_37 = input_37.as_ref().ok_or_else(|| {
4403 aws_smithy_http::operation::error::BuildError::missing_field(
4404 "id",
4405 "cannot be empty or unset",
4406 )
4407 })?;
4408 let id = aws_smithy_http::label::fmt_string(
4409 input_37,
4410 aws_smithy_http::label::EncodingStrategy::Default,
4411 );
4412 if id.is_empty() {
4413 return Err(
4414 aws_smithy_http::operation::error::BuildError::missing_field(
4415 "id",
4416 "cannot be empty or unset",
4417 ),
4418 );
4419 }
4420 write!(output, "/shared-guides/{id}/samples", id = id)
4421 .expect("formatting should succeed");
4422 Ok(())
4423 }
4424 #[allow(clippy::unnecessary_wraps)]
4425 fn update_http_builder(
4426 input: &crate::input::ListPublicSharedGuideSamplesInput,
4427 builder: http::request::Builder,
4428 ) -> std::result::Result<
4429 http::request::Builder,
4430 aws_smithy_http::operation::error::BuildError,
4431 > {
4432 let mut uri = String::new();
4433 uri_base(input, &mut uri)?;
4434 Ok(builder.method("GET").uri(uri))
4435 }
4436 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
4437 builder
4438 };
4439 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
4440 #[allow(clippy::useless_conversion)]
4441 let body = aws_smithy_http::body::SdkBody::from("");
4442 let request = request.body(body).expect("should be valid request");
4443 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
4444 if let Some(api_key_config) = _config.api_key() {
4445 request.properties_mut().insert(api_key_config.clone());
4446 let api_key = api_key_config.api_key();
4447 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
4448 "Authorization".to_owned(),
4449 Some("Key".to_owned()),
4450 );
4451 let name = auth_definition.name();
4452 let value = match auth_definition.scheme() {
4453 Some(value) => format!("{value} {api_key}"),
4454 None => api_key.to_owned(),
4455 };
4456 request.http_mut().headers_mut().insert(
4457 http::header::HeaderName::from_bytes(name.as_bytes())
4458 .expect("valid header name for api key auth"),
4459 http::header::HeaderValue::from_bytes(value.as_bytes())
4460 .expect("valid header value for api key auth"),
4461 );
4462 }
4463 request.properties_mut().insert(endpoint_result);
4464 if let Some(params) = params {
4465 request.properties_mut().insert(params);
4466 }
4467 request
4468 .properties_mut()
4469 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
4470 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
4471 aws_types::os_shim_internal::Env::real(),
4472 crate::API_METADATA.clone(),
4473 );
4474 if let Some(app_name) = _config.app_name() {
4475 user_agent = user_agent.with_app_name(app_name.clone());
4476 }
4477 request.properties_mut().insert(user_agent);
4478 if let Some(region) = &_config.region {
4479 request.properties_mut().insert(region.clone());
4480 }
4481 let op = aws_smithy_http::operation::Operation::new(
4482 request,
4483 crate::operation::ListPublicSharedGuideSamples::new(),
4484 )
4485 .with_metadata(aws_smithy_http::operation::Metadata::new(
4486 "ListPublicSharedGuideSamples",
4487 "guides",
4488 ));
4489 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
4490 Ok(op)
4491 }
4492 pub fn builder() -> crate::input::list_public_shared_guide_samples_input::Builder {
4494 crate::input::list_public_shared_guide_samples_input::Builder::default()
4495 }
4496}
4497
4498pub mod list_x12_transaction_sets_input {
4500
4501 #[non_exhaustive]
4503 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
4504 pub struct Builder {
4505 pub(crate) version: std::option::Option<std::string::String>,
4506 }
4507 impl Builder {
4508 #[allow(missing_docs)] pub fn version(mut self, input: impl Into<std::string::String>) -> Self {
4510 self.version = Some(input.into());
4511 self
4512 }
4513 #[allow(missing_docs)] pub fn set_version(mut self, input: std::option::Option<std::string::String>) -> Self {
4515 self.version = input;
4516 self
4517 }
4518 pub fn build(
4520 self,
4521 ) -> Result<
4522 crate::input::ListX12TransactionSetsInput,
4523 aws_smithy_http::operation::error::BuildError,
4524 > {
4525 Ok(crate::input::ListX12TransactionSetsInput {
4526 version: self.version,
4527 })
4528 }
4529 }
4530}
4531impl ListX12TransactionSetsInput {
4532 #[allow(unused_mut)]
4534 #[allow(clippy::let_and_return)]
4535 #[allow(clippy::needless_borrow)]
4536 pub async fn make_operation(
4537 &self,
4538 _config: &crate::config::Config,
4539 ) -> std::result::Result<
4540 aws_smithy_http::operation::Operation<
4541 crate::operation::ListX12TransactionSets,
4542 aws_http::retry::AwsResponseRetryClassifier,
4543 >,
4544 aws_smithy_http::operation::error::BuildError,
4545 > {
4546 let params_result = crate::endpoint::Params::builder()
4547 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
4548 .set_endpoint(_config.endpoint_url.clone())
4549 .set_stage(_config.stage.clone())
4550 .build()
4551 .map_err(|err| {
4552 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
4553 "could not construct endpoint parameters",
4554 err,
4555 )
4556 });
4557 let (endpoint_result, params) = match params_result {
4558 Ok(params) => (
4559 _config.endpoint_resolver.resolve_endpoint(¶ms),
4560 Some(params),
4561 ),
4562 Err(e) => (Err(e), None),
4563 };
4564 let mut request = {
4565 fn uri_base(
4566 _input: &crate::input::ListX12TransactionSetsInput,
4567 output: &mut String,
4568 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4569 let input_38 = &_input.version;
4570 let input_38 = input_38.as_ref().ok_or_else(|| {
4571 aws_smithy_http::operation::error::BuildError::missing_field(
4572 "version",
4573 "cannot be empty or unset",
4574 )
4575 })?;
4576 let version = aws_smithy_http::label::fmt_string(
4577 input_38,
4578 aws_smithy_http::label::EncodingStrategy::Default,
4579 );
4580 if version.is_empty() {
4581 return Err(
4582 aws_smithy_http::operation::error::BuildError::missing_field(
4583 "version",
4584 "cannot be empty or unset",
4585 ),
4586 );
4587 }
4588 write!(
4589 output,
4590 "/x12-release/{version}/transaction-sets",
4591 version = version
4592 )
4593 .expect("formatting should succeed");
4594 Ok(())
4595 }
4596 #[allow(clippy::unnecessary_wraps)]
4597 fn update_http_builder(
4598 input: &crate::input::ListX12TransactionSetsInput,
4599 builder: http::request::Builder,
4600 ) -> std::result::Result<
4601 http::request::Builder,
4602 aws_smithy_http::operation::error::BuildError,
4603 > {
4604 let mut uri = String::new();
4605 uri_base(input, &mut uri)?;
4606 Ok(builder.method("GET").uri(uri))
4607 }
4608 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
4609 builder
4610 };
4611 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
4612 #[allow(clippy::useless_conversion)]
4613 let body = aws_smithy_http::body::SdkBody::from("");
4614 let request = request.body(body).expect("should be valid request");
4615 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
4616 if let Some(api_key_config) = _config.api_key() {
4617 request.properties_mut().insert(api_key_config.clone());
4618 let api_key = api_key_config.api_key();
4619 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
4620 "Authorization".to_owned(),
4621 Some("Key".to_owned()),
4622 );
4623 let name = auth_definition.name();
4624 let value = match auth_definition.scheme() {
4625 Some(value) => format!("{value} {api_key}"),
4626 None => api_key.to_owned(),
4627 };
4628 request.http_mut().headers_mut().insert(
4629 http::header::HeaderName::from_bytes(name.as_bytes())
4630 .expect("valid header name for api key auth"),
4631 http::header::HeaderValue::from_bytes(value.as_bytes())
4632 .expect("valid header value for api key auth"),
4633 );
4634 }
4635 request.properties_mut().insert(endpoint_result);
4636 if let Some(params) = params {
4637 request.properties_mut().insert(params);
4638 }
4639 request
4640 .properties_mut()
4641 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
4642 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
4643 aws_types::os_shim_internal::Env::real(),
4644 crate::API_METADATA.clone(),
4645 );
4646 if let Some(app_name) = _config.app_name() {
4647 user_agent = user_agent.with_app_name(app_name.clone());
4648 }
4649 request.properties_mut().insert(user_agent);
4650 if let Some(region) = &_config.region {
4651 request.properties_mut().insert(region.clone());
4652 }
4653 let op = aws_smithy_http::operation::Operation::new(
4654 request,
4655 crate::operation::ListX12TransactionSets::new(),
4656 )
4657 .with_metadata(aws_smithy_http::operation::Metadata::new(
4658 "ListX12TransactionSets",
4659 "guides",
4660 ));
4661 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
4662 Ok(op)
4663 }
4664 pub fn builder() -> crate::input::list_x12_transaction_sets_input::Builder {
4666 crate::input::list_x12_transaction_sets_input::Builder::default()
4667 }
4668}
4669
4670pub mod publish_guide_input {
4672
4673 #[non_exhaustive]
4675 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
4676 pub struct Builder {
4677 pub(crate) id: std::option::Option<std::string::String>,
4678 pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
4679 }
4680 impl Builder {
4681 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
4683 self.id = Some(input.into());
4684 self
4685 }
4686 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
4688 self.id = input;
4689 self
4690 }
4691 #[allow(missing_docs)] pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
4693 self.output_format = Some(input);
4694 self
4695 }
4696 #[allow(missing_docs)] pub fn set_output_format(
4698 mut self,
4699 input: std::option::Option<crate::model::OutputFormat>,
4700 ) -> Self {
4701 self.output_format = input;
4702 self
4703 }
4704 pub fn build(
4706 self,
4707 ) -> Result<crate::input::PublishGuideInput, aws_smithy_http::operation::error::BuildError>
4708 {
4709 Ok(crate::input::PublishGuideInput {
4710 id: self.id,
4711 output_format: self.output_format,
4712 })
4713 }
4714 }
4715}
4716impl PublishGuideInput {
4717 #[allow(unused_mut)]
4719 #[allow(clippy::let_and_return)]
4720 #[allow(clippy::needless_borrow)]
4721 pub async fn make_operation(
4722 &self,
4723 _config: &crate::config::Config,
4724 ) -> std::result::Result<
4725 aws_smithy_http::operation::Operation<
4726 crate::operation::PublishGuide,
4727 aws_http::retry::AwsResponseRetryClassifier,
4728 >,
4729 aws_smithy_http::operation::error::BuildError,
4730 > {
4731 let params_result = crate::endpoint::Params::builder()
4732 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
4733 .set_endpoint(_config.endpoint_url.clone())
4734 .set_stage(_config.stage.clone())
4735 .build()
4736 .map_err(|err| {
4737 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
4738 "could not construct endpoint parameters",
4739 err,
4740 )
4741 });
4742 let (endpoint_result, params) = match params_result {
4743 Ok(params) => (
4744 _config.endpoint_resolver.resolve_endpoint(¶ms),
4745 Some(params),
4746 ),
4747 Err(e) => (Err(e), None),
4748 };
4749 let mut request = {
4750 fn uri_base(
4751 _input: &crate::input::PublishGuideInput,
4752 output: &mut String,
4753 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4754 let input_39 = &_input.id;
4755 let input_39 = input_39.as_ref().ok_or_else(|| {
4756 aws_smithy_http::operation::error::BuildError::missing_field(
4757 "id",
4758 "cannot be empty or unset",
4759 )
4760 })?;
4761 let id = aws_smithy_http::label::fmt_string(
4762 input_39,
4763 aws_smithy_http::label::EncodingStrategy::Default,
4764 );
4765 if id.is_empty() {
4766 return Err(
4767 aws_smithy_http::operation::error::BuildError::missing_field(
4768 "id",
4769 "cannot be empty or unset",
4770 ),
4771 );
4772 }
4773 write!(output, "/guides/{id}/publish", id = id).expect("formatting should succeed");
4774 Ok(())
4775 }
4776 fn uri_query(
4777 _input: &crate::input::PublishGuideInput,
4778 mut output: &mut String,
4779 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4780 let mut query = aws_smithy_http::query::Writer::new(&mut output);
4781 if let Some(inner_40) = &_input.output_format {
4782 {
4783 query.push_kv(
4784 "outputFormat",
4785 &aws_smithy_http::query::fmt_string(&inner_40),
4786 );
4787 }
4788 }
4789 Ok(())
4790 }
4791 #[allow(clippy::unnecessary_wraps)]
4792 fn update_http_builder(
4793 input: &crate::input::PublishGuideInput,
4794 builder: http::request::Builder,
4795 ) -> std::result::Result<
4796 http::request::Builder,
4797 aws_smithy_http::operation::error::BuildError,
4798 > {
4799 let mut uri = String::new();
4800 uri_base(input, &mut uri)?;
4801 uri_query(input, &mut uri)?;
4802 Ok(builder.method("PUT").uri(uri))
4803 }
4804 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
4805 builder
4806 };
4807 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
4808 #[allow(clippy::useless_conversion)]
4809 let body = aws_smithy_http::body::SdkBody::from("");
4810 let request = request.body(body).expect("should be valid request");
4811 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
4812 if let Some(api_key_config) = _config.api_key() {
4813 request.properties_mut().insert(api_key_config.clone());
4814 let api_key = api_key_config.api_key();
4815 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
4816 "Authorization".to_owned(),
4817 Some("Key".to_owned()),
4818 );
4819 let name = auth_definition.name();
4820 let value = match auth_definition.scheme() {
4821 Some(value) => format!("{value} {api_key}"),
4822 None => api_key.to_owned(),
4823 };
4824 request.http_mut().headers_mut().insert(
4825 http::header::HeaderName::from_bytes(name.as_bytes())
4826 .expect("valid header name for api key auth"),
4827 http::header::HeaderValue::from_bytes(value.as_bytes())
4828 .expect("valid header value for api key auth"),
4829 );
4830 }
4831 request.properties_mut().insert(endpoint_result);
4832 if let Some(params) = params {
4833 request.properties_mut().insert(params);
4834 }
4835 request
4836 .properties_mut()
4837 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
4838 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
4839 aws_types::os_shim_internal::Env::real(),
4840 crate::API_METADATA.clone(),
4841 );
4842 if let Some(app_name) = _config.app_name() {
4843 user_agent = user_agent.with_app_name(app_name.clone());
4844 }
4845 request.properties_mut().insert(user_agent);
4846 if let Some(region) = &_config.region {
4847 request.properties_mut().insert(region.clone());
4848 }
4849 let op = aws_smithy_http::operation::Operation::new(
4850 request,
4851 crate::operation::PublishGuide::new(),
4852 )
4853 .with_metadata(aws_smithy_http::operation::Metadata::new(
4854 "PublishGuide",
4855 "guides",
4856 ));
4857 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
4858 Ok(op)
4859 }
4860 pub fn builder() -> crate::input::publish_guide_input::Builder {
4862 crate::input::publish_guide_input::Builder::default()
4863 }
4864}
4865
4866pub mod revert_guide_input {
4868
4869 #[non_exhaustive]
4871 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
4872 pub struct Builder {
4873 pub(crate) id: std::option::Option<std::string::String>,
4874 pub(crate) output_format: std::option::Option<crate::model::OutputFormat>,
4875 }
4876 impl Builder {
4877 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
4879 self.id = Some(input.into());
4880 self
4881 }
4882 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
4884 self.id = input;
4885 self
4886 }
4887 #[allow(missing_docs)] pub fn output_format(mut self, input: crate::model::OutputFormat) -> Self {
4889 self.output_format = Some(input);
4890 self
4891 }
4892 #[allow(missing_docs)] pub fn set_output_format(
4894 mut self,
4895 input: std::option::Option<crate::model::OutputFormat>,
4896 ) -> Self {
4897 self.output_format = input;
4898 self
4899 }
4900 pub fn build(
4902 self,
4903 ) -> Result<crate::input::RevertGuideInput, aws_smithy_http::operation::error::BuildError>
4904 {
4905 Ok(crate::input::RevertGuideInput {
4906 id: self.id,
4907 output_format: self.output_format,
4908 })
4909 }
4910 }
4911}
4912impl RevertGuideInput {
4913 #[allow(unused_mut)]
4915 #[allow(clippy::let_and_return)]
4916 #[allow(clippy::needless_borrow)]
4917 pub async fn make_operation(
4918 &self,
4919 _config: &crate::config::Config,
4920 ) -> std::result::Result<
4921 aws_smithy_http::operation::Operation<
4922 crate::operation::RevertGuide,
4923 aws_http::retry::AwsResponseRetryClassifier,
4924 >,
4925 aws_smithy_http::operation::error::BuildError,
4926 > {
4927 let params_result = crate::endpoint::Params::builder()
4928 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
4929 .set_endpoint(_config.endpoint_url.clone())
4930 .set_stage(_config.stage.clone())
4931 .build()
4932 .map_err(|err| {
4933 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
4934 "could not construct endpoint parameters",
4935 err,
4936 )
4937 });
4938 let (endpoint_result, params) = match params_result {
4939 Ok(params) => (
4940 _config.endpoint_resolver.resolve_endpoint(¶ms),
4941 Some(params),
4942 ),
4943 Err(e) => (Err(e), None),
4944 };
4945 let mut request = {
4946 fn uri_base(
4947 _input: &crate::input::RevertGuideInput,
4948 output: &mut String,
4949 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4950 let input_41 = &_input.id;
4951 let input_41 = input_41.as_ref().ok_or_else(|| {
4952 aws_smithy_http::operation::error::BuildError::missing_field(
4953 "id",
4954 "cannot be empty or unset",
4955 )
4956 })?;
4957 let id = aws_smithy_http::label::fmt_string(
4958 input_41,
4959 aws_smithy_http::label::EncodingStrategy::Default,
4960 );
4961 if id.is_empty() {
4962 return Err(
4963 aws_smithy_http::operation::error::BuildError::missing_field(
4964 "id",
4965 "cannot be empty or unset",
4966 ),
4967 );
4968 }
4969 write!(output, "/guides/{id}/revert", id = id).expect("formatting should succeed");
4970 Ok(())
4971 }
4972 fn uri_query(
4973 _input: &crate::input::RevertGuideInput,
4974 mut output: &mut String,
4975 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
4976 let mut query = aws_smithy_http::query::Writer::new(&mut output);
4977 if let Some(inner_42) = &_input.output_format {
4978 {
4979 query.push_kv(
4980 "outputFormat",
4981 &aws_smithy_http::query::fmt_string(&inner_42),
4982 );
4983 }
4984 }
4985 Ok(())
4986 }
4987 #[allow(clippy::unnecessary_wraps)]
4988 fn update_http_builder(
4989 input: &crate::input::RevertGuideInput,
4990 builder: http::request::Builder,
4991 ) -> std::result::Result<
4992 http::request::Builder,
4993 aws_smithy_http::operation::error::BuildError,
4994 > {
4995 let mut uri = String::new();
4996 uri_base(input, &mut uri)?;
4997 uri_query(input, &mut uri)?;
4998 Ok(builder.method("PUT").uri(uri))
4999 }
5000 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
5001 builder
5002 };
5003 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
5004 #[allow(clippy::useless_conversion)]
5005 let body = aws_smithy_http::body::SdkBody::from("");
5006 let request = request.body(body).expect("should be valid request");
5007 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
5008 if let Some(api_key_config) = _config.api_key() {
5009 request.properties_mut().insert(api_key_config.clone());
5010 let api_key = api_key_config.api_key();
5011 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
5012 "Authorization".to_owned(),
5013 Some("Key".to_owned()),
5014 );
5015 let name = auth_definition.name();
5016 let value = match auth_definition.scheme() {
5017 Some(value) => format!("{value} {api_key}"),
5018 None => api_key.to_owned(),
5019 };
5020 request.http_mut().headers_mut().insert(
5021 http::header::HeaderName::from_bytes(name.as_bytes())
5022 .expect("valid header name for api key auth"),
5023 http::header::HeaderValue::from_bytes(value.as_bytes())
5024 .expect("valid header value for api key auth"),
5025 );
5026 }
5027 request.properties_mut().insert(endpoint_result);
5028 if let Some(params) = params {
5029 request.properties_mut().insert(params);
5030 }
5031 request
5032 .properties_mut()
5033 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
5034 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
5035 aws_types::os_shim_internal::Env::real(),
5036 crate::API_METADATA.clone(),
5037 );
5038 if let Some(app_name) = _config.app_name() {
5039 user_agent = user_agent.with_app_name(app_name.clone());
5040 }
5041 request.properties_mut().insert(user_agent);
5042 if let Some(region) = &_config.region {
5043 request.properties_mut().insert(region.clone());
5044 }
5045 let op = aws_smithy_http::operation::Operation::new(
5046 request,
5047 crate::operation::RevertGuide::new(),
5048 )
5049 .with_metadata(aws_smithy_http::operation::Metadata::new(
5050 "RevertGuide",
5051 "guides",
5052 ));
5053 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
5054 Ok(op)
5055 }
5056 pub fn builder() -> crate::input::revert_guide_input::Builder {
5058 crate::input::revert_guide_input::Builder::default()
5059 }
5060}
5061
5062pub mod update_account_config_input {
5064
5065 #[non_exhaustive]
5067 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
5068 pub struct Builder {
5069 pub(crate) logo_url: std::option::Option<std::string::String>,
5070 pub(crate) logo_data: std::option::Option<std::string::String>,
5071 pub(crate) link_text: std::option::Option<std::string::String>,
5072 pub(crate) link_url: std::option::Option<std::string::String>,
5073 pub(crate) slug: std::option::Option<std::string::String>,
5074 pub(crate) display_name: std::option::Option<std::string::String>,
5075 }
5076 impl Builder {
5077 pub fn logo_url(mut self, input: impl Into<std::string::String>) -> Self {
5079 self.logo_url = Some(input.into());
5080 self
5081 }
5082 pub fn set_logo_url(mut self, input: std::option::Option<std::string::String>) -> Self {
5084 self.logo_url = input;
5085 self
5086 }
5087 pub fn logo_data(mut self, input: impl Into<std::string::String>) -> Self {
5089 self.logo_data = Some(input.into());
5090 self
5091 }
5092 pub fn set_logo_data(mut self, input: std::option::Option<std::string::String>) -> Self {
5094 self.logo_data = input;
5095 self
5096 }
5097 #[allow(missing_docs)] pub fn link_text(mut self, input: impl Into<std::string::String>) -> Self {
5099 self.link_text = Some(input.into());
5100 self
5101 }
5102 #[allow(missing_docs)] pub fn set_link_text(mut self, input: std::option::Option<std::string::String>) -> Self {
5104 self.link_text = input;
5105 self
5106 }
5107 #[allow(missing_docs)] pub fn link_url(mut self, input: impl Into<std::string::String>) -> Self {
5109 self.link_url = Some(input.into());
5110 self
5111 }
5112 #[allow(missing_docs)] pub fn set_link_url(mut self, input: std::option::Option<std::string::String>) -> Self {
5114 self.link_url = input;
5115 self
5116 }
5117 #[allow(missing_docs)] pub fn slug(mut self, input: impl Into<std::string::String>) -> Self {
5119 self.slug = Some(input.into());
5120 self
5121 }
5122 #[allow(missing_docs)] pub fn set_slug(mut self, input: std::option::Option<std::string::String>) -> Self {
5124 self.slug = input;
5125 self
5126 }
5127 #[allow(missing_docs)] pub fn display_name(mut self, input: impl Into<std::string::String>) -> Self {
5129 self.display_name = Some(input.into());
5130 self
5131 }
5132 #[allow(missing_docs)] pub fn set_display_name(mut self, input: std::option::Option<std::string::String>) -> Self {
5134 self.display_name = input;
5135 self
5136 }
5137 pub fn build(
5139 self,
5140 ) -> Result<
5141 crate::input::UpdateAccountConfigInput,
5142 aws_smithy_http::operation::error::BuildError,
5143 > {
5144 Ok(crate::input::UpdateAccountConfigInput {
5145 logo_url: self.logo_url,
5146 logo_data: self.logo_data,
5147 link_text: self.link_text,
5148 link_url: self.link_url,
5149 slug: self.slug,
5150 display_name: self.display_name,
5151 })
5152 }
5153 }
5154}
5155impl UpdateAccountConfigInput {
5156 #[allow(unused_mut)]
5158 #[allow(clippy::let_and_return)]
5159 #[allow(clippy::needless_borrow)]
5160 pub async fn make_operation(
5161 &self,
5162 _config: &crate::config::Config,
5163 ) -> std::result::Result<
5164 aws_smithy_http::operation::Operation<
5165 crate::operation::UpdateAccountConfig,
5166 aws_http::retry::AwsResponseRetryClassifier,
5167 >,
5168 aws_smithy_http::operation::error::BuildError,
5169 > {
5170 let params_result = crate::endpoint::Params::builder()
5171 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
5172 .set_endpoint(_config.endpoint_url.clone())
5173 .set_stage(_config.stage.clone())
5174 .build()
5175 .map_err(|err| {
5176 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
5177 "could not construct endpoint parameters",
5178 err,
5179 )
5180 });
5181 let (endpoint_result, params) = match params_result {
5182 Ok(params) => (
5183 _config.endpoint_resolver.resolve_endpoint(¶ms),
5184 Some(params),
5185 ),
5186 Err(e) => (Err(e), None),
5187 };
5188 let mut request = {
5189 fn uri_base(
5190 _input: &crate::input::UpdateAccountConfigInput,
5191 output: &mut String,
5192 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
5193 write!(output, "/account-config").expect("formatting should succeed");
5194 Ok(())
5195 }
5196 #[allow(clippy::unnecessary_wraps)]
5197 fn update_http_builder(
5198 input: &crate::input::UpdateAccountConfigInput,
5199 builder: http::request::Builder,
5200 ) -> std::result::Result<
5201 http::request::Builder,
5202 aws_smithy_http::operation::error::BuildError,
5203 > {
5204 let mut uri = String::new();
5205 uri_base(input, &mut uri)?;
5206 Ok(builder.method("PUT").uri(uri))
5207 }
5208 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
5209 builder = aws_smithy_http::header::set_request_header_if_absent(
5210 builder,
5211 http::header::CONTENT_TYPE,
5212 "application/json",
5213 );
5214 builder
5215 };
5216 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
5217 #[allow(clippy::useless_conversion)]
5218 let body = aws_smithy_http::body::SdkBody::from(
5219 crate::operation_ser::serialize_operation_crate_operation_update_account_config(&self)?,
5220 );
5221 if let Some(content_length) = body.content_length() {
5222 request = aws_smithy_http::header::set_request_header_if_absent(
5223 request,
5224 http::header::CONTENT_LENGTH,
5225 content_length,
5226 );
5227 }
5228 let request = request.body(body).expect("should be valid request");
5229 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
5230 if let Some(api_key_config) = _config.api_key() {
5231 request.properties_mut().insert(api_key_config.clone());
5232 let api_key = api_key_config.api_key();
5233 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
5234 "Authorization".to_owned(),
5235 Some("Key".to_owned()),
5236 );
5237 let name = auth_definition.name();
5238 let value = match auth_definition.scheme() {
5239 Some(value) => format!("{value} {api_key}"),
5240 None => api_key.to_owned(),
5241 };
5242 request.http_mut().headers_mut().insert(
5243 http::header::HeaderName::from_bytes(name.as_bytes())
5244 .expect("valid header name for api key auth"),
5245 http::header::HeaderValue::from_bytes(value.as_bytes())
5246 .expect("valid header value for api key auth"),
5247 );
5248 }
5249 request.properties_mut().insert(endpoint_result);
5250 if let Some(params) = params {
5251 request.properties_mut().insert(params);
5252 }
5253 request
5254 .properties_mut()
5255 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
5256 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
5257 aws_types::os_shim_internal::Env::real(),
5258 crate::API_METADATA.clone(),
5259 );
5260 if let Some(app_name) = _config.app_name() {
5261 user_agent = user_agent.with_app_name(app_name.clone());
5262 }
5263 request.properties_mut().insert(user_agent);
5264 if let Some(region) = &_config.region {
5265 request.properties_mut().insert(region.clone());
5266 }
5267 let op = aws_smithy_http::operation::Operation::new(
5268 request,
5269 crate::operation::UpdateAccountConfig::new(),
5270 )
5271 .with_metadata(aws_smithy_http::operation::Metadata::new(
5272 "UpdateAccountConfig",
5273 "guides",
5274 ));
5275 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
5276 Ok(op)
5277 }
5278 pub fn builder() -> crate::input::update_account_config_input::Builder {
5280 crate::input::update_account_config_input::Builder::default()
5281 }
5282}
5283
5284pub mod update_guide_input {
5286
5287 #[non_exhaustive]
5289 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
5290 pub struct Builder {
5291 pub(crate) id: std::option::Option<std::string::String>,
5292 pub(crate) name: std::option::Option<std::string::String>,
5293 pub(crate) definition: std::option::Option<aws_smithy_types::Document>,
5294 pub(crate) x12_envelope: std::option::Option<std::string::String>,
5295 }
5296 impl Builder {
5297 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
5299 self.id = Some(input.into());
5300 self
5301 }
5302 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
5304 self.id = input;
5305 self
5306 }
5307 #[allow(missing_docs)] pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
5309 self.name = Some(input.into());
5310 self
5311 }
5312 #[allow(missing_docs)] pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
5314 self.name = input;
5315 self
5316 }
5317 #[allow(missing_docs)] pub fn definition(mut self, input: aws_smithy_types::Document) -> Self {
5319 self.definition = Some(input);
5320 self
5321 }
5322 #[allow(missing_docs)] pub fn set_definition(
5324 mut self,
5325 input: std::option::Option<aws_smithy_types::Document>,
5326 ) -> Self {
5327 self.definition = input;
5328 self
5329 }
5330 #[allow(missing_docs)] pub fn x12_envelope(mut self, input: impl Into<std::string::String>) -> Self {
5332 self.x12_envelope = Some(input.into());
5333 self
5334 }
5335 #[allow(missing_docs)] pub fn set_x12_envelope(mut self, input: std::option::Option<std::string::String>) -> Self {
5337 self.x12_envelope = input;
5338 self
5339 }
5340 pub fn build(
5342 self,
5343 ) -> Result<crate::input::UpdateGuideInput, aws_smithy_http::operation::error::BuildError>
5344 {
5345 Ok(crate::input::UpdateGuideInput {
5346 id: self.id,
5347 name: self.name,
5348 definition: self.definition,
5349 x12_envelope: self.x12_envelope,
5350 })
5351 }
5352 }
5353}
5354impl UpdateGuideInput {
5355 #[allow(unused_mut)]
5357 #[allow(clippy::let_and_return)]
5358 #[allow(clippy::needless_borrow)]
5359 pub async fn make_operation(
5360 &self,
5361 _config: &crate::config::Config,
5362 ) -> std::result::Result<
5363 aws_smithy_http::operation::Operation<
5364 crate::operation::UpdateGuide,
5365 aws_http::retry::AwsResponseRetryClassifier,
5366 >,
5367 aws_smithy_http::operation::error::BuildError,
5368 > {
5369 let params_result = crate::endpoint::Params::builder()
5370 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
5371 .set_endpoint(_config.endpoint_url.clone())
5372 .set_stage(_config.stage.clone())
5373 .build()
5374 .map_err(|err| {
5375 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
5376 "could not construct endpoint parameters",
5377 err,
5378 )
5379 });
5380 let (endpoint_result, params) = match params_result {
5381 Ok(params) => (
5382 _config.endpoint_resolver.resolve_endpoint(¶ms),
5383 Some(params),
5384 ),
5385 Err(e) => (Err(e), None),
5386 };
5387 let mut request = {
5388 fn uri_base(
5389 _input: &crate::input::UpdateGuideInput,
5390 output: &mut String,
5391 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
5392 let input_43 = &_input.id;
5393 let input_43 = input_43.as_ref().ok_or_else(|| {
5394 aws_smithy_http::operation::error::BuildError::missing_field(
5395 "id",
5396 "cannot be empty or unset",
5397 )
5398 })?;
5399 let id = aws_smithy_http::label::fmt_string(
5400 input_43,
5401 aws_smithy_http::label::EncodingStrategy::Default,
5402 );
5403 if id.is_empty() {
5404 return Err(
5405 aws_smithy_http::operation::error::BuildError::missing_field(
5406 "id",
5407 "cannot be empty or unset",
5408 ),
5409 );
5410 }
5411 write!(output, "/guides/{id}", id = id).expect("formatting should succeed");
5412 Ok(())
5413 }
5414 #[allow(clippy::unnecessary_wraps)]
5415 fn update_http_builder(
5416 input: &crate::input::UpdateGuideInput,
5417 builder: http::request::Builder,
5418 ) -> std::result::Result<
5419 http::request::Builder,
5420 aws_smithy_http::operation::error::BuildError,
5421 > {
5422 let mut uri = String::new();
5423 uri_base(input, &mut uri)?;
5424 Ok(builder.method("PUT").uri(uri))
5425 }
5426 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
5427 builder = aws_smithy_http::header::set_request_header_if_absent(
5428 builder,
5429 http::header::CONTENT_TYPE,
5430 "application/json",
5431 );
5432 builder
5433 };
5434 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
5435 #[allow(clippy::useless_conversion)]
5436 let body = aws_smithy_http::body::SdkBody::from(
5437 crate::operation_ser::serialize_operation_crate_operation_update_guide(&self)?,
5438 );
5439 if let Some(content_length) = body.content_length() {
5440 request = aws_smithy_http::header::set_request_header_if_absent(
5441 request,
5442 http::header::CONTENT_LENGTH,
5443 content_length,
5444 );
5445 }
5446 let request = request.body(body).expect("should be valid request");
5447 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
5448 if let Some(api_key_config) = _config.api_key() {
5449 request.properties_mut().insert(api_key_config.clone());
5450 let api_key = api_key_config.api_key();
5451 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
5452 "Authorization".to_owned(),
5453 Some("Key".to_owned()),
5454 );
5455 let name = auth_definition.name();
5456 let value = match auth_definition.scheme() {
5457 Some(value) => format!("{value} {api_key}"),
5458 None => api_key.to_owned(),
5459 };
5460 request.http_mut().headers_mut().insert(
5461 http::header::HeaderName::from_bytes(name.as_bytes())
5462 .expect("valid header name for api key auth"),
5463 http::header::HeaderValue::from_bytes(value.as_bytes())
5464 .expect("valid header value for api key auth"),
5465 );
5466 }
5467 request.properties_mut().insert(endpoint_result);
5468 if let Some(params) = params {
5469 request.properties_mut().insert(params);
5470 }
5471 request
5472 .properties_mut()
5473 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
5474 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
5475 aws_types::os_shim_internal::Env::real(),
5476 crate::API_METADATA.clone(),
5477 );
5478 if let Some(app_name) = _config.app_name() {
5479 user_agent = user_agent.with_app_name(app_name.clone());
5480 }
5481 request.properties_mut().insert(user_agent);
5482 if let Some(region) = &_config.region {
5483 request.properties_mut().insert(region.clone());
5484 }
5485 let op = aws_smithy_http::operation::Operation::new(
5486 request,
5487 crate::operation::UpdateGuide::new(),
5488 )
5489 .with_metadata(aws_smithy_http::operation::Metadata::new(
5490 "UpdateGuide",
5491 "guides",
5492 ));
5493 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
5494 Ok(op)
5495 }
5496 pub fn builder() -> crate::input::update_guide_input::Builder {
5498 crate::input::update_guide_input::Builder::default()
5499 }
5500}
5501
5502pub mod update_guide_attachment_input {
5504
5505 #[non_exhaustive]
5507 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
5508 pub struct Builder {
5509 pub(crate) id: std::option::Option<std::string::String>,
5510 pub(crate) guide_attachment_id: std::option::Option<std::string::String>,
5511 pub(crate) name: std::option::Option<std::string::String>,
5512 pub(crate) filename: std::option::Option<std::string::String>,
5513 pub(crate) visibility: std::option::Option<crate::model::AttachmentVisibility>,
5514 pub(crate) content: std::option::Option<aws_smithy_types::Blob>,
5515 }
5516 impl Builder {
5517 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
5519 self.id = Some(input.into());
5520 self
5521 }
5522 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
5524 self.id = input;
5525 self
5526 }
5527 #[allow(missing_docs)] pub fn guide_attachment_id(mut self, input: impl Into<std::string::String>) -> Self {
5529 self.guide_attachment_id = Some(input.into());
5530 self
5531 }
5532 #[allow(missing_docs)] pub fn set_guide_attachment_id(
5534 mut self,
5535 input: std::option::Option<std::string::String>,
5536 ) -> Self {
5537 self.guide_attachment_id = input;
5538 self
5539 }
5540 #[allow(missing_docs)] pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
5542 self.name = Some(input.into());
5543 self
5544 }
5545 #[allow(missing_docs)] pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
5547 self.name = input;
5548 self
5549 }
5550 #[allow(missing_docs)] pub fn filename(mut self, input: impl Into<std::string::String>) -> Self {
5552 self.filename = Some(input.into());
5553 self
5554 }
5555 #[allow(missing_docs)] pub fn set_filename(mut self, input: std::option::Option<std::string::String>) -> Self {
5557 self.filename = input;
5558 self
5559 }
5560 #[allow(missing_docs)] pub fn visibility(mut self, input: crate::model::AttachmentVisibility) -> Self {
5562 self.visibility = Some(input);
5563 self
5564 }
5565 #[allow(missing_docs)] pub fn set_visibility(
5567 mut self,
5568 input: std::option::Option<crate::model::AttachmentVisibility>,
5569 ) -> Self {
5570 self.visibility = input;
5571 self
5572 }
5573 #[allow(missing_docs)] pub fn content(mut self, input: aws_smithy_types::Blob) -> Self {
5575 self.content = Some(input);
5576 self
5577 }
5578 #[allow(missing_docs)] pub fn set_content(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
5580 self.content = input;
5581 self
5582 }
5583 pub fn build(
5585 self,
5586 ) -> Result<
5587 crate::input::UpdateGuideAttachmentInput,
5588 aws_smithy_http::operation::error::BuildError,
5589 > {
5590 Ok(crate::input::UpdateGuideAttachmentInput {
5591 id: self.id,
5592 guide_attachment_id: self.guide_attachment_id,
5593 name: self.name,
5594 filename: self.filename,
5595 visibility: self.visibility,
5596 content: self.content,
5597 })
5598 }
5599 }
5600}
5601impl UpdateGuideAttachmentInput {
5602 #[allow(unused_mut)]
5604 #[allow(clippy::let_and_return)]
5605 #[allow(clippy::needless_borrow)]
5606 pub async fn make_operation(
5607 &self,
5608 _config: &crate::config::Config,
5609 ) -> std::result::Result<
5610 aws_smithy_http::operation::Operation<
5611 crate::operation::UpdateGuideAttachment,
5612 aws_http::retry::AwsResponseRetryClassifier,
5613 >,
5614 aws_smithy_http::operation::error::BuildError,
5615 > {
5616 let params_result = crate::endpoint::Params::builder()
5617 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
5618 .set_endpoint(_config.endpoint_url.clone())
5619 .set_stage(_config.stage.clone())
5620 .build()
5621 .map_err(|err| {
5622 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
5623 "could not construct endpoint parameters",
5624 err,
5625 )
5626 });
5627 let (endpoint_result, params) = match params_result {
5628 Ok(params) => (
5629 _config.endpoint_resolver.resolve_endpoint(¶ms),
5630 Some(params),
5631 ),
5632 Err(e) => (Err(e), None),
5633 };
5634 let mut request = {
5635 fn uri_base(
5636 _input: &crate::input::UpdateGuideAttachmentInput,
5637 output: &mut String,
5638 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
5639 let input_44 = &_input.id;
5640 let input_44 = input_44.as_ref().ok_or_else(|| {
5641 aws_smithy_http::operation::error::BuildError::missing_field(
5642 "id",
5643 "cannot be empty or unset",
5644 )
5645 })?;
5646 let id = aws_smithy_http::label::fmt_string(
5647 input_44,
5648 aws_smithy_http::label::EncodingStrategy::Default,
5649 );
5650 if id.is_empty() {
5651 return Err(
5652 aws_smithy_http::operation::error::BuildError::missing_field(
5653 "id",
5654 "cannot be empty or unset",
5655 ),
5656 );
5657 }
5658 let input_45 = &_input.guide_attachment_id;
5659 let input_45 = input_45.as_ref().ok_or_else(|| {
5660 aws_smithy_http::operation::error::BuildError::missing_field(
5661 "guide_attachment_id",
5662 "cannot be empty or unset",
5663 )
5664 })?;
5665 let guide_attachment_id = aws_smithy_http::label::fmt_string(
5666 input_45,
5667 aws_smithy_http::label::EncodingStrategy::Default,
5668 );
5669 if guide_attachment_id.is_empty() {
5670 return Err(
5671 aws_smithy_http::operation::error::BuildError::missing_field(
5672 "guide_attachment_id",
5673 "cannot be empty or unset",
5674 ),
5675 );
5676 }
5677 write!(
5678 output,
5679 "/guides/{id}/attachments/{guideAttachmentId}",
5680 id = id,
5681 guideAttachmentId = guide_attachment_id
5682 )
5683 .expect("formatting should succeed");
5684 Ok(())
5685 }
5686 #[allow(clippy::unnecessary_wraps)]
5687 fn update_http_builder(
5688 input: &crate::input::UpdateGuideAttachmentInput,
5689 builder: http::request::Builder,
5690 ) -> std::result::Result<
5691 http::request::Builder,
5692 aws_smithy_http::operation::error::BuildError,
5693 > {
5694 let mut uri = String::new();
5695 uri_base(input, &mut uri)?;
5696 Ok(builder.method("PUT").uri(uri))
5697 }
5698 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
5699 builder = aws_smithy_http::header::set_request_header_if_absent(
5700 builder,
5701 http::header::CONTENT_TYPE,
5702 "application/json",
5703 );
5704 builder
5705 };
5706 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
5707 #[allow(clippy::useless_conversion)]
5708 let body = aws_smithy_http::body::SdkBody::from(
5709 crate::operation_ser::serialize_operation_crate_operation_update_guide_attachment(
5710 &self,
5711 )?,
5712 );
5713 if let Some(content_length) = body.content_length() {
5714 request = aws_smithy_http::header::set_request_header_if_absent(
5715 request,
5716 http::header::CONTENT_LENGTH,
5717 content_length,
5718 );
5719 }
5720 let request = request.body(body).expect("should be valid request");
5721 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
5722 if let Some(api_key_config) = _config.api_key() {
5723 request.properties_mut().insert(api_key_config.clone());
5724 let api_key = api_key_config.api_key();
5725 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
5726 "Authorization".to_owned(),
5727 Some("Key".to_owned()),
5728 );
5729 let name = auth_definition.name();
5730 let value = match auth_definition.scheme() {
5731 Some(value) => format!("{value} {api_key}"),
5732 None => api_key.to_owned(),
5733 };
5734 request.http_mut().headers_mut().insert(
5735 http::header::HeaderName::from_bytes(name.as_bytes())
5736 .expect("valid header name for api key auth"),
5737 http::header::HeaderValue::from_bytes(value.as_bytes())
5738 .expect("valid header value for api key auth"),
5739 );
5740 }
5741 request.properties_mut().insert(endpoint_result);
5742 if let Some(params) = params {
5743 request.properties_mut().insert(params);
5744 }
5745 request
5746 .properties_mut()
5747 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
5748 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
5749 aws_types::os_shim_internal::Env::real(),
5750 crate::API_METADATA.clone(),
5751 );
5752 if let Some(app_name) = _config.app_name() {
5753 user_agent = user_agent.with_app_name(app_name.clone());
5754 }
5755 request.properties_mut().insert(user_agent);
5756 if let Some(region) = &_config.region {
5757 request.properties_mut().insert(region.clone());
5758 }
5759 let op = aws_smithy_http::operation::Operation::new(
5760 request,
5761 crate::operation::UpdateGuideAttachment::new(),
5762 )
5763 .with_metadata(aws_smithy_http::operation::Metadata::new(
5764 "UpdateGuideAttachment",
5765 "guides",
5766 ));
5767 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
5768 Ok(op)
5769 }
5770 pub fn builder() -> crate::input::update_guide_attachment_input::Builder {
5772 crate::input::update_guide_attachment_input::Builder::default()
5773 }
5774}
5775
5776pub mod update_guide_sample_input {
5778
5779 #[non_exhaustive]
5781 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
5782 pub struct Builder {
5783 pub(crate) id: std::option::Option<std::string::String>,
5784 pub(crate) guide_sample_id: std::option::Option<std::string::String>,
5785 pub(crate) name: std::option::Option<std::string::String>,
5786 pub(crate) content: std::option::Option<std::string::String>,
5787 pub(crate) description: std::option::Option<std::string::String>,
5788 }
5789 impl Builder {
5790 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
5792 self.id = Some(input.into());
5793 self
5794 }
5795 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
5797 self.id = input;
5798 self
5799 }
5800 #[allow(missing_docs)] pub fn guide_sample_id(mut self, input: impl Into<std::string::String>) -> Self {
5802 self.guide_sample_id = Some(input.into());
5803 self
5804 }
5805 #[allow(missing_docs)] pub fn set_guide_sample_id(
5807 mut self,
5808 input: std::option::Option<std::string::String>,
5809 ) -> Self {
5810 self.guide_sample_id = input;
5811 self
5812 }
5813 #[allow(missing_docs)] pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
5815 self.name = Some(input.into());
5816 self
5817 }
5818 #[allow(missing_docs)] pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
5820 self.name = input;
5821 self
5822 }
5823 #[allow(missing_docs)] pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
5825 self.content = Some(input.into());
5826 self
5827 }
5828 #[allow(missing_docs)] pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
5830 self.content = input;
5831 self
5832 }
5833 #[allow(missing_docs)] pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
5835 self.description = Some(input.into());
5836 self
5837 }
5838 #[allow(missing_docs)] pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
5840 self.description = input;
5841 self
5842 }
5843 pub fn build(
5845 self,
5846 ) -> Result<
5847 crate::input::UpdateGuideSampleInput,
5848 aws_smithy_http::operation::error::BuildError,
5849 > {
5850 Ok(crate::input::UpdateGuideSampleInput {
5851 id: self.id,
5852 guide_sample_id: self.guide_sample_id,
5853 name: self.name,
5854 content: self.content,
5855 description: self.description,
5856 })
5857 }
5858 }
5859}
5860impl UpdateGuideSampleInput {
5861 #[allow(unused_mut)]
5863 #[allow(clippy::let_and_return)]
5864 #[allow(clippy::needless_borrow)]
5865 pub async fn make_operation(
5866 &self,
5867 _config: &crate::config::Config,
5868 ) -> std::result::Result<
5869 aws_smithy_http::operation::Operation<
5870 crate::operation::UpdateGuideSample,
5871 aws_http::retry::AwsResponseRetryClassifier,
5872 >,
5873 aws_smithy_http::operation::error::BuildError,
5874 > {
5875 let params_result = crate::endpoint::Params::builder()
5876 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
5877 .set_endpoint(_config.endpoint_url.clone())
5878 .set_stage(_config.stage.clone())
5879 .build()
5880 .map_err(|err| {
5881 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
5882 "could not construct endpoint parameters",
5883 err,
5884 )
5885 });
5886 let (endpoint_result, params) = match params_result {
5887 Ok(params) => (
5888 _config.endpoint_resolver.resolve_endpoint(¶ms),
5889 Some(params),
5890 ),
5891 Err(e) => (Err(e), None),
5892 };
5893 let mut request = {
5894 fn uri_base(
5895 _input: &crate::input::UpdateGuideSampleInput,
5896 output: &mut String,
5897 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
5898 let input_46 = &_input.id;
5899 let input_46 = input_46.as_ref().ok_or_else(|| {
5900 aws_smithy_http::operation::error::BuildError::missing_field(
5901 "id",
5902 "cannot be empty or unset",
5903 )
5904 })?;
5905 let id = aws_smithy_http::label::fmt_string(
5906 input_46,
5907 aws_smithy_http::label::EncodingStrategy::Default,
5908 );
5909 if id.is_empty() {
5910 return Err(
5911 aws_smithy_http::operation::error::BuildError::missing_field(
5912 "id",
5913 "cannot be empty or unset",
5914 ),
5915 );
5916 }
5917 let input_47 = &_input.guide_sample_id;
5918 let input_47 = input_47.as_ref().ok_or_else(|| {
5919 aws_smithy_http::operation::error::BuildError::missing_field(
5920 "guide_sample_id",
5921 "cannot be empty or unset",
5922 )
5923 })?;
5924 let guide_sample_id = aws_smithy_http::label::fmt_string(
5925 input_47,
5926 aws_smithy_http::label::EncodingStrategy::Default,
5927 );
5928 if guide_sample_id.is_empty() {
5929 return Err(
5930 aws_smithy_http::operation::error::BuildError::missing_field(
5931 "guide_sample_id",
5932 "cannot be empty or unset",
5933 ),
5934 );
5935 }
5936 write!(
5937 output,
5938 "/guides/{id}/samples/{guideSampleId}",
5939 id = id,
5940 guideSampleId = guide_sample_id
5941 )
5942 .expect("formatting should succeed");
5943 Ok(())
5944 }
5945 #[allow(clippy::unnecessary_wraps)]
5946 fn update_http_builder(
5947 input: &crate::input::UpdateGuideSampleInput,
5948 builder: http::request::Builder,
5949 ) -> std::result::Result<
5950 http::request::Builder,
5951 aws_smithy_http::operation::error::BuildError,
5952 > {
5953 let mut uri = String::new();
5954 uri_base(input, &mut uri)?;
5955 Ok(builder.method("PUT").uri(uri))
5956 }
5957 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
5958 builder = aws_smithy_http::header::set_request_header_if_absent(
5959 builder,
5960 http::header::CONTENT_TYPE,
5961 "application/json",
5962 );
5963 builder
5964 };
5965 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
5966 #[allow(clippy::useless_conversion)]
5967 let body = aws_smithy_http::body::SdkBody::from(
5968 crate::operation_ser::serialize_operation_crate_operation_update_guide_sample(&self)?,
5969 );
5970 if let Some(content_length) = body.content_length() {
5971 request = aws_smithy_http::header::set_request_header_if_absent(
5972 request,
5973 http::header::CONTENT_LENGTH,
5974 content_length,
5975 );
5976 }
5977 let request = request.body(body).expect("should be valid request");
5978 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
5979 if let Some(api_key_config) = _config.api_key() {
5980 request.properties_mut().insert(api_key_config.clone());
5981 let api_key = api_key_config.api_key();
5982 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
5983 "Authorization".to_owned(),
5984 Some("Key".to_owned()),
5985 );
5986 let name = auth_definition.name();
5987 let value = match auth_definition.scheme() {
5988 Some(value) => format!("{value} {api_key}"),
5989 None => api_key.to_owned(),
5990 };
5991 request.http_mut().headers_mut().insert(
5992 http::header::HeaderName::from_bytes(name.as_bytes())
5993 .expect("valid header name for api key auth"),
5994 http::header::HeaderValue::from_bytes(value.as_bytes())
5995 .expect("valid header value for api key auth"),
5996 );
5997 }
5998 request.properties_mut().insert(endpoint_result);
5999 if let Some(params) = params {
6000 request.properties_mut().insert(params);
6001 }
6002 request
6003 .properties_mut()
6004 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
6005 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
6006 aws_types::os_shim_internal::Env::real(),
6007 crate::API_METADATA.clone(),
6008 );
6009 if let Some(app_name) = _config.app_name() {
6010 user_agent = user_agent.with_app_name(app_name.clone());
6011 }
6012 request.properties_mut().insert(user_agent);
6013 if let Some(region) = &_config.region {
6014 request.properties_mut().insert(region.clone());
6015 }
6016 let op = aws_smithy_http::operation::Operation::new(
6017 request,
6018 crate::operation::UpdateGuideSample::new(),
6019 )
6020 .with_metadata(aws_smithy_http::operation::Metadata::new(
6021 "UpdateGuideSample",
6022 "guides",
6023 ));
6024 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
6025 Ok(op)
6026 }
6027 pub fn builder() -> crate::input::update_guide_sample_input::Builder {
6029 crate::input::update_guide_sample_input::Builder::default()
6030 }
6031}
6032
6033pub mod update_share_config_input {
6035
6036 #[non_exhaustive]
6038 #[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
6039 pub struct Builder {
6040 pub(crate) id: std::option::Option<std::string::String>,
6041 pub(crate) share_enabled: std::option::Option<bool>,
6042 }
6043 impl Builder {
6044 pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
6046 self.id = Some(input.into());
6047 self
6048 }
6049 pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
6051 self.id = input;
6052 self
6053 }
6054 #[allow(missing_docs)] pub fn share_enabled(mut self, input: bool) -> Self {
6056 self.share_enabled = Some(input);
6057 self
6058 }
6059 #[allow(missing_docs)] pub fn set_share_enabled(mut self, input: std::option::Option<bool>) -> Self {
6061 self.share_enabled = input;
6062 self
6063 }
6064 pub fn build(
6066 self,
6067 ) -> Result<
6068 crate::input::UpdateShareConfigInput,
6069 aws_smithy_http::operation::error::BuildError,
6070 > {
6071 Ok(crate::input::UpdateShareConfigInput {
6072 id: self.id,
6073 share_enabled: self.share_enabled,
6074 })
6075 }
6076 }
6077}
6078impl UpdateShareConfigInput {
6079 #[allow(unused_mut)]
6081 #[allow(clippy::let_and_return)]
6082 #[allow(clippy::needless_borrow)]
6083 pub async fn make_operation(
6084 &self,
6085 _config: &crate::config::Config,
6086 ) -> std::result::Result<
6087 aws_smithy_http::operation::Operation<
6088 crate::operation::UpdateShareConfig,
6089 aws_http::retry::AwsResponseRetryClassifier,
6090 >,
6091 aws_smithy_http::operation::error::BuildError,
6092 > {
6093 let params_result = crate::endpoint::Params::builder()
6094 .set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
6095 .set_endpoint(_config.endpoint_url.clone())
6096 .set_stage(_config.stage.clone())
6097 .build()
6098 .map_err(|err| {
6099 aws_smithy_http::endpoint::ResolveEndpointError::from_source(
6100 "could not construct endpoint parameters",
6101 err,
6102 )
6103 });
6104 let (endpoint_result, params) = match params_result {
6105 Ok(params) => (
6106 _config.endpoint_resolver.resolve_endpoint(¶ms),
6107 Some(params),
6108 ),
6109 Err(e) => (Err(e), None),
6110 };
6111 let mut request = {
6112 fn uri_base(
6113 _input: &crate::input::UpdateShareConfigInput,
6114 output: &mut String,
6115 ) -> Result<(), aws_smithy_http::operation::error::BuildError> {
6116 let input_48 = &_input.id;
6117 let input_48 = input_48.as_ref().ok_or_else(|| {
6118 aws_smithy_http::operation::error::BuildError::missing_field(
6119 "id",
6120 "cannot be empty or unset",
6121 )
6122 })?;
6123 let id = aws_smithy_http::label::fmt_string(
6124 input_48,
6125 aws_smithy_http::label::EncodingStrategy::Default,
6126 );
6127 if id.is_empty() {
6128 return Err(
6129 aws_smithy_http::operation::error::BuildError::missing_field(
6130 "id",
6131 "cannot be empty or unset",
6132 ),
6133 );
6134 }
6135 write!(output, "/guides/{id}/share-config", id = id)
6136 .expect("formatting should succeed");
6137 Ok(())
6138 }
6139 #[allow(clippy::unnecessary_wraps)]
6140 fn update_http_builder(
6141 input: &crate::input::UpdateShareConfigInput,
6142 builder: http::request::Builder,
6143 ) -> std::result::Result<
6144 http::request::Builder,
6145 aws_smithy_http::operation::error::BuildError,
6146 > {
6147 let mut uri = String::new();
6148 uri_base(input, &mut uri)?;
6149 Ok(builder.method("PUT").uri(uri))
6150 }
6151 let mut builder = update_http_builder(&self, http::request::Builder::new())?;
6152 builder = aws_smithy_http::header::set_request_header_if_absent(
6153 builder,
6154 http::header::CONTENT_TYPE,
6155 "application/json",
6156 );
6157 builder
6158 };
6159 let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
6160 #[allow(clippy::useless_conversion)]
6161 let body = aws_smithy_http::body::SdkBody::from(
6162 crate::operation_ser::serialize_operation_crate_operation_update_share_config(&self)?,
6163 );
6164 if let Some(content_length) = body.content_length() {
6165 request = aws_smithy_http::header::set_request_header_if_absent(
6166 request,
6167 http::header::CONTENT_LENGTH,
6168 content_length,
6169 );
6170 }
6171 let request = request.body(body).expect("should be valid request");
6172 let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
6173 if let Some(api_key_config) = _config.api_key() {
6174 request.properties_mut().insert(api_key_config.clone());
6175 let api_key = api_key_config.api_key();
6176 let auth_definition = aws_smithy_http_auth::definition::HttpAuthDefinition::header(
6177 "Authorization".to_owned(),
6178 Some("Key".to_owned()),
6179 );
6180 let name = auth_definition.name();
6181 let value = match auth_definition.scheme() {
6182 Some(value) => format!("{value} {api_key}"),
6183 None => api_key.to_owned(),
6184 };
6185 request.http_mut().headers_mut().insert(
6186 http::header::HeaderName::from_bytes(name.as_bytes())
6187 .expect("valid header name for api key auth"),
6188 http::header::HeaderValue::from_bytes(value.as_bytes())
6189 .expect("valid header value for api key auth"),
6190 );
6191 }
6192 request.properties_mut().insert(endpoint_result);
6193 if let Some(params) = params {
6194 request.properties_mut().insert(params);
6195 }
6196 request
6197 .properties_mut()
6198 .insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
6199 let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
6200 aws_types::os_shim_internal::Env::real(),
6201 crate::API_METADATA.clone(),
6202 );
6203 if let Some(app_name) = _config.app_name() {
6204 user_agent = user_agent.with_app_name(app_name.clone());
6205 }
6206 request.properties_mut().insert(user_agent);
6207 if let Some(region) = &_config.region {
6208 request.properties_mut().insert(region.clone());
6209 }
6210 let op = aws_smithy_http::operation::Operation::new(
6211 request,
6212 crate::operation::UpdateShareConfig::new(),
6213 )
6214 .with_metadata(aws_smithy_http::operation::Metadata::new(
6215 "UpdateShareConfig",
6216 "guides",
6217 ));
6218 let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
6219 Ok(op)
6220 }
6221 pub fn builder() -> crate::input::update_share_config_input::Builder {
6223 crate::input::update_share_config_input::Builder::default()
6224 }
6225}
6226
6227#[allow(missing_docs)] #[non_exhaustive]
6229#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6230pub struct UpdateShareConfigInput {
6231 #[doc(hidden)]
6233 pub id: std::option::Option<std::string::String>,
6234 #[allow(missing_docs)] #[doc(hidden)]
6236 pub share_enabled: std::option::Option<bool>,
6237}
6238impl UpdateShareConfigInput {
6239 pub fn id(&self) -> std::option::Option<&str> {
6241 self.id.as_deref()
6242 }
6243 #[allow(missing_docs)] pub fn share_enabled(&self) -> std::option::Option<bool> {
6245 self.share_enabled
6246 }
6247}
6248
6249#[allow(missing_docs)] #[non_exhaustive]
6251#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6252pub struct ListPublicSharedGuideSamplesInput {
6253 #[doc(hidden)]
6255 pub id: std::option::Option<std::string::String>,
6256}
6257impl ListPublicSharedGuideSamplesInput {
6258 pub fn id(&self) -> std::option::Option<&str> {
6260 self.id.as_deref()
6261 }
6262}
6263
6264#[allow(missing_docs)] #[non_exhaustive]
6266#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6267pub struct ListPublicSharedGuideAttachmentsInput {
6268 #[doc(hidden)]
6270 pub id: std::option::Option<std::string::String>,
6271}
6272impl ListPublicSharedGuideAttachmentsInput {
6273 pub fn id(&self) -> std::option::Option<&str> {
6275 self.id.as_deref()
6276 }
6277}
6278
6279#[allow(missing_docs)] #[non_exhaustive]
6281#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6282pub struct GetPublicSharedGuideInput {
6283 #[allow(missing_docs)] #[doc(hidden)]
6285 pub id: std::option::Option<std::string::String>,
6286 #[allow(missing_docs)] #[doc(hidden)]
6288 pub output_format: std::option::Option<crate::model::OutputFormat>,
6289}
6290impl GetPublicSharedGuideInput {
6291 #[allow(missing_docs)] pub fn id(&self) -> std::option::Option<&str> {
6293 self.id.as_deref()
6294 }
6295 #[allow(missing_docs)] pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
6297 self.output_format.as_ref()
6298 }
6299}
6300
6301#[allow(missing_docs)] #[non_exhaustive]
6303#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6304pub struct ListPublicGuidesInput {
6305 #[allow(missing_docs)] #[doc(hidden)]
6307 pub slug: std::option::Option<std::string::String>,
6308 #[doc(hidden)]
6310 pub next_page_token: std::option::Option<std::string::String>,
6311 #[doc(hidden)]
6313 pub page_size: std::option::Option<i32>,
6314}
6315impl ListPublicGuidesInput {
6316 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6318 self.slug.as_deref()
6319 }
6320 pub fn next_page_token(&self) -> std::option::Option<&str> {
6322 self.next_page_token.as_deref()
6323 }
6324 pub fn page_size(&self) -> std::option::Option<i32> {
6326 self.page_size
6327 }
6328}
6329
6330#[allow(missing_docs)] #[non_exhaustive]
6332#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6333pub struct GetPublicGuideInput {
6334 #[allow(missing_docs)] #[doc(hidden)]
6336 pub slug: std::option::Option<std::string::String>,
6337 #[doc(hidden)]
6339 pub id: std::option::Option<std::string::String>,
6340 #[allow(missing_docs)] #[doc(hidden)]
6342 pub output_format: std::option::Option<crate::model::OutputFormat>,
6343}
6344impl GetPublicGuideInput {
6345 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6347 self.slug.as_deref()
6348 }
6349 pub fn id(&self) -> std::option::Option<&str> {
6351 self.id.as_deref()
6352 }
6353 #[allow(missing_docs)] pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
6355 self.output_format.as_ref()
6356 }
6357}
6358
6359#[allow(missing_docs)] #[non_exhaustive]
6361#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6362pub struct ListPublicGuideSamplesInput {
6363 #[allow(missing_docs)] #[doc(hidden)]
6365 pub slug: std::option::Option<std::string::String>,
6366 #[doc(hidden)]
6368 pub id: std::option::Option<std::string::String>,
6369}
6370impl ListPublicGuideSamplesInput {
6371 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6373 self.slug.as_deref()
6374 }
6375 pub fn id(&self) -> std::option::Option<&str> {
6377 self.id.as_deref()
6378 }
6379}
6380
6381#[allow(missing_docs)] #[non_exhaustive]
6383#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6384pub struct ListPublicGuideAttachmentsInput {
6385 #[allow(missing_docs)] #[doc(hidden)]
6387 pub slug: std::option::Option<std::string::String>,
6388 #[doc(hidden)]
6390 pub id: std::option::Option<std::string::String>,
6391}
6392impl ListPublicGuideAttachmentsInput {
6393 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6395 self.slug.as_deref()
6396 }
6397 pub fn id(&self) -> std::option::Option<&str> {
6399 self.id.as_deref()
6400 }
6401}
6402
6403#[allow(missing_docs)] #[non_exhaustive]
6405#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6406pub struct GetPublicAccountConfigInput {
6407 #[allow(missing_docs)] #[doc(hidden)]
6409 pub slug: std::option::Option<std::string::String>,
6410}
6411impl GetPublicAccountConfigInput {
6412 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6414 self.slug.as_deref()
6415 }
6416}
6417
6418#[allow(missing_docs)] #[non_exhaustive]
6420#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6421pub struct GetGuidesNetworkInput {
6422 #[allow(missing_docs)] #[doc(hidden)]
6424 pub slug: std::option::Option<std::string::String>,
6425 #[allow(missing_docs)] #[doc(hidden)]
6427 pub guide_id: std::option::Option<std::string::String>,
6428}
6429impl GetGuidesNetworkInput {
6430 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6432 self.slug.as_deref()
6433 }
6434 #[allow(missing_docs)] pub fn guide_id(&self) -> std::option::Option<&str> {
6436 self.guide_id.as_deref()
6437 }
6438}
6439
6440#[allow(missing_docs)] #[non_exhaustive]
6442#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6443pub struct RevertGuideInput {
6444 #[doc(hidden)]
6446 pub id: std::option::Option<std::string::String>,
6447 #[allow(missing_docs)] #[doc(hidden)]
6449 pub output_format: std::option::Option<crate::model::OutputFormat>,
6450}
6451impl RevertGuideInput {
6452 pub fn id(&self) -> std::option::Option<&str> {
6454 self.id.as_deref()
6455 }
6456 #[allow(missing_docs)] pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
6458 self.output_format.as_ref()
6459 }
6460}
6461
6462#[allow(missing_docs)] #[non_exhaustive]
6464#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6465pub struct PublishGuideInput {
6466 #[doc(hidden)]
6468 pub id: std::option::Option<std::string::String>,
6469 #[allow(missing_docs)] #[doc(hidden)]
6471 pub output_format: std::option::Option<crate::model::OutputFormat>,
6472}
6473impl PublishGuideInput {
6474 pub fn id(&self) -> std::option::Option<&str> {
6476 self.id.as_deref()
6477 }
6478 #[allow(missing_docs)] pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
6480 self.output_format.as_ref()
6481 }
6482}
6483
6484#[allow(missing_docs)] #[non_exhaustive]
6486#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6487pub struct ChangeGuideVisibilityInput {
6488 #[allow(missing_docs)] #[doc(hidden)]
6490 pub id: std::option::Option<std::string::String>,
6491 #[allow(missing_docs)] #[doc(hidden)]
6493 pub visibility: std::option::Option<crate::model::GuideVisibility>,
6494}
6495impl ChangeGuideVisibilityInput {
6496 #[allow(missing_docs)] pub fn id(&self) -> std::option::Option<&str> {
6498 self.id.as_deref()
6499 }
6500 #[allow(missing_docs)] pub fn visibility(&self) -> std::option::Option<&crate::model::GuideVisibility> {
6502 self.visibility.as_ref()
6503 }
6504}
6505
6506#[allow(missing_docs)] #[non_exhaustive]
6508#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6509pub struct ListGuidesInput {
6510 #[allow(missing_docs)] #[doc(hidden)]
6512 pub status: std::option::Option<crate::model::GuideStatus>,
6513 #[doc(hidden)]
6515 pub next_page_token: std::option::Option<std::string::String>,
6516 #[doc(hidden)]
6518 pub page_size: std::option::Option<i32>,
6519}
6520impl ListGuidesInput {
6521 #[allow(missing_docs)] pub fn status(&self) -> std::option::Option<&crate::model::GuideStatus> {
6523 self.status.as_ref()
6524 }
6525 pub fn next_page_token(&self) -> std::option::Option<&str> {
6527 self.next_page_token.as_deref()
6528 }
6529 pub fn page_size(&self) -> std::option::Option<i32> {
6531 self.page_size
6532 }
6533}
6534
6535#[allow(missing_docs)] #[non_exhaustive]
6537#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6538pub struct CreateGuideInput {
6539 #[allow(missing_docs)] #[doc(hidden)]
6541 pub name: std::option::Option<std::string::String>,
6542 #[allow(missing_docs)] #[doc(hidden)]
6544 pub target: std::option::Option<crate::model::GuideTarget>,
6545 #[allow(missing_docs)] #[doc(hidden)]
6547 pub definition: std::option::Option<aws_smithy_types::Document>,
6548 #[allow(missing_docs)] #[doc(hidden)]
6550 pub x12_envelope: std::option::Option<std::string::String>,
6551 #[allow(missing_docs)] #[doc(hidden)]
6553 pub output_format: std::option::Option<crate::model::OutputFormat>,
6554 #[allow(missing_docs)] #[doc(hidden)]
6556 pub samples: std::option::Option<std::vec::Vec<crate::model::CreateGuideSampleData>>,
6557 #[allow(missing_docs)] #[doc(hidden)]
6559 pub attachments: std::option::Option<std::vec::Vec<crate::model::CreateGuideAttachmentData>>,
6560 #[doc(hidden)]
6562 pub source_guide: std::option::Option<std::string::String>,
6563}
6564impl CreateGuideInput {
6565 #[allow(missing_docs)] pub fn name(&self) -> std::option::Option<&str> {
6567 self.name.as_deref()
6568 }
6569 #[allow(missing_docs)] pub fn target(&self) -> std::option::Option<&crate::model::GuideTarget> {
6571 self.target.as_ref()
6572 }
6573 #[allow(missing_docs)] pub fn definition(&self) -> std::option::Option<&aws_smithy_types::Document> {
6575 self.definition.as_ref()
6576 }
6577 #[allow(missing_docs)] pub fn x12_envelope(&self) -> std::option::Option<&str> {
6579 self.x12_envelope.as_deref()
6580 }
6581 #[allow(missing_docs)] pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
6583 self.output_format.as_ref()
6584 }
6585 #[allow(missing_docs)] pub fn samples(&self) -> std::option::Option<&[crate::model::CreateGuideSampleData]> {
6587 self.samples.as_deref()
6588 }
6589 #[allow(missing_docs)] pub fn attachments(&self) -> std::option::Option<&[crate::model::CreateGuideAttachmentData]> {
6591 self.attachments.as_deref()
6592 }
6593 pub fn source_guide(&self) -> std::option::Option<&str> {
6595 self.source_guide.as_deref()
6596 }
6597}
6598
6599#[allow(missing_docs)] #[non_exhaustive]
6601#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6602pub struct DeleteGuideInput {
6603 #[allow(missing_docs)] #[doc(hidden)]
6605 pub id: std::option::Option<std::string::String>,
6606}
6607impl DeleteGuideInput {
6608 #[allow(missing_docs)] pub fn id(&self) -> std::option::Option<&str> {
6610 self.id.as_deref()
6611 }
6612}
6613
6614#[allow(missing_docs)] #[non_exhaustive]
6616#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6617pub struct UpdateGuideInput {
6618 #[doc(hidden)]
6620 pub id: std::option::Option<std::string::String>,
6621 #[allow(missing_docs)] #[doc(hidden)]
6623 pub name: std::option::Option<std::string::String>,
6624 #[allow(missing_docs)] #[doc(hidden)]
6626 pub definition: std::option::Option<aws_smithy_types::Document>,
6627 #[allow(missing_docs)] #[doc(hidden)]
6629 pub x12_envelope: std::option::Option<std::string::String>,
6630}
6631impl UpdateGuideInput {
6632 pub fn id(&self) -> std::option::Option<&str> {
6634 self.id.as_deref()
6635 }
6636 #[allow(missing_docs)] pub fn name(&self) -> std::option::Option<&str> {
6638 self.name.as_deref()
6639 }
6640 #[allow(missing_docs)] pub fn definition(&self) -> std::option::Option<&aws_smithy_types::Document> {
6642 self.definition.as_ref()
6643 }
6644 #[allow(missing_docs)] pub fn x12_envelope(&self) -> std::option::Option<&str> {
6646 self.x12_envelope.as_deref()
6647 }
6648}
6649
6650#[allow(missing_docs)] #[non_exhaustive]
6652#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6653pub struct GetGuideInput {
6654 #[allow(missing_docs)] #[doc(hidden)]
6656 pub id: std::option::Option<std::string::String>,
6657 #[allow(missing_docs)] #[doc(hidden)]
6659 pub output_format: std::option::Option<crate::model::OutputFormat>,
6660}
6661impl GetGuideInput {
6662 #[allow(missing_docs)] pub fn id(&self) -> std::option::Option<&str> {
6664 self.id.as_deref()
6665 }
6666 #[allow(missing_docs)] pub fn output_format(&self) -> std::option::Option<&crate::model::OutputFormat> {
6668 self.output_format.as_ref()
6669 }
6670}
6671
6672#[allow(missing_docs)] #[non_exhaustive]
6674#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6675pub struct ListGuideSamplesInput {
6676 #[doc(hidden)]
6678 pub id: std::option::Option<std::string::String>,
6679}
6680impl ListGuideSamplesInput {
6681 pub fn id(&self) -> std::option::Option<&str> {
6683 self.id.as_deref()
6684 }
6685}
6686
6687#[allow(missing_docs)] #[non_exhaustive]
6689#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6690pub struct CreateGuideSampleInput {
6691 #[doc(hidden)]
6693 pub id: std::option::Option<std::string::String>,
6694 #[allow(missing_docs)] #[doc(hidden)]
6696 pub name: std::option::Option<std::string::String>,
6697 #[allow(missing_docs)] #[doc(hidden)]
6699 pub content: std::option::Option<std::string::String>,
6700 #[allow(missing_docs)] #[doc(hidden)]
6702 pub description: std::option::Option<std::string::String>,
6703}
6704impl CreateGuideSampleInput {
6705 pub fn id(&self) -> std::option::Option<&str> {
6707 self.id.as_deref()
6708 }
6709 #[allow(missing_docs)] pub fn name(&self) -> std::option::Option<&str> {
6711 self.name.as_deref()
6712 }
6713 #[allow(missing_docs)] pub fn content(&self) -> std::option::Option<&str> {
6715 self.content.as_deref()
6716 }
6717 #[allow(missing_docs)] pub fn description(&self) -> std::option::Option<&str> {
6719 self.description.as_deref()
6720 }
6721}
6722
6723#[allow(missing_docs)] #[non_exhaustive]
6725#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6726pub struct DeleteGuideSampleInput {
6727 #[doc(hidden)]
6729 pub id: std::option::Option<std::string::String>,
6730 #[allow(missing_docs)] #[doc(hidden)]
6732 pub guide_sample_id: std::option::Option<std::string::String>,
6733}
6734impl DeleteGuideSampleInput {
6735 pub fn id(&self) -> std::option::Option<&str> {
6737 self.id.as_deref()
6738 }
6739 #[allow(missing_docs)] pub fn guide_sample_id(&self) -> std::option::Option<&str> {
6741 self.guide_sample_id.as_deref()
6742 }
6743}
6744
6745#[allow(missing_docs)] #[non_exhaustive]
6747#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6748pub struct UpdateGuideSampleInput {
6749 #[doc(hidden)]
6751 pub id: std::option::Option<std::string::String>,
6752 #[allow(missing_docs)] #[doc(hidden)]
6754 pub guide_sample_id: std::option::Option<std::string::String>,
6755 #[allow(missing_docs)] #[doc(hidden)]
6757 pub name: std::option::Option<std::string::String>,
6758 #[allow(missing_docs)] #[doc(hidden)]
6760 pub content: std::option::Option<std::string::String>,
6761 #[allow(missing_docs)] #[doc(hidden)]
6763 pub description: std::option::Option<std::string::String>,
6764}
6765impl UpdateGuideSampleInput {
6766 pub fn id(&self) -> std::option::Option<&str> {
6768 self.id.as_deref()
6769 }
6770 #[allow(missing_docs)] pub fn guide_sample_id(&self) -> std::option::Option<&str> {
6772 self.guide_sample_id.as_deref()
6773 }
6774 #[allow(missing_docs)] pub fn name(&self) -> std::option::Option<&str> {
6776 self.name.as_deref()
6777 }
6778 #[allow(missing_docs)] pub fn content(&self) -> std::option::Option<&str> {
6780 self.content.as_deref()
6781 }
6782 #[allow(missing_docs)] pub fn description(&self) -> std::option::Option<&str> {
6784 self.description.as_deref()
6785 }
6786}
6787
6788#[allow(missing_docs)] #[non_exhaustive]
6790#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6791pub struct ListGuideAttachmentsInput {
6792 #[doc(hidden)]
6794 pub id: std::option::Option<std::string::String>,
6795}
6796impl ListGuideAttachmentsInput {
6797 pub fn id(&self) -> std::option::Option<&str> {
6799 self.id.as_deref()
6800 }
6801}
6802
6803#[allow(missing_docs)] #[non_exhaustive]
6805#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6806pub struct CreateGuideAttachmentInput {
6807 #[doc(hidden)]
6809 pub id: std::option::Option<std::string::String>,
6810 #[allow(missing_docs)] #[doc(hidden)]
6812 pub name: std::option::Option<std::string::String>,
6813 #[allow(missing_docs)] #[doc(hidden)]
6815 pub filename: std::option::Option<std::string::String>,
6816 #[allow(missing_docs)] #[doc(hidden)]
6818 pub visibility: std::option::Option<crate::model::AttachmentVisibility>,
6819 #[allow(missing_docs)] #[doc(hidden)]
6821 pub content: std::option::Option<aws_smithy_types::Blob>,
6822}
6823impl CreateGuideAttachmentInput {
6824 pub fn id(&self) -> std::option::Option<&str> {
6826 self.id.as_deref()
6827 }
6828 #[allow(missing_docs)] pub fn name(&self) -> std::option::Option<&str> {
6830 self.name.as_deref()
6831 }
6832 #[allow(missing_docs)] pub fn filename(&self) -> std::option::Option<&str> {
6834 self.filename.as_deref()
6835 }
6836 #[allow(missing_docs)] pub fn visibility(&self) -> std::option::Option<&crate::model::AttachmentVisibility> {
6838 self.visibility.as_ref()
6839 }
6840 #[allow(missing_docs)] pub fn content(&self) -> std::option::Option<&aws_smithy_types::Blob> {
6842 self.content.as_ref()
6843 }
6844}
6845
6846#[allow(missing_docs)] #[non_exhaustive]
6848#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6849pub struct DeleteGuideAttachmentInput {
6850 #[doc(hidden)]
6852 pub id: std::option::Option<std::string::String>,
6853 #[allow(missing_docs)] #[doc(hidden)]
6855 pub guide_attachment_id: std::option::Option<std::string::String>,
6856}
6857impl DeleteGuideAttachmentInput {
6858 pub fn id(&self) -> std::option::Option<&str> {
6860 self.id.as_deref()
6861 }
6862 #[allow(missing_docs)] pub fn guide_attachment_id(&self) -> std::option::Option<&str> {
6864 self.guide_attachment_id.as_deref()
6865 }
6866}
6867
6868#[allow(missing_docs)] #[non_exhaustive]
6870#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6871pub struct UpdateGuideAttachmentInput {
6872 #[doc(hidden)]
6874 pub id: std::option::Option<std::string::String>,
6875 #[allow(missing_docs)] #[doc(hidden)]
6877 pub guide_attachment_id: std::option::Option<std::string::String>,
6878 #[allow(missing_docs)] #[doc(hidden)]
6880 pub name: std::option::Option<std::string::String>,
6881 #[allow(missing_docs)] #[doc(hidden)]
6883 pub filename: std::option::Option<std::string::String>,
6884 #[allow(missing_docs)] #[doc(hidden)]
6886 pub visibility: std::option::Option<crate::model::AttachmentVisibility>,
6887 #[allow(missing_docs)] #[doc(hidden)]
6889 pub content: std::option::Option<aws_smithy_types::Blob>,
6890}
6891impl UpdateGuideAttachmentInput {
6892 pub fn id(&self) -> std::option::Option<&str> {
6894 self.id.as_deref()
6895 }
6896 #[allow(missing_docs)] pub fn guide_attachment_id(&self) -> std::option::Option<&str> {
6898 self.guide_attachment_id.as_deref()
6899 }
6900 #[allow(missing_docs)] pub fn name(&self) -> std::option::Option<&str> {
6902 self.name.as_deref()
6903 }
6904 #[allow(missing_docs)] pub fn filename(&self) -> std::option::Option<&str> {
6906 self.filename.as_deref()
6907 }
6908 #[allow(missing_docs)] pub fn visibility(&self) -> std::option::Option<&crate::model::AttachmentVisibility> {
6910 self.visibility.as_ref()
6911 }
6912 #[allow(missing_docs)] pub fn content(&self) -> std::option::Option<&aws_smithy_types::Blob> {
6914 self.content.as_ref()
6915 }
6916}
6917
6918#[allow(missing_docs)] #[non_exhaustive]
6920#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6921pub struct UpdateAccountConfigInput {
6922 #[doc(hidden)]
6924 pub logo_url: std::option::Option<std::string::String>,
6925 #[doc(hidden)]
6927 pub logo_data: std::option::Option<std::string::String>,
6928 #[allow(missing_docs)] #[doc(hidden)]
6930 pub link_text: std::option::Option<std::string::String>,
6931 #[allow(missing_docs)] #[doc(hidden)]
6933 pub link_url: std::option::Option<std::string::String>,
6934 #[allow(missing_docs)] #[doc(hidden)]
6936 pub slug: std::option::Option<std::string::String>,
6937 #[allow(missing_docs)] #[doc(hidden)]
6939 pub display_name: std::option::Option<std::string::String>,
6940}
6941impl UpdateAccountConfigInput {
6942 pub fn logo_url(&self) -> std::option::Option<&str> {
6944 self.logo_url.as_deref()
6945 }
6946 pub fn logo_data(&self) -> std::option::Option<&str> {
6948 self.logo_data.as_deref()
6949 }
6950 #[allow(missing_docs)] pub fn link_text(&self) -> std::option::Option<&str> {
6952 self.link_text.as_deref()
6953 }
6954 #[allow(missing_docs)] pub fn link_url(&self) -> std::option::Option<&str> {
6956 self.link_url.as_deref()
6957 }
6958 #[allow(missing_docs)] pub fn slug(&self) -> std::option::Option<&str> {
6960 self.slug.as_deref()
6961 }
6962 #[allow(missing_docs)] pub fn display_name(&self) -> std::option::Option<&str> {
6964 self.display_name.as_deref()
6965 }
6966}
6967
6968#[allow(missing_docs)] #[non_exhaustive]
6970#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6971pub struct GetAccountConfigInput {}
6972
6973#[allow(missing_docs)] #[non_exhaustive]
6975#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6976pub struct ListX12TransactionSetsInput {
6977 #[allow(missing_docs)] #[doc(hidden)]
6979 pub version: std::option::Option<std::string::String>,
6980}
6981impl ListX12TransactionSetsInput {
6982 #[allow(missing_docs)] pub fn version(&self) -> std::option::Option<&str> {
6984 self.version.as_deref()
6985 }
6986}
6987
6988#[allow(missing_docs)] #[non_exhaustive]
6990#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
6991pub struct ListAllPublicGuidesInput {
6992 #[doc(hidden)]
6994 pub next_page_token: std::option::Option<std::string::String>,
6995 #[doc(hidden)]
6997 pub page_size: std::option::Option<i32>,
6998}
6999impl ListAllPublicGuidesInput {
7000 pub fn next_page_token(&self) -> std::option::Option<&str> {
7002 self.next_page_token.as_deref()
7003 }
7004 pub fn page_size(&self) -> std::option::Option<i32> {
7006 self.page_size
7007 }
7008}
7009
7010#[allow(missing_docs)] #[non_exhaustive]
7012#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
7013pub struct GetX12TransactionSetMetadataInput {
7014 #[allow(missing_docs)] #[doc(hidden)]
7016 pub version: std::option::Option<std::string::String>,
7017 #[allow(missing_docs)] #[doc(hidden)]
7019 pub transaction_set_id: std::option::Option<std::string::String>,
7020}
7021impl GetX12TransactionSetMetadataInput {
7022 #[allow(missing_docs)] pub fn version(&self) -> std::option::Option<&str> {
7024 self.version.as_deref()
7025 }
7026 #[allow(missing_docs)] pub fn transaction_set_id(&self) -> std::option::Option<&str> {
7028 self.transaction_set_id.as_deref()
7029 }
7030}