mirror of
https://github.com/minio/minio-rs.git
synced 2025-12-06 15:26:51 +08:00
Unexport unnecessary list functions (#97)
Unexports `list_objects_v1`, `list_objects_v2` and `list_object_versions` and associated request/response types. These are not necessary as the higher level `list_objects()` can be used instead for equivalent functionality.
This commit is contained in:
parent
1d917a8b7a
commit
b19513c90f
@ -19,10 +19,10 @@ use http::Method;
|
|||||||
use crate::s3::{
|
use crate::s3::{
|
||||||
client::Client,
|
client::Client,
|
||||||
error::Error,
|
error::Error,
|
||||||
response::{
|
response::list_objects::{
|
||||||
ListObjectVersionsResponse, ListObjectsResponse, ListObjectsV1Response,
|
ListObjectVersionsResponse, ListObjectsV1Response, ListObjectsV2Response,
|
||||||
ListObjectsV2Response,
|
|
||||||
},
|
},
|
||||||
|
response::ListObjectsResponse,
|
||||||
types::{S3Api, S3Request, ToS3Request, ToStream},
|
types::{S3Api, S3Request, ToS3Request, ToStream},
|
||||||
utils::{check_bucket_name, merge, Multimap},
|
utils::{check_bucket_name, merge, Multimap},
|
||||||
};
|
};
|
||||||
@ -48,10 +48,9 @@ fn add_common_list_objects_query_params(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Argument builder for ListObjectsV1 S3 API, created by
|
/// Argument for ListObjectsV1 S3 API.
|
||||||
/// [list_objects_v1()](crate::s3::client::Client::list_objects_v1).
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct ListObjectsV1 {
|
struct ListObjectsV1 {
|
||||||
client: Option<Client>,
|
client: Option<Client>,
|
||||||
|
|
||||||
extra_headers: Option<Multimap>,
|
extra_headers: Option<Multimap>,
|
||||||
@ -161,64 +160,9 @@ impl From<ListObjects> for ListObjectsV1 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ListObjectsV1 {
|
/// Argument for ListObjectsV2 S3 API.
|
||||||
pub fn new(bucket: &str) -> Self {
|
|
||||||
Self {
|
|
||||||
bucket: bucket.to_owned(),
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn client(mut self, client: &Client) -> Self {
|
|
||||||
self.client = Some(client.clone());
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extra_headers(mut self, extra_headers: Option<Multimap>) -> Self {
|
|
||||||
self.extra_headers = extra_headers;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extra_query_params(mut self, extra_query_params: Option<Multimap>) -> Self {
|
|
||||||
self.extra_query_params = extra_query_params;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn region(mut self, region: Option<String>) -> Self {
|
|
||||||
self.region = region;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn delimiter(mut self, delimiter: Option<String>) -> Self {
|
|
||||||
self.delimiter = delimiter;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn disable_url_encoding(mut self, disable_url_encoding: bool) -> Self {
|
|
||||||
self.disable_url_encoding = disable_url_encoding;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn max_keys(mut self, max_keys: Option<u16>) -> Self {
|
|
||||||
self.max_keys = max_keys;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn prefix(mut self, prefix: Option<String>) -> Self {
|
|
||||||
self.prefix = prefix;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn marker(mut self, marker: Option<String>) -> Self {
|
|
||||||
self.marker = marker;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Argument builder for ListObjectsV2 S3 API, created by
|
|
||||||
/// [list_objects_v2()](crate::s3::client::Client::list_objects_v2).
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct ListObjectsV2 {
|
struct ListObjectsV2 {
|
||||||
client: Option<Client>,
|
client: Option<Client>,
|
||||||
|
|
||||||
extra_headers: Option<Multimap>,
|
extra_headers: Option<Multimap>,
|
||||||
@ -331,79 +275,9 @@ impl From<ListObjects> for ListObjectsV2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ListObjectsV2 {
|
/// Argument for ListObjectVerions S3 API
|
||||||
pub fn new(bucket: &str) -> Self {
|
|
||||||
Self {
|
|
||||||
bucket: bucket.to_owned(),
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn client(mut self, client: &Client) -> Self {
|
|
||||||
self.client = Some(client.clone());
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extra_headers(mut self, extra_headers: Option<Multimap>) -> Self {
|
|
||||||
self.extra_headers = extra_headers;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extra_query_params(mut self, extra_query_params: Option<Multimap>) -> Self {
|
|
||||||
self.extra_query_params = extra_query_params;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn region(mut self, region: Option<String>) -> Self {
|
|
||||||
self.region = region;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn delimiter(mut self, delimiter: Option<String>) -> Self {
|
|
||||||
self.delimiter = delimiter;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn disable_url_encoding(mut self, disable_url_encoding: bool) -> Self {
|
|
||||||
self.disable_url_encoding = disable_url_encoding;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn max_keys(mut self, max_keys: Option<u16>) -> Self {
|
|
||||||
self.max_keys = max_keys;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn prefix(mut self, prefix: Option<String>) -> Self {
|
|
||||||
self.prefix = prefix;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn start_after(mut self, start_after: Option<String>) -> Self {
|
|
||||||
self.start_after = start_after;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn continuation_token(mut self, continuation_token: Option<String>) -> Self {
|
|
||||||
self.continuation_token = continuation_token;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn fetch_owner(mut self, fetch_owner: bool) -> Self {
|
|
||||||
self.fetch_owner = fetch_owner;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn include_user_metadata(mut self, include_user_metadata: bool) -> Self {
|
|
||||||
self.include_user_metadata = include_user_metadata;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Argument builder for ListObjectVerions S3 API created by
|
|
||||||
/// [list_object_versions()](crate::s3::client::Client::list_object_versions).
|
|
||||||
#[derive(Clone, Debug, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct ListObjectVersions {
|
struct ListObjectVersions {
|
||||||
client: Option<Client>,
|
client: Option<Client>,
|
||||||
|
|
||||||
extra_headers: Option<Multimap>,
|
extra_headers: Option<Multimap>,
|
||||||
@ -513,70 +387,6 @@ impl From<ListObjects> for ListObjectVersions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ListObjectVersions {
|
|
||||||
pub fn new(bucket: &str) -> Self {
|
|
||||||
Self {
|
|
||||||
bucket: bucket.to_owned(),
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn client(mut self, client: &Client) -> Self {
|
|
||||||
self.client = Some(client.clone());
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extra_headers(mut self, extra_headers: Option<Multimap>) -> Self {
|
|
||||||
self.extra_headers = extra_headers;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn extra_query_params(mut self, extra_query_params: Option<Multimap>) -> Self {
|
|
||||||
self.extra_query_params = extra_query_params;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn region(mut self, region: Option<String>) -> Self {
|
|
||||||
self.region = region;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn delimiter(mut self, delimiter: Option<String>) -> Self {
|
|
||||||
self.delimiter = delimiter;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn disable_url_encoding(mut self, disable_url_encoding: bool) -> Self {
|
|
||||||
self.disable_url_encoding = disable_url_encoding;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn max_keys(mut self, max_keys: Option<u16>) -> Self {
|
|
||||||
self.max_keys = max_keys;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn prefix(mut self, prefix: Option<String>) -> Self {
|
|
||||||
self.prefix = prefix;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn key_marker(mut self, key_marker: Option<String>) -> Self {
|
|
||||||
self.key_marker = key_marker;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn version_id_marker(mut self, version_id_marker: Option<String>) -> Self {
|
|
||||||
self.version_id_marker = version_id_marker;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn include_user_metadata(mut self, include_user_metadata: bool) -> Self {
|
|
||||||
self.include_user_metadata = include_user_metadata;
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Argument builder for
|
/// Argument builder for
|
||||||
/// [list_objects()](crate::s3::client::Client::list_objects) API.
|
/// [list_objects()](crate::s3::client::Client::list_objects) API.
|
||||||
///
|
///
|
||||||
|
|||||||
@ -16,21 +16,9 @@
|
|||||||
//! S3 APIs for listing objects.
|
//! S3 APIs for listing objects.
|
||||||
|
|
||||||
use super::Client;
|
use super::Client;
|
||||||
use crate::s3::builders::{ListObjectVersions, ListObjects, ListObjectsV1, ListObjectsV2};
|
use crate::s3::builders::ListObjects;
|
||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
pub fn list_objects_v1(&self, bucket: &str) -> ListObjectsV1 {
|
|
||||||
ListObjectsV1::new(bucket).client(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn list_objects_v2(&self, bucket: &str) -> ListObjectsV2 {
|
|
||||||
ListObjectsV2::new(bucket).client(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn list_object_versions(&self, bucket: &str) -> ListObjectVersions {
|
|
||||||
ListObjectVersions::new(bucket).client(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// List objects with version information optionally. This function handles
|
/// List objects with version information optionally. This function handles
|
||||||
/// pagination and returns a stream of results. Each result corresponds to
|
/// pagination and returns a stream of results. Each result corresponds to
|
||||||
/// the response of a single listing API call.
|
/// the response of a single listing API call.
|
||||||
|
|||||||
@ -33,16 +33,14 @@ use crate::s3::utils::{
|
|||||||
|
|
||||||
mod buckets;
|
mod buckets;
|
||||||
mod get_object;
|
mod get_object;
|
||||||
mod list_objects;
|
pub(crate) mod list_objects;
|
||||||
mod listen_bucket_notification;
|
mod listen_bucket_notification;
|
||||||
mod put_object;
|
mod put_object;
|
||||||
mod remove_objects;
|
mod remove_objects;
|
||||||
|
|
||||||
pub use buckets::{GetBucketVersioningResponse, ListBucketsResponse};
|
pub use buckets::{GetBucketVersioningResponse, ListBucketsResponse};
|
||||||
pub use get_object::GetObjectResponse;
|
pub use get_object::GetObjectResponse;
|
||||||
pub use list_objects::{
|
pub use list_objects::ListObjectsResponse;
|
||||||
ListObjectVersionsResponse, ListObjectsResponse, ListObjectsV1Response, ListObjectsV2Response,
|
|
||||||
};
|
|
||||||
pub use listen_bucket_notification::ListenBucketNotificationResponse;
|
pub use listen_bucket_notification::ListenBucketNotificationResponse;
|
||||||
pub use put_object::{
|
pub use put_object::{
|
||||||
AbortMultipartUploadResponse2, CompleteMultipartUploadResponse2,
|
AbortMultipartUploadResponse2, CompleteMultipartUploadResponse2,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user