aws_sdk_kms/schema_serde/
shape_enable_key_rotation_input_input.rs1static ENABLEKEYROTATIONINPUT_MEMBER_KEY_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3 ::aws_smithy_schema::ShapeId::from_parts(
4 "com.amazonaws.kms.synthetic#EnableKeyRotationInput$KeyId",
5 "com.amazonaws.kms.synthetic",
6 "EnableKeyRotationInput",
7 ),
8 ::aws_smithy_schema::ShapeType::String,
9 "KeyId",
10 0,
11);
12static ENABLEKEYROTATIONINPUT_MEMBER_ROTATION_PERIOD_IN_DAYS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13 ::aws_smithy_schema::ShapeId::from_parts(
14 "com.amazonaws.kms.synthetic#EnableKeyRotationInput$RotationPeriodInDays",
15 "com.amazonaws.kms.synthetic",
16 "EnableKeyRotationInput",
17 ),
18 ::aws_smithy_schema::ShapeType::Integer,
19 "RotationPeriodInDays",
20 1,
21);
22static ENABLEKEYROTATIONINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
23 ::aws_smithy_schema::ShapeId::from_parts(
24 "com.amazonaws.kms.synthetic#EnableKeyRotationInput",
25 "com.amazonaws.kms.synthetic",
26 "EnableKeyRotationInput",
27 ),
28 ::aws_smithy_schema::ShapeType::Structure,
29 &[
30 &ENABLEKEYROTATIONINPUT_MEMBER_KEY_ID,
31 &ENABLEKEYROTATIONINPUT_MEMBER_ROTATION_PERIOD_IN_DAYS,
32 ],
33)
34.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
35.with_original_name("EnableKeyRotationRequest");
36impl crate::operation::enable_key_rotation::EnableKeyRotationInput {
37 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &ENABLEKEYROTATIONINPUT_SCHEMA;
39}
40impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::enable_key_rotation::EnableKeyRotationInput {
41 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
42 Self::SCHEMA
43 }
44
45 #[allow(unused_variables, clippy::diverging_sub_expression)]
46 fn serialize_members(
47 &self,
48 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
49 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
50 if let Some(ref val) = self.key_id {
51 ser.write_string(&ENABLEKEYROTATIONINPUT_MEMBER_KEY_ID, val)?;
52 }
53 if let Some(ref val) = self.rotation_period_in_days {
54 ser.write_integer(&ENABLEKEYROTATIONINPUT_MEMBER_ROTATION_PERIOD_IN_DAYS, *val)?;
55 }
56 Ok(())
57 }
58}
59impl crate::operation::enable_key_rotation::builders::EnableKeyRotationInputBuilder {
60 #[allow(
61 unused_variables,
62 unreachable_code,
63 clippy::single_match,
64 clippy::match_single_binding,
65 clippy::diverging_sub_expression
66 )]
67 pub(crate) fn deserialize_members(
68 &mut self,
69 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
70 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
71 deserializer.read_struct(&ENABLEKEYROTATIONINPUT_SCHEMA, &mut |member, deser| {
72 match member.member_index() {
73 Some(0) => {
74 if deser.is_null() {
75 deser.read_null()?;
76 } else {
77 self.key_id = Some(deser.read_string(member)?);
78 }
79 }
80 Some(1) => {
81 if deser.is_null() {
82 deser.read_null()?;
83 } else {
84 self.rotation_period_in_days = Some(deser.read_integer(member)?);
85 }
86 }
87 _ => {}
88 }
89 Ok(())
90 })
91 }
92}
93
94impl crate::operation::enable_key_rotation::EnableKeyRotationInput {
95 pub fn deserialize(
97 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
98 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
99 let mut builder = Self::builder();
100 builder.deserialize_members(deserializer)?;
101 builder.key_id = builder.key_id.or(Some(String::new()));
102 builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
103 }
104}