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 ComplexNestedErrorData {
|
6 6 | #[allow(missing_docs)] // documentation missing in model
|
7 7 | pub foo: ::std::option::Option<::std::string::String>,
|
8 8 | }
|
9 9 | impl ComplexNestedErrorData {
|
10 10 | #[allow(missing_docs)] // documentation missing in model
|
11 11 | pub fn foo(&self) -> ::std::option::Option<&str> {
|
12 12 | self.foo.as_deref()
|
13 13 | }
|
14 14 | }
|
15 15 | static COMPLEXNESTEDERRORDATA_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
16 16 | "aws.protocoltests.json#ComplexNestedErrorData",
|
17 17 | "aws.protocoltests.json",
|
18 18 | "ComplexNestedErrorData",
|
19 19 | );
|
20 20 | static COMPLEXNESTEDERRORDATA_MEMBER_FOO: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
21 21 | ::aws_smithy_schema::ShapeId::from_static(
|
22 22 | "aws.protocoltests.json#ComplexNestedErrorData$Foo",
|
23 23 | "aws.protocoltests.json",
|
24 24 | "ComplexNestedErrorData",
|
25 25 | ),
|
26 26 | ::aws_smithy_schema::ShapeType::String,
|
27 - | "foo",
|
27 + | "Foo",
|
28 28 | 0,
|
29 29 | )
|
30 30 | .with_json_name("Fooooo");
|
31 31 | static COMPLEXNESTEDERRORDATA_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
32 32 | COMPLEXNESTEDERRORDATA_SCHEMA_ID,
|
33 33 | ::aws_smithy_schema::ShapeType::Structure,
|
34 34 | &[&COMPLEXNESTEDERRORDATA_MEMBER_FOO],
|
35 35 | );
|
36 36 | impl ComplexNestedErrorData {
|
37 37 | /// The schema for this shape.
|
38 38 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXNESTEDERRORDATA_SCHEMA;
|
39 39 | }
|
40 40 | impl ::aws_smithy_schema::serde::SerializableStruct for ComplexNestedErrorData {
|
41 41 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
42 42 | fn serialize_members(
|
43 43 | &self,
|
44 44 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
45 45 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
46 46 | if let Some(ref val) = self.foo {
|
47 47 | ser.write_string(&COMPLEXNESTEDERRORDATA_MEMBER_FOO, val)?;
|
48 48 | }
|
49 49 | Ok(())
|
50 50 | }
|
51 51 | }
|
52 52 | impl ComplexNestedErrorData {
|
53 53 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
54 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
55 - | deserializer: &mut D,
|
54 + | pub fn deserialize(
|
55 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
56 56 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
57 57 | #[allow(unused_variables, unused_mut)]
|
58 58 | let mut builder = Self::builder();
|
59 59 | #[allow(
|
60 60 | unused_variables,
|
61 61 | unreachable_code,
|
62 62 | clippy::single_match,
|
63 63 | clippy::match_single_binding,
|
64 64 | clippy::diverging_sub_expression
|
65 65 | )]
|
66 - | deserializer.read_struct(&COMPLEXNESTEDERRORDATA_SCHEMA, (), |_, member, deser| {
|
66 + | deserializer.read_struct(&COMPLEXNESTEDERRORDATA_SCHEMA, &mut |member, deser| {
|
67 67 | match member.member_index() {
|
68 68 | Some(0) => {
|
69 69 | builder.foo = Some(deser.read_string(member)?);
|
70 70 | }
|
71 71 | _ => {}
|
72 72 | }
|
73 73 | Ok(())
|
74 74 | })?;
|
75 75 | Ok(builder.build())
|
76 76 | }
|
77 77 | }
|
78 + | impl ComplexNestedErrorData {
|
79 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
80 + | pub fn deserialize_with_response(
|
81 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
82 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
83 + | _status: u16,
|
84 + | _body: &[u8],
|
85 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
86 + | Self::deserialize(deserializer)
|
87 + | }
|
88 + | }
|
78 89 | impl ComplexNestedErrorData {
|
79 90 | /// Creates a new builder-style object to manufacture [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
|
80 91 | pub fn builder() -> crate::types::builders::ComplexNestedErrorDataBuilder {
|
81 92 | crate::types::builders::ComplexNestedErrorDataBuilder::default()
|
82 93 | }
|
83 94 | }
|
84 95 |
|
85 96 | /// A builder for [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
|
86 97 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
87 98 | #[non_exhaustive]
|
88 99 | pub struct ComplexNestedErrorDataBuilder {
|
89 100 | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
90 101 | }
|
91 102 | impl ComplexNestedErrorDataBuilder {
|
92 103 | #[allow(missing_docs)] // documentation missing in model
|
93 104 | pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
94 105 | self.foo = ::std::option::Option::Some(input.into());
|
95 106 | self
|
96 107 | }
|
97 108 | #[allow(missing_docs)] // documentation missing in model
|
98 109 | pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
99 110 | self.foo = input;
|
100 111 | self
|
101 112 | }
|
102 113 | #[allow(missing_docs)] // documentation missing in model
|
103 114 | pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
|
104 115 | &self.foo
|
105 116 | }
|
106 117 | /// Consumes the builder and constructs a [`ComplexNestedErrorData`](crate::types::ComplexNestedErrorData).
|
107 118 | pub fn build(self) -> crate::types::ComplexNestedErrorData {
|