Skip to main content

aws_sdk_kms/schema_serde/
shape_schedule_key_deletion_output_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2static SCHEDULEKEYDELETIONOUTPUT_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#ScheduleKeyDeletionOutput$KeyId",
5        "com.amazonaws.kms.synthetic",
6        "ScheduleKeyDeletionOutput",
7    ),
8    ::aws_smithy_schema::ShapeType::String,
9    "KeyId",
10    0,
11);
12static SCHEDULEKEYDELETIONOUTPUT_MEMBER_DELETION_DATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13    ::aws_smithy_schema::ShapeId::from_parts(
14        "com.amazonaws.kms.synthetic#ScheduleKeyDeletionOutput$DeletionDate",
15        "com.amazonaws.kms.synthetic",
16        "ScheduleKeyDeletionOutput",
17    ),
18    ::aws_smithy_schema::ShapeType::Timestamp,
19    "DeletionDate",
20    1,
21);
22static SCHEDULEKEYDELETIONOUTPUT_MEMBER_KEY_STATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23    ::aws_smithy_schema::ShapeId::from_parts(
24        "com.amazonaws.kms.synthetic#ScheduleKeyDeletionOutput$KeyState",
25        "com.amazonaws.kms.synthetic",
26        "ScheduleKeyDeletionOutput",
27    ),
28    ::aws_smithy_schema::ShapeType::String,
29    "KeyState",
30    2,
31);
32static SCHEDULEKEYDELETIONOUTPUT_MEMBER_PENDING_WINDOW_IN_DAYS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33    ::aws_smithy_schema::ShapeId::from_parts(
34        "com.amazonaws.kms.synthetic#ScheduleKeyDeletionOutput$PendingWindowInDays",
35        "com.amazonaws.kms.synthetic",
36        "ScheduleKeyDeletionOutput",
37    ),
38    ::aws_smithy_schema::ShapeType::Integer,
39    "PendingWindowInDays",
40    3,
41);
42static SCHEDULEKEYDELETIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
43    ::aws_smithy_schema::ShapeId::from_parts(
44        "com.amazonaws.kms.synthetic#ScheduleKeyDeletionOutput",
45        "com.amazonaws.kms.synthetic",
46        "ScheduleKeyDeletionOutput",
47    ),
48    ::aws_smithy_schema::ShapeType::Structure,
49    &[
50        &SCHEDULEKEYDELETIONOUTPUT_MEMBER_KEY_ID,
51        &SCHEDULEKEYDELETIONOUTPUT_MEMBER_DELETION_DATE,
52        &SCHEDULEKEYDELETIONOUTPUT_MEMBER_KEY_STATE,
53        &SCHEDULEKEYDELETIONOUTPUT_MEMBER_PENDING_WINDOW_IN_DAYS,
54    ],
55)
56.with_original_name("ScheduleKeyDeletionResponse");
57impl crate::operation::schedule_key_deletion::ScheduleKeyDeletionOutput {
58    /// The schema for this shape.
59    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &SCHEDULEKEYDELETIONOUTPUT_SCHEMA;
60}
61impl ::aws_smithy_schema::serde::SerializableStruct for crate::operation::schedule_key_deletion::ScheduleKeyDeletionOutput {
62    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
63        Self::SCHEMA
64    }
65
66    #[allow(unused_variables, clippy::diverging_sub_expression)]
67    fn serialize_members(
68        &self,
69        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
70    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
71        if let Some(ref val) = self.key_id {
72            ser.write_string(&SCHEDULEKEYDELETIONOUTPUT_MEMBER_KEY_ID, val)?;
73        }
74        if let Some(ref val) = self.deletion_date {
75            ser.write_timestamp(&SCHEDULEKEYDELETIONOUTPUT_MEMBER_DELETION_DATE, val)?;
76        }
77        if let Some(ref val) = self.key_state {
78            ser.write_string(&SCHEDULEKEYDELETIONOUTPUT_MEMBER_KEY_STATE, val.as_str())?;
79        }
80        if let Some(ref val) = self.pending_window_in_days {
81            ser.write_integer(&SCHEDULEKEYDELETIONOUTPUT_MEMBER_PENDING_WINDOW_IN_DAYS, *val)?;
82        }
83        Ok(())
84    }
85}
86impl crate::operation::schedule_key_deletion::builders::ScheduleKeyDeletionOutputBuilder {
87    #[allow(
88        unused_variables,
89        unreachable_code,
90        clippy::single_match,
91        clippy::match_single_binding,
92        clippy::diverging_sub_expression
93    )]
94    pub(crate) fn deserialize_members(
95        &mut self,
96        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
97    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
98        deserializer.read_struct(&SCHEDULEKEYDELETIONOUTPUT_SCHEMA, &mut |member, deser| {
99            match member.member_index() {
100                Some(0) => {
101                    if deser.is_null() {
102                        deser.read_null()?;
103                    } else {
104                        self.key_id = Some(deser.read_string(member)?);
105                    }
106                }
107                Some(1) => {
108                    if deser.is_null() {
109                        deser.read_null()?;
110                    } else {
111                        self.deletion_date = Some(deser.read_timestamp(member)?);
112                    }
113                }
114                Some(2) => {
115                    if deser.is_null() {
116                        deser.read_null()?;
117                    } else {
118                        self.key_state = Some(crate::types::KeyState::from(deser.read_string(member)?.as_str()));
119                    }
120                }
121                Some(3) => {
122                    if deser.is_null() {
123                        deser.read_null()?;
124                    } else {
125                        self.pending_window_in_days = Some(deser.read_integer(member)?);
126                    }
127                }
128                _ => {}
129            }
130            Ok(())
131        })
132    }
133}
134
135impl crate::operation::schedule_key_deletion::ScheduleKeyDeletionOutput {
136    /// Deserializes this structure from a [`ShapeDeserializer`].
137    pub fn deserialize(
138        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
139    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
140        let mut builder = Self::builder();
141        builder.deserialize_members(deserializer)?;
142        Ok(builder.build())
143    }
144}