Skip to content

Commit

Permalink
Cleanup obsolete methods (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
martijn00 authored Apr 17, 2023
1 parent 6a45116 commit 1682ce9
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 889 deletions.
144 changes: 0 additions & 144 deletions Minio/ApiEndpoints/BucketOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,150 +30,6 @@ namespace Minio;

public partial class MinioClient : IBucketOperations
{
/// <summary>
/// Create a private bucket with the given name.
/// </summary>
/// <param name="bucketName">Name of the new bucket</param>
/// <param name="location">Region</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns> Task </returns>
/// <exception cref="InvalidBucketNameException">When bucketName is null</exception>
[Obsolete("Use MakeBucketAsync method with MakeBucketArgs object. Refer MakeBucket example code.")]
public Task MakeBucketAsync(string bucketName, string location = "us-east-1",
CancellationToken cancellationToken = default)
{
var args = new MakeBucketArgs()
.WithBucket(bucketName)
.WithLocation(location);
return MakeBucketAsync(args, cancellationToken);
}

/// <summary>
/// Returns true if the specified bucketName exists, otherwise returns false.
/// </summary>
/// <param name="bucketName">Bucket to test existence of</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task that returns true if exists and user has access</returns>
[Obsolete("Use BucketExistsAsync method with BucketExistsArgs object. Refer BucketExists example code.")]
public Task<bool> BucketExistsAsync(string bucketName, CancellationToken cancellationToken = default)
{
var args = new BucketExistsArgs()
.WithBucket(bucketName);
return BucketExistsAsync(args, cancellationToken);
}

/// <summary>
/// Remove a bucket
/// </summary>
/// <param name="bucketName">Name of bucket to remove</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task</returns>
[Obsolete("Use RemoveBucketAsync method with RemoveBucketArgs object. Refer RemoveBucket example code.")]
public Task RemoveBucketAsync(string bucketName, CancellationToken cancellationToken = default)
{
var args = new RemoveBucketArgs()
.WithBucket(bucketName);
return RemoveBucketAsync(args, cancellationToken);
}

/// <summary>
/// List all objects non-recursively in a bucket with a given prefix, optionally emulating a directory
/// </summary>
/// <param name="bucketName">Bucket to list objects from</param>
/// <param name="prefix">Filters all objects beginning with a given prefix</param>
/// <param name="recursive">Set to true to recursively list all objects</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>An observable of items that client can subscribe to</returns>
[Obsolete("Use ListObjectsAsync method with ListObjectsArgs object. Refer ListObjects example code.")]
public IObservable<Item> ListObjectsAsync(string bucketName, string prefix = null, bool recursive = false,
CancellationToken cancellationToken = default)
{
var args = new ListObjectsArgs()
.WithBucket(bucketName)
.WithPrefix(prefix)
.WithRecursive(recursive);
return ListObjectsAsync(args, cancellationToken);
}

/// <summary>
/// Returns current policy stored on the server for this bucket
/// </summary>
/// <param name="bucketName">Bucket name.</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task that returns the Bucket policy as a json string</returns>
[Obsolete("Use GetPolicyAsync method with GetPolicyArgs object. Refer GetBucketPolicy example code.")]
public Task<string> GetPolicyAsync(string bucketName, CancellationToken cancellationToken = default)
{
var args = new GetPolicyArgs()
.WithBucket(bucketName);
return GetPolicyAsync(args, cancellationToken);
}

/// <summary>
/// Sets the current bucket policy
/// </summary>
/// <param name="bucketName">Bucket Name</param>
/// <param name="policyJson">Policy json as string </param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task to set a policy</returns>
[Obsolete("Use SetPolicyAsync method with SetPolicyArgs object. Refer SetBucketPolicy example code.")]
public Task SetPolicyAsync(string bucketName, string policyJson, CancellationToken cancellationToken = default)
{
var args = new SetPolicyArgs()
.WithBucket(bucketName)
.WithPolicy(policyJson);
return SetPolicyAsync(args, cancellationToken);
}

/// <summary>
/// Gets notification configuration for this bucket
/// </summary>
/// <param name="bucketName">Bucket name</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns></returns>
[Obsolete(
"Use GetBucketNotificationsAsync method with GetBucketNotificationsArgs object. Refer GetBucketNotification example code.")]
public Task<BucketNotification> GetBucketNotificationsAsync(string bucketName,
CancellationToken cancellationToken = default)
{
var args = new GetBucketNotificationsArgs()
.WithBucket(bucketName);
return GetBucketNotificationsAsync(args, cancellationToken);
}

/// <summary>
/// Sets the notification configuration for this bucket
/// </summary>
/// <param name="bucketName">Bucket name</param>
/// <param name="notification">Notification object with configuration to be set on the server</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns></returns>
[Obsolete(
"Use SetBucketNotificationsAsync method with SetBucketNotificationsArgs object. Refer SetBucketNotification example code.")]
public Task SetBucketNotificationsAsync(string bucketName, BucketNotification notification,
CancellationToken cancellationToken = default)
{
var args = new SetBucketNotificationsArgs()
.WithBucket(bucketName)
.WithBucketNotificationConfiguration(notification);
return SetBucketNotificationsAsync(args, cancellationToken);
}

/// <summary>
/// Removes all bucket notification configurations stored on the server.
/// </summary>
/// <param name="bucketName">Bucket name</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns></returns>
[Obsolete(
"Use RemoveAllBucketNotificationsAsync method with RemoveAllBucketNotificationsArgs object. Refer RemoveAllBucketNotification example code.")]
public Task RemoveAllBucketNotificationsAsync(string bucketName, CancellationToken cancellationToken = default)
{
var args = new RemoveAllBucketNotificationsArgs()
.WithBucket(bucketName);
return RemoveAllBucketNotificationsAsync(args, cancellationToken);
}

/// <summary>
/// List all the buckets for the current Endpoint URL
/// </summary>
Expand Down
107 changes: 0 additions & 107 deletions Minio/ApiEndpoints/IBucketOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ public interface IBucketOperations
/// <exception cref="NotImplementedException">When object-lock or another extension is not implemented</exception>
Task MakeBucketAsync(MakeBucketArgs args, CancellationToken cancellationToken = default);

/// <summary>
/// Create a private bucket with the given name.
/// </summary>
/// <param name="bucketName">Name of the new bucket</param>
/// <param name="location">Region</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task</returns>
[Obsolete("Use MakeBucketAsync method with MakeBucketArgs object. Refer MakeBucket example code.")]
Task MakeBucketAsync(string bucketName, string location = "us-east-1",
CancellationToken cancellationToken = default);

/// <summary>
/// List all objects in a bucket
/// </summary>
Expand All @@ -67,15 +56,6 @@ Task MakeBucketAsync(string bucketName, string location = "us-east-1",
/// <exception cref="BucketNotFoundException">When bucket is not found</exception>
Task<bool> BucketExistsAsync(BucketExistsArgs args, CancellationToken cancellationToken = default);

/// <summary>
/// Returns true if the specified bucketName exists, otherwise returns false.
/// </summary>
/// <param name="bucketName">Bucket to test existence of</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task that returns true if exists and user has access</returns>
[Obsolete("Use BucketExistsAsync method with BucketExistsArgs object. Refer BucketExists example code.")]
Task<bool> BucketExistsAsync(string bucketName, CancellationToken cancellationToken = default);

/// <summary>
/// Remove the bucket with the given name.
/// </summary>
Expand All @@ -87,15 +67,6 @@ Task MakeBucketAsync(string bucketName, string location = "us-east-1",
/// <exception cref="BucketNotFoundException">When bucket is not found</exception>
Task RemoveBucketAsync(RemoveBucketArgs args, CancellationToken cancellationToken = default);

/// <summary>
/// Remove a bucket
/// </summary>
/// <param name="bucketName">Name of bucket to remove</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Task</returns>
[Obsolete("Use RemoveBucketAsync method with RemoveBucketArgs object. Refer RemoveBucket example code.")]
Task RemoveBucketAsync(string bucketName, CancellationToken cancellationToken = default);

/// <summary>
/// List all objects non-recursively in a bucket with a given prefix, optionally emulating a directory
/// </summary>
Expand Down Expand Up @@ -255,84 +226,6 @@ Task<ObjectLockConfiguration> GetObjectLockConfigurationAsync(GetObjectLockConfi
Task RemoveObjectLockConfigurationAsync(RemoveObjectLockConfigurationArgs args,
CancellationToken cancellationToken = default);

/// <summary>
/// List all objects non-recursively in a bucket with a given prefix, optionally emulating a directory
/// </summary>
/// <param name="bucketName">Bucket to list objects from</param>
/// <param name="prefix">Filter all incomplete uploads starting with this prefix</param>
/// <param name="recursive">List incomplete uploads recursively</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>An observable of items that client can subscribe to</returns>
[Obsolete("Use ListObjectsAsync method with ListObjectsArgs object. Refer ListObjects example code.")]
IObservable<Item> ListObjectsAsync(string bucketName, string prefix = null, bool recursive = false,
CancellationToken cancellationToken = default);

/// <summary>
/// Get bucket policy
/// </summary>
/// <param name="bucketName">Bucket name</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Returns Task with bucket policy json as string </returns>
[Obsolete("Use GetPolicyAsync method with GetPolicyArgs object. Refer GetBucketPolicy example code.")]
Task<string> GetPolicyAsync(string bucketName, CancellationToken cancellationToken = default);

/// <summary>
/// Sets the current bucket policy
/// </summary>
/// <param name="bucketName">Bucket Name</param>
/// <param name="policyJson">policy json</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>Returns Task that sets the current bucket policy</returns>
[Obsolete("Use SetPolicyAsync method with SetPolicyArgs object. Refer SetBucketPolicy example code.")]
Task SetPolicyAsync(string bucketName, string policyJson, CancellationToken cancellationToken = default);

/// <summary>
/// Gets the notification configuration set for this bucket
/// </summary>
/// <param name="bucketName">Bucket Name</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>BucketNotification object populated with the notification subresource</returns>
[Obsolete(
"Use GetBucketNotificationsAsync method with GetBucketNotificationsArgs object. Refer GetBucketNotification example code.")]
Task<BucketNotification> GetBucketNotificationsAsync(string bucketName,
CancellationToken cancellationToken = default);

/// <summary>
/// Sets bucket notification configuration
/// </summary>
/// <param name="bucketName">Bucket Name</param>
/// <param name="notification">BucketNotification object</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns></returns>
[Obsolete(
"Use SetBucketNotificationsAsync method with SetBucketNotificationsArgs object. Refer SetBucketNotification example code.")]
Task SetBucketNotificationsAsync(string bucketName, BucketNotification notification,
CancellationToken cancellationToken = default);

/// <summary>
/// Remove all bucket notifications
/// </summary>
/// <param name="bucketName">bucketName</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns></returns>
[Obsolete(
"Use RemoveAllBucketNotificationsAsync method with RemoveAllBucketNotificationsArgs object. Refer RemoveAllBucketNotification example code.")]
Task RemoveAllBucketNotificationsAsync(string bucketName, CancellationToken cancellationToken = default);

/// <summary>
/// Subscribes to bucket change notifications (a Minio-only extension)
/// </summary>
/// <param name="bucketName">Bucket to get notifications from</param>
/// <param name="events">Events to listen for</param>
/// <param name="prefix">Filter keys starting with this prefix</param>
/// <param name="suffix">Filter keys ending with this suffix</param>
/// <param name="cancellationToken">Optional cancellation token to cancel the operation</param>
/// <returns>An observable of JSON-based notification events</returns>
[Obsolete(
"Use ListenBucketNotificationsAsync method with ListenBucketNotificationsArgs object. Refer ListenBucketNotifications example code.")]
IObservable<MinioNotificationRaw> ListenBucketNotificationsAsync(string bucketName, IList<EventType> events,
string prefix = "", string suffix = "", CancellationToken cancellationToken = default);

/// <summary>
/// Get Versioning information on the bucket with given bucket name
/// </summary>
Expand Down
Loading

0 comments on commit 1682ce9

Please sign in to comment.