aws_sdk_glue/schema_serde/
shape_authentication_configuration.rs1static AUTHENTICATIONCONFIGURATION_MEMBER_AUTHENTICATION_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
3 ::aws_smithy_schema::ShapeId::from_parts(
4 "com.amazonaws.glue#AuthenticationConfiguration$AuthenticationType",
5 "com.amazonaws.glue",
6 "AuthenticationConfiguration",
7 ),
8 ::aws_smithy_schema::ShapeType::String,
9 "AuthenticationType",
10 0,
11);
12static AUTHENTICATIONCONFIGURATION_MEMBER_SECRET_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
13 ::aws_smithy_schema::ShapeId::from_parts(
14 "com.amazonaws.glue#AuthenticationConfiguration$SecretArn",
15 "com.amazonaws.glue",
16 "AuthenticationConfiguration",
17 ),
18 ::aws_smithy_schema::ShapeType::String,
19 "SecretArn",
20 1,
21);
22static AUTHENTICATIONCONFIGURATION_MEMBER_KMS_KEY_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
23 ::aws_smithy_schema::ShapeId::from_parts(
24 "com.amazonaws.glue#AuthenticationConfiguration$KmsKeyArn",
25 "com.amazonaws.glue",
26 "AuthenticationConfiguration",
27 ),
28 ::aws_smithy_schema::ShapeType::String,
29 "KmsKeyArn",
30 2,
31);
32static AUTHENTICATIONCONFIGURATION_MEMBER_O_AUTH2_PROPERTIES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
33 ::aws_smithy_schema::ShapeId::from_parts(
34 "com.amazonaws.glue#AuthenticationConfiguration$OAuth2Properties",
35 "com.amazonaws.glue",
36 "AuthenticationConfiguration",
37 ),
38 ::aws_smithy_schema::ShapeType::Structure,
39 "OAuth2Properties",
40 3,
41);
42static AUTHENTICATIONCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
43 ::aws_smithy_schema::ShapeId::from_parts(
44 "com.amazonaws.glue#AuthenticationConfiguration",
45 "com.amazonaws.glue",
46 "AuthenticationConfiguration",
47 ),
48 ::aws_smithy_schema::ShapeType::Structure,
49 &[
50 &AUTHENTICATIONCONFIGURATION_MEMBER_AUTHENTICATION_TYPE,
51 &AUTHENTICATIONCONFIGURATION_MEMBER_SECRET_ARN,
52 &AUTHENTICATIONCONFIGURATION_MEMBER_KMS_KEY_ARN,
53 &AUTHENTICATIONCONFIGURATION_MEMBER_O_AUTH2_PROPERTIES,
54 ],
55);
56impl crate::types::AuthenticationConfiguration {
57 pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &AUTHENTICATIONCONFIGURATION_SCHEMA;
59}
60impl ::aws_smithy_schema::serde::SerializableStruct for crate::types::AuthenticationConfiguration {
61 fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
62 Self::SCHEMA
63 }
64
65 #[allow(unused_variables, clippy::diverging_sub_expression)]
66 fn serialize_members(
67 &self,
68 ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
69 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
70 if let Some(ref val) = self.authentication_type {
71 ser.write_string(&AUTHENTICATIONCONFIGURATION_MEMBER_AUTHENTICATION_TYPE, val.as_str())?;
72 }
73 if let Some(ref val) = self.secret_arn {
74 ser.write_string(&AUTHENTICATIONCONFIGURATION_MEMBER_SECRET_ARN, val)?;
75 }
76 if let Some(ref val) = self.kms_key_arn {
77 ser.write_string(&AUTHENTICATIONCONFIGURATION_MEMBER_KMS_KEY_ARN, val)?;
78 }
79 if let Some(ref val) = self.o_auth2_properties {
80 ser.write_struct(&AUTHENTICATIONCONFIGURATION_MEMBER_O_AUTH2_PROPERTIES, val)?;
81 }
82 Ok(())
83 }
84}
85impl crate::types::builders::AuthenticationConfigurationBuilder {
86 #[allow(
87 unused_variables,
88 unreachable_code,
89 clippy::single_match,
90 clippy::match_single_binding,
91 clippy::diverging_sub_expression
92 )]
93 pub(crate) fn deserialize_members(
94 &mut self,
95 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
96 ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
97 deserializer.read_struct(&AUTHENTICATIONCONFIGURATION_SCHEMA, &mut |member, deser| {
98 match member.member_index() {
99 Some(0) => {
100 if deser.is_null() {
101 deser.read_null()?;
102 } else {
103 self.authentication_type = Some(crate::types::AuthenticationType::from(deser.read_string(member)?.as_str()));
104 }
105 }
106 Some(1) => {
107 if deser.is_null() {
108 deser.read_null()?;
109 } else {
110 self.secret_arn = Some(deser.read_string(member)?);
111 }
112 }
113 Some(2) => {
114 if deser.is_null() {
115 deser.read_null()?;
116 } else {
117 self.kms_key_arn = Some(deser.read_string(member)?);
118 }
119 }
120 Some(3) => {
121 if deser.is_null() {
122 deser.read_null()?;
123 } else {
124 self.o_auth2_properties = Some(crate::types::OAuth2Properties::deserialize(deser)?);
125 }
126 }
127 _ => {}
128 }
129 Ok(())
130 })
131 }
132}
133
134impl crate::types::AuthenticationConfiguration {
135 pub fn deserialize(
137 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
138 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
139 let mut builder = Self::builder();
140 builder.deserialize_members(deserializer)?;
141 Ok(builder.build())
142 }
143}