15 15 | /// OperationName::LambdaInvoke => { /* ... */ },
|
16 16 | /// OperationName::S3ComputeObjectChecksum => { /* ... */ },
|
17 17 | /// OperationName::S3DeleteObjectTagging => { /* ... */ },
|
18 18 | /// OperationName::S3InitiateRestoreObject => { /* ... */ },
|
19 19 | /// OperationName::S3PutObjectAcl => { /* ... */ },
|
20 20 | /// OperationName::S3PutObjectCopy => { /* ... */ },
|
21 21 | /// OperationName::S3PutObjectLegalHold => { /* ... */ },
|
22 22 | /// OperationName::S3PutObjectRetention => { /* ... */ },
|
23 23 | /// OperationName::S3PutObjectTagging => { /* ... */ },
|
24 24 | /// OperationName::S3ReplicateObject => { /* ... */ },
|
25 + | /// OperationName::S3UpdateObjectEncryption => { /* ... */ },
|
25 26 | /// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
|
26 27 | /// _ => { /* ... */ },
|
27 28 | /// }
|
28 29 | /// ```
|
29 30 | /// The above code demonstrates that when `operationname` represents
|
30 31 | /// `NewFeature`, the execution path will lead to the second last match arm,
|
31 32 | /// even though the enum does not contain a variant `OperationName::NewFeature`
|
32 33 | /// in the current version of SDK. The reason is that the variable `other`,
|
33 34 | /// created by the `@` operator, is bound to
|
34 35 | /// `OperationName::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
|
35 36 | /// and calling `as_str` on it yields `"NewFeature"`.
|
36 37 | /// This match expression is forward-compatible when executed with a newer
|
37 38 | /// version of SDK where the variant `OperationName::NewFeature` is defined.
|
38 39 | /// Specifically, when `operationname` represents `NewFeature`,
|
39 40 | /// the execution path will hit the second last match arm as before by virtue of
|
40 41 | /// calling `as_str` on `OperationName::NewFeature` also yielding `"NewFeature"`.
|
41 42 | ///
|
42 43 | /// Explicitly matching on the `Unknown` variant should
|
43 44 | /// be avoided for two reasons:
|
44 45 | /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
|
45 46 | /// - It might inadvertently shadow other intended match arms.
|
46 47 | ///
|
47 48 | #[allow(missing_docs)] // documentation missing in model
|
48 49 | #[non_exhaustive]
|
49 50 | #[derive(
|
50 51 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
|
51 52 | )]
|
52 53 | pub enum OperationName {
|
53 54 | #[allow(missing_docs)] // documentation missing in model
|
54 55 | LambdaInvoke,
|
55 56 | #[allow(missing_docs)] // documentation missing in model
|
56 57 | S3ComputeObjectChecksum,
|
57 58 | #[allow(missing_docs)] // documentation missing in model
|
58 59 | S3DeleteObjectTagging,
|
59 60 | #[allow(missing_docs)] // documentation missing in model
|
60 61 | S3InitiateRestoreObject,
|
61 62 | #[allow(missing_docs)] // documentation missing in model
|
62 63 | S3PutObjectAcl,
|
63 64 | #[allow(missing_docs)] // documentation missing in model
|
64 65 | S3PutObjectCopy,
|
65 66 | #[allow(missing_docs)] // documentation missing in model
|
66 67 | S3PutObjectLegalHold,
|
67 68 | #[allow(missing_docs)] // documentation missing in model
|
68 69 | S3PutObjectRetention,
|
69 70 | #[allow(missing_docs)] // documentation missing in model
|
70 71 | S3PutObjectTagging,
|
71 72 | #[allow(missing_docs)] // documentation missing in model
|
72 73 | S3ReplicateObject,
|
74 + | #[allow(missing_docs)] // documentation missing in model
|
75 + | S3UpdateObjectEncryption,
|
73 76 | /// `Unknown` contains new variants that have been added since this code was generated.
|
74 77 | #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
|
75 78 | Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
|
76 79 | }
|
77 80 | impl ::std::convert::From<&str> for OperationName {
|
78 81 | fn from(s: &str) -> Self {
|
79 82 | match s {
|
80 83 | "LambdaInvoke" => OperationName::LambdaInvoke,
|
81 84 | "S3ComputeObjectChecksum" => OperationName::S3ComputeObjectChecksum,
|
82 85 | "S3DeleteObjectTagging" => OperationName::S3DeleteObjectTagging,
|
83 86 | "S3InitiateRestoreObject" => OperationName::S3InitiateRestoreObject,
|
84 87 | "S3PutObjectAcl" => OperationName::S3PutObjectAcl,
|
85 88 | "S3PutObjectCopy" => OperationName::S3PutObjectCopy,
|
86 89 | "S3PutObjectLegalHold" => OperationName::S3PutObjectLegalHold,
|
87 90 | "S3PutObjectRetention" => OperationName::S3PutObjectRetention,
|
88 91 | "S3PutObjectTagging" => OperationName::S3PutObjectTagging,
|
89 92 | "S3ReplicateObject" => OperationName::S3ReplicateObject,
|
93 + | "S3UpdateObjectEncryption" => OperationName::S3UpdateObjectEncryption,
|
90 94 | other => OperationName::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
|
91 95 | }
|
92 96 | }
|
93 97 | }
|
94 98 | impl ::std::str::FromStr for OperationName {
|
95 99 | type Err = ::std::convert::Infallible;
|
96 100 |
|
97 101 | fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
|
98 102 | ::std::result::Result::Ok(OperationName::from(s))
|
99 103 | }
|
100 104 | }
|
101 105 | impl OperationName {
|
102 106 | /// Returns the `&str` value of the enum member.
|
103 107 | pub fn as_str(&self) -> &str {
|
104 108 | match self {
|
105 109 | OperationName::LambdaInvoke => "LambdaInvoke",
|
106 110 | OperationName::S3ComputeObjectChecksum => "S3ComputeObjectChecksum",
|
107 111 | OperationName::S3DeleteObjectTagging => "S3DeleteObjectTagging",
|
108 112 | OperationName::S3InitiateRestoreObject => "S3InitiateRestoreObject",
|
109 113 | OperationName::S3PutObjectAcl => "S3PutObjectAcl",
|
110 114 | OperationName::S3PutObjectCopy => "S3PutObjectCopy",
|
111 115 | OperationName::S3PutObjectLegalHold => "S3PutObjectLegalHold",
|
112 116 | OperationName::S3PutObjectRetention => "S3PutObjectRetention",
|
113 117 | OperationName::S3PutObjectTagging => "S3PutObjectTagging",
|
114 118 | OperationName::S3ReplicateObject => "S3ReplicateObject",
|
119 + | OperationName::S3UpdateObjectEncryption => "S3UpdateObjectEncryption",
|
115 120 | OperationName::Unknown(value) => value.as_str(),
|
116 121 | }
|
117 122 | }
|
118 123 | /// Returns all the `&str` representations of the enum members.
|
119 124 | pub const fn values() -> &'static [&'static str] {
|
120 125 | &[
|
121 126 | "LambdaInvoke",
|
122 127 | "S3ComputeObjectChecksum",
|
123 128 | "S3DeleteObjectTagging",
|
124 129 | "S3InitiateRestoreObject",
|
125 130 | "S3PutObjectAcl",
|
126 131 | "S3PutObjectCopy",
|
127 132 | "S3PutObjectLegalHold",
|
128 133 | "S3PutObjectRetention",
|
129 134 | "S3PutObjectTagging",
|
130 135 | "S3ReplicateObject",
|
136 + | "S3UpdateObjectEncryption",
|
131 137 | ]
|
132 138 | }
|
133 139 | }
|
134 140 | impl ::std::convert::AsRef<str> for OperationName {
|
135 141 | fn as_ref(&self) -> &str {
|
136 142 | self.as_str()
|
137 143 | }
|
138 144 | }
|
139 145 | impl OperationName {
|
140 146 | /// Parses the enum value while disallowing unknown variants.
|
141 147 | ///
|
142 148 | /// Unknown variants will result in an error.
|
143 149 | pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
|
144 150 | match Self::from(value) {
|
145 151 | #[allow(deprecated)]
|
146 152 | Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
|
147 153 | known => Ok(known),
|
148 154 | }
|
149 155 | }
|
150 156 | }
|
151 157 | impl ::std::fmt::Display for OperationName {
|
152 158 | fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
153 159 | match self {
|
154 160 | OperationName::LambdaInvoke => write!(f, "LambdaInvoke"),
|
155 161 | OperationName::S3ComputeObjectChecksum => write!(f, "S3ComputeObjectChecksum"),
|
156 162 | OperationName::S3DeleteObjectTagging => write!(f, "S3DeleteObjectTagging"),
|
157 163 | OperationName::S3InitiateRestoreObject => write!(f, "S3InitiateRestoreObject"),
|
158 164 | OperationName::S3PutObjectAcl => write!(f, "S3PutObjectAcl"),
|
159 165 | OperationName::S3PutObjectCopy => write!(f, "S3PutObjectCopy"),
|
160 166 | OperationName::S3PutObjectLegalHold => write!(f, "S3PutObjectLegalHold"),
|
161 167 | OperationName::S3PutObjectRetention => write!(f, "S3PutObjectRetention"),
|
162 168 | OperationName::S3PutObjectTagging => write!(f, "S3PutObjectTagging"),
|
163 169 | OperationName::S3ReplicateObject => write!(f, "S3ReplicateObject"),
|
170 + | OperationName::S3UpdateObjectEncryption => write!(f, "S3UpdateObjectEncryption"),
|
164 171 | OperationName::Unknown(value) => write!(f, "{value}"),
|
165 172 | }
|
166 173 | }
|
167 174 | }
|