Skip to main content

aws_lite_rs/types/
s3.rs

1//! Types for the Amazon S3 API (v1).
2//!
3//! Auto-generated from the AWS Botocore Model.
4//! **Do not edit manually** — modify the manifest and re-run codegen.
5
6use serde::{Deserialize, Serialize};
7
8/// The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket. You can
9/// enable the configuration options in any combination. Bucket-level settings work alongside
10/// account-level settings (which may inherit from organization-level policies). For more
11/// information about when Amazon S3 considers a bucket or object public, see The Meaning of
12/// "Public" in the Amazon S3 User Guide.
13///
14/// **AWS API**: `s3.v1.PublicAccessBlockConfiguration`
15#[derive(Debug, Clone, Default, Serialize, Deserialize)]
16#[serde(rename_all = "PascalCase")]
17pub struct PublicAccessBlockConfiguration {
18    /// Specifies whether Amazon S3 should block public access control lists (ACLs) for this
19    /// bucket and objects in this bucket. Setting this element to TRUE causes the following
20    /// behavior: PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public.
21    /// PUT Object calls fail if the request includes a public ACL. PUT Bucket calls fail if the
22    /// request includes a public ACL. Enabling this setting doesn't affect existing policies or
23    /// ACLs.
24    #[serde(skip_serializing_if = "Option::is_none")]
25    pub block_public_acls: Option<bool>,
26
27    /// Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in
28    /// this bucket. Setting this element to TRUE causes Amazon S3 to ignore all public ACLs on
29    /// this bucket and objects in this bucket. Enabling this setting doesn't affect the
30    /// persistence of any existing ACLs and doesn't prevent new public ACLs from being set.
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub ignore_public_acls: Option<bool>,
33
34    /// Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting
35    /// this element to TRUE causes Amazon S3 to reject calls to PUT Bucket policy if the
36    /// specified bucket policy allows public access. Enabling this setting doesn't affect
37    /// existing bucket policies.
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub block_public_policy: Option<bool>,
40
41    /// Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
42    /// Setting this element to TRUE restricts access to this bucket to only Amazon Web Services
43    /// service principals and authorized users within this account if the bucket has a public
44    /// policy. Enabling this setting doesn't affect previously stored bucket policies, except
45    /// that public and cross-account access within any public bucket policy, including non-
46    /// public delegation to specific accounts, is blocked.
47    #[serde(skip_serializing_if = "Option::is_none")]
48    pub restrict_public_buckets: Option<bool>,
49}
50
51impl PublicAccessBlockConfiguration {
52    #[cfg(any(test, feature = "test-support"))]
53    /// Create a fixture instance for testing.
54    pub fn fixture() -> Self {
55        Self {
56            block_public_acls: Some(false),
57            ignore_public_acls: Some(false),
58            block_public_policy: Some(false),
59            restrict_public_buckets: Some(false),
60        }
61    }
62}
63
64/// Specifies the lifecycle configuration for objects in an Amazon S3 bucket. For more
65/// information, see Object Lifecycle Management in the Amazon S3 User Guide.
66///
67/// **AWS API**: `s3.v1.BucketLifecycleConfiguration`
68#[derive(Debug, Clone, Default, Serialize, Deserialize)]
69#[serde(rename_all = "PascalCase")]
70pub struct BucketLifecycleConfiguration {
71    /// A lifecycle rule for individual objects in an Amazon S3 bucket.
72    #[serde(default)]
73    pub rules: Vec<LifecycleRule>,
74}
75
76impl BucketLifecycleConfiguration {
77    #[cfg(any(test, feature = "test-support"))]
78    /// Create a fixture instance for testing.
79    pub fn fixture() -> Self {
80        Self { rules: vec![] }
81    }
82}
83
84/// The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter can have
85/// exactly one of Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan, or And specified. If
86/// the Filter element is left empty, the Lifecycle Rule applies to all objects in the bucket.
87///
88/// **AWS API**: `s3.v1.LifecycleRuleFilter`
89///
90/// ## Coverage
91/// 3 of 5 fields included.
92/// Omitted fields:
93/// - `Tag` — not selected in manifest
94/// - `And` — not selected in manifest
95#[derive(Debug, Clone, Default, Serialize, Deserialize)]
96#[serde(rename_all = "PascalCase")]
97pub struct LifecycleRuleFilter {
98    /// Prefix identifying one or more objects to which the rule applies. Replacement must be
99    /// made for object keys containing special characters (such as carriage returns) when using
100    /// XML requests. For more information, see XML related object key constraints.
101    #[serde(skip_serializing_if = "Option::is_none")]
102    pub prefix: Option<String>,
103
104    /// Minimum object size to which the rule applies.
105    #[serde(skip_serializing_if = "Option::is_none")]
106    pub object_size_greater_than: Option<i64>,
107
108    /// Maximum object size to which the rule applies.
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub object_size_less_than: Option<i64>,
111}
112
113impl LifecycleRuleFilter {
114    #[cfg(any(test, feature = "test-support"))]
115    /// Create a fixture instance for testing.
116    pub fn fixture() -> Self {
117        Self {
118            prefix: Some("test-prefix".into()),
119            object_size_greater_than: Some(100),
120            object_size_less_than: Some(100),
121        }
122    }
123}
124
125/// A lifecycle rule for individual objects in an Amazon S3 bucket. For more information see,
126/// Managing your storage lifecycle in the Amazon S3 User Guide.
127///
128/// **AWS API**: `s3.v1.LifecycleRule`
129#[derive(Debug, Clone, Default, Serialize, Deserialize)]
130#[serde(rename_all = "PascalCase")]
131pub struct LifecycleRule {
132    /// Specifies the expiration for the lifecycle of the object in the form of date, days and,
133    /// whether the object has a delete marker.
134    #[serde(skip_serializing_if = "Option::is_none")]
135    pub expiration: Option<LifecycleExpiration>,
136
137    /// Unique identifier for the rule. The value cannot be longer than 255 characters.
138    #[serde(rename = "ID")]
139    #[serde(skip_serializing_if = "Option::is_none")]
140    pub id: Option<String>,
141
142    /// The general purpose bucket prefix that identifies one or more objects to which the rule
143    /// applies. We recommend using Filter instead of Prefix for new PUTs. Previous
144    /// configurations where a prefix is defined will continue to operate as before. Replacement
145    /// must be made for object keys containing special characters (such as carriage returns)
146    /// when using XML requests. For more information, see XML related object key constraints.
147    #[serde(skip_serializing_if = "Option::is_none")]
148    pub prefix: Option<String>,
149
150    /// The Filter is used to identify objects that a Lifecycle Rule applies to. A Filter must
151    /// have exactly one of Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan, or And
152    /// specified. Filter is required if the LifecycleRule does not contain a Prefix element.
153    /// For more information about Tag filters, see Adding filters to Lifecycle rules in the
154    /// Amazon S3 User Guide. Tag filters are not supported for directory buckets.
155    #[serde(skip_serializing_if = "Option::is_none")]
156    pub filter: Option<LifecycleRuleFilter>,
157
158    /// If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not
159    /// currently being applied.
160    pub status: String,
161
162    /// Specifies when an Amazon S3 object transitions to a specified storage class. This
163    /// parameter applies to general purpose buckets only. It is not supported for directory
164    /// bucket lifecycle configurations.
165    #[serde(rename = "Transition")]
166    #[serde(default)]
167    #[serde(skip_serializing_if = "Vec::is_empty")]
168    pub transitions: Vec<Transition>,
169
170    /// Specifies the transition rule for the lifecycle rule that describes when noncurrent
171    /// objects transition to a specific storage class. If your bucket is versioning-enabled (or
172    /// versioning is suspended), you can set this action to request that Amazon S3 transition
173    /// noncurrent object versions to a specific storage class at a set period in the object's
174    /// lifetime. This parameter applies to general purpose buckets only. It is not supported
175    /// for directory bucket lifecycle configurations.
176    #[serde(rename = "NoncurrentVersionTransition")]
177    #[serde(default)]
178    #[serde(skip_serializing_if = "Vec::is_empty")]
179    pub noncurrent_version_transitions: Vec<NoncurrentVersionTransition>,
180
181    /// The `NoncurrentVersionExpiration` field.
182    #[serde(skip_serializing_if = "Option::is_none")]
183    pub noncurrent_version_expiration: Option<NoncurrentVersionExpiration>,
184
185    /// The `AbortIncompleteMultipartUpload` field.
186    #[serde(skip_serializing_if = "Option::is_none")]
187    pub abort_incomplete_multipart_upload: Option<AbortIncompleteMultipartUpload>,
188}
189
190impl LifecycleRule {
191    #[cfg(any(test, feature = "test-support"))]
192    /// Create a fixture instance for testing.
193    pub fn fixture() -> Self {
194        Self {
195            expiration: Some(LifecycleExpiration::fixture()),
196            id: Some("test-id".into()),
197            prefix: Some("test-prefix".into()),
198            filter: Some(LifecycleRuleFilter::fixture()),
199            status: "test-status".into(),
200            transitions: vec![],
201            noncurrent_version_transitions: vec![],
202            noncurrent_version_expiration: Some(NoncurrentVersionExpiration::fixture()),
203            abort_incomplete_multipart_upload: Some(AbortIncompleteMultipartUpload::fixture()),
204        }
205    }
206}
207
208///
209/// **AWS API**: `s3.v1.ListBucketsOutput`
210///
211/// ## Coverage
212/// 2 of 4 fields included.
213/// Omitted fields:
214/// - `ContinuationToken` — not selected in manifest
215/// - `Prefix` — not selected in manifest
216#[derive(Debug, Clone, Default, Serialize, Deserialize)]
217#[serde(rename_all = "PascalCase")]
218pub struct ListBucketsResponse {
219    /// The list of buckets owned by the requester.
220    #[serde(default)]
221    #[serde(skip_serializing_if = "Vec::is_empty")]
222    pub buckets: Vec<Bucket>,
223
224    /// The owner of the buckets listed.
225    #[serde(skip_serializing_if = "Option::is_none")]
226    pub owner: Option<Owner>,
227}
228
229impl ListBucketsResponse {
230    #[cfg(any(test, feature = "test-support"))]
231    /// Create a fixture instance for testing.
232    pub fn fixture() -> Self {
233        Self {
234            buckets: vec![],
235            owner: Some(Owner::fixture()),
236        }
237    }
238}
239
240/// In terms of implementation, a Bucket is a resource.
241///
242/// **AWS API**: `s3.v1.Bucket`
243///
244/// ## Coverage
245/// 2 of 4 fields included.
246/// Omitted fields:
247/// - `BucketRegion` — not selected in manifest
248/// - `BucketArn` — not selected in manifest
249#[derive(Debug, Clone, Default, Serialize, Deserialize)]
250#[serde(rename_all = "PascalCase")]
251pub struct Bucket {
252    /// The name of the bucket.
253    #[serde(skip_serializing_if = "Option::is_none")]
254    pub name: Option<String>,
255
256    /// Date the bucket was created. This date can change when making changes to your bucket,
257    /// such as editing its bucket policy.
258    #[serde(skip_serializing_if = "Option::is_none")]
259    pub creation_date: Option<String>,
260}
261
262impl Bucket {
263    #[cfg(any(test, feature = "test-support"))]
264    /// Create a fixture instance for testing.
265    pub fn fixture() -> Self {
266        Self {
267            name: Some("test-name".into()),
268            creation_date: Some("test-creation_date".into()),
269        }
270    }
271}
272
273/// Container for the owner's display name and ID.
274///
275/// **AWS API**: `s3.v1.Owner`
276#[derive(Debug, Clone, Default, Serialize, Deserialize)]
277#[serde(rename_all = "PascalCase")]
278pub struct Owner {
279    /// The `DisplayName` field.
280    #[serde(skip_serializing_if = "Option::is_none")]
281    pub display_name: Option<String>,
282
283    /// Container for the ID of the owner.
284    #[serde(rename = "ID")]
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub id: Option<String>,
287}
288
289impl Owner {
290    #[cfg(any(test, feature = "test-support"))]
291    /// Create a fixture instance for testing.
292    pub fn fixture() -> Self {
293        Self {
294            display_name: Some("test-display_name".into()),
295            id: Some("test-id".into()),
296        }
297    }
298}
299
300///
301/// **AWS API**: `s3.v1.GetBucketVersioningOutput`
302#[derive(Debug, Clone, Default, Serialize, Deserialize)]
303#[serde(rename_all = "PascalCase")]
304pub struct GetBucketVersioningResponse {
305    /// The versioning state of the bucket.
306    #[serde(skip_serializing_if = "Option::is_none")]
307    pub status: Option<String>,
308
309    /// Specifies whether MFA delete is enabled in the bucket versioning configuration. This
310    /// element is only returned if the bucket has been configured with MFA delete. If the
311    /// bucket has never been so configured, this element is not returned.
312    #[serde(rename = "MfaDelete")]
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub mfa_delete: Option<String>,
315}
316
317impl GetBucketVersioningResponse {
318    #[cfg(any(test, feature = "test-support"))]
319    /// Create a fixture instance for testing.
320    pub fn fixture() -> Self {
321        Self {
322            status: Some("test-status".into()),
323            mfa_delete: Some("test-mfa_delete".into()),
324        }
325    }
326}
327
328///
329/// **AWS API**: `s3.v1.GetBucketEncryptionOutput`
330#[derive(Debug, Clone, Default, Serialize, Deserialize)]
331#[serde(rename_all = "PascalCase")]
332pub struct GetBucketEncryptionResponse {
333    /// The `ServerSideEncryptionConfiguration` field.
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub server_side_encryption_configuration: Option<ServerSideEncryptionConfiguration>,
336}
337
338impl GetBucketEncryptionResponse {
339    #[cfg(any(test, feature = "test-support"))]
340    /// Create a fixture instance for testing.
341    pub fn fixture() -> Self {
342        Self {
343            server_side_encryption_configuration: Some(ServerSideEncryptionConfiguration::fixture()),
344        }
345    }
346}
347
348/// Specifies the default server-side-encryption configuration.
349///
350/// **AWS API**: `s3.v1.ServerSideEncryptionConfiguration`
351#[derive(Debug, Clone, Default, Serialize, Deserialize)]
352#[serde(rename_all = "PascalCase")]
353pub struct ServerSideEncryptionConfiguration {
354    /// Container for information about a particular server-side encryption configuration rule.
355    #[serde(rename = "Rule")]
356    #[serde(default)]
357    pub rules: Vec<ServerSideEncryptionRule>,
358}
359
360impl ServerSideEncryptionConfiguration {
361    #[cfg(any(test, feature = "test-support"))]
362    /// Create a fixture instance for testing.
363    pub fn fixture() -> Self {
364        Self { rules: vec![] }
365    }
366}
367
368/// Specifies the default server-side encryption configuration. General purpose buckets
369/// - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS
370///   key ARN. If you use a KMS key alias instead, then KMS resolves the key within the
371///   requester’s account. This behavior can result in data that's encrypted with a KMS key that
372///   belongs to the requester, and not the bucket owner. Directory buckets
373/// - When you specify an KMS customer managed key for encryption in your directory bucket, only
374///   use the key ID or key ARN. The key alias format of the KMS key isn't supported.
375///
376/// **AWS API**: `s3.v1.ServerSideEncryptionRule`
377///
378/// ## Coverage
379/// 2 of 3 fields included.
380/// Omitted fields:
381/// - `BlockedEncryptionTypes` — not selected in manifest
382#[derive(Debug, Clone, Default, Serialize, Deserialize)]
383#[serde(rename_all = "PascalCase")]
384pub struct ServerSideEncryptionRule {
385    /// Specifies the default server-side encryption to apply to new objects in the bucket. If a
386    /// PUT Object request doesn't specify any server-side encryption, this default encryption
387    /// will be applied.
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub apply_server_side_encryption_by_default: Option<ServerSideEncryptionByDefault>,
390
391    /// Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption
392    /// using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected.
393    /// Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key.
394    /// General purpose buckets
395    /// - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket
396    ///   Keys in the Amazon S3 User Guide. Directory buckets
397    /// - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and
398    ///   can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted
399    ///   objects from general purpose buckets to directory buckets, from directory buckets to
400    ///   general purpose buckets, or between directory buckets, through CopyObject,
401    ///   UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this
402    ///   case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-
403    ///   encrypted object.
404    #[serde(skip_serializing_if = "Option::is_none")]
405    pub bucket_key_enabled: Option<bool>,
406}
407
408impl ServerSideEncryptionRule {
409    #[cfg(any(test, feature = "test-support"))]
410    /// Create a fixture instance for testing.
411    pub fn fixture() -> Self {
412        Self {
413            apply_server_side_encryption_by_default: Some(ServerSideEncryptionByDefault::fixture()),
414            bucket_key_enabled: Some(false),
415        }
416    }
417}
418
419/// Describes the default server-side encryption to apply to new objects in the bucket. If a PUT
420/// Object request doesn't specify any server-side encryption, this default encryption will be
421/// applied. For more information, see PutBucketEncryption. General purpose buckets
422/// - If you don't specify a customer managed key at configuration, Amazon S3 automatically
423///   creates an Amazon Web Services KMS key (aws/s3) in your Amazon Web Services account the
424///   first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon
425///   S3 uses this KMS key for SSE-KMS. Directory buckets
426/// - Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's
427///   lifetime. The Amazon Web Services managed key (aws/s3) isn't supported. Directory buckets
428/// - For directory buckets, there are only two supported options for server-side encryption:
429///   SSE-S3 and SSE-KMS.
430///
431/// **AWS API**: `s3.v1.ServerSideEncryptionByDefault`
432#[derive(Debug, Clone, Default, Serialize, Deserialize)]
433#[serde(rename_all = "PascalCase")]
434pub struct ServerSideEncryptionByDefault {
435    /// Server-side encryption algorithm to use for the default encryption. For directory
436    /// buckets, there are only two supported values for server-side encryption: AES256 and
437    /// aws:kms.
438    #[serde(rename = "SSEAlgorithm")]
439    pub sse_algorithm: String,
440
441    /// Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the
442    /// default encryption. General purpose buckets
443    /// - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or
444    ///   aws:kms:dsse. Directory buckets
445    /// - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms. You can
446    ///   specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. Key
447    ///   ID: 1234abcd-12ab-34cd-56ef-1234567890ab Key ARN: arn:aws:kms:us-
448    ///   east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab Key Alias: alias/alias-
449    ///   name If you are using encryption with cross-account or Amazon Web Services service
450    ///   operations, you must use a fully qualified KMS key ARN. For more information, see
451    ///   Using encryption for cross-account operations. General purpose buckets
452    /// - If you're specifying a customer managed KMS key, we recommend using a fully qualified
453    ///   KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the
454    ///   requester’s account. This behavior can result in data that's encrypted with a KMS key
455    ///   that belongs to the requester, and not the bucket owner. Also, if you use a key ID,
456    ///   you can run into a LogDestination undeliverable error when creating a VPC flow log.
457    ///   Directory buckets
458    /// - When you specify an KMS customer managed key for encryption in your directory bucket,
459    ///   only use the key ID or key ARN. The key alias format of the KMS key isn't supported.
460    ///   Amazon S3 only supports symmetric encryption KMS keys. For more information, see
461    ///   Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management
462    ///   Service Developer Guide.
463    #[serde(rename = "KMSMasterKeyID")]
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub kms_master_key_id: Option<String>,
466}
467
468impl ServerSideEncryptionByDefault {
469    #[cfg(any(test, feature = "test-support"))]
470    /// Create a fixture instance for testing.
471    pub fn fixture() -> Self {
472        Self {
473            sse_algorithm: "test-sse_algorithm".into(),
474            kms_master_key_id: Some("test-kms_master_key_id".into()),
475        }
476    }
477}
478
479///
480/// **AWS API**: `s3.v1.GetBucketLoggingOutput`
481#[derive(Debug, Clone, Default, Serialize, Deserialize)]
482#[serde(rename_all = "PascalCase")]
483pub struct GetBucketLoggingResponse {
484    /// The `LoggingEnabled` field.
485    #[serde(skip_serializing_if = "Option::is_none")]
486    pub logging_enabled: Option<LoggingEnabled>,
487}
488
489impl GetBucketLoggingResponse {
490    #[cfg(any(test, feature = "test-support"))]
491    /// Create a fixture instance for testing.
492    pub fn fixture() -> Self {
493        Self {
494            logging_enabled: Some(LoggingEnabled::fixture()),
495        }
496    }
497}
498
499/// Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys
500/// for a bucket. For more information, see PUT Bucket logging in the Amazon S3 API Reference.
501///
502/// **AWS API**: `s3.v1.LoggingEnabled`
503///
504/// ## Coverage
505/// 2 of 4 fields included.
506/// Omitted fields:
507/// - `TargetGrants` — not selected in manifest
508/// - `TargetObjectKeyFormat` — not selected in manifest
509#[derive(Debug, Clone, Default, Serialize, Deserialize)]
510#[serde(rename_all = "PascalCase")]
511pub struct LoggingEnabled {
512    /// Specifies the bucket where you want Amazon S3 to store server access logs. You can have
513    /// your logs delivered to any bucket that you own, including the same bucket that is being
514    /// logged. You can also configure multiple buckets to deliver their logs to the same target
515    /// bucket. In this case, you should choose a different TargetPrefix for each source bucket
516    /// so that the delivered log files can be distinguished by key.
517    pub target_bucket: String,
518
519    /// A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets
520    /// in a single bucket, you can use a prefix to distinguish which log files came from which
521    /// bucket.
522    pub target_prefix: String,
523}
524
525impl LoggingEnabled {
526    #[cfg(any(test, feature = "test-support"))]
527    /// Create a fixture instance for testing.
528    pub fn fixture() -> Self {
529        Self {
530            target_bucket: "test-target_bucket".into(),
531            target_prefix: "test-target_prefix".into(),
532        }
533    }
534}
535
536///
537/// **AWS API**: `s3.v1.GetBucketAclOutput`
538#[derive(Debug, Clone, Default, Serialize, Deserialize)]
539#[serde(rename_all = "PascalCase")]
540pub struct GetBucketAclResponse {
541    /// Container for the bucket owner's ID.
542    #[serde(skip_serializing_if = "Option::is_none")]
543    pub owner: Option<Owner>,
544
545    /// A list of grants.
546    #[serde(rename = "AccessControlList")]
547    #[serde(default)]
548    #[serde(skip_serializing_if = "Vec::is_empty")]
549    pub grants: Vec<Grant>,
550}
551
552impl GetBucketAclResponse {
553    #[cfg(any(test, feature = "test-support"))]
554    /// Create a fixture instance for testing.
555    pub fn fixture() -> Self {
556        Self {
557            owner: Some(Owner::fixture()),
558            grants: vec![],
559        }
560    }
561}
562
563/// Container for grant information.
564///
565/// **AWS API**: `s3.v1.Grant`
566#[derive(Debug, Clone, Default, Serialize, Deserialize)]
567#[serde(rename_all = "PascalCase")]
568pub struct Grant {
569    /// The person being granted permissions.
570    #[serde(skip_serializing_if = "Option::is_none")]
571    pub grantee: Option<Grantee>,
572
573    /// Specifies the permission given to the grantee.
574    #[serde(skip_serializing_if = "Option::is_none")]
575    pub permission: Option<String>,
576}
577
578impl Grant {
579    #[cfg(any(test, feature = "test-support"))]
580    /// Create a fixture instance for testing.
581    pub fn fixture() -> Self {
582        Self {
583            grantee: Some(Grantee::fixture()),
584            permission: Some("test-permission".into()),
585        }
586    }
587}
588
589/// Container for the person being granted permissions.
590///
591/// **AWS API**: `s3.v1.Grantee`
592///
593/// ## Coverage
594/// 3 of 5 fields included.
595/// Omitted fields:
596/// - `EmailAddress` — not selected in manifest
597/// - `Type` — not selected in manifest
598#[derive(Debug, Clone, Default, Serialize, Deserialize)]
599#[serde(rename_all = "PascalCase")]
600pub struct Grantee {
601    /// The `DisplayName` field.
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub display_name: Option<String>,
604
605    /// The canonical user ID of the grantee.
606    #[serde(rename = "ID")]
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub id: Option<String>,
609
610    /// URI of the grantee group.
611    #[serde(rename = "URI")]
612    #[serde(skip_serializing_if = "Option::is_none")]
613    pub uri: Option<String>,
614}
615
616impl Grantee {
617    #[cfg(any(test, feature = "test-support"))]
618    /// Create a fixture instance for testing.
619    pub fn fixture() -> Self {
620        Self {
621            display_name: Some("test-display_name".into()),
622            id: Some("test-id".into()),
623            uri: Some("test-uri".into()),
624        }
625    }
626}
627
628///
629/// **AWS API**: `s3.v1.GetBucketLifecycleConfigurationOutput`
630///
631/// ## Coverage
632/// 1 of 2 fields included.
633/// Omitted fields:
634/// - `TransitionDefaultMinimumObjectSize` — not selected in manifest
635#[derive(Debug, Clone, Default, Serialize, Deserialize)]
636#[serde(rename_all = "PascalCase")]
637pub struct GetBucketLifecycleConfigurationResponse {
638    /// Container for a lifecycle rule.
639    #[serde(rename = "Rule")]
640    #[serde(default)]
641    #[serde(skip_serializing_if = "Vec::is_empty")]
642    pub rules: Vec<LifecycleRule>,
643}
644
645impl GetBucketLifecycleConfigurationResponse {
646    #[cfg(any(test, feature = "test-support"))]
647    /// Create a fixture instance for testing.
648    pub fn fixture() -> Self {
649        Self { rules: vec![] }
650    }
651}
652
653///
654/// **AWS API**: `s3.v1.GetPublicAccessBlockOutput`
655#[derive(Debug, Clone, Default, Serialize, Deserialize)]
656#[serde(rename_all = "PascalCase")]
657pub struct GetPublicAccessBlockResponse {
658    /// The PublicAccessBlock configuration currently in effect for this Amazon S3 bucket.
659    #[serde(skip_serializing_if = "Option::is_none")]
660    pub public_access_block_configuration: Option<PublicAccessBlockConfiguration>,
661}
662
663impl GetPublicAccessBlockResponse {
664    #[cfg(any(test, feature = "test-support"))]
665    /// Create a fixture instance for testing.
666    pub fn fixture() -> Self {
667        Self {
668            public_access_block_configuration: Some(PublicAccessBlockConfiguration::fixture()),
669        }
670    }
671}
672
673/// Describes the versioning state of an Amazon S3 bucket. For more information, see PUT Bucket
674/// versioning in the Amazon S3 API Reference.
675///
676/// **AWS API**: `s3.v1.VersioningConfiguration`
677#[derive(Debug, Clone, Default, Serialize, Deserialize)]
678#[serde(rename_all = "PascalCase")]
679pub struct VersioningConfiguration {
680    /// Specifies whether MFA delete is enabled in the bucket versioning configuration. This
681    /// element is only returned if the bucket has been configured with MFA delete. If the
682    /// bucket has never been so configured, this element is not returned.
683    #[serde(rename = "MfaDelete")]
684    #[serde(skip_serializing_if = "Option::is_none")]
685    pub mfa_delete: Option<String>,
686
687    /// The versioning state of the bucket.
688    #[serde(skip_serializing_if = "Option::is_none")]
689    pub status: Option<String>,
690}
691
692impl VersioningConfiguration {
693    #[cfg(any(test, feature = "test-support"))]
694    /// Create a fixture instance for testing.
695    pub fn fixture() -> Self {
696        Self {
697            mfa_delete: Some("test-mfa_delete".into()),
698            status: Some("test-status".into()),
699        }
700    }
701}
702
703/// Container for logging status information.
704///
705/// **AWS API**: `s3.v1.BucketLoggingStatus`
706#[derive(Debug, Clone, Default, Serialize, Deserialize)]
707#[serde(rename_all = "PascalCase")]
708pub struct BucketLoggingStatus {
709    /// The `LoggingEnabled` field.
710    #[serde(skip_serializing_if = "Option::is_none")]
711    pub logging_enabled: Option<LoggingEnabled>,
712}
713
714impl BucketLoggingStatus {
715    #[cfg(any(test, feature = "test-support"))]
716    /// Create a fixture instance for testing.
717    pub fn fixture() -> Self {
718        Self {
719            logging_enabled: Some(LoggingEnabled::fixture()),
720        }
721    }
722}
723
724// ======================================================================
725// Auto-generated dependency types (referenced via $ref)
726// ======================================================================
727
728/// Specifies the days since the initiation of an incomplete multipart upload that Amazon S3
729/// will wait before permanently removing all parts of the upload. For more information, see
730/// Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the Amazon
731/// S3 User Guide.
732///
733/// **AWS API**: `s3.v1.AbortIncompleteMultipartUpload`
734///
735/// *Auto-generated dependency — all fields included.*
736#[derive(Debug, Clone, Default, Serialize, Deserialize)]
737#[serde(rename_all = "PascalCase")]
738pub struct AbortIncompleteMultipartUpload {
739    /// Specifies the number of days after which Amazon S3 aborts an incomplete multipart
740    /// upload.
741    #[serde(skip_serializing_if = "Option::is_none")]
742    pub days_after_initiation: Option<i32>,
743}
744
745impl AbortIncompleteMultipartUpload {
746    #[cfg(any(test, feature = "test-support"))]
747    /// Create a fixture instance for testing.
748    pub fn fixture() -> Self {
749        Self {
750            days_after_initiation: Some(100),
751        }
752    }
753}
754
755/// Container for the expiration for the lifecycle of the object. For more information see,
756/// Managing your storage lifecycle in the Amazon S3 User Guide.
757///
758/// **AWS API**: `s3.v1.LifecycleExpiration`
759///
760/// *Auto-generated dependency — all fields included.*
761#[derive(Debug, Clone, Default, Serialize, Deserialize)]
762#[serde(rename_all = "PascalCase")]
763pub struct LifecycleExpiration {
764    /// Indicates at what date the object is to be moved or deleted. The date value must conform
765    /// to the ISO 8601 format. The time is always midnight UTC. This parameter applies to
766    /// general purpose buckets only. It is not supported for directory bucket lifecycle
767    /// configurations.
768    #[serde(skip_serializing_if = "Option::is_none")]
769    pub date: Option<String>,
770
771    /// Indicates the lifetime, in days, of the objects that are subject to the rule. The value
772    /// must be a non-zero positive integer.
773    #[serde(skip_serializing_if = "Option::is_none")]
774    pub days: Option<i32>,
775
776    /// Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If
777    /// set to true, the delete marker will be expired; if set to false the policy takes no
778    /// action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
779    /// This parameter applies to general purpose buckets only. It is not supported for
780    /// directory bucket lifecycle configurations.
781    #[serde(skip_serializing_if = "Option::is_none")]
782    pub expired_object_delete_marker: Option<bool>,
783}
784
785impl LifecycleExpiration {
786    #[cfg(any(test, feature = "test-support"))]
787    /// Create a fixture instance for testing.
788    pub fn fixture() -> Self {
789        Self {
790            date: Some("test-date".into()),
791            days: Some(100),
792            expired_object_delete_marker: Some(false),
793        }
794    }
795}
796
797/// Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently
798/// deletes the noncurrent object versions. You set this lifecycle configuration action on a
799/// bucket that has versioning enabled (or suspended) to request that Amazon S3 delete
800/// noncurrent object versions at a specific period in the object's lifetime. This parameter
801/// applies to general purpose buckets only. It is not supported for directory bucket lifecycle
802/// configurations.
803///
804/// **AWS API**: `s3.v1.NoncurrentVersionExpiration`
805///
806/// *Auto-generated dependency — all fields included.*
807#[derive(Debug, Clone, Default, Serialize, Deserialize)]
808#[serde(rename_all = "PascalCase")]
809pub struct NoncurrentVersionExpiration {
810    /// Specifies the number of days an object is noncurrent before Amazon S3 can perform the
811    /// associated action. The value must be a non-zero positive integer. For information about
812    /// the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became
813    /// Noncurrent in the Amazon S3 User Guide. This parameter applies to general purpose
814    /// buckets only. It is not supported for directory bucket lifecycle configurations.
815    #[serde(skip_serializing_if = "Option::is_none")]
816    pub noncurrent_days: Option<i32>,
817
818    /// Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100
819    /// noncurrent versions to retain. Amazon S3 will permanently delete any additional
820    /// noncurrent versions beyond the specified number to retain. For more information about
821    /// noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide.
822    /// This parameter applies to general purpose buckets only. It is not supported for
823    /// directory bucket lifecycle configurations.
824    #[serde(skip_serializing_if = "Option::is_none")]
825    pub newer_noncurrent_versions: Option<i32>,
826}
827
828impl NoncurrentVersionExpiration {
829    #[cfg(any(test, feature = "test-support"))]
830    /// Create a fixture instance for testing.
831    pub fn fixture() -> Self {
832        Self {
833            noncurrent_days: Some(100),
834            newer_noncurrent_versions: Some(100),
835        }
836    }
837}
838
839/// Container for the transition rule that describes when noncurrent objects transition to the
840/// STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER_IR, GLACIER, or DEEP_ARCHIVE storage
841/// class. If your bucket is versioning-enabled (or versioning is suspended), you can set this
842/// action to request that Amazon S3 transition noncurrent object versions to the STANDARD_IA,
843/// ONEZONE_IA, INTELLIGENT_TIERING, GLACIER_IR, GLACIER, or DEEP_ARCHIVE storage class at a
844/// specific period in the object's lifetime.
845///
846/// **AWS API**: `s3.v1.NoncurrentVersionTransition`
847///
848/// *Auto-generated dependency — all fields included.*
849#[derive(Debug, Clone, Default, Serialize, Deserialize)]
850#[serde(rename_all = "PascalCase")]
851pub struct NoncurrentVersionTransition {
852    /// Specifies the number of days an object is noncurrent before Amazon S3 can perform the
853    /// associated action. For information about the noncurrent days calculations, see How
854    /// Amazon S3 Calculates How Long an Object Has Been Noncurrent in the Amazon S3 User Guide.
855    #[serde(skip_serializing_if = "Option::is_none")]
856    pub noncurrent_days: Option<i32>,
857
858    /// The class of storage used to store the object.
859    #[serde(skip_serializing_if = "Option::is_none")]
860    pub storage_class: Option<String>,
861
862    /// Specifies how many noncurrent versions Amazon S3 will retain in the same storage class
863    /// before transitioning objects. You can specify up to 100 noncurrent versions to retain.
864    /// Amazon S3 will transition any additional noncurrent versions beyond the specified number
865    /// to retain. For more information about noncurrent versions, see Lifecycle configuration
866    /// elements in the Amazon S3 User Guide.
867    #[serde(skip_serializing_if = "Option::is_none")]
868    pub newer_noncurrent_versions: Option<i32>,
869}
870
871impl NoncurrentVersionTransition {
872    #[cfg(any(test, feature = "test-support"))]
873    /// Create a fixture instance for testing.
874    pub fn fixture() -> Self {
875        Self {
876            noncurrent_days: Some(100),
877            storage_class: Some("test-storage_class".into()),
878            newer_noncurrent_versions: Some(100),
879        }
880    }
881}
882
883/// Specifies when an object transitions to a specified storage class. For more information
884/// about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3
885/// Lifecycle in the Amazon S3 User Guide.
886///
887/// **AWS API**: `s3.v1.Transition`
888///
889/// *Auto-generated dependency — all fields included.*
890#[derive(Debug, Clone, Default, Serialize, Deserialize)]
891#[serde(rename_all = "PascalCase")]
892pub struct Transition {
893    /// Indicates when objects are transitioned to the specified storage class. The date value
894    /// must be in ISO 8601 format. The time is always midnight UTC.
895    #[serde(skip_serializing_if = "Option::is_none")]
896    pub date: Option<String>,
897
898    /// Indicates the number of days after creation when objects are transitioned to the
899    /// specified storage class. If the specified storage class is INTELLIGENT_TIERING,
900    /// GLACIER_IR, GLACIER, or DEEP_ARCHIVE, valid values are 0 or positive integers. If the
901    /// specified storage class is STANDARD_IA or ONEZONE_IA, valid values are positive integers
902    /// greater than 30. Be aware that some storage classes have a minimum storage duration and
903    /// that you're charged for transitioning objects before their minimum storage duration. For
904    /// more information, see Constraints and considerations for transitions in the Amazon S3
905    /// User Guide.
906    #[serde(skip_serializing_if = "Option::is_none")]
907    pub days: Option<i32>,
908
909    /// The storage class to which you want the object to transition.
910    #[serde(skip_serializing_if = "Option::is_none")]
911    pub storage_class: Option<String>,
912}
913
914impl Transition {
915    #[cfg(any(test, feature = "test-support"))]
916    /// Create a fixture instance for testing.
917    pub fn fixture() -> Self {
918        Self {
919            date: Some("test-date".into()),
920            days: Some(100),
921            storage_class: Some("test-storage_class".into()),
922        }
923    }
924}