9 9 | /// <p>The policy version to delete.</p>
|
10 10 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits.</p>
|
11 11 | /// <p>For more information about managed policy versions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html">Versioning for managed policies</a> in the <i>IAM User Guide</i>.</p>
|
12 12 | pub version_id: ::std::option::Option<::std::string::String>,
|
13 13 | }
|
14 14 | impl DeletePolicyVersionInput {
|
15 15 | /// <p>The Amazon Resource Name (ARN) of the IAM policy from which you want to delete a version.</p>
|
16 16 | /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
|
17 17 | pub fn policy_arn(&self) -> ::std::option::Option<&str> {
|
18 18 | self.policy_arn.as_deref()
|
19 19 | }
|
20 20 | /// <p>The policy version to delete.</p>
|
21 21 | /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits.</p>
|
22 22 | /// <p>For more information about managed policy versions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html">Versioning for managed policies</a> in the <i>IAM User Guide</i>.</p>
|
23 23 | pub fn version_id(&self) -> ::std::option::Option<&str> {
|
24 24 | self.version_id.as_deref()
|
25 25 | }
|
26 26 | }
|
27 27 | static DELETEPOLICYVERSIONINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
28 28 | "com.amazonaws.iam.synthetic#DeletePolicyVersionInput",
|
29 29 | "com.amazonaws.iam.synthetic",
|
30 30 | "DeletePolicyVersionInput",
|
31 31 | );
|
32 32 | static DELETEPOLICYVERSIONINPUT_MEMBER_POLICY_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
33 33 | ::aws_smithy_schema::ShapeId::from_static(
|
34 34 | "com.amazonaws.iam.synthetic#DeletePolicyVersionInput$PolicyArn",
|
35 35 | "com.amazonaws.iam.synthetic",
|
36 36 | "DeletePolicyVersionInput",
|
37 37 | ),
|
38 38 | ::aws_smithy_schema::ShapeType::String,
|
39 - | "policy_arn",
|
39 + | "PolicyArn",
|
40 40 | 0,
|
41 41 | );
|
42 42 | static DELETEPOLICYVERSIONINPUT_MEMBER_VERSION_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
43 43 | ::aws_smithy_schema::ShapeId::from_static(
|
44 44 | "com.amazonaws.iam.synthetic#DeletePolicyVersionInput$VersionId",
|
45 45 | "com.amazonaws.iam.synthetic",
|
46 46 | "DeletePolicyVersionInput",
|
47 47 | ),
|
48 48 | ::aws_smithy_schema::ShapeType::String,
|
49 - | "version_id",
|
49 + | "VersionId",
|
50 50 | 1,
|
51 51 | );
|
52 52 | static DELETEPOLICYVERSIONINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
53 53 | DELETEPOLICYVERSIONINPUT_SCHEMA_ID,
|
54 54 | ::aws_smithy_schema::ShapeType::Structure,
|
55 55 | &[&DELETEPOLICYVERSIONINPUT_MEMBER_POLICY_ARN, &DELETEPOLICYVERSIONINPUT_MEMBER_VERSION_ID],
|
56 56 | );
|
57 57 | impl DeletePolicyVersionInput {
|
58 58 | /// The schema for this shape.
|
59 59 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DELETEPOLICYVERSIONINPUT_SCHEMA;
|
60 60 | }
|
61 61 | impl ::aws_smithy_schema::serde::SerializableStruct for DeletePolicyVersionInput {
|
62 62 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
63 63 | fn serialize_members(
|
64 64 | &self,
|
65 65 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
66 66 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
67 67 | if let Some(ref val) = self.policy_arn {
|
68 68 | ser.write_string(&DELETEPOLICYVERSIONINPUT_MEMBER_POLICY_ARN, val)?;
|
69 69 | }
|
70 70 | if let Some(ref val) = self.version_id {
|
71 71 | ser.write_string(&DELETEPOLICYVERSIONINPUT_MEMBER_VERSION_ID, val)?;
|
72 72 | }
|
73 73 | Ok(())
|
74 74 | }
|
75 75 | }
|
76 76 | impl DeletePolicyVersionInput {
|
77 77 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
78 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
79 - | deserializer: &mut D,
|
78 + | pub fn deserialize(
|
79 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
80 80 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
81 81 | #[allow(unused_variables, unused_mut)]
|
82 82 | let mut builder = Self::builder();
|
83 83 | #[allow(
|
84 84 | unused_variables,
|
85 85 | unreachable_code,
|
86 86 | clippy::single_match,
|
87 87 | clippy::match_single_binding,
|
88 88 | clippy::diverging_sub_expression
|
89 89 | )]
|
90 - | deserializer.read_struct(&DELETEPOLICYVERSIONINPUT_SCHEMA, (), |_, member, deser| {
|
90 + | deserializer.read_struct(&DELETEPOLICYVERSIONINPUT_SCHEMA, &mut |member, deser| {
|
91 91 | match member.member_index() {
|
92 92 | Some(0) => {
|
93 93 | builder.policy_arn = Some(deser.read_string(member)?);
|
94 94 | }
|
95 95 | Some(1) => {
|
96 96 | builder.version_id = Some(deser.read_string(member)?);
|
97 97 | }
|
98 98 | _ => {}
|
99 99 | }
|
100 100 | Ok(())
|
101 101 | })?;
|
102 + | builder.policy_arn = builder.policy_arn.or(Some(String::new()));
|
103 + | builder.version_id = builder.version_id.or(Some(String::new()));
|
102 104 | builder
|
103 105 | .build()
|
104 106 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
105 107 | }
|
106 108 | }
|
109 + | impl DeletePolicyVersionInput {
|
110 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
111 + | pub fn deserialize_with_response(
|
112 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
113 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
114 + | _status: u16,
|
115 + | _body: &[u8],
|
116 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
117 + | Self::deserialize(deserializer)
|
118 + | }
|
119 + | }
|
107 120 | impl DeletePolicyVersionInput {
|
108 121 | /// Creates a new builder-style object to manufacture [`DeletePolicyVersionInput`](crate::operation::delete_policy_version::DeletePolicyVersionInput).
|
109 122 | pub fn builder() -> crate::operation::delete_policy_version::builders::DeletePolicyVersionInputBuilder {
|
110 123 | crate::operation::delete_policy_version::builders::DeletePolicyVersionInputBuilder::default()
|
111 124 | }
|
112 125 | }
|
113 126 |
|
114 127 | /// A builder for [`DeletePolicyVersionInput`](crate::operation::delete_policy_version::DeletePolicyVersionInput).
|
115 128 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
116 129 | #[non_exhaustive]
|
117 130 | pub struct DeletePolicyVersionInputBuilder {
|
118 131 | pub(crate) policy_arn: ::std::option::Option<::std::string::String>,
|
119 132 | pub(crate) version_id: ::std::option::Option<::std::string::String>,
|
120 133 | }
|
121 134 | impl DeletePolicyVersionInputBuilder {
|
122 135 | /// <p>The Amazon Resource Name (ARN) of the IAM policy from which you want to delete a version.</p>
|
123 136 | /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
|
124 137 | /// This field is required.
|
125 138 | pub fn policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
126 139 | self.policy_arn = ::std::option::Option::Some(input.into());
|
127 140 | self
|
128 141 | }
|
129 142 | /// <p>The Amazon Resource Name (ARN) of the IAM policy from which you want to delete a version.</p>
|
130 143 | /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
|
131 144 | pub fn set_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
132 145 | self.policy_arn = input;
|
133 146 | self
|
134 147 | }
|
135 148 | /// <p>The Amazon Resource Name (ARN) of the IAM policy from which you want to delete a version.</p>
|
136 149 | /// <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
|