40 40 | "com.amazonaws.bedrockruntime",
|
41 41 | "GuardrailStreamConfiguration",
|
42 42 | );
|
43 43 | static GUARDRAILSTREAMCONFIGURATION_MEMBER_GUARDRAIL_IDENTIFIER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
44 44 | ::aws_smithy_schema::ShapeId::from_static(
|
45 45 | "com.amazonaws.bedrockruntime#GuardrailStreamConfiguration$guardrailIdentifier",
|
46 46 | "com.amazonaws.bedrockruntime",
|
47 47 | "GuardrailStreamConfiguration",
|
48 48 | ),
|
49 49 | ::aws_smithy_schema::ShapeType::String,
|
50 - | "guardrail_identifier",
|
50 + | "guardrailIdentifier",
|
51 51 | 0,
|
52 52 | );
|
53 53 | static GUARDRAILSTREAMCONFIGURATION_MEMBER_GUARDRAIL_VERSION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
54 54 | ::aws_smithy_schema::ShapeId::from_static(
|
55 55 | "com.amazonaws.bedrockruntime#GuardrailStreamConfiguration$guardrailVersion",
|
56 56 | "com.amazonaws.bedrockruntime",
|
57 57 | "GuardrailStreamConfiguration",
|
58 58 | ),
|
59 59 | ::aws_smithy_schema::ShapeType::String,
|
60 - | "guardrail_version",
|
60 + | "guardrailVersion",
|
61 61 | 1,
|
62 62 | );
|
63 63 | static GUARDRAILSTREAMCONFIGURATION_MEMBER_TRACE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
64 64 | ::aws_smithy_schema::ShapeId::from_static(
|
65 65 | "com.amazonaws.bedrockruntime#GuardrailStreamConfiguration$trace",
|
66 66 | "com.amazonaws.bedrockruntime",
|
67 67 | "GuardrailStreamConfiguration",
|
68 68 | ),
|
69 69 | ::aws_smithy_schema::ShapeType::String,
|
70 70 | "trace",
|
71 71 | 2,
|
72 72 | );
|
73 73 | static GUARDRAILSTREAMCONFIGURATION_MEMBER_STREAM_PROCESSING_MODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
74 74 | ::aws_smithy_schema::ShapeId::from_static(
|
75 75 | "com.amazonaws.bedrockruntime#GuardrailStreamConfiguration$streamProcessingMode",
|
76 76 | "com.amazonaws.bedrockruntime",
|
77 77 | "GuardrailStreamConfiguration",
|
78 78 | ),
|
79 79 | ::aws_smithy_schema::ShapeType::String,
|
80 - | "stream_processing_mode",
|
80 + | "streamProcessingMode",
|
81 81 | 3,
|
82 82 | );
|
83 83 | static GUARDRAILSTREAMCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
84 84 | GUARDRAILSTREAMCONFIGURATION_SCHEMA_ID,
|
85 85 | ::aws_smithy_schema::ShapeType::Structure,
|
86 86 | &[
|
87 87 | &GUARDRAILSTREAMCONFIGURATION_MEMBER_GUARDRAIL_IDENTIFIER,
|
88 88 | &GUARDRAILSTREAMCONFIGURATION_MEMBER_GUARDRAIL_VERSION,
|
89 89 | &GUARDRAILSTREAMCONFIGURATION_MEMBER_TRACE,
|
90 90 | &GUARDRAILSTREAMCONFIGURATION_MEMBER_STREAM_PROCESSING_MODE,
|
91 91 | ],
|
92 92 | );
|
93 93 | impl GuardrailStreamConfiguration {
|
94 94 | /// The schema for this shape.
|
95 95 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &GUARDRAILSTREAMCONFIGURATION_SCHEMA;
|
96 96 | }
|
97 97 | impl ::aws_smithy_schema::serde::SerializableStruct for GuardrailStreamConfiguration {
|
98 98 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
99 99 | fn serialize_members(
|
100 100 | &self,
|
101 101 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
102 102 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
103 103 | {
|
104 104 | let val = &self.guardrail_identifier;
|
105 105 | ser.write_string(&GUARDRAILSTREAMCONFIGURATION_MEMBER_GUARDRAIL_IDENTIFIER, val)?;
|
106 106 | }
|
107 107 | {
|
108 108 | let val = &self.guardrail_version;
|
109 109 | ser.write_string(&GUARDRAILSTREAMCONFIGURATION_MEMBER_GUARDRAIL_VERSION, val)?;
|
110 110 | }
|
111 111 | {
|
112 112 | let val = &self.trace;
|
113 113 | ser.write_string(&GUARDRAILSTREAMCONFIGURATION_MEMBER_TRACE, val.as_str())?;
|
114 114 | }
|
115 115 | {
|
116 116 | let val = &self.stream_processing_mode;
|
117 117 | ser.write_string(&GUARDRAILSTREAMCONFIGURATION_MEMBER_STREAM_PROCESSING_MODE, val.as_str())?;
|
118 118 | }
|
119 119 | Ok(())
|
120 120 | }
|
121 121 | }
|
122 122 | impl GuardrailStreamConfiguration {
|
123 123 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
124 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
125 - | deserializer: &mut D,
|
124 + | pub fn deserialize(
|
125 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
126 126 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
127 127 | #[allow(unused_variables, unused_mut)]
|
128 128 | let mut builder = Self::builder();
|
129 129 | #[allow(
|
130 130 | unused_variables,
|
131 131 | unreachable_code,
|
132 132 | clippy::single_match,
|
133 133 | clippy::match_single_binding,
|
134 134 | clippy::diverging_sub_expression
|
135 135 | )]
|
136 - | deserializer.read_struct(&GUARDRAILSTREAMCONFIGURATION_SCHEMA, (), |_, member, deser| {
|
136 + | deserializer.read_struct(&GUARDRAILSTREAMCONFIGURATION_SCHEMA, &mut |member, deser| {
|
137 137 | match member.member_index() {
|
138 138 | Some(0) => {
|
139 139 | builder.guardrail_identifier = Some(deser.read_string(member)?);
|
140 140 | }
|
141 141 | Some(1) => {
|
142 142 | builder.guardrail_version = Some(deser.read_string(member)?);
|
143 143 | }
|
144 144 | Some(2) => {
|
145 145 | builder.trace = Some(crate::types::GuardrailTrace::from(deser.read_string(member)?.as_str()));
|
146 146 | }
|
147 147 | Some(3) => {
|
148 148 | builder.stream_processing_mode = Some(crate::types::GuardrailStreamProcessingMode::from(deser.read_string(member)?.as_str()));
|
149 149 | }
|
150 150 | _ => {}
|
151 151 | }
|
152 152 | Ok(())
|
153 153 | })?;
|
154 + | builder.guardrail_identifier = builder.guardrail_identifier.or(Some(String::new()));
|
155 + | builder.guardrail_version = builder.guardrail_version.or(Some(String::new()));
|
154 156 | builder
|
155 157 | .build()
|
156 158 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
157 159 | }
|
158 160 | }
|
161 + | impl GuardrailStreamConfiguration {
|
162 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
163 + | pub fn deserialize_with_response(
|
164 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
165 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
166 + | _status: u16,
|
167 + | _body: &[u8],
|
168 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
169 + | Self::deserialize(deserializer)
|
170 + | }
|
171 + | }
|
159 172 | impl GuardrailStreamConfiguration {
|
160 173 | /// Creates a new builder-style object to manufacture [`GuardrailStreamConfiguration`](crate::types::GuardrailStreamConfiguration).
|
161 174 | pub fn builder() -> crate::types::builders::GuardrailStreamConfigurationBuilder {
|
162 175 | crate::types::builders::GuardrailStreamConfigurationBuilder::default()
|
163 176 | }
|
164 177 | }
|
165 178 |
|
166 179 | /// A builder for [`GuardrailStreamConfiguration`](crate::types::GuardrailStreamConfiguration).
|
167 180 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
168 181 | #[non_exhaustive]
|