Skip to content

Commit

Permalink
sync codegen minio
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 12, 2024
1 parent 42a00af commit 14b7ee4
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 1 deletion.
3 changes: 3 additions & 0 deletions crates/s3s-aws/src/conv/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ impl AwsConversion for s3s::dto::DeleteBucketInput {
Ok(Self {
bucket: unwrap_from_aws(x.bucket, "bucket")?,
expected_bucket_owner: try_from_aws(x.expected_bucket_owner)?,
force_delete: None,
})
}

Expand Down Expand Up @@ -8644,6 +8645,8 @@ impl AwsConversion for s3s::dto::VersioningConfiguration {

fn try_from_aws(x: Self::Target) -> S3Result<Self> {
Ok(Self {
exclude_folders: None,
excluded_prefixes: None,
mfa_delete: try_from_aws(x.mfa_delete)?,
status: try_from_aws(x.status)?,
})
Expand Down
48 changes: 48 additions & 0 deletions crates/s3s/src/dto/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3690,6 +3690,7 @@ pub struct DeleteBucketInput {
/// <code>501 Not Implemented</code>.</p>
/// </note>
pub expected_bucket_owner: Option<AccountId>,
pub force_delete: Option<ForceDelete>,
}

impl fmt::Debug for DeleteBucketInput {
Expand All @@ -3699,6 +3700,9 @@ impl fmt::Debug for DeleteBucketInput {
if let Some(ref val) = self.expected_bucket_owner {
d.field("expected_bucket_owner", val);
}
if let Some(ref val) = self.force_delete {
d.field("force_delete", val);
}
d.finish_non_exhaustive()
}
}
Expand Down Expand Up @@ -6707,6 +6711,25 @@ impl fmt::Debug for EventBridgeConfiguration {

pub type EventList = List<Event>;

pub type ExcludeFolders = bool;

#[derive(Clone, Default, PartialEq)]
pub struct ExcludedPrefix {
pub prefix: Option<Prefix>,
}

impl fmt::Debug for ExcludedPrefix {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = f.debug_struct("ExcludedPrefix");
if let Some(ref val) = self.prefix {
d.field("prefix", val);
}
d.finish_non_exhaustive()
}
}

pub type ExcludedPrefixes = List<ExcludedPrefix>;

/// <p>Optional configuration to replicate existing source bucket objects.
/// </p>
/// <note>
Expand Down Expand Up @@ -6963,6 +6986,8 @@ impl FromStr for FilterRuleName {

pub type FilterRuleValue = String;

pub type ForceDelete = bool;

#[derive(Clone, PartialEq)]
pub struct GetBucketAccelerateConfigurationInput {
/// <p>The name of the bucket for which the accelerate configuration is retrieved.</p>
Expand Down Expand Up @@ -19300,6 +19325,8 @@ pub type VersionIdMarker = String;
/// Bucket versioning</a> in the <i>Amazon S3 API Reference</i>.</p>
#[derive(Clone, Default, PartialEq)]
pub struct VersioningConfiguration {
pub exclude_folders: Option<ExcludeFolders>,
pub excluded_prefixes: Option<ExcludedPrefixes>,
/// <p>Specifies whether MFA delete is enabled in the bucket versioning configuration. This
/// element is only returned if the bucket has been configured with MFA delete. If the bucket
/// has never been so configured, this element is not returned.</p>
Expand All @@ -19311,6 +19338,12 @@ pub struct VersioningConfiguration {
impl fmt::Debug for VersioningConfiguration {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = f.debug_struct("VersioningConfiguration");
if let Some(ref val) = self.exclude_folders {
d.field("exclude_folders", val);
}
if let Some(ref val) = self.excluded_prefixes {
d.field("excluded_prefixes", val);
}
if let Some(ref val) = self.mfa_delete {
d.field("mfa_delete", val);
}
Expand Down Expand Up @@ -21388,6 +21421,8 @@ pub mod builders {
bucket: Option<BucketName>,

expected_bucket_owner: Option<AccountId>,

force_delete: Option<ForceDelete>,
}

impl DeleteBucketInputBuilder {
Expand All @@ -21401,6 +21436,11 @@ pub mod builders {
self
}

pub fn set_force_delete(&mut self, field: Option<ForceDelete>) -> &mut Self {
self.force_delete = field;
self
}

#[must_use]
pub fn bucket(mut self, field: BucketName) -> Self {
self.bucket = Some(field);
Expand All @@ -21413,12 +21453,20 @@ pub mod builders {
self
}

#[must_use]
pub fn force_delete(mut self, field: Option<ForceDelete>) -> Self {
self.force_delete = field;
self
}

pub fn build(self) -> Result<DeleteBucketInput, BuildError> {
let bucket = self.bucket.ok_or_else(|| BuildError::missing_field("bucket"))?;
let expected_bucket_owner = self.expected_bucket_owner;
let force_delete = self.force_delete;
Ok(DeleteBucketInput {
bucket,
expected_bucket_owner,
force_delete,
})
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/s3s/src/header/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,5 @@ pub const X_AMZ_TRANSITION_DEFAULT_MINIMUM_OBJECT_SIZE: HeaderName =
pub const X_AMZ_VERSION_ID: HeaderName = HeaderName::from_static("x-amz-version-id");

pub const X_AMZ_WEBSITE_REDIRECT_LOCATION: HeaderName = HeaderName::from_static("x-amz-website-redirect-location");

pub const X_MINIO_FORCE_DELETE: HeaderName = HeaderName::from_static("x-minio-force-delete");
3 changes: 3 additions & 0 deletions crates/s3s/src/ops/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,12 @@ impl DeleteBucket {

let expected_bucket_owner: Option<AccountId> = http::parse_opt_header(req, &X_AMZ_EXPECTED_BUCKET_OWNER)?;

let force_delete: Option<ForceDelete> = http::parse_opt_header(req, &X_MINIO_FORCE_DELETE)?;

Ok(DeleteBucketInput {
bucket,
expected_bucket_owner,
force_delete,
})
}

Expand Down
56 changes: 55 additions & 1 deletion crates/s3s/src/xml/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ use std::io::Write;
// DeserializeContent: Event
// SerializeContent: EventBridgeConfiguration
// DeserializeContent: EventBridgeConfiguration
// SerializeContent: ExcludeFolders
// DeserializeContent: ExcludeFolders
// SerializeContent: ExcludedPrefix
// DeserializeContent: ExcludedPrefix
// SerializeContent: ExistingObjectReplication
// DeserializeContent: ExistingObjectReplication
// SerializeContent: ExistingObjectReplicationStatus
Expand Down Expand Up @@ -3371,6 +3375,31 @@ impl<'xml> DeserializeContent<'xml> for EventBridgeConfiguration {
Ok(Self {})
}
}
impl SerializeContent for ExcludedPrefix {
fn serialize_content<W: Write>(&self, s: &mut Serializer<W>) -> SerResult {
if let Some(ref val) = self.prefix {
s.content("Prefix", val)?;
}
Ok(())
}
}

impl<'xml> DeserializeContent<'xml> for ExcludedPrefix {
fn deserialize_content(d: &mut Deserializer<'xml>) -> DeResult<Self> {
let mut prefix: Option<Prefix> = None;
d.for_each_element(|d, x| match x {
b"Prefix" => {
if prefix.is_some() {
return Err(DeError::DuplicateField);
}
prefix = Some(d.content()?);
Ok(())
}
_ => Err(DeError::UnexpectedTagName),
})?;
Ok(Self { prefix })
}
}
impl SerializeContent for ExistingObjectReplication {
fn serialize_content<W: Write>(&self, s: &mut Serializer<W>) -> SerResult {
s.content("Status", &self.status)?;
Expand Down Expand Up @@ -8979,6 +9008,12 @@ impl<'xml> DeserializeContent<'xml> for Type {
}
impl SerializeContent for VersioningConfiguration {
fn serialize_content<W: Write>(&self, s: &mut Serializer<W>) -> SerResult {
if let Some(ref val) = self.exclude_folders {
s.content("ExcludeFolders", val)?;
}
if let Some(iter) = &self.excluded_prefixes {
s.flattened_list("ExcludedPrefixes", iter)?;
}
if let Some(ref val) = self.mfa_delete {
s.content("MfaDelete", val)?;
}
Expand All @@ -8991,9 +9026,23 @@ impl SerializeContent for VersioningConfiguration {

impl<'xml> DeserializeContent<'xml> for VersioningConfiguration {
fn deserialize_content(d: &mut Deserializer<'xml>) -> DeResult<Self> {
let mut exclude_folders: Option<ExcludeFolders> = None;
let mut excluded_prefixes: Option<ExcludedPrefixes> = None;
let mut mfa_delete: Option<MFADelete> = None;
let mut status: Option<BucketVersioningStatus> = None;
d.for_each_element(|d, x| match x {
b"ExcludeFolders" => {
if exclude_folders.is_some() {
return Err(DeError::DuplicateField);
}
exclude_folders = Some(d.content()?);
Ok(())
}
b"ExcludedPrefixes" => {
let ans: ExcludedPrefix = d.content()?;
excluded_prefixes.get_or_insert_with(List::new).push(ans);
Ok(())
}
b"MfaDelete" => {
if mfa_delete.is_some() {
return Err(DeError::DuplicateField);
Expand All @@ -9010,7 +9059,12 @@ impl<'xml> DeserializeContent<'xml> for VersioningConfiguration {
}
_ => Err(DeError::UnexpectedTagName),
})?;
Ok(Self { mfa_delete, status })
Ok(Self {
exclude_folders,
excluded_prefixes,
mfa_delete,
status,
})
}
}
impl SerializeContent for WebsiteConfiguration {
Expand Down

0 comments on commit 14b7ee4

Please sign in to comment.