aws_sdk_glue/schema_serde/
shape_physical_connection_requirements.rs1static PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SUBNET_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3 ::aws_smithy_schema::ShapeId::from_parts(
4 "com.amazonaws.glue#PhysicalConnectionRequirements$SubnetId",
5 "com.amazonaws.glue",
6 "PhysicalConnectionRequirements",
7 ),
8 ::aws_smithy_schema::ShapeType::String,
9 "SubnetId",
10 0,
11);
12static PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SECURITY_GROUP_ID_LIST_MEMBER: ::aws_smithy_schema::Schema<'static> =
13 ::aws_smithy_schema::Schema::new_member(
14 ::aws_smithy_schema::ShapeId::from_parts(
15 "com.amazonaws.glue#SecurityGroupIdList$member",
16 "com.amazonaws.glue",
17 "SecurityGroupIdList",
18 ),
19 ::aws_smithy_schema::ShapeType::String,
20 "member",
21 0,
22 );
23static PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SECURITY_GROUP_ID_LIST: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
24 ::aws_smithy_schema::ShapeId::from_parts(
25 "com.amazonaws.glue#PhysicalConnectionRequirements$SecurityGroupIdList",
26 "com.amazonaws.glue",
27 "PhysicalConnectionRequirements",
28 ),
29 ::aws_smithy_schema::ShapeType::List,
30 "SecurityGroupIdList",
31 1,
32)
33.with_list_member(&PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SECURITY_GROUP_ID_LIST_MEMBER);
34static PHYSICALCONNECTIONREQUIREMENTS_MEMBER_AVAILABILITY_ZONE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
35 ::aws_smithy_schema::ShapeId::from_parts(
36 "com.amazonaws.glue#PhysicalConnectionRequirements$AvailabilityZone",
37 "com.amazonaws.glue",
38 "PhysicalConnectionRequirements",
39 ),
40 ::aws_smithy_schema::ShapeType::String,
41 "AvailabilityZone",
42 2,
43);
44static PHYSICALCONNECTIONREQUIREMENTS_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
45 ::aws_smithy_schema::ShapeId::from_parts(
46 "com.amazonaws.glue#PhysicalConnectionRequirements",
47 "com.amazonaws.glue",
48 "PhysicalConnectionRequirements",
49 ),
50 ::aws_smithy_schema::ShapeType::Structure,
51 &[
52 &PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SUBNET_ID,
53 &PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SECURITY_GROUP_ID_LIST,
54 &PHYSICALCONNECTIONREQUIREMENTS_MEMBER_AVAILABILITY_ZONE,
55 ],
56);
57impl crate::types::PhysicalConnectionRequirements {
58 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &PHYSICALCONNECTIONREQUIREMENTS_SCHEMA;
60}
61impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::PhysicalConnectionRequirements {
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.subnet_id {
72 ser.write_string(&PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SUBNET_ID, val)?;
73 }
74 if let Some(ref val) = self.security_group_id_list {
75 ser.write_list(
76 &PHYSICALCONNECTIONREQUIREMENTS_MEMBER_SECURITY_GROUP_ID_LIST,
77 &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
78 for item in val {
79 ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
80 }
81 Ok(())
82 },
83 )?;
84 }
85 if let Some(ref val) = self.availability_zone {
86 ser.write_string(&PHYSICALCONNECTIONREQUIREMENTS_MEMBER_AVAILABILITY_ZONE, val)?;
87 }
88 Ok(())
89 }
90}
91impl crate::types::builders::PhysicalConnectionRequirementsBuilder {
92 #[allow(
93 unused_variables,
94 unreachable_code,
95 clippy::single_match,
96 clippy::match_single_binding,
97 clippy::diverging_sub_expression
98 )]
99 pub(crate) fn deserialize_members(
100 &mut self,
101 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
102 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
103 deserializer.read_struct(&PHYSICALCONNECTIONREQUIREMENTS_SCHEMA, &mut |member, deser| {
104 match member.member_index() {
105 Some(0) => {
106 if deser.is_null() {
107 deser.read_null()?;
108 } else {
109 self.subnet_id = Some(deser.read_string(member)?);
110 }
111 }
112 Some(1) => {
113 if deser.is_null() {
114 deser.read_null()?;
115 } else {
116 self.security_group_id_list = Some(deser.read_string_list(member)?);
117 }
118 }
119 Some(2) => {
120 if deser.is_null() {
121 deser.read_null()?;
122 } else {
123 self.availability_zone = Some(deser.read_string(member)?);
124 }
125 }
126 _ => {}
127 }
128 Ok(())
129 })
130 }
131}
132
133impl crate::types::PhysicalConnectionRequirements {
134 pub fn deserialize(
136 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
137 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
138 let mut builder = Self::builder();
139 builder.deserialize_members(deserializer)?;
140 Ok(builder.build())
141 }
142}