1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 2 | #[allow(missing_docs)] // documentation missing in model
|
3 3 | #[non_exhaustive]
|
4 4 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
5 5 | pub struct EndpointWithHostLabelHeaderOperationInput {
|
6 6 | #[allow(missing_docs)] // documentation missing in model
|
7 7 | pub account_id: ::std::option::Option<::std::string::String>,
|
8 8 | }
|
9 9 | impl EndpointWithHostLabelHeaderOperationInput {
|
10 10 | #[allow(missing_docs)] // documentation missing in model
|
11 11 | pub fn account_id(&self) -> ::std::option::Option<&str> {
|
12 12 | self.account_id.as_deref()
|
13 13 | }
|
14 14 | }
|
15 15 | static ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
16 16 | "aws.protocoltests.restxml.synthetic#EndpointWithHostLabelHeaderOperationInput",
|
17 17 | "aws.protocoltests.restxml.synthetic",
|
18 18 | "EndpointWithHostLabelHeaderOperationInput",
|
19 19 | );
|
20 20 | static ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_MEMBER_ACCOUNT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
21 21 | ::aws_smithy_schema::ShapeId::from_static(
|
22 22 | "aws.protocoltests.restxml.synthetic#EndpointWithHostLabelHeaderOperationInput$accountId",
|
23 23 | "aws.protocoltests.restxml.synthetic",
|
24 24 | "EndpointWithHostLabelHeaderOperationInput",
|
25 25 | ),
|
26 26 | ::aws_smithy_schema::ShapeType::String,
|
27 - | "account_id",
|
27 + | "accountId",
|
28 28 | 0,
|
29 29 | )
|
30 30 | .with_host_label()
|
31 31 | .with_http_header("X-Amz-Account-Id");
|
32 32 | static ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
33 33 | ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA_ID,
|
34 34 | ::aws_smithy_schema::ShapeType::Structure,
|
35 35 | &[&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_MEMBER_ACCOUNT_ID],
|
36 - | );
|
36 + | )
|
37 + | .with_http(aws_smithy_schema::traits::HttpTrait::new(
|
38 + | "POST",
|
39 + | "/EndpointWithHostLabelHeaderOperation",
|
40 + | None,
|
41 + | ));
|
37 42 | impl EndpointWithHostLabelHeaderOperationInput {
|
38 43 | /// The schema for this shape.
|
39 44 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA;
|
40 45 | }
|
41 46 | impl ::aws_smithy_schema::serde::SerializableStruct for EndpointWithHostLabelHeaderOperationInput {
|
42 47 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
43 48 | fn serialize_members(
|
44 49 | &self,
|
45 50 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
46 51 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
47 52 | if let Some(ref val) = self.account_id {
|
48 53 | ser.write_string(&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_MEMBER_ACCOUNT_ID, val)?;
|
49 54 | }
|
50 55 | Ok(())
|
51 56 | }
|
52 57 | }
|
53 58 | impl EndpointWithHostLabelHeaderOperationInput {
|
54 59 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
55 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
56 - | deserializer: &mut D,
|
60 + | pub fn deserialize(
|
61 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
57 62 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
58 63 | #[allow(unused_variables, unused_mut)]
|
59 64 | let mut builder = Self::builder();
|
60 65 | #[allow(
|
61 66 | unused_variables,
|
62 67 | unreachable_code,
|
63 68 | clippy::single_match,
|
64 69 | clippy::match_single_binding,
|
65 70 | clippy::diverging_sub_expression
|
66 71 | )]
|
67 - | deserializer.read_struct(&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA, (), |_, member, deser| {
|
72 + | deserializer.read_struct(&ENDPOINTWITHHOSTLABELHEADEROPERATIONINPUT_SCHEMA, &mut |member, deser| {
|
68 73 | match member.member_index() {
|
69 74 | Some(0) => {
|
70 75 | builder.account_id = Some(deser.read_string(member)?);
|
71 76 | }
|
72 77 | _ => {}
|
73 78 | }
|
74 79 | Ok(())
|
75 80 | })?;
|
81 + | builder.account_id = builder.account_id.or(Some(String::new()));
|
82 + | builder
|
83 + | .build()
|
84 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
85 + | }
|
86 + | }
|
87 + | impl EndpointWithHostLabelHeaderOperationInput {
|
88 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
89 + | /// Header-bound members are read directly from headers, avoiding runtime
|
90 + | /// member iteration overhead. Body members are read via the deserializer.
|
91 + | pub fn deserialize_with_response(
|
92 + | _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
93 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
94 + | _status: u16,
|
95 + | _body: &[u8],
|
96 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
97 + | #[allow(unused_variables, unused_mut)]
|
98 + | let mut builder = Self::builder();
|
99 + | if let Some(val) = headers.get("X-Amz-Account-Id") {
|
100 + | builder.account_id = Some(val.to_string());
|
101 + | }
|
76 102 | builder
|
77 103 | .build()
|
78 104 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
79 105 | }
|
80 106 | }
|
81 107 | impl EndpointWithHostLabelHeaderOperationInput {
|
82 108 | /// Creates a new builder-style object to manufacture [`EndpointWithHostLabelHeaderOperationInput`](crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationInput).
|
83 109 | pub fn builder() -> crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder {
|
84 110 | crate::operation::endpoint_with_host_label_header_operation::builders::EndpointWithHostLabelHeaderOperationInputBuilder::default()
|
85 111 | }
|
86 112 | }
|
87 113 |
|
88 114 | /// A builder for [`EndpointWithHostLabelHeaderOperationInput`](crate::operation::endpoint_with_host_label_header_operation::EndpointWithHostLabelHeaderOperationInput).
|
89 115 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
90 116 | #[non_exhaustive]
|
91 117 | pub struct EndpointWithHostLabelHeaderOperationInputBuilder {
|
92 118 | pub(crate) account_id: ::std::option::Option<::std::string::String>,
|
93 119 | }
|
94 120 | impl EndpointWithHostLabelHeaderOperationInputBuilder {
|
95 121 | #[allow(missing_docs)] // documentation missing in model
|
96 122 | /// This field is required.
|
97 123 | pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
98 124 | self.account_id = ::std::option::Option::Some(input.into());
|
99 125 | self
|
100 126 | }
|
101 127 | #[allow(missing_docs)] // documentation missing in model
|
102 128 | pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
103 129 | self.account_id = input;
|
104 130 | self
|
105 131 | }
|