diff --git a/codegen/src/v1/dto.rs b/codegen/src/v1/dto.rs index 88390d8d..7f5bd80e 100644 --- a/codegen/src/v1/dto.rs +++ b/codegen/src/v1/dto.rs @@ -1,5 +1,6 @@ use super::o; use super::ops::{Operations, SKIPPED_OPS, is_op_input}; +use super::order; use super::rust::codegen_doc; use super::smithy::SmithyTraitsExt; use super::{rust, smithy}; @@ -151,7 +152,25 @@ pub fn collect_rust_types(model: &smithy::Model, ops: &Operations) -> RustTypes } smithy::Shape::Structure(shape) => { let mut fields = Vec::new(); - for (field_name, field) in &shape.members { + let member_list: Vec<(&str, &smithy::StructureMember)> = + if let Some(order) = order::struct_member_order(&rs_shape_name) { + let order_set: BTreeSet<&str> = order.iter().copied().collect(); + let mut list = Vec::new(); + for &name in order { + if let Some(field) = shape.members.get(name) { + list.push((name, field)); + } + } + for (name, field) in &shape.members { + if !order_set.contains(name.as_str()) { + list.push((name.as_str(), field)); + } + } + list + } else { + shape.members.iter().map(|(k, v)| (k.as_str(), v)).collect() + }; + for (field_name, field) in member_list { let rs_field_name = if field_name == "Type" { "type_".into() } else { @@ -212,7 +231,7 @@ pub fn collect_rust_types(model: &smithy::Model, ops: &Operations) -> RustTypes type_: field_type, doc: field.traits.doc().map(o), - camel_name: field_name.clone(), + camel_name: field_name.to_owned(), option_type, default_value, diff --git a/codegen/src/v1/mod.rs b/codegen/src/v1/mod.rs index 7e4517fd..8b239abe 100644 --- a/codegen/src/v1/mod.rs +++ b/codegen/src/v1/mod.rs @@ -8,6 +8,7 @@ mod error; mod headers; mod minio; mod ops; +mod order; mod s3_trait; mod sts; mod xml; diff --git a/codegen/src/v1/order.rs b/codegen/src/v1/order.rs new file mode 100644 index 00000000..9c7ae5c9 --- /dev/null +++ b/codegen/src/v1/order.rs @@ -0,0 +1,37 @@ +pub fn struct_member_order(shape_name: &str) -> Option<&'static [&'static str]> { + match shape_name { + "ListObjectsOutput" => Some(LIST_OBJECTS_OUTPUT_ORDER), + "ListObjectsV2Output" => Some(LIST_OBJECTS_V2_OUTPUT_ORDER), + _ => None, + } +} + +const LIST_OBJECTS_OUTPUT_ORDER: &[&str] = &[ + "Name", + "Prefix", + "Marker", + "MaxKeys", + "IsTruncated", + "Contents", + "CommonPrefixes", + "Delimiter", + "NextMarker", + "EncodingType", + "RequestCharged", +]; + +const LIST_OBJECTS_V2_OUTPUT_ORDER: &[&str] = &[ + "Name", + "Prefix", + "MaxKeys", + "KeyCount", + "ContinuationToken", + "IsTruncated", + "NextContinuationToken", + "Contents", + "CommonPrefixes", + "Delimiter", + "EncodingType", + "StartAfter", + "RequestCharged", +]; diff --git a/crates/s3s-aws/src/conv/generated.rs b/crates/s3s-aws/src/conv/generated.rs index 41954e41..8b958e04 100644 --- a/crates/s3s-aws/src/conv/generated.rs +++ b/crates/s3s-aws/src/conv/generated.rs @@ -5051,32 +5051,32 @@ impl AwsConversion for s3s::dto::ListObjectsOutput { fn try_from_aws(x: Self::Target) -> S3Result { Ok(Self { - common_prefixes: try_from_aws(x.common_prefixes)?, - contents: try_from_aws(x.contents)?, - delimiter: try_from_aws(x.delimiter)?, - encoding_type: try_from_aws(x.encoding_type)?, - is_truncated: try_from_aws(x.is_truncated)?, + name: try_from_aws(x.name)?, + prefix: try_from_aws(x.prefix)?, marker: try_from_aws(x.marker)?, max_keys: try_from_aws(x.max_keys)?, - name: try_from_aws(x.name)?, + is_truncated: try_from_aws(x.is_truncated)?, + contents: try_from_aws(x.contents)?, + common_prefixes: try_from_aws(x.common_prefixes)?, + delimiter: try_from_aws(x.delimiter)?, next_marker: try_from_aws(x.next_marker)?, - prefix: try_from_aws(x.prefix)?, + encoding_type: try_from_aws(x.encoding_type)?, request_charged: try_from_aws(x.request_charged)?, }) } fn try_into_aws(x: Self) -> S3Result { let mut y = Self::Target::builder(); - y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); - y = y.set_contents(try_into_aws(x.contents)?); - y = y.set_delimiter(try_into_aws(x.delimiter)?); - y = y.set_encoding_type(try_into_aws(x.encoding_type)?); - y = y.set_is_truncated(try_into_aws(x.is_truncated)?); + y = y.set_name(try_into_aws(x.name)?); + y = y.set_prefix(try_into_aws(x.prefix)?); y = y.set_marker(try_into_aws(x.marker)?); y = y.set_max_keys(try_into_aws(x.max_keys)?); - y = y.set_name(try_into_aws(x.name)?); + y = y.set_is_truncated(try_into_aws(x.is_truncated)?); + y = y.set_contents(try_into_aws(x.contents)?); + y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); + y = y.set_delimiter(try_into_aws(x.delimiter)?); y = y.set_next_marker(try_into_aws(x.next_marker)?); - y = y.set_prefix(try_into_aws(x.prefix)?); + y = y.set_encoding_type(try_into_aws(x.encoding_type)?); y = y.set_request_charged(try_into_aws(x.request_charged)?); Ok(y.build()) } @@ -5125,37 +5125,37 @@ impl AwsConversion for s3s::dto::ListObjectsV2Output { fn try_from_aws(x: Self::Target) -> S3Result { Ok(Self { - common_prefixes: try_from_aws(x.common_prefixes)?, - contents: try_from_aws(x.contents)?, + name: try_from_aws(x.name)?, + prefix: try_from_aws(x.prefix)?, + max_keys: try_from_aws(x.max_keys)?, + key_count: try_from_aws(x.key_count)?, continuation_token: try_from_aws(x.continuation_token)?, - delimiter: try_from_aws(x.delimiter)?, - encoding_type: try_from_aws(x.encoding_type)?, is_truncated: try_from_aws(x.is_truncated)?, - key_count: try_from_aws(x.key_count)?, - max_keys: try_from_aws(x.max_keys)?, - name: try_from_aws(x.name)?, next_continuation_token: try_from_aws(x.next_continuation_token)?, - prefix: try_from_aws(x.prefix)?, - request_charged: try_from_aws(x.request_charged)?, + contents: try_from_aws(x.contents)?, + common_prefixes: try_from_aws(x.common_prefixes)?, + delimiter: try_from_aws(x.delimiter)?, + encoding_type: try_from_aws(x.encoding_type)?, start_after: try_from_aws(x.start_after)?, + request_charged: try_from_aws(x.request_charged)?, }) } fn try_into_aws(x: Self) -> S3Result { let mut y = Self::Target::builder(); - y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); - y = y.set_contents(try_into_aws(x.contents)?); + y = y.set_name(try_into_aws(x.name)?); + y = y.set_prefix(try_into_aws(x.prefix)?); + y = y.set_max_keys(try_into_aws(x.max_keys)?); + y = y.set_key_count(try_into_aws(x.key_count)?); y = y.set_continuation_token(try_into_aws(x.continuation_token)?); - y = y.set_delimiter(try_into_aws(x.delimiter)?); - y = y.set_encoding_type(try_into_aws(x.encoding_type)?); y = y.set_is_truncated(try_into_aws(x.is_truncated)?); - y = y.set_key_count(try_into_aws(x.key_count)?); - y = y.set_max_keys(try_into_aws(x.max_keys)?); - y = y.set_name(try_into_aws(x.name)?); y = y.set_next_continuation_token(try_into_aws(x.next_continuation_token)?); - y = y.set_prefix(try_into_aws(x.prefix)?); - y = y.set_request_charged(try_into_aws(x.request_charged)?); + y = y.set_contents(try_into_aws(x.contents)?); + y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); + y = y.set_delimiter(try_into_aws(x.delimiter)?); + y = y.set_encoding_type(try_into_aws(x.encoding_type)?); y = y.set_start_after(try_into_aws(x.start_after)?); + y = y.set_request_charged(try_into_aws(x.request_charged)?); Ok(y.build()) } } diff --git a/crates/s3s-aws/src/conv/generated_minio.rs b/crates/s3s-aws/src/conv/generated_minio.rs index 6db8fdec..0d61fdd4 100644 --- a/crates/s3s-aws/src/conv/generated_minio.rs +++ b/crates/s3s-aws/src/conv/generated_minio.rs @@ -5055,32 +5055,32 @@ impl AwsConversion for s3s::dto::ListObjectsOutput { fn try_from_aws(x: Self::Target) -> S3Result { Ok(Self { - common_prefixes: try_from_aws(x.common_prefixes)?, - contents: try_from_aws(x.contents)?, - delimiter: try_from_aws(x.delimiter)?, - encoding_type: try_from_aws(x.encoding_type)?, - is_truncated: try_from_aws(x.is_truncated)?, + name: try_from_aws(x.name)?, + prefix: try_from_aws(x.prefix)?, marker: try_from_aws(x.marker)?, max_keys: try_from_aws(x.max_keys)?, - name: try_from_aws(x.name)?, + is_truncated: try_from_aws(x.is_truncated)?, + contents: try_from_aws(x.contents)?, + common_prefixes: try_from_aws(x.common_prefixes)?, + delimiter: try_from_aws(x.delimiter)?, next_marker: try_from_aws(x.next_marker)?, - prefix: try_from_aws(x.prefix)?, + encoding_type: try_from_aws(x.encoding_type)?, request_charged: try_from_aws(x.request_charged)?, }) } fn try_into_aws(x: Self) -> S3Result { let mut y = Self::Target::builder(); - y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); - y = y.set_contents(try_into_aws(x.contents)?); - y = y.set_delimiter(try_into_aws(x.delimiter)?); - y = y.set_encoding_type(try_into_aws(x.encoding_type)?); - y = y.set_is_truncated(try_into_aws(x.is_truncated)?); + y = y.set_name(try_into_aws(x.name)?); + y = y.set_prefix(try_into_aws(x.prefix)?); y = y.set_marker(try_into_aws(x.marker)?); y = y.set_max_keys(try_into_aws(x.max_keys)?); - y = y.set_name(try_into_aws(x.name)?); + y = y.set_is_truncated(try_into_aws(x.is_truncated)?); + y = y.set_contents(try_into_aws(x.contents)?); + y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); + y = y.set_delimiter(try_into_aws(x.delimiter)?); y = y.set_next_marker(try_into_aws(x.next_marker)?); - y = y.set_prefix(try_into_aws(x.prefix)?); + y = y.set_encoding_type(try_into_aws(x.encoding_type)?); y = y.set_request_charged(try_into_aws(x.request_charged)?); Ok(y.build()) } @@ -5129,37 +5129,37 @@ impl AwsConversion for s3s::dto::ListObjectsV2Output { fn try_from_aws(x: Self::Target) -> S3Result { Ok(Self { - common_prefixes: try_from_aws(x.common_prefixes)?, - contents: try_from_aws(x.contents)?, + name: try_from_aws(x.name)?, + prefix: try_from_aws(x.prefix)?, + max_keys: try_from_aws(x.max_keys)?, + key_count: try_from_aws(x.key_count)?, continuation_token: try_from_aws(x.continuation_token)?, - delimiter: try_from_aws(x.delimiter)?, - encoding_type: try_from_aws(x.encoding_type)?, is_truncated: try_from_aws(x.is_truncated)?, - key_count: try_from_aws(x.key_count)?, - max_keys: try_from_aws(x.max_keys)?, - name: try_from_aws(x.name)?, next_continuation_token: try_from_aws(x.next_continuation_token)?, - prefix: try_from_aws(x.prefix)?, - request_charged: try_from_aws(x.request_charged)?, + contents: try_from_aws(x.contents)?, + common_prefixes: try_from_aws(x.common_prefixes)?, + delimiter: try_from_aws(x.delimiter)?, + encoding_type: try_from_aws(x.encoding_type)?, start_after: try_from_aws(x.start_after)?, + request_charged: try_from_aws(x.request_charged)?, }) } fn try_into_aws(x: Self) -> S3Result { let mut y = Self::Target::builder(); - y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); - y = y.set_contents(try_into_aws(x.contents)?); + y = y.set_name(try_into_aws(x.name)?); + y = y.set_prefix(try_into_aws(x.prefix)?); + y = y.set_max_keys(try_into_aws(x.max_keys)?); + y = y.set_key_count(try_into_aws(x.key_count)?); y = y.set_continuation_token(try_into_aws(x.continuation_token)?); - y = y.set_delimiter(try_into_aws(x.delimiter)?); - y = y.set_encoding_type(try_into_aws(x.encoding_type)?); y = y.set_is_truncated(try_into_aws(x.is_truncated)?); - y = y.set_key_count(try_into_aws(x.key_count)?); - y = y.set_max_keys(try_into_aws(x.max_keys)?); - y = y.set_name(try_into_aws(x.name)?); y = y.set_next_continuation_token(try_into_aws(x.next_continuation_token)?); - y = y.set_prefix(try_into_aws(x.prefix)?); - y = y.set_request_charged(try_into_aws(x.request_charged)?); + y = y.set_contents(try_into_aws(x.contents)?); + y = y.set_common_prefixes(try_into_aws(x.common_prefixes)?); + y = y.set_delimiter(try_into_aws(x.delimiter)?); + y = y.set_encoding_type(try_into_aws(x.encoding_type)?); y = y.set_start_after(try_into_aws(x.start_after)?); + y = y.set_request_charged(try_into_aws(x.request_charged)?); Ok(y.build()) } } diff --git a/crates/s3s/src/dto/generated.rs b/crates/s3s/src/dto/generated.rs index 3b65a082..8a90d595 100644 --- a/crates/s3s/src/dto/generated.rs +++ b/crates/s3s/src/dto/generated.rs @@ -12516,6 +12516,20 @@ impl ListObjectsInput { #[derive(Clone, Default, PartialEq)] pub struct ListObjectsOutput { + ///

The bucket name.

+ pub name: Option, + ///

Keys that begin with the indicated prefix.

+ pub prefix: Option, + ///

Indicates where in the bucket listing begins. Marker is included in the response if it + /// was sent with the request.

+ pub marker: Option, + ///

The maximum number of keys returned in the response body.

+ pub max_keys: Option, + ///

A flag that indicates whether Amazon S3 returned all of the results that satisfied the search + /// criteria.

+ pub is_truncated: Option, + ///

Metadata about each object returned.

+ pub contents: Option, ///

All of the keys (up to 1,000) rolled up in a common prefix count as a single return when /// calculating the number of returns.

///

A response can contain CommonPrefixes only if you specify a @@ -12532,14 +12546,24 @@ pub struct ListObjectsOutput { /// notes/summer/. All of the keys that roll up into a common prefix count as a /// single return when calculating the number of returns.

pub common_prefixes: Option, - ///

Metadata about each object returned.

- pub contents: Option, ///

Causes keys that contain the same string between the prefix and the first occurrence of /// the delimiter to be rolled up into a single result element in the /// CommonPrefixes collection. These rolled-up keys are not returned elsewhere /// in the response. Each rolled-up result counts as only one return against the /// MaxKeys value.

pub delimiter: Option, + ///

When the response is truncated (the IsTruncated element value in the + /// response is true), you can use the key name in this field as the + /// marker parameter in the subsequent request to get the next set of objects. + /// Amazon S3 lists objects in alphabetical order.

+ /// + ///

This element is returned only if you have the delimiter request + /// parameter specified. If the response does not include the NextMarker + /// element and it is truncated, you can use the value of the last Key element + /// in the response as the marker parameter in the subsequent request to get + /// the next set of object keys.

+ ///
+ pub next_marker: Option, ///

Encoding type used by Amazon S3 to encode the object keys in the response. /// Responses are encoded only in UTF-8. An object key can contain any Unicode character. /// However, the XML 1.0 parser can't parse certain characters, such as characters with an @@ -12554,65 +12578,41 @@ pub struct ListObjectsOutput { /// test_file%283%29.png.

/// pub encoding_type: Option, - ///

A flag that indicates whether Amazon S3 returned all of the results that satisfied the search - /// criteria.

- pub is_truncated: Option, - ///

Indicates where in the bucket listing begins. Marker is included in the response if it - /// was sent with the request.

- pub marker: Option, - ///

The maximum number of keys returned in the response body.

- pub max_keys: Option, - ///

The bucket name.

- pub name: Option, - ///

When the response is truncated (the IsTruncated element value in the - /// response is true), you can use the key name in this field as the - /// marker parameter in the subsequent request to get the next set of objects. - /// Amazon S3 lists objects in alphabetical order.

- /// - ///

This element is returned only if you have the delimiter request - /// parameter specified. If the response does not include the NextMarker - /// element and it is truncated, you can use the value of the last Key element - /// in the response as the marker parameter in the subsequent request to get - /// the next set of object keys.

- ///
- pub next_marker: Option, - ///

Keys that begin with the indicated prefix.

- pub prefix: Option, pub request_charged: Option, } impl fmt::Debug for ListObjectsOutput { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut d = f.debug_struct("ListObjectsOutput"); - if let Some(ref val) = self.common_prefixes { - d.field("common_prefixes", val); + if let Some(ref val) = self.name { + d.field("name", val); } - if let Some(ref val) = self.contents { - d.field("contents", val); + if let Some(ref val) = self.prefix { + d.field("prefix", val); } - if let Some(ref val) = self.delimiter { - d.field("delimiter", val); + if let Some(ref val) = self.marker { + d.field("marker", val); } - if let Some(ref val) = self.encoding_type { - d.field("encoding_type", val); + if let Some(ref val) = self.max_keys { + d.field("max_keys", val); } if let Some(ref val) = self.is_truncated { d.field("is_truncated", val); } - if let Some(ref val) = self.marker { - d.field("marker", val); + if let Some(ref val) = self.contents { + d.field("contents", val); } - if let Some(ref val) = self.max_keys { - d.field("max_keys", val); + if let Some(ref val) = self.common_prefixes { + d.field("common_prefixes", val); } - if let Some(ref val) = self.name { - d.field("name", val); + if let Some(ref val) = self.delimiter { + d.field("delimiter", val); } if let Some(ref val) = self.next_marker { d.field("next_marker", val); } - if let Some(ref val) = self.prefix { - d.field("prefix", val); + if let Some(ref val) = self.encoding_type { + d.field("encoding_type", val); } if let Some(ref val) = self.request_charged { d.field("request_charged", val); @@ -12769,6 +12769,41 @@ impl ListObjectsV2Input { #[derive(Clone, Default, PartialEq)] pub struct ListObjectsV2Output { + ///

The bucket name.

+ pub name: Option, + ///

Keys that begin with the indicated prefix.

+ /// + ///

+ /// Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are supported.

+ ///
+ pub prefix: Option, + ///

Sets the maximum number of keys returned in the response. By default, the action returns + /// up to 1,000 key names. The response might contain fewer keys but will never contain + /// more.

+ pub max_keys: Option, + ///

+ /// KeyCount is the number of keys returned with this request. + /// KeyCount will always be less than or equal to the MaxKeys + /// field. For example, if you ask for 50 keys, your result will include 50 keys or + /// fewer.

+ pub key_count: Option, + ///

If ContinuationToken was sent with the request, it is included in the + /// response. You can use the returned ContinuationToken for pagination of the + /// list response. You can use this ContinuationToken for pagination of the list + /// results.

+ pub continuation_token: Option, + ///

Set to false if all of the results were returned. Set to true + /// if more keys are available to return. If the number of results exceeds that specified by + /// MaxKeys, all of the results might not be returned.

+ pub is_truncated: Option, + ///

+ /// NextContinuationToken is sent when isTruncated is true, which + /// means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 + /// can be continued with this NextContinuationToken. + /// NextContinuationToken is obfuscated and is not a real key

+ pub next_continuation_token: Option, + ///

Metadata about each object returned.

+ pub contents: Option, ///

All of the keys (up to 1,000) that share the same prefix are grouped together. When /// counting the total numbers of returns by this API operation, this group of keys is /// considered as one item.

@@ -12803,13 +12838,6 @@ pub struct ListObjectsV2Output { /// /// pub common_prefixes: Option, - ///

Metadata about each object returned.

- pub contents: Option, - ///

If ContinuationToken was sent with the request, it is included in the - /// response. You can use the returned ContinuationToken for pagination of the - /// list response. You can use this ContinuationToken for pagination of the list - /// results.

- pub continuation_token: Option, ///

Causes keys that contain the same string between the prefix and the first /// occurrence of the delimiter to be rolled up into a single result element in the /// CommonPrefixes collection. These rolled-up keys are not returned elsewhere @@ -12827,84 +12855,56 @@ pub struct ListObjectsV2Output { ///

/// Delimiter, Prefix, Key, and StartAfter.

pub encoding_type: Option, - ///

Set to false if all of the results were returned. Set to true - /// if more keys are available to return. If the number of results exceeds that specified by - /// MaxKeys, all of the results might not be returned.

- pub is_truncated: Option, - ///

- /// KeyCount is the number of keys returned with this request. - /// KeyCount will always be less than or equal to the MaxKeys - /// field. For example, if you ask for 50 keys, your result will include 50 keys or - /// fewer.

- pub key_count: Option, - ///

Sets the maximum number of keys returned in the response. By default, the action returns - /// up to 1,000 key names. The response might contain fewer keys but will never contain - /// more.

- pub max_keys: Option, - ///

The bucket name.

- pub name: Option, - ///

- /// NextContinuationToken is sent when isTruncated is true, which - /// means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 - /// can be continued with this NextContinuationToken. - /// NextContinuationToken is obfuscated and is not a real key

- pub next_continuation_token: Option, - ///

Keys that begin with the indicated prefix.

- /// - ///

- /// Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are supported.

- ///
- pub prefix: Option, - pub request_charged: Option, ///

If StartAfter was sent with the request, it is included in the response.

/// ///

This functionality is not supported for directory buckets.

///
pub start_after: Option, + pub request_charged: Option, } impl fmt::Debug for ListObjectsV2Output { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut d = f.debug_struct("ListObjectsV2Output"); - if let Some(ref val) = self.common_prefixes { - d.field("common_prefixes", val); - } - if let Some(ref val) = self.contents { - d.field("contents", val); - } - if let Some(ref val) = self.continuation_token { - d.field("continuation_token", val); - } - if let Some(ref val) = self.delimiter { - d.field("delimiter", val); + if let Some(ref val) = self.name { + d.field("name", val); } - if let Some(ref val) = self.encoding_type { - d.field("encoding_type", val); + if let Some(ref val) = self.prefix { + d.field("prefix", val); } - if let Some(ref val) = self.is_truncated { - d.field("is_truncated", val); + if let Some(ref val) = self.max_keys { + d.field("max_keys", val); } if let Some(ref val) = self.key_count { d.field("key_count", val); } - if let Some(ref val) = self.max_keys { - d.field("max_keys", val); + if let Some(ref val) = self.continuation_token { + d.field("continuation_token", val); } - if let Some(ref val) = self.name { - d.field("name", val); + if let Some(ref val) = self.is_truncated { + d.field("is_truncated", val); } if let Some(ref val) = self.next_continuation_token { d.field("next_continuation_token", val); } - if let Some(ref val) = self.prefix { - d.field("prefix", val); + if let Some(ref val) = self.contents { + d.field("contents", val); } - if let Some(ref val) = self.request_charged { - d.field("request_charged", val); + if let Some(ref val) = self.common_prefixes { + d.field("common_prefixes", val); + } + if let Some(ref val) = self.delimiter { + d.field("delimiter", val); + } + if let Some(ref val) = self.encoding_type { + d.field("encoding_type", val); } if let Some(ref val) = self.start_after { d.field("start_after", val); } + if let Some(ref val) = self.request_charged { + d.field("request_charged", val); + } d.finish_non_exhaustive() } } @@ -35442,25 +35442,25 @@ impl DtoExt for ListObjectsInput { } impl DtoExt for ListObjectsOutput { fn ignore_empty_strings(&mut self) { - if self.delimiter.as_deref() == Some("") { - self.delimiter = None; + if self.name.as_deref() == Some("") { + self.name = None; } - if let Some(ref val) = self.encoding_type - && val.as_str() == "" - { - self.encoding_type = None; + if self.prefix.as_deref() == Some("") { + self.prefix = None; } if self.marker.as_deref() == Some("") { self.marker = None; } - if self.name.as_deref() == Some("") { - self.name = None; + if self.delimiter.as_deref() == Some("") { + self.delimiter = None; } if self.next_marker.as_deref() == Some("") { self.next_marker = None; } - if self.prefix.as_deref() == Some("") { - self.prefix = None; + if let Some(ref val) = self.encoding_type + && val.as_str() == "" + { + self.encoding_type = None; } if let Some(ref val) = self.request_charged && val.as_str() == "" @@ -35500,9 +35500,18 @@ impl DtoExt for ListObjectsV2Input { } impl DtoExt for ListObjectsV2Output { fn ignore_empty_strings(&mut self) { + if self.name.as_deref() == Some("") { + self.name = None; + } + if self.prefix.as_deref() == Some("") { + self.prefix = None; + } if self.continuation_token.as_deref() == Some("") { self.continuation_token = None; } + if self.next_continuation_token.as_deref() == Some("") { + self.next_continuation_token = None; + } if self.delimiter.as_deref() == Some("") { self.delimiter = None; } @@ -35511,23 +35520,14 @@ impl DtoExt for ListObjectsV2Output { { self.encoding_type = None; } - if self.name.as_deref() == Some("") { - self.name = None; - } - if self.next_continuation_token.as_deref() == Some("") { - self.next_continuation_token = None; - } - if self.prefix.as_deref() == Some("") { - self.prefix = None; + if self.start_after.as_deref() == Some("") { + self.start_after = None; } if let Some(ref val) = self.request_charged && val.as_str() == "" { self.request_charged = None; } - if self.start_after.as_deref() == Some("") { - self.start_after = None; - } } } impl DtoExt for ListPartsInput { diff --git a/crates/s3s/src/dto/generated_minio.rs b/crates/s3s/src/dto/generated_minio.rs index 9f1cc05e..0a2cd28f 100644 --- a/crates/s3s/src/dto/generated_minio.rs +++ b/crates/s3s/src/dto/generated_minio.rs @@ -12636,6 +12636,20 @@ impl ListObjectsInput { #[derive(Clone, Default, PartialEq)] pub struct ListObjectsOutput { + ///

The bucket name.

+ pub name: Option, + ///

Keys that begin with the indicated prefix.

+ pub prefix: Option, + ///

Indicates where in the bucket listing begins. Marker is included in the response if it + /// was sent with the request.

+ pub marker: Option, + ///

The maximum number of keys returned in the response body.

+ pub max_keys: Option, + ///

A flag that indicates whether Amazon S3 returned all of the results that satisfied the search + /// criteria.

+ pub is_truncated: Option, + ///

Metadata about each object returned.

+ pub contents: Option, ///

All of the keys (up to 1,000) rolled up in a common prefix count as a single return when /// calculating the number of returns.

///

A response can contain CommonPrefixes only if you specify a @@ -12652,14 +12666,24 @@ pub struct ListObjectsOutput { /// notes/summer/. All of the keys that roll up into a common prefix count as a /// single return when calculating the number of returns.

pub common_prefixes: Option, - ///

Metadata about each object returned.

- pub contents: Option, ///

Causes keys that contain the same string between the prefix and the first occurrence of /// the delimiter to be rolled up into a single result element in the /// CommonPrefixes collection. These rolled-up keys are not returned elsewhere /// in the response. Each rolled-up result counts as only one return against the /// MaxKeys value.

pub delimiter: Option, + ///

When the response is truncated (the IsTruncated element value in the + /// response is true), you can use the key name in this field as the + /// marker parameter in the subsequent request to get the next set of objects. + /// Amazon S3 lists objects in alphabetical order.

+ /// + ///

This element is returned only if you have the delimiter request + /// parameter specified. If the response does not include the NextMarker + /// element and it is truncated, you can use the value of the last Key element + /// in the response as the marker parameter in the subsequent request to get + /// the next set of object keys.

+ ///
+ pub next_marker: Option, ///

Encoding type used by Amazon S3 to encode the object keys in the response. /// Responses are encoded only in UTF-8. An object key can contain any Unicode character. /// However, the XML 1.0 parser can't parse certain characters, such as characters with an @@ -12674,65 +12698,41 @@ pub struct ListObjectsOutput { /// test_file%283%29.png.

/// pub encoding_type: Option, - ///

A flag that indicates whether Amazon S3 returned all of the results that satisfied the search - /// criteria.

- pub is_truncated: Option, - ///

Indicates where in the bucket listing begins. Marker is included in the response if it - /// was sent with the request.

- pub marker: Option, - ///

The maximum number of keys returned in the response body.

- pub max_keys: Option, - ///

The bucket name.

- pub name: Option, - ///

When the response is truncated (the IsTruncated element value in the - /// response is true), you can use the key name in this field as the - /// marker parameter in the subsequent request to get the next set of objects. - /// Amazon S3 lists objects in alphabetical order.

- /// - ///

This element is returned only if you have the delimiter request - /// parameter specified. If the response does not include the NextMarker - /// element and it is truncated, you can use the value of the last Key element - /// in the response as the marker parameter in the subsequent request to get - /// the next set of object keys.

- ///
- pub next_marker: Option, - ///

Keys that begin with the indicated prefix.

- pub prefix: Option, pub request_charged: Option, } impl fmt::Debug for ListObjectsOutput { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut d = f.debug_struct("ListObjectsOutput"); - if let Some(ref val) = self.common_prefixes { - d.field("common_prefixes", val); + if let Some(ref val) = self.name { + d.field("name", val); } - if let Some(ref val) = self.contents { - d.field("contents", val); + if let Some(ref val) = self.prefix { + d.field("prefix", val); } - if let Some(ref val) = self.delimiter { - d.field("delimiter", val); + if let Some(ref val) = self.marker { + d.field("marker", val); } - if let Some(ref val) = self.encoding_type { - d.field("encoding_type", val); + if let Some(ref val) = self.max_keys { + d.field("max_keys", val); } if let Some(ref val) = self.is_truncated { d.field("is_truncated", val); } - if let Some(ref val) = self.marker { - d.field("marker", val); + if let Some(ref val) = self.contents { + d.field("contents", val); } - if let Some(ref val) = self.max_keys { - d.field("max_keys", val); + if let Some(ref val) = self.common_prefixes { + d.field("common_prefixes", val); } - if let Some(ref val) = self.name { - d.field("name", val); + if let Some(ref val) = self.delimiter { + d.field("delimiter", val); } if let Some(ref val) = self.next_marker { d.field("next_marker", val); } - if let Some(ref val) = self.prefix { - d.field("prefix", val); + if let Some(ref val) = self.encoding_type { + d.field("encoding_type", val); } if let Some(ref val) = self.request_charged { d.field("request_charged", val); @@ -12889,6 +12889,41 @@ impl ListObjectsV2Input { #[derive(Clone, Default, PartialEq)] pub struct ListObjectsV2Output { + ///

The bucket name.

+ pub name: Option, + ///

Keys that begin with the indicated prefix.

+ /// + ///

+ /// Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are supported.

+ ///
+ pub prefix: Option, + ///

Sets the maximum number of keys returned in the response. By default, the action returns + /// up to 1,000 key names. The response might contain fewer keys but will never contain + /// more.

+ pub max_keys: Option, + ///

+ /// KeyCount is the number of keys returned with this request. + /// KeyCount will always be less than or equal to the MaxKeys + /// field. For example, if you ask for 50 keys, your result will include 50 keys or + /// fewer.

+ pub key_count: Option, + ///

If ContinuationToken was sent with the request, it is included in the + /// response. You can use the returned ContinuationToken for pagination of the + /// list response. You can use this ContinuationToken for pagination of the list + /// results.

+ pub continuation_token: Option, + ///

Set to false if all of the results were returned. Set to true + /// if more keys are available to return. If the number of results exceeds that specified by + /// MaxKeys, all of the results might not be returned.

+ pub is_truncated: Option, + ///

+ /// NextContinuationToken is sent when isTruncated is true, which + /// means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 + /// can be continued with this NextContinuationToken. + /// NextContinuationToken is obfuscated and is not a real key

+ pub next_continuation_token: Option, + ///

Metadata about each object returned.

+ pub contents: Option, ///

All of the keys (up to 1,000) that share the same prefix are grouped together. When /// counting the total numbers of returns by this API operation, this group of keys is /// considered as one item.

@@ -12923,13 +12958,6 @@ pub struct ListObjectsV2Output { /// /// pub common_prefixes: Option, - ///

Metadata about each object returned.

- pub contents: Option, - ///

If ContinuationToken was sent with the request, it is included in the - /// response. You can use the returned ContinuationToken for pagination of the - /// list response. You can use this ContinuationToken for pagination of the list - /// results.

- pub continuation_token: Option, ///

Causes keys that contain the same string between the prefix and the first /// occurrence of the delimiter to be rolled up into a single result element in the /// CommonPrefixes collection. These rolled-up keys are not returned elsewhere @@ -12947,84 +12975,56 @@ pub struct ListObjectsV2Output { ///

/// Delimiter, Prefix, Key, and StartAfter.

pub encoding_type: Option, - ///

Set to false if all of the results were returned. Set to true - /// if more keys are available to return. If the number of results exceeds that specified by - /// MaxKeys, all of the results might not be returned.

- pub is_truncated: Option, - ///

- /// KeyCount is the number of keys returned with this request. - /// KeyCount will always be less than or equal to the MaxKeys - /// field. For example, if you ask for 50 keys, your result will include 50 keys or - /// fewer.

- pub key_count: Option, - ///

Sets the maximum number of keys returned in the response. By default, the action returns - /// up to 1,000 key names. The response might contain fewer keys but will never contain - /// more.

- pub max_keys: Option, - ///

The bucket name.

- pub name: Option, - ///

- /// NextContinuationToken is sent when isTruncated is true, which - /// means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 - /// can be continued with this NextContinuationToken. - /// NextContinuationToken is obfuscated and is not a real key

- pub next_continuation_token: Option, - ///

Keys that begin with the indicated prefix.

- /// - ///

- /// Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are supported.

- ///
- pub prefix: Option, - pub request_charged: Option, ///

If StartAfter was sent with the request, it is included in the response.

/// ///

This functionality is not supported for directory buckets.

///
pub start_after: Option, + pub request_charged: Option, } impl fmt::Debug for ListObjectsV2Output { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut d = f.debug_struct("ListObjectsV2Output"); - if let Some(ref val) = self.common_prefixes { - d.field("common_prefixes", val); - } - if let Some(ref val) = self.contents { - d.field("contents", val); - } - if let Some(ref val) = self.continuation_token { - d.field("continuation_token", val); - } - if let Some(ref val) = self.delimiter { - d.field("delimiter", val); + if let Some(ref val) = self.name { + d.field("name", val); } - if let Some(ref val) = self.encoding_type { - d.field("encoding_type", val); + if let Some(ref val) = self.prefix { + d.field("prefix", val); } - if let Some(ref val) = self.is_truncated { - d.field("is_truncated", val); + if let Some(ref val) = self.max_keys { + d.field("max_keys", val); } if let Some(ref val) = self.key_count { d.field("key_count", val); } - if let Some(ref val) = self.max_keys { - d.field("max_keys", val); + if let Some(ref val) = self.continuation_token { + d.field("continuation_token", val); } - if let Some(ref val) = self.name { - d.field("name", val); + if let Some(ref val) = self.is_truncated { + d.field("is_truncated", val); } if let Some(ref val) = self.next_continuation_token { d.field("next_continuation_token", val); } - if let Some(ref val) = self.prefix { - d.field("prefix", val); + if let Some(ref val) = self.contents { + d.field("contents", val); } - if let Some(ref val) = self.request_charged { - d.field("request_charged", val); + if let Some(ref val) = self.common_prefixes { + d.field("common_prefixes", val); + } + if let Some(ref val) = self.delimiter { + d.field("delimiter", val); + } + if let Some(ref val) = self.encoding_type { + d.field("encoding_type", val); } if let Some(ref val) = self.start_after { d.field("start_after", val); } + if let Some(ref val) = self.request_charged { + d.field("request_charged", val); + } d.finish_non_exhaustive() } } @@ -35701,25 +35701,25 @@ impl DtoExt for ListObjectsInput { } impl DtoExt for ListObjectsOutput { fn ignore_empty_strings(&mut self) { - if self.delimiter.as_deref() == Some("") { - self.delimiter = None; + if self.name.as_deref() == Some("") { + self.name = None; } - if let Some(ref val) = self.encoding_type - && val.as_str() == "" - { - self.encoding_type = None; + if self.prefix.as_deref() == Some("") { + self.prefix = None; } if self.marker.as_deref() == Some("") { self.marker = None; } - if self.name.as_deref() == Some("") { - self.name = None; + if self.delimiter.as_deref() == Some("") { + self.delimiter = None; } if self.next_marker.as_deref() == Some("") { self.next_marker = None; } - if self.prefix.as_deref() == Some("") { - self.prefix = None; + if let Some(ref val) = self.encoding_type + && val.as_str() == "" + { + self.encoding_type = None; } if let Some(ref val) = self.request_charged && val.as_str() == "" @@ -35759,9 +35759,18 @@ impl DtoExt for ListObjectsV2Input { } impl DtoExt for ListObjectsV2Output { fn ignore_empty_strings(&mut self) { + if self.name.as_deref() == Some("") { + self.name = None; + } + if self.prefix.as_deref() == Some("") { + self.prefix = None; + } if self.continuation_token.as_deref() == Some("") { self.continuation_token = None; } + if self.next_continuation_token.as_deref() == Some("") { + self.next_continuation_token = None; + } if self.delimiter.as_deref() == Some("") { self.delimiter = None; } @@ -35770,23 +35779,14 @@ impl DtoExt for ListObjectsV2Output { { self.encoding_type = None; } - if self.name.as_deref() == Some("") { - self.name = None; - } - if self.next_continuation_token.as_deref() == Some("") { - self.next_continuation_token = None; - } - if self.prefix.as_deref() == Some("") { - self.prefix = None; + if self.start_after.as_deref() == Some("") { + self.start_after = None; } if let Some(ref val) = self.request_charged && val.as_str() == "" { self.request_charged = None; } - if self.start_after.as_deref() == Some("") { - self.start_after = None; - } } } impl DtoExt for ListPartsInput { diff --git a/crates/s3s/src/xml/generated.rs b/crates/s3s/src/xml/generated.rs index cc9247b0..7175e6e4 100644 --- a/crates/s3s/src/xml/generated.rs +++ b/crates/s3s/src/xml/generated.rs @@ -5960,35 +5960,35 @@ impl SerializeContent for ListObjectVersionsOutput { impl SerializeContent for ListObjectsOutput { fn serialize_content(&self, s: &mut Serializer) -> SerResult { - if let Some(iter) = &self.common_prefixes { - s.flattened_list("CommonPrefixes", iter)?; + if let Some(ref val) = self.name { + s.content("Name", val)?; } - if let Some(iter) = &self.contents { - s.flattened_list("Contents", iter)?; + if let Some(ref val) = self.prefix { + s.content("Prefix", val)?; } - if let Some(ref val) = self.delimiter { - s.content("Delimiter", val)?; + if let Some(ref val) = self.marker { + s.content("Marker", val)?; } - if let Some(ref val) = self.encoding_type { - s.content("EncodingType", val)?; + if let Some(ref val) = self.max_keys { + s.content("MaxKeys", val)?; } if let Some(ref val) = self.is_truncated { s.content("IsTruncated", val)?; } - if let Some(ref val) = self.marker { - s.content("Marker", val)?; + if let Some(iter) = &self.contents { + s.flattened_list("Contents", iter)?; } - if let Some(ref val) = self.max_keys { - s.content("MaxKeys", val)?; + if let Some(iter) = &self.common_prefixes { + s.flattened_list("CommonPrefixes", iter)?; } - if let Some(ref val) = self.name { - s.content("Name", val)?; + if let Some(ref val) = self.delimiter { + s.content("Delimiter", val)?; } if let Some(ref val) = self.next_marker { s.content("NextMarker", val)?; } - if let Some(ref val) = self.prefix { - s.content("Prefix", val)?; + if let Some(ref val) = self.encoding_type { + s.content("EncodingType", val)?; } Ok(()) } @@ -5996,38 +5996,38 @@ impl SerializeContent for ListObjectsOutput { impl SerializeContent for ListObjectsV2Output { fn serialize_content(&self, s: &mut Serializer) -> SerResult { - if let Some(iter) = &self.common_prefixes { - s.flattened_list("CommonPrefixes", iter)?; + if let Some(ref val) = self.name { + s.content("Name", val)?; } - if let Some(iter) = &self.contents { - s.flattened_list("Contents", iter)?; + if let Some(ref val) = self.prefix { + s.content("Prefix", val)?; } - if let Some(ref val) = self.continuation_token { - s.content("ContinuationToken", val)?; + if let Some(ref val) = self.max_keys { + s.content("MaxKeys", val)?; } - if let Some(ref val) = self.delimiter { - s.content("Delimiter", val)?; + if let Some(ref val) = self.key_count { + s.content("KeyCount", val)?; } - if let Some(ref val) = self.encoding_type { - s.content("EncodingType", val)?; + if let Some(ref val) = self.continuation_token { + s.content("ContinuationToken", val)?; } if let Some(ref val) = self.is_truncated { s.content("IsTruncated", val)?; } - if let Some(ref val) = self.key_count { - s.content("KeyCount", val)?; + if let Some(ref val) = self.next_continuation_token { + s.content("NextContinuationToken", val)?; } - if let Some(ref val) = self.max_keys { - s.content("MaxKeys", val)?; + if let Some(iter) = &self.contents { + s.flattened_list("Contents", iter)?; } - if let Some(ref val) = self.name { - s.content("Name", val)?; + if let Some(iter) = &self.common_prefixes { + s.flattened_list("CommonPrefixes", iter)?; } - if let Some(ref val) = self.next_continuation_token { - s.content("NextContinuationToken", val)?; + if let Some(ref val) = self.delimiter { + s.content("Delimiter", val)?; } - if let Some(ref val) = self.prefix { - s.content("Prefix", val)?; + if let Some(ref val) = self.encoding_type { + s.content("EncodingType", val)?; } if let Some(ref val) = self.start_after { s.content("StartAfter", val)?; diff --git a/crates/s3s/src/xml/generated_minio.rs b/crates/s3s/src/xml/generated_minio.rs index 01bf389d..a2b50607 100644 --- a/crates/s3s/src/xml/generated_minio.rs +++ b/crates/s3s/src/xml/generated_minio.rs @@ -6036,35 +6036,35 @@ impl SerializeContent for ListObjectVersionsOutput { impl SerializeContent for ListObjectsOutput { fn serialize_content(&self, s: &mut Serializer) -> SerResult { - if let Some(iter) = &self.common_prefixes { - s.flattened_list("CommonPrefixes", iter)?; + if let Some(ref val) = self.name { + s.content("Name", val)?; } - if let Some(iter) = &self.contents { - s.flattened_list("Contents", iter)?; + if let Some(ref val) = self.prefix { + s.content("Prefix", val)?; } - if let Some(ref val) = self.delimiter { - s.content("Delimiter", val)?; + if let Some(ref val) = self.marker { + s.content("Marker", val)?; } - if let Some(ref val) = self.encoding_type { - s.content("EncodingType", val)?; + if let Some(ref val) = self.max_keys { + s.content("MaxKeys", val)?; } if let Some(ref val) = self.is_truncated { s.content("IsTruncated", val)?; } - if let Some(ref val) = self.marker { - s.content("Marker", val)?; + if let Some(iter) = &self.contents { + s.flattened_list("Contents", iter)?; } - if let Some(ref val) = self.max_keys { - s.content("MaxKeys", val)?; + if let Some(iter) = &self.common_prefixes { + s.flattened_list("CommonPrefixes", iter)?; } - if let Some(ref val) = self.name { - s.content("Name", val)?; + if let Some(ref val) = self.delimiter { + s.content("Delimiter", val)?; } if let Some(ref val) = self.next_marker { s.content("NextMarker", val)?; } - if let Some(ref val) = self.prefix { - s.content("Prefix", val)?; + if let Some(ref val) = self.encoding_type { + s.content("EncodingType", val)?; } Ok(()) } @@ -6072,38 +6072,38 @@ impl SerializeContent for ListObjectsOutput { impl SerializeContent for ListObjectsV2Output { fn serialize_content(&self, s: &mut Serializer) -> SerResult { - if let Some(iter) = &self.common_prefixes { - s.flattened_list("CommonPrefixes", iter)?; + if let Some(ref val) = self.name { + s.content("Name", val)?; } - if let Some(iter) = &self.contents { - s.flattened_list("Contents", iter)?; + if let Some(ref val) = self.prefix { + s.content("Prefix", val)?; } - if let Some(ref val) = self.continuation_token { - s.content("ContinuationToken", val)?; + if let Some(ref val) = self.max_keys { + s.content("MaxKeys", val)?; } - if let Some(ref val) = self.delimiter { - s.content("Delimiter", val)?; + if let Some(ref val) = self.key_count { + s.content("KeyCount", val)?; } - if let Some(ref val) = self.encoding_type { - s.content("EncodingType", val)?; + if let Some(ref val) = self.continuation_token { + s.content("ContinuationToken", val)?; } if let Some(ref val) = self.is_truncated { s.content("IsTruncated", val)?; } - if let Some(ref val) = self.key_count { - s.content("KeyCount", val)?; + if let Some(ref val) = self.next_continuation_token { + s.content("NextContinuationToken", val)?; } - if let Some(ref val) = self.max_keys { - s.content("MaxKeys", val)?; + if let Some(iter) = &self.contents { + s.flattened_list("Contents", iter)?; } - if let Some(ref val) = self.name { - s.content("Name", val)?; + if let Some(iter) = &self.common_prefixes { + s.flattened_list("CommonPrefixes", iter)?; } - if let Some(ref val) = self.next_continuation_token { - s.content("NextContinuationToken", val)?; + if let Some(ref val) = self.delimiter { + s.content("Delimiter", val)?; } - if let Some(ref val) = self.prefix { - s.content("Prefix", val)?; + if let Some(ref val) = self.encoding_type { + s.content("EncodingType", val)?; } if let Some(ref val) = self.start_after { s.content("StartAfter", val)?;