Skip to main content

rustack_s3_model/
operations.rs

1//! Auto-generated from AWS S3 Smithy model. DO NOT EDIT.
2
3/// All supported S3 operations.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum S3Operation {
6    /// The CreateBucket operation.
7    CreateBucket,
8    /// The DeleteBucket operation.
9    DeleteBucket,
10    /// The HeadBucket operation.
11    HeadBucket,
12    /// The ListBuckets operation.
13    ListBuckets,
14    /// The GetBucketLocation operation.
15    GetBucketLocation,
16    /// The GetBucketVersioning operation.
17    GetBucketVersioning,
18    /// The PutBucketVersioning operation.
19    PutBucketVersioning,
20    /// The GetBucketEncryption operation.
21    GetBucketEncryption,
22    /// The PutBucketEncryption operation.
23    PutBucketEncryption,
24    /// The DeleteBucketEncryption operation.
25    DeleteBucketEncryption,
26    /// The GetBucketCors operation.
27    GetBucketCors,
28    /// The PutBucketCors operation.
29    PutBucketCors,
30    /// The DeleteBucketCors operation.
31    DeleteBucketCors,
32    /// The GetBucketLifecycleConfiguration operation.
33    GetBucketLifecycleConfiguration,
34    /// The PutBucketLifecycleConfiguration operation.
35    PutBucketLifecycleConfiguration,
36    /// The DeleteBucketLifecycle operation.
37    DeleteBucketLifecycle,
38    /// The GetBucketPolicy operation.
39    GetBucketPolicy,
40    /// The PutBucketPolicy operation.
41    PutBucketPolicy,
42    /// The DeleteBucketPolicy operation.
43    DeleteBucketPolicy,
44    /// The GetBucketTagging operation.
45    GetBucketTagging,
46    /// The PutBucketTagging operation.
47    PutBucketTagging,
48    /// The DeleteBucketTagging operation.
49    DeleteBucketTagging,
50    /// The GetBucketNotificationConfiguration operation.
51    GetBucketNotificationConfiguration,
52    /// The PutBucketNotificationConfiguration operation.
53    PutBucketNotificationConfiguration,
54    /// The GetBucketLogging operation.
55    GetBucketLogging,
56    /// The PutBucketLogging operation.
57    PutBucketLogging,
58    /// The GetPublicAccessBlock operation.
59    GetPublicAccessBlock,
60    /// The PutPublicAccessBlock operation.
61    PutPublicAccessBlock,
62    /// The DeletePublicAccessBlock operation.
63    DeletePublicAccessBlock,
64    /// The GetBucketOwnershipControls operation.
65    GetBucketOwnershipControls,
66    /// The PutBucketOwnershipControls operation.
67    PutBucketOwnershipControls,
68    /// The DeleteBucketOwnershipControls operation.
69    DeleteBucketOwnershipControls,
70    /// The GetObjectLockConfiguration operation.
71    GetObjectLockConfiguration,
72    /// The PutObjectLockConfiguration operation.
73    PutObjectLockConfiguration,
74    /// The GetBucketAccelerateConfiguration operation.
75    GetBucketAccelerateConfiguration,
76    /// The PutBucketAccelerateConfiguration operation.
77    PutBucketAccelerateConfiguration,
78    /// The GetBucketRequestPayment operation.
79    GetBucketRequestPayment,
80    /// The PutBucketRequestPayment operation.
81    PutBucketRequestPayment,
82    /// The GetBucketWebsite operation.
83    GetBucketWebsite,
84    /// The PutBucketWebsite operation.
85    PutBucketWebsite,
86    /// The DeleteBucketWebsite operation.
87    DeleteBucketWebsite,
88    /// The GetBucketAcl operation.
89    GetBucketAcl,
90    /// The PutBucketAcl operation.
91    PutBucketAcl,
92    /// The GetBucketPolicyStatus operation.
93    GetBucketPolicyStatus,
94    /// The PutObject operation.
95    PutObject,
96    /// The GetObject operation.
97    GetObject,
98    /// The HeadObject operation.
99    HeadObject,
100    /// The DeleteObject operation.
101    DeleteObject,
102    /// The DeleteObjects operation.
103    DeleteObjects,
104    /// The CopyObject operation.
105    CopyObject,
106    /// The GetObjectTagging operation.
107    GetObjectTagging,
108    /// The PutObjectTagging operation.
109    PutObjectTagging,
110    /// The DeleteObjectTagging operation.
111    DeleteObjectTagging,
112    /// The GetObjectAcl operation.
113    GetObjectAcl,
114    /// The PutObjectAcl operation.
115    PutObjectAcl,
116    /// The GetObjectRetention operation.
117    GetObjectRetention,
118    /// The PutObjectRetention operation.
119    PutObjectRetention,
120    /// The GetObjectLegalHold operation.
121    GetObjectLegalHold,
122    /// The PutObjectLegalHold operation.
123    PutObjectLegalHold,
124    /// The GetObjectAttributes operation.
125    GetObjectAttributes,
126    /// The CreateMultipartUpload operation.
127    CreateMultipartUpload,
128    /// The UploadPart operation.
129    UploadPart,
130    /// The UploadPartCopy operation.
131    UploadPartCopy,
132    /// The CompleteMultipartUpload operation.
133    CompleteMultipartUpload,
134    /// The AbortMultipartUpload operation.
135    AbortMultipartUpload,
136    /// The ListParts operation.
137    ListParts,
138    /// The ListMultipartUploads operation.
139    ListMultipartUploads,
140    /// The ListObjects operation.
141    ListObjects,
142    /// The ListObjectsV2 operation.
143    ListObjectsV2,
144    /// The ListObjectVersions operation.
145    ListObjectVersions,
146    /// The PostObject (browser-based upload) operation.
147    PostObject,
148}
149
150impl S3Operation {
151    /// Returns the AWS operation name string.
152    #[must_use]
153    pub fn as_str(&self) -> &'static str {
154        match self {
155            Self::CreateBucket => "CreateBucket",
156            Self::DeleteBucket => "DeleteBucket",
157            Self::HeadBucket => "HeadBucket",
158            Self::ListBuckets => "ListBuckets",
159            Self::GetBucketLocation => "GetBucketLocation",
160            Self::GetBucketVersioning => "GetBucketVersioning",
161            Self::PutBucketVersioning => "PutBucketVersioning",
162            Self::GetBucketEncryption => "GetBucketEncryption",
163            Self::PutBucketEncryption => "PutBucketEncryption",
164            Self::DeleteBucketEncryption => "DeleteBucketEncryption",
165            Self::GetBucketCors => "GetBucketCors",
166            Self::PutBucketCors => "PutBucketCors",
167            Self::DeleteBucketCors => "DeleteBucketCors",
168            Self::GetBucketLifecycleConfiguration => "GetBucketLifecycleConfiguration",
169            Self::PutBucketLifecycleConfiguration => "PutBucketLifecycleConfiguration",
170            Self::DeleteBucketLifecycle => "DeleteBucketLifecycle",
171            Self::GetBucketPolicy => "GetBucketPolicy",
172            Self::PutBucketPolicy => "PutBucketPolicy",
173            Self::DeleteBucketPolicy => "DeleteBucketPolicy",
174            Self::GetBucketTagging => "GetBucketTagging",
175            Self::PutBucketTagging => "PutBucketTagging",
176            Self::DeleteBucketTagging => "DeleteBucketTagging",
177            Self::GetBucketNotificationConfiguration => "GetBucketNotificationConfiguration",
178            Self::PutBucketNotificationConfiguration => "PutBucketNotificationConfiguration",
179            Self::GetBucketLogging => "GetBucketLogging",
180            Self::PutBucketLogging => "PutBucketLogging",
181            Self::GetPublicAccessBlock => "GetPublicAccessBlock",
182            Self::PutPublicAccessBlock => "PutPublicAccessBlock",
183            Self::DeletePublicAccessBlock => "DeletePublicAccessBlock",
184            Self::GetBucketOwnershipControls => "GetBucketOwnershipControls",
185            Self::PutBucketOwnershipControls => "PutBucketOwnershipControls",
186            Self::DeleteBucketOwnershipControls => "DeleteBucketOwnershipControls",
187            Self::GetObjectLockConfiguration => "GetObjectLockConfiguration",
188            Self::PutObjectLockConfiguration => "PutObjectLockConfiguration",
189            Self::GetBucketAccelerateConfiguration => "GetBucketAccelerateConfiguration",
190            Self::PutBucketAccelerateConfiguration => "PutBucketAccelerateConfiguration",
191            Self::GetBucketRequestPayment => "GetBucketRequestPayment",
192            Self::PutBucketRequestPayment => "PutBucketRequestPayment",
193            Self::GetBucketWebsite => "GetBucketWebsite",
194            Self::PutBucketWebsite => "PutBucketWebsite",
195            Self::DeleteBucketWebsite => "DeleteBucketWebsite",
196            Self::GetBucketAcl => "GetBucketAcl",
197            Self::PutBucketAcl => "PutBucketAcl",
198            Self::GetBucketPolicyStatus => "GetBucketPolicyStatus",
199            Self::PutObject => "PutObject",
200            Self::GetObject => "GetObject",
201            Self::HeadObject => "HeadObject",
202            Self::DeleteObject => "DeleteObject",
203            Self::DeleteObjects => "DeleteObjects",
204            Self::CopyObject => "CopyObject",
205            Self::GetObjectTagging => "GetObjectTagging",
206            Self::PutObjectTagging => "PutObjectTagging",
207            Self::DeleteObjectTagging => "DeleteObjectTagging",
208            Self::GetObjectAcl => "GetObjectAcl",
209            Self::PutObjectAcl => "PutObjectAcl",
210            Self::GetObjectRetention => "GetObjectRetention",
211            Self::PutObjectRetention => "PutObjectRetention",
212            Self::GetObjectLegalHold => "GetObjectLegalHold",
213            Self::PutObjectLegalHold => "PutObjectLegalHold",
214            Self::GetObjectAttributes => "GetObjectAttributes",
215            Self::CreateMultipartUpload => "CreateMultipartUpload",
216            Self::UploadPart => "UploadPart",
217            Self::UploadPartCopy => "UploadPartCopy",
218            Self::CompleteMultipartUpload => "CompleteMultipartUpload",
219            Self::AbortMultipartUpload => "AbortMultipartUpload",
220            Self::ListParts => "ListParts",
221            Self::ListMultipartUploads => "ListMultipartUploads",
222            Self::ListObjects => "ListObjects",
223            Self::ListObjectsV2 => "ListObjectsV2",
224            Self::ListObjectVersions => "ListObjectVersions",
225            Self::PostObject => "PostObject",
226        }
227    }
228
229    /// Parse an operation name string into an S3Operation.
230    #[must_use]
231    pub fn from_name(name: &str) -> Option<Self> {
232        match name {
233            "CreateBucket" => Some(Self::CreateBucket),
234            "DeleteBucket" => Some(Self::DeleteBucket),
235            "HeadBucket" => Some(Self::HeadBucket),
236            "ListBuckets" => Some(Self::ListBuckets),
237            "GetBucketLocation" => Some(Self::GetBucketLocation),
238            "GetBucketVersioning" => Some(Self::GetBucketVersioning),
239            "PutBucketVersioning" => Some(Self::PutBucketVersioning),
240            "GetBucketEncryption" => Some(Self::GetBucketEncryption),
241            "PutBucketEncryption" => Some(Self::PutBucketEncryption),
242            "DeleteBucketEncryption" => Some(Self::DeleteBucketEncryption),
243            "GetBucketCors" => Some(Self::GetBucketCors),
244            "PutBucketCors" => Some(Self::PutBucketCors),
245            "DeleteBucketCors" => Some(Self::DeleteBucketCors),
246            "GetBucketLifecycleConfiguration" => Some(Self::GetBucketLifecycleConfiguration),
247            "PutBucketLifecycleConfiguration" => Some(Self::PutBucketLifecycleConfiguration),
248            "DeleteBucketLifecycle" => Some(Self::DeleteBucketLifecycle),
249            "GetBucketPolicy" => Some(Self::GetBucketPolicy),
250            "PutBucketPolicy" => Some(Self::PutBucketPolicy),
251            "DeleteBucketPolicy" => Some(Self::DeleteBucketPolicy),
252            "GetBucketTagging" => Some(Self::GetBucketTagging),
253            "PutBucketTagging" => Some(Self::PutBucketTagging),
254            "DeleteBucketTagging" => Some(Self::DeleteBucketTagging),
255            "GetBucketNotificationConfiguration" => Some(Self::GetBucketNotificationConfiguration),
256            "PutBucketNotificationConfiguration" => Some(Self::PutBucketNotificationConfiguration),
257            "GetBucketLogging" => Some(Self::GetBucketLogging),
258            "PutBucketLogging" => Some(Self::PutBucketLogging),
259            "GetPublicAccessBlock" => Some(Self::GetPublicAccessBlock),
260            "PutPublicAccessBlock" => Some(Self::PutPublicAccessBlock),
261            "DeletePublicAccessBlock" => Some(Self::DeletePublicAccessBlock),
262            "GetBucketOwnershipControls" => Some(Self::GetBucketOwnershipControls),
263            "PutBucketOwnershipControls" => Some(Self::PutBucketOwnershipControls),
264            "DeleteBucketOwnershipControls" => Some(Self::DeleteBucketOwnershipControls),
265            "GetObjectLockConfiguration" => Some(Self::GetObjectLockConfiguration),
266            "PutObjectLockConfiguration" => Some(Self::PutObjectLockConfiguration),
267            "GetBucketAccelerateConfiguration" => Some(Self::GetBucketAccelerateConfiguration),
268            "PutBucketAccelerateConfiguration" => Some(Self::PutBucketAccelerateConfiguration),
269            "GetBucketRequestPayment" => Some(Self::GetBucketRequestPayment),
270            "PutBucketRequestPayment" => Some(Self::PutBucketRequestPayment),
271            "GetBucketWebsite" => Some(Self::GetBucketWebsite),
272            "PutBucketWebsite" => Some(Self::PutBucketWebsite),
273            "DeleteBucketWebsite" => Some(Self::DeleteBucketWebsite),
274            "GetBucketAcl" => Some(Self::GetBucketAcl),
275            "PutBucketAcl" => Some(Self::PutBucketAcl),
276            "GetBucketPolicyStatus" => Some(Self::GetBucketPolicyStatus),
277            "PutObject" => Some(Self::PutObject),
278            "GetObject" => Some(Self::GetObject),
279            "HeadObject" => Some(Self::HeadObject),
280            "DeleteObject" => Some(Self::DeleteObject),
281            "DeleteObjects" => Some(Self::DeleteObjects),
282            "CopyObject" => Some(Self::CopyObject),
283            "GetObjectTagging" => Some(Self::GetObjectTagging),
284            "PutObjectTagging" => Some(Self::PutObjectTagging),
285            "DeleteObjectTagging" => Some(Self::DeleteObjectTagging),
286            "GetObjectAcl" => Some(Self::GetObjectAcl),
287            "PutObjectAcl" => Some(Self::PutObjectAcl),
288            "GetObjectRetention" => Some(Self::GetObjectRetention),
289            "PutObjectRetention" => Some(Self::PutObjectRetention),
290            "GetObjectLegalHold" => Some(Self::GetObjectLegalHold),
291            "PutObjectLegalHold" => Some(Self::PutObjectLegalHold),
292            "GetObjectAttributes" => Some(Self::GetObjectAttributes),
293            "CreateMultipartUpload" => Some(Self::CreateMultipartUpload),
294            "UploadPart" => Some(Self::UploadPart),
295            "UploadPartCopy" => Some(Self::UploadPartCopy),
296            "CompleteMultipartUpload" => Some(Self::CompleteMultipartUpload),
297            "AbortMultipartUpload" => Some(Self::AbortMultipartUpload),
298            "ListParts" => Some(Self::ListParts),
299            "ListMultipartUploads" => Some(Self::ListMultipartUploads),
300            "ListObjects" => Some(Self::ListObjects),
301            "ListObjectsV2" => Some(Self::ListObjectsV2),
302            "ListObjectVersions" => Some(Self::ListObjectVersions),
303            "PostObject" => Some(Self::PostObject),
304            _ => None,
305        }
306    }
307}
308
309impl std::fmt::Display for S3Operation {
310    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
311        f.write_str(self.as_str())
312    }
313}