65 65 | }
|
66 66 | static ONDEMANDOPTIONSREQUEST_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
67 67 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#OnDemandOptionsRequest", "com.amazonaws.ec2", "OnDemandOptionsRequest");
|
68 68 | static ONDEMANDOPTIONSREQUEST_MEMBER_ALLOCATION_STRATEGY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
69 69 | ::aws_smithy_schema::ShapeId::from_static(
|
70 70 | "com.amazonaws.ec2#OnDemandOptionsRequest$AllocationStrategy",
|
71 71 | "com.amazonaws.ec2",
|
72 72 | "OnDemandOptionsRequest",
|
73 73 | ),
|
74 74 | ::aws_smithy_schema::ShapeType::String,
|
75 - | "allocation_strategy",
|
75 + | "AllocationStrategy",
|
76 76 | 0,
|
77 77 | );
|
78 78 | static ONDEMANDOPTIONSREQUEST_MEMBER_CAPACITY_RESERVATION_OPTIONS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
79 79 | ::aws_smithy_schema::ShapeId::from_static(
|
80 80 | "com.amazonaws.ec2#OnDemandOptionsRequest$CapacityReservationOptions",
|
81 81 | "com.amazonaws.ec2",
|
82 82 | "OnDemandOptionsRequest",
|
83 83 | ),
|
84 84 | ::aws_smithy_schema::ShapeType::Structure,
|
85 - | "capacity_reservation_options",
|
85 + | "CapacityReservationOptions",
|
86 86 | 1,
|
87 87 | );
|
88 88 | static ONDEMANDOPTIONSREQUEST_MEMBER_SINGLE_INSTANCE_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
89 89 | ::aws_smithy_schema::ShapeId::from_static(
|
90 90 | "com.amazonaws.ec2#OnDemandOptionsRequest$SingleInstanceType",
|
91 91 | "com.amazonaws.ec2",
|
92 92 | "OnDemandOptionsRequest",
|
93 93 | ),
|
94 94 | ::aws_smithy_schema::ShapeType::Boolean,
|
95 - | "single_instance_type",
|
95 + | "SingleInstanceType",
|
96 96 | 2,
|
97 97 | );
|
98 98 | static ONDEMANDOPTIONSREQUEST_MEMBER_SINGLE_AVAILABILITY_ZONE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
99 99 | ::aws_smithy_schema::ShapeId::from_static(
|
100 100 | "com.amazonaws.ec2#OnDemandOptionsRequest$SingleAvailabilityZone",
|
101 101 | "com.amazonaws.ec2",
|
102 102 | "OnDemandOptionsRequest",
|
103 103 | ),
|
104 104 | ::aws_smithy_schema::ShapeType::Boolean,
|
105 - | "single_availability_zone",
|
105 + | "SingleAvailabilityZone",
|
106 106 | 3,
|
107 107 | );
|
108 108 | static ONDEMANDOPTIONSREQUEST_MEMBER_MIN_TARGET_CAPACITY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
109 109 | ::aws_smithy_schema::ShapeId::from_static(
|
110 110 | "com.amazonaws.ec2#OnDemandOptionsRequest$MinTargetCapacity",
|
111 111 | "com.amazonaws.ec2",
|
112 112 | "OnDemandOptionsRequest",
|
113 113 | ),
|
114 114 | ::aws_smithy_schema::ShapeType::Integer,
|
115 - | "min_target_capacity",
|
115 + | "MinTargetCapacity",
|
116 116 | 4,
|
117 117 | );
|
118 118 | static ONDEMANDOPTIONSREQUEST_MEMBER_MAX_TOTAL_PRICE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
119 119 | ::aws_smithy_schema::ShapeId::from_static(
|
120 120 | "com.amazonaws.ec2#OnDemandOptionsRequest$MaxTotalPrice",
|
121 121 | "com.amazonaws.ec2",
|
122 122 | "OnDemandOptionsRequest",
|
123 123 | ),
|
124 124 | ::aws_smithy_schema::ShapeType::String,
|
125 - | "max_total_price",
|
125 + | "MaxTotalPrice",
|
126 126 | 5,
|
127 127 | );
|
128 128 | static ONDEMANDOPTIONSREQUEST_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
129 129 | ONDEMANDOPTIONSREQUEST_SCHEMA_ID,
|
130 130 | ::aws_smithy_schema::ShapeType::Structure,
|
131 131 | &[
|
132 132 | &ONDEMANDOPTIONSREQUEST_MEMBER_ALLOCATION_STRATEGY,
|
133 133 | &ONDEMANDOPTIONSREQUEST_MEMBER_CAPACITY_RESERVATION_OPTIONS,
|
134 134 | &ONDEMANDOPTIONSREQUEST_MEMBER_SINGLE_INSTANCE_TYPE,
|
135 135 | &ONDEMANDOPTIONSREQUEST_MEMBER_SINGLE_AVAILABILITY_ZONE,
|
136 136 | &ONDEMANDOPTIONSREQUEST_MEMBER_MIN_TARGET_CAPACITY,
|
137 137 | &ONDEMANDOPTIONSREQUEST_MEMBER_MAX_TOTAL_PRICE,
|
138 138 | ],
|
139 139 | );
|
140 140 | impl OnDemandOptionsRequest {
|
141 141 | /// The schema for this shape.
|
142 142 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ONDEMANDOPTIONSREQUEST_SCHEMA;
|
143 143 | }
|
144 144 | impl ::aws_smithy_schema::serde::SerializableStruct for OnDemandOptionsRequest {
|
145 145 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
146 146 | fn serialize_members(
|
147 147 | &self,
|
148 148 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
149 149 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
150 150 | if let Some(ref val) = self.allocation_strategy {
|
151 151 | ser.write_string(&ONDEMANDOPTIONSREQUEST_MEMBER_ALLOCATION_STRATEGY, val.as_str())?;
|
152 152 | }
|
153 153 | if let Some(ref val) = self.capacity_reservation_options {
|
154 154 | ser.write_struct(&ONDEMANDOPTIONSREQUEST_MEMBER_CAPACITY_RESERVATION_OPTIONS, val)?;
|
155 155 | }
|
156 156 | if let Some(ref val) = self.single_instance_type {
|
157 157 | ser.write_boolean(&ONDEMANDOPTIONSREQUEST_MEMBER_SINGLE_INSTANCE_TYPE, *val)?;
|
158 158 | }
|
159 159 | if let Some(ref val) = self.single_availability_zone {
|
160 160 | ser.write_boolean(&ONDEMANDOPTIONSREQUEST_MEMBER_SINGLE_AVAILABILITY_ZONE, *val)?;
|
161 161 | }
|
162 162 | if let Some(ref val) = self.min_target_capacity {
|
163 163 | ser.write_integer(&ONDEMANDOPTIONSREQUEST_MEMBER_MIN_TARGET_CAPACITY, *val)?;
|
164 164 | }
|
165 165 | if let Some(ref val) = self.max_total_price {
|
166 166 | ser.write_string(&ONDEMANDOPTIONSREQUEST_MEMBER_MAX_TOTAL_PRICE, val)?;
|
167 167 | }
|
168 168 | Ok(())
|
169 169 | }
|
170 170 | }
|
171 171 | impl OnDemandOptionsRequest {
|
172 172 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
173 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
174 - | deserializer: &mut D,
|
173 + | pub fn deserialize(
|
174 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
175 175 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
176 176 | #[allow(unused_variables, unused_mut)]
|
177 177 | let mut builder = Self::builder();
|
178 178 | #[allow(
|
179 179 | unused_variables,
|
180 180 | unreachable_code,
|
181 181 | clippy::single_match,
|
182 182 | clippy::match_single_binding,
|
183 183 | clippy::diverging_sub_expression
|
184 184 | )]
|
185 - | deserializer.read_struct(&ONDEMANDOPTIONSREQUEST_SCHEMA, (), |_, member, deser| {
|
185 + | deserializer.read_struct(&ONDEMANDOPTIONSREQUEST_SCHEMA, &mut |member, deser| {
|
186 186 | match member.member_index() {
|
187 187 | Some(0) => {
|
188 188 | builder.allocation_strategy = Some(crate::types::FleetOnDemandAllocationStrategy::from(deser.read_string(member)?.as_str()));
|
189 189 | }
|
190 190 | Some(1) => {
|
191 191 | builder.capacity_reservation_options = Some(crate::types::CapacityReservationOptionsRequest::deserialize(deser)?);
|
192 192 | }
|
193 193 | Some(2) => {
|
194 194 | builder.single_instance_type = Some(deser.read_boolean(member)?);
|
195 195 | }
|
196 196 | Some(3) => {
|
197 197 | builder.single_availability_zone = Some(deser.read_boolean(member)?);
|
198 198 | }
|
199 199 | Some(4) => {
|
200 200 | builder.min_target_capacity = Some(deser.read_integer(member)?);
|
201 201 | }
|
202 202 | Some(5) => {
|
203 203 | builder.max_total_price = Some(deser.read_string(member)?);
|
204 204 | }
|
205 205 | _ => {}
|
206 206 | }
|
207 207 | Ok(())
|
208 208 | })?;
|
209 209 | Ok(builder.build())
|
210 210 | }
|
211 211 | }
|
212 + | impl OnDemandOptionsRequest {
|
213 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
214 + | pub fn deserialize_with_response(
|
215 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
216 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
217 + | _status: u16,
|
218 + | _body: &[u8],
|
219 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
220 + | Self::deserialize(deserializer)
|
221 + | }
|
222 + | }
|
212 223 | impl OnDemandOptionsRequest {
|
213 224 | /// Creates a new builder-style object to manufacture [`OnDemandOptionsRequest`](crate::types::OnDemandOptionsRequest).
|
214 225 | pub fn builder() -> crate::types::builders::OnDemandOptionsRequestBuilder {
|
215 226 | crate::types::builders::OnDemandOptionsRequestBuilder::default()
|
216 227 | }
|
217 228 | }
|
218 229 |
|
219 230 | /// A builder for [`OnDemandOptionsRequest`](crate::types::OnDemandOptionsRequest).
|
220 231 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
221 232 | #[non_exhaustive]
|