53 53 | "com.amazonaws.iam.synthetic",
|
54 54 | "PutUserPolicyInput",
|
55 55 | );
|
56 56 | static PUTUSERPOLICYINPUT_MEMBER_USER_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
57 57 | ::aws_smithy_schema::ShapeId::from_static(
|
58 58 | "com.amazonaws.iam.synthetic#PutUserPolicyInput$UserName",
|
59 59 | "com.amazonaws.iam.synthetic",
|
60 60 | "PutUserPolicyInput",
|
61 61 | ),
|
62 62 | ::aws_smithy_schema::ShapeType::String,
|
63 - | "user_name",
|
63 + | "UserName",
|
64 64 | 0,
|
65 65 | );
|
66 66 | static PUTUSERPOLICYINPUT_MEMBER_POLICY_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
67 67 | ::aws_smithy_schema::ShapeId::from_static(
|
68 68 | "com.amazonaws.iam.synthetic#PutUserPolicyInput$PolicyName",
|
69 69 | "com.amazonaws.iam.synthetic",
|
70 70 | "PutUserPolicyInput",
|
71 71 | ),
|
72 72 | ::aws_smithy_schema::ShapeType::String,
|
73 - | "policy_name",
|
73 + | "PolicyName",
|
74 74 | 1,
|
75 75 | );
|
76 76 | static PUTUSERPOLICYINPUT_MEMBER_POLICY_DOCUMENT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
77 77 | ::aws_smithy_schema::ShapeId::from_static(
|
78 78 | "com.amazonaws.iam.synthetic#PutUserPolicyInput$PolicyDocument",
|
79 79 | "com.amazonaws.iam.synthetic",
|
80 80 | "PutUserPolicyInput",
|
81 81 | ),
|
82 82 | ::aws_smithy_schema::ShapeType::String,
|
83 - | "policy_document",
|
83 + | "PolicyDocument",
|
84 84 | 2,
|
85 85 | );
|
86 86 | static PUTUSERPOLICYINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
87 87 | PUTUSERPOLICYINPUT_SCHEMA_ID,
|
88 88 | ::aws_smithy_schema::ShapeType::Structure,
|
89 89 | &[
|
90 90 | &PUTUSERPOLICYINPUT_MEMBER_USER_NAME,
|
91 91 | &PUTUSERPOLICYINPUT_MEMBER_POLICY_NAME,
|
92 92 | &PUTUSERPOLICYINPUT_MEMBER_POLICY_DOCUMENT,
|
93 93 | ],
|
94 94 | );
|
95 95 | impl PutUserPolicyInput {
|
96 96 | /// The schema for this shape.
|
97 97 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PUTUSERPOLICYINPUT_SCHEMA;
|
98 98 | }
|
99 99 | impl ::aws_smithy_schema::serde::SerializableStruct for PutUserPolicyInput {
|
100 100 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
101 101 | fn serialize_members(
|
102 102 | &self,
|
103 103 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
104 104 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
105 105 | if let Some(ref val) = self.user_name {
|
106 106 | ser.write_string(&PUTUSERPOLICYINPUT_MEMBER_USER_NAME, val)?;
|
107 107 | }
|
108 108 | if let Some(ref val) = self.policy_name {
|
109 109 | ser.write_string(&PUTUSERPOLICYINPUT_MEMBER_POLICY_NAME, val)?;
|
110 110 | }
|
111 111 | if let Some(ref val) = self.policy_document {
|
112 112 | ser.write_string(&PUTUSERPOLICYINPUT_MEMBER_POLICY_DOCUMENT, val)?;
|
113 113 | }
|
114 114 | Ok(())
|
115 115 | }
|
116 116 | }
|
117 117 | impl PutUserPolicyInput {
|
118 118 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
119 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
120 - | deserializer: &mut D,
|
119 + | pub fn deserialize(
|
120 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
121 121 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
122 122 | #[allow(unused_variables, unused_mut)]
|
123 123 | let mut builder = Self::builder();
|
124 124 | #[allow(
|
125 125 | unused_variables,
|
126 126 | unreachable_code,
|
127 127 | clippy::single_match,
|
128 128 | clippy::match_single_binding,
|
129 129 | clippy::diverging_sub_expression
|
130 130 | )]
|
131 - | deserializer.read_struct(&PUTUSERPOLICYINPUT_SCHEMA, (), |_, member, deser| {
|
131 + | deserializer.read_struct(&PUTUSERPOLICYINPUT_SCHEMA, &mut |member, deser| {
|
132 132 | match member.member_index() {
|
133 133 | Some(0) => {
|
134 134 | builder.user_name = Some(deser.read_string(member)?);
|
135 135 | }
|
136 136 | Some(1) => {
|
137 137 | builder.policy_name = Some(deser.read_string(member)?);
|
138 138 | }
|
139 139 | Some(2) => {
|
140 140 | builder.policy_document = Some(deser.read_string(member)?);
|
141 141 | }
|
142 142 | _ => {}
|
143 143 | }
|
144 144 | Ok(())
|
145 145 | })?;
|
146 + | builder.user_name = builder.user_name.or(Some(String::new()));
|
147 + | builder.policy_name = builder.policy_name.or(Some(String::new()));
|
148 + | builder.policy_document = builder.policy_document.or(Some(String::new()));
|
146 149 | builder
|
147 150 | .build()
|
148 151 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
149 152 | }
|
150 153 | }
|
154 + | impl PutUserPolicyInput {
|
155 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
156 + | pub fn deserialize_with_response(
|
157 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
158 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
159 + | _status: u16,
|
160 + | _body: &[u8],
|
161 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
162 + | Self::deserialize(deserializer)
|
163 + | }
|
164 + | }
|
151 165 | impl PutUserPolicyInput {
|
152 166 | /// Creates a new builder-style object to manufacture [`PutUserPolicyInput`](crate::operation::put_user_policy::PutUserPolicyInput).
|
153 167 | pub fn builder() -> crate::operation::put_user_policy::builders::PutUserPolicyInputBuilder {
|
154 168 | crate::operation::put_user_policy::builders::PutUserPolicyInputBuilder::default()
|
155 169 | }
|
156 170 | }
|
157 171 |
|
158 172 | /// A builder for [`PutUserPolicyInput`](crate::operation::put_user_policy::PutUserPolicyInput).
|
159 173 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
160 174 | #[non_exhaustive]
|
161 175 | pub struct PutUserPolicyInputBuilder {
|
162 176 | pub(crate) user_name: ::std::option::Option<::std::string::String>,
|
163 177 | pub(crate) policy_name: ::std::option::Option<::std::string::String>,
|
164 178 | pub(crate) policy_document: ::std::option::Option<::std::string::String>,
|
165 179 | }
|
166 180 | impl PutUserPolicyInputBuilder {
|
167 181 | /// <p>The name of the user to associate the policy with.</p>
|
168 182 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
|
169 183 | /// This field is required.
|
170 184 | pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
171 185 | self.user_name = ::std::option::Option::Some(input.into());
|
172 186 | self
|
173 187 | }
|
174 188 | /// <p>The name of the user to associate the policy with.</p>
|
175 189 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
|
176 190 | pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
177 191 | self.user_name = input;
|
178 192 | self
|
179 193 | }
|
180 194 | /// <p>The name of the user to associate the policy with.</p>
|