Skip to content

Commit

Permalink
more fn and fields deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
geetanshjuneja committed Dec 31, 2024
1 parent b6a8ef0 commit cd886b5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/layers/capability_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ mod tests {
list_with_versioned: true,
..Default::default()
});
let res = op.lister_with("path/").version(true).await;
let res = op.lister_with("path/").versioned(true).await;
assert!(res.is_ok())
}
}
2 changes: 1 addition & 1 deletion core/src/raw/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl OpList {
}

/// Change the version of this list operation
#[deprecated(since = "0.51.1", note = "use versioned instead")]
#[deprecated(since = "0.51.1", note = "use with_versioned instead")]
pub fn with_version(mut self, version: bool) -> Self {
self.versioned = version;
self
Expand Down
5 changes: 4 additions & 1 deletion core/src/types/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ pub struct Capability {
/// Indicates if recursive listing is supported.
pub list_with_recursive: bool,
/// Indicates if versioned listing is supported.
#[deprecated(since = "0.51.1", note = "use with_versioned instead")]
pub list_with_version: bool,
/// Indicates if versioned listing is supported.
pub list_with_versioned: bool,
/// Indicates whether cache control information is available in list response
pub list_has_cache_control: bool,
Expand All @@ -193,7 +196,7 @@ pub struct Capability {
/// Indicates whether last modified timestamp is available in list response
pub list_has_last_modified: bool,
/// Indicates whether version information is available in list response
pub list_has_versioned: bool,
pub list_has_version: bool,
/// Indicates whether user-defined metadata is available in list response
pub list_has_user_metadata: bool,

Expand Down
12 changes: 12 additions & 0 deletions core/src/types/operator/operator_futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,19 @@ impl<F: Future<Output = Result<Lister>>> FutureLister<F> {
/// by the underlying service
///
/// Default to `false`
#[deprecated(since = "0.51.1", note = "use versioned instead")]
pub fn version(self, v: bool) -> Self {
self.map(|args| args.with_versioned(v))
}

/// The version is used to control whether the object versions should be returned.
///
/// - If `false`, list operation will not return with object versions
/// - If `true`, list operation will return with object versions if object versioning is supported
/// by the underlying service
///
/// Default to `false`
pub fn versioned(self, v: bool) -> Self {
self.map(|args| args.with_versioned(v))
}
}
4 changes: 2 additions & 2 deletions core/tests/behavior/async_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ pub async fn test_list_with_versioned_and_limit(op: Operator) -> Result<()> {
.collect();
expected.push(parent.to_string());

let mut objects = op.lister_with(parent).version(true).limit(5).await?;
let mut objects = op.lister_with(parent).versioned(true).limit(5).await?;
let mut actual = vec![];
while let Some(o) = objects.try_next().await? {
let path = o.path().to_string();
Expand Down Expand Up @@ -672,7 +672,7 @@ pub async fn test_list_with_versioned_and_start_after(op: Operator) -> Result<()

let mut objects = op
.lister_with(dir)
.version(true)
.versioned(true)
.start_after(&given[2])
.await?;
let mut actual = vec![];
Expand Down

0 comments on commit cd886b5

Please sign in to comment.