From 0a8bccfecb8de5caf508d043e33c75428197d1b0 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Mon, 6 Jan 2025 00:51:23 -0800 Subject: [PATCH 01/15] Initial code changes for storage samples of GetSoftDeletedBucket, ListSoftDeletedBucket,RestoreSoftDeletedBucket --- .../Storage.Samples/GetSoftDeletedBucket.cs | 37 ++++++++++++++++ .../Storage.Samples/ListSoftDeletedBuckets.cs | 36 ++++++++++++++++ .../RestoreSoftDeletedBucket.cs | 43 +++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 storage/api/Storage.Samples/GetSoftDeletedBucket.cs create mode 100644 storage/api/Storage.Samples/ListSoftDeletedBuckets.cs create mode 100644 storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs diff --git a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs new file mode 100644 index 00000000000..9b174d76084 --- /dev/null +++ b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs @@ -0,0 +1,37 @@ +// Copyright 2024 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// [START storage_get_soft_deleted_bucket] + +using Google.Apis.Storage.v1.Data; +using Google.Cloud.Storage.V1; +using System; +using System.Threading.Tasks; + +public class GetSoftDeletedBucketSample +{ + public Bucket GetSoftDeletedBucket(string bucketName = "your-unique-bucket-name") + { + var client = StorageClient.Create(); + var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = false }); + client.DeleteBucket(bucketName, new DeleteBucketOptions { DeleteObjects = true }); + var softDeleted = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = true, Generation = bucket.Generation }); + Console.WriteLine($"Bucket:\t{softDeleted.Name}"); + Console.WriteLine($"Bucket Generation:\t{softDeleted.Generation}"); + Console.WriteLine($"Bucket SoftDelete Time:\t{softDeleted.SoftDeleteTimeDateTimeOffset}"); + Console.WriteLine($"Bucket HardDelete Time:\t{softDeleted.HardDeleteTimeDateTimeOffset}"); + return softDeleted; + } +} +// [END storage_get_soft_deleted_bucket] diff --git a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs new file mode 100644 index 00000000000..8649e316aa7 --- /dev/null +++ b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs @@ -0,0 +1,36 @@ +// Copyright 2024 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// [START storage_list_soft_deleted_buckets] + +using Google.Apis.Storage.v1.Data; +using Google.Cloud.Storage.V1; +using System; +using System.Collections.Generic; + +public class ListSoftDeletedBucketsSample +{ + public IEnumerable ListSoftDeletedBuckets(string projectId = "your-project-id") + { + var storage = StorageClient.Create(); + var buckets = storage.ListBuckets(projectId, new ListBucketsOptions { SoftDeleted = true }); + Console.WriteLine("Soft Deleted Buckets are as follows:"); + foreach (var bucket in buckets) + { + Console.WriteLine(bucket.Name); + } + return buckets; + } +} +// [END storage_list_soft_deleted_buckets] diff --git a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs new file mode 100644 index 00000000000..799edad3873 --- /dev/null +++ b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs @@ -0,0 +1,43 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// [START storage_restore_bucket] + +using Google.Apis.Storage.v1.Data; +using Google.Cloud.Storage.Control.V2; +using Google.Cloud.Storage.V1; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Storage.Samples +{ + public class RestoreSoftDeletedBucketSample + { + public Bucket RestoreSoftDeletedBucket(string bucketName = "your-unique-bucket-name") + { + var client = StorageClient.Create(); + var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = false }); + client.DeleteBucket(bucket.Name, new DeleteBucketOptions { DeleteObjects = true }); + var restored = client.RestoreBucket(bucket.Name, bucket.Generation.Value); + Console.WriteLine($"Bucket Name:\t {restored.Name}"); + Console.WriteLine($"Bucket Generation:\t {restored.Generation}"); + return restored; + } + } +} +// [END storage_restore_bucket] From bd7b348bde3b97bbed698de7c2cf37de69f9f3e3 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Mon, 10 Mar 2025 04:55:49 -0700 Subject: [PATCH 02/15] listSoftDeletedBuckets sample and test case added --- .../Storage.Samples.Tests/ListBucketsTest.cs | 27 +++++++++++++++++++ .../Storage.Samples.Tests/StorageFixture.cs | 24 ++++++++++++++++- .../Storage.Samples/ListSoftDeletedBuckets.cs | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs index a0441708eca..7b16ffbd883 100644 --- a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs +++ b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs @@ -12,7 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +using Google.Apis.Storage.v1.Data; +using Google.Cloud.Storage.V1; using System; +using System.Threading; +using System.Threading.Tasks; using Xunit; [Collection(nameof(StorageFixture))] @@ -36,4 +40,27 @@ public void ListBuckets() var buckets = listBucketsSample.ListBuckets(_fixture.ProjectId); Assert.Contains(buckets, c => c.Name == bucketName); } + + [Fact] + public async Task SoftDeletedOnly() + { + ListSoftDeletedBucketsSample listSoftDeletedBucketsSample = new ListSoftDeletedBucketsSample(); + var bucketName = _fixture.GenerateBucketName(); + var softDeleteBucket = _fixture.CreateSoftDeleteBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); + + var actualBuckets = listSoftDeletedBucketsSample.ListSoftDeletedBuckets(_fixture.ProjectId); + // Check the list contains the bucket we just soft-deleted. + Assert.Contains(actualBuckets, bucket => bucket.Name == softDeleteBucket.Name && bucket.Generation == softDeleteBucket.Generation); + // Check all the buckets in the list are soft-deleted buckets. + Assert.All(actualBuckets, AssertSoftDeletedBucket); + } + + // Validates that the given bucket is soft-deleted. + private void AssertSoftDeletedBucket(Bucket b) + { + Assert.NotNull(b.Generation); + Assert.NotNull(b.HardDeleteTimeDateTimeOffset); + Assert.NotNull(b.SoftDeleteTimeDateTimeOffset); + } } diff --git a/storage/api/Storage.Samples.Tests/StorageFixture.cs b/storage/api/Storage.Samples.Tests/StorageFixture.cs index 263b83cea30..5c82d92044c 100644 --- a/storage/api/Storage.Samples.Tests/StorageFixture.cs +++ b/storage/api/Storage.Samples.Tests/StorageFixture.cs @@ -1,4 +1,4 @@ -// Copyright 2020 Google Inc. +// Copyright 2020 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ public class StorageFixture : IDisposable, ICollectionFixture public string KmsKeyLocation { get; } = "us-west1"; public string ServiceAccountEmail { get; } = "gcs-iam-acl-test@dotnet-docs-samples-tests.iam.gserviceaccount.com"; public List TempTopicNames { get; } = new List(); + public StorageClient Client { get; } public RetryRobot HmacChangesPropagated { get; } = new RetryRobot { @@ -64,6 +65,7 @@ public StorageFixture() { throw new Exception("You need to set the Environment variable 'GOOGLE_PROJECT_ID' with your Google Cloud Project's project id."); } + Client = StorageClient.Create(); // create simple bucket CreateBucket(BucketNameGeneric); @@ -217,6 +219,26 @@ public void CreateBucket(string bucketName, string location = null, AutoclassDat TempBucketNames.Add(bucketName); } + internal Bucket CreateSoftDeleteBucket(string name, bool multiVersion, bool softDelete = false, bool registerForDeletion = true) + { + var bucket = Client.CreateBucket(ProjectId, + new Bucket + { + Name = name, + Versioning = new Bucket.VersioningData { Enabled = multiVersion }, + // The minimum allowed for soft delete is 7 days. + SoftDeletePolicy = softDelete ? new Bucket.SoftDeletePolicyData { RetentionDurationSeconds = (int) TimeSpan.FromDays(7).TotalSeconds } : null, + }); + SleepAfterBucketCreateUpdateDelete(); + if (registerForDeletion) + { + TempBucketNames.Add(name); + } + return bucket; + } + + internal string GenerateBucketName() => Guid.NewGuid().ToString(); + /// /// Bucket creation/update/deletion is rate-limited. To avoid making the tests flaky, we sleep after each operation. /// diff --git a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs index 8649e316aa7..57e720f94a8 100644 --- a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs +++ b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs @@ -24,7 +24,7 @@ public class ListSoftDeletedBucketsSample public IEnumerable ListSoftDeletedBuckets(string projectId = "your-project-id") { var storage = StorageClient.Create(); - var buckets = storage.ListBuckets(projectId, new ListBucketsOptions { SoftDeleted = true }); + var buckets = storage.ListBuckets(projectId, new ListBucketsOptions { SoftDeletedOnly = true }); Console.WriteLine("Soft Deleted Buckets are as follows:"); foreach (var bucket in buckets) { From 311edf28d6f88232e1d14549071a00317fc7b2f2 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Tue, 11 Mar 2025 01:00:25 -0700 Subject: [PATCH 03/15] Google.Cloud.Storage.V1 version update to get soft delete bucket metatadata --- storage/api/Storage.Samples/Storage.Samples.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/api/Storage.Samples/Storage.Samples.csproj b/storage/api/Storage.Samples/Storage.Samples.csproj index 5e5a50498f1..e881863305f 100644 --- a/storage/api/Storage.Samples/Storage.Samples.csproj +++ b/storage/api/Storage.Samples/Storage.Samples.csproj @@ -1,4 +1,4 @@ - + netstandard2.1 @@ -6,7 +6,7 @@ - + From ba028ed704dedf9b915a43eaaecfbcca4f215431 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Tue, 11 Mar 2025 03:21:23 -0700 Subject: [PATCH 04/15] get and restore samples and test cases for soft delete feature phase 2 --- .../Storage.Samples.Tests/GetBucketTest.cs | 43 +++++++++++++++++++ .../Storage.Samples.Tests/ListBucketsTest.cs | 2 +- .../RestoreBucketTest.cs | 41 ++++++++++++++++++ .../Storage.Samples/GetSoftDeletedBucket.cs | 19 ++++---- .../RestoreSoftDeletedBucket.cs | 26 +++-------- 5 files changed, 100 insertions(+), 31 deletions(-) create mode 100644 storage/api/Storage.Samples.Tests/GetBucketTest.cs create mode 100644 storage/api/Storage.Samples.Tests/RestoreBucketTest.cs diff --git a/storage/api/Storage.Samples.Tests/GetBucketTest.cs b/storage/api/Storage.Samples.Tests/GetBucketTest.cs new file mode 100644 index 00000000000..ac2e37ed2cb --- /dev/null +++ b/storage/api/Storage.Samples.Tests/GetBucketTest.cs @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Google.Cloud.Storage.V1; +using System.Threading.Tasks; +using Xunit; + +[Collection(nameof(StorageFixture))] +public class GetBucketTest +{ + private readonly StorageFixture _fixture; + + public GetBucketTest(StorageFixture fixture) + { + _fixture = fixture; + } + + [Fact] + public async Task SoftDeleted() + { + GetSoftDeletedBucketSample getSoftDeletedBucketSample = new GetSoftDeletedBucketSample(); + var bucketName = _fixture.GenerateBucketName(); + var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); + + var softDeleted = getSoftDeletedBucketSample.GetSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation); + Assert.Equal(softDeleteBucket.Name, softDeleted.Name); + Assert.Equal(softDeleteBucket.Generation, softDeleted.Generation); + Assert.NotNull(softDeleted.SoftDeleteTimeDateTimeOffset); + Assert.NotNull(softDeleted.HardDeleteTimeDateTimeOffset); + } +} diff --git a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs index 7b16ffbd883..4caa3c0d17e 100644 --- a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs +++ b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs @@ -46,7 +46,7 @@ public async Task SoftDeletedOnly() { ListSoftDeletedBucketsSample listSoftDeletedBucketsSample = new ListSoftDeletedBucketsSample(); var bucketName = _fixture.GenerateBucketName(); - var softDeleteBucket = _fixture.CreateSoftDeleteBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); var actualBuckets = listSoftDeletedBucketsSample.ListSoftDeletedBuckets(_fixture.ProjectId); diff --git a/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs b/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs new file mode 100644 index 00000000000..5c6bc164975 --- /dev/null +++ b/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs @@ -0,0 +1,41 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Google.Cloud.Storage.V1; +using System.Threading.Tasks; +using Xunit; + +[Collection(nameof(StorageFixture))] +public class RestoreBucketTest +{ + private readonly StorageFixture _fixture; + + public RestoreBucketTest(StorageFixture fixture) + { + _fixture = fixture; + } + + [Fact] + public async Task RestoreSoftDeletedBucket() + { + RestoreSoftDeletedBucketSample restoreSoftDeletedBucketSample = new RestoreSoftDeletedBucketSample(); + var bucketName = _fixture.GenerateBucketName(); + var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); + + var restoredBucket = restoreSoftDeletedBucketSample.RestoreSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation); + Assert.Equal(softDeleteBucket.Name, restoredBucket.Name); + Assert.Equal(softDeleteBucket.Generation, restoredBucket.Generation); + } +} diff --git a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs index 9b174d76084..a83e6b2788e 100644 --- a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs @@ -17,21 +17,18 @@ using Google.Apis.Storage.v1.Data; using Google.Cloud.Storage.V1; using System; -using System.Threading.Tasks; public class GetSoftDeletedBucketSample { - public Bucket GetSoftDeletedBucket(string bucketName = "your-unique-bucket-name") + public Bucket GetSoftDeletedBucket(string bucketName = "your-unique-bucket-name", long? generation = 123456789) { - var client = StorageClient.Create(); - var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = false }); - client.DeleteBucket(bucketName, new DeleteBucketOptions { DeleteObjects = true }); - var softDeleted = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = true, Generation = bucket.Generation }); - Console.WriteLine($"Bucket:\t{softDeleted.Name}"); - Console.WriteLine($"Bucket Generation:\t{softDeleted.Generation}"); - Console.WriteLine($"Bucket SoftDelete Time:\t{softDeleted.SoftDeleteTimeDateTimeOffset}"); - Console.WriteLine($"Bucket HardDelete Time:\t{softDeleted.HardDeleteTimeDateTimeOffset}"); - return softDeleted; + var client = StorageClient.Create(); + var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = true, Generation = generation }); + Console.WriteLine($"Bucket:\t{bucket.Name}"); + Console.WriteLine($"Bucket Generation:\t{bucket.Generation}"); + Console.WriteLine($"Bucket SoftDelete Time:\t{bucket.SoftDeleteTimeDateTimeOffset}"); + Console.WriteLine($"Bucket HardDelete Time:\t{bucket.HardDeleteTimeDateTimeOffset}"); + return bucket; } } // [END storage_get_soft_deleted_bucket] diff --git a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs index 799edad3873..67c6ed0568f 100644 --- a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs @@ -15,29 +15,17 @@ // [START storage_restore_bucket] using Google.Apis.Storage.v1.Data; -using Google.Cloud.Storage.Control.V2; using Google.Cloud.Storage.V1; using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; - -namespace Storage.Samples +public class RestoreSoftDeletedBucketSample { - public class RestoreSoftDeletedBucketSample + public Bucket RestoreSoftDeletedBucket(string bucketName = "your-unique-bucket-name", long generation = 123456789) { - public Bucket RestoreSoftDeletedBucket(string bucketName = "your-unique-bucket-name") - { - var client = StorageClient.Create(); - var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = false }); - client.DeleteBucket(bucket.Name, new DeleteBucketOptions { DeleteObjects = true }); - var restored = client.RestoreBucket(bucket.Name, bucket.Generation.Value); - Console.WriteLine($"Bucket Name:\t {restored.Name}"); - Console.WriteLine($"Bucket Generation:\t {restored.Generation}"); - return restored; - } + var client = StorageClient.Create(); + var restored = client.RestoreBucket(bucketName, generation); + Console.WriteLine($"Bucket Name:\t {restored.Name}"); + Console.WriteLine($"Bucket Generation:\t {restored.Generation}"); + return restored; } } // [END storage_restore_bucket] From c22b190466c1fb389cfdc5ececf37f042229244c Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Tue, 11 Mar 2025 05:19:24 -0700 Subject: [PATCH 05/15] method name change in fixture from CreateSoftDeleteBucket to CreateBucket --- storage/api/Storage.Samples.Tests/StorageFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/api/Storage.Samples.Tests/StorageFixture.cs b/storage/api/Storage.Samples.Tests/StorageFixture.cs index 5c82d92044c..9bcc2903b58 100644 --- a/storage/api/Storage.Samples.Tests/StorageFixture.cs +++ b/storage/api/Storage.Samples.Tests/StorageFixture.cs @@ -219,7 +219,7 @@ public void CreateBucket(string bucketName, string location = null, AutoclassDat TempBucketNames.Add(bucketName); } - internal Bucket CreateSoftDeleteBucket(string name, bool multiVersion, bool softDelete = false, bool registerForDeletion = true) + internal Bucket CreateBucket(string name, bool multiVersion, bool softDelete = false, bool registerForDeletion = true) { var bucket = Client.CreateBucket(ProjectId, new Bucket From 15d8d3d525f4e70cdc5ed03cb869f1e39501fab3 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Tue, 18 Mar 2025 01:36:04 -0700 Subject: [PATCH 06/15] Method descriptions are added for samples i.e getsoftdeleted , listsoftdeleted , restoresoftdeleted --- storage/api/Storage.Samples/GetSoftDeletedBucket.cs | 9 ++++++++- storage/api/Storage.Samples/ListSoftDeletedBuckets.cs | 4 ++++ storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs index a83e6b2788e..d0acc94d7cc 100644 --- a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs @@ -20,7 +20,14 @@ public class GetSoftDeletedBucketSample { - public Bucket GetSoftDeletedBucket(string bucketName = "your-unique-bucket-name", long? generation = 123456789) + /// + /// Get a soft deleted bucket. + /// + /// The name of the bucket. + /// The generation of the bucket. + public Bucket GetSoftDeletedBucket( + string bucketName = "your-unique-bucket-name", + long? generation = 123456789) { var client = StorageClient.Create(); var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = true, Generation = generation }); diff --git a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs index 57e720f94a8..5b7c027d4ee 100644 --- a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs +++ b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs @@ -21,6 +21,10 @@ public class ListSoftDeletedBucketsSample { + /// + /// List soft deleted buckets. + /// + /// The ID of the project to list soft deleted buckets. public IEnumerable ListSoftDeletedBuckets(string projectId = "your-project-id") { var storage = StorageClient.Create(); diff --git a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs index 67c6ed0568f..0eb9501f45c 100644 --- a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs @@ -19,7 +19,14 @@ using System; public class RestoreSoftDeletedBucketSample { - public Bucket RestoreSoftDeletedBucket(string bucketName = "your-unique-bucket-name", long generation = 123456789) + /// + /// Restores a soft deleted bucket. + /// + /// The name of the bucket to restore. + /// The generation of the bucket. + public Bucket RestoreSoftDeletedBucket( + string bucketName = "your-unique-bucket-name", + long generation = 123456789) { var client = StorageClient.Create(); var restored = client.RestoreBucket(bucketName, generation); From 38de4504343f2b4ad9913fd620bdc0da983b06c3 Mon Sep 17 00:00:00 2001 From: Mahendra Date: Fri, 21 Mar 2025 10:34:46 +0530 Subject: [PATCH 07/15] Update RestoreBucketTest.cs --- storage/api/Storage.Samples.Tests/RestoreBucketTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs b/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs index 5c6bc164975..0f3cabf3967 100644 --- a/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs +++ b/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs @@ -34,7 +34,7 @@ public async Task RestoreSoftDeletedBucket() var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); - var restoredBucket = restoreSoftDeletedBucketSample.RestoreSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation); + var restoredBucket = restoreSoftDeletedBucketSample.RestoreSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation.Value); Assert.Equal(softDeleteBucket.Name, restoredBucket.Name); Assert.Equal(softDeleteBucket.Generation, restoredBucket.Generation); } From dcfad28aeb3b151b3ed98b615dbb7d589a53f925 Mon Sep 17 00:00:00 2001 From: Mahendra Date: Fri, 4 Apr 2025 17:50:29 +0530 Subject: [PATCH 08/15] Update storage/api/Storage.Samples/GetSoftDeletedBucket.cs Co-authored-by: Amanda Tarafa Mas <14878252+amanda-tarafa@users.noreply.github.com> --- storage/api/Storage.Samples/GetSoftDeletedBucket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs index d0acc94d7cc..7f6ceef5c99 100644 --- a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs @@ -1,4 +1,4 @@ -// Copyright 2024 Google Inc. +// Copyright 2025 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 7ff99de0e20af7042047962d6aeac190ab038ba6 Mon Sep 17 00:00:00 2001 From: Mahendra Date: Fri, 4 Apr 2025 17:51:33 +0530 Subject: [PATCH 09/15] Update storage/api/Storage.Samples/GetSoftDeletedBucket.cs Co-authored-by: Amanda Tarafa Mas <14878252+amanda-tarafa@users.noreply.github.com> --- storage/api/Storage.Samples/GetSoftDeletedBucket.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs index 7f6ceef5c99..75f68d0b311 100644 --- a/storage/api/Storage.Samples/GetSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/GetSoftDeletedBucket.cs @@ -30,7 +30,11 @@ public Bucket GetSoftDeletedBucket( long? generation = 123456789) { var client = StorageClient.Create(); - var bucket = client.GetBucket(bucketName, new GetBucketOptions { SoftDeleted = true, Generation = generation }); + var bucket = client.GetBucket(bucketName, new GetBucketOptions + { + SoftDeleted = true, + Generation = generation + }); Console.WriteLine($"Bucket:\t{bucket.Name}"); Console.WriteLine($"Bucket Generation:\t{bucket.Generation}"); Console.WriteLine($"Bucket SoftDelete Time:\t{bucket.SoftDeleteTimeDateTimeOffset}"); From 41514e62638c4f1a4d86e45ec8cd311c6c72821f Mon Sep 17 00:00:00 2001 From: Mahendra Date: Fri, 4 Apr 2025 17:51:44 +0530 Subject: [PATCH 10/15] Update storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs Co-authored-by: Amanda Tarafa Mas <14878252+amanda-tarafa@users.noreply.github.com> --- storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs index 0eb9501f45c..870a01ea5cb 100644 --- a/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs +++ b/storage/api/Storage.Samples/RestoreSoftDeletedBucket.cs @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"). // you may not use this file except in compliance with the License. From 49d5833fef44e7d0230636e44581a408c0eaf298 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Fri, 4 Apr 2025 05:37:38 -0700 Subject: [PATCH 11/15] copyright year change --- storage/api/Storage.Samples/ListSoftDeletedBuckets.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs index 5b7c027d4ee..06ff7b38bd3 100644 --- a/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs +++ b/storage/api/Storage.Samples/ListSoftDeletedBuckets.cs @@ -1,4 +1,4 @@ -// Copyright 2024 Google Inc. +// Copyright 2025 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From dcc8ece3310ed914d280c83693d9b47816a38440 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Fri, 4 Apr 2025 06:14:40 -0700 Subject: [PATCH 12/15] softdelete bucket test changes --- .../GetSoftDeleteBucketTest.cs | 43 ++++++++++++++++ .../ListSoftDeleteBucketsTest.cs | 51 +++++++++++++++++++ .../RestoreSoftDeleteBucketTest.cs | 41 +++++++++++++++ 3 files changed, 135 insertions(+) create mode 100644 storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs create mode 100644 storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs create mode 100644 storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs diff --git a/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs b/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs new file mode 100644 index 00000000000..03fac4360c0 --- /dev/null +++ b/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Google.Cloud.Storage.V1; +using System.Threading.Tasks; +using Xunit; + +[Collection(nameof(StorageFixture))] +public class GetSoftDeleteBucketTest +{ + private readonly StorageFixture _fixture; + + public GetSoftDeleteBucketTest(StorageFixture fixture) + { + _fixture = fixture; + } + + [Fact] + public async Task SoftDeleted() + { + GetSoftDeletedBucketSample getSoftDeletedBucketSample = new GetSoftDeletedBucketSample(); + var bucketName = _fixture.GenerateBucketName(); + var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name); + + var softDeleted = getSoftDeletedBucketSample.GetSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation); + Assert.Equal(softDeleteBucket.Name, softDeleted.Name); + Assert.Equal(softDeleteBucket.Generation, softDeleted.Generation); + Assert.NotNull(softDeleted.SoftDeleteTimeDateTimeOffset); + Assert.NotNull(softDeleted.HardDeleteTimeDateTimeOffset); + } +} diff --git a/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs b/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs new file mode 100644 index 00000000000..33e5c4c02ec --- /dev/null +++ b/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs @@ -0,0 +1,51 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Google.Apis.Storage.v1.Data; +using System.Threading.Tasks; +using Xunit; + +[Collection(nameof(StorageFixture))] +public class ListSoftDeleteBucketsTest +{ + private readonly StorageFixture _fixture; + + public ListSoftDeleteBucketsTest(StorageFixture fixture) + { + _fixture = fixture; + } + + [Fact] + public async Task SoftDeletedOnly() + { + ListSoftDeletedBucketsSample listSoftDeletedBucketsSample = new ListSoftDeletedBucketsSample(); + var bucketName = _fixture.GenerateBucketName(); + var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name); + + var actualBuckets = listSoftDeletedBucketsSample.ListSoftDeletedBuckets(_fixture.ProjectId); + // Check the list contains the bucket we just soft-deleted. + Assert.Contains(actualBuckets, bucket => bucket.Name == softDeleteBucket.Name && bucket.Generation == softDeleteBucket.Generation); + // Check all the buckets in the list are soft-deleted buckets. + Assert.All(actualBuckets, AssertSoftDeletedBucket); + } + + // Validates that the given bucket is soft-deleted. + private void AssertSoftDeletedBucket(Bucket b) + { + Assert.NotNull(b.Generation); + Assert.NotNull(b.HardDeleteTimeDateTimeOffset); + Assert.NotNull(b.SoftDeleteTimeDateTimeOffset); + } +} diff --git a/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs b/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs new file mode 100644 index 00000000000..c244cc34847 --- /dev/null +++ b/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs @@ -0,0 +1,41 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"). +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using Google.Cloud.Storage.V1; +using System.Threading.Tasks; +using Xunit; + +[Collection(nameof(StorageFixture))] +public class RestoreSoftDeleteBucketTest +{ + private readonly StorageFixture _fixture; + + public RestoreSoftDeleteBucketTest(StorageFixture fixture) + { + _fixture = fixture; + } + + [Fact] + public async Task RestoreSoftDeletedBucket() + { + RestoreSoftDeletedBucketSample restoreSoftDeletedBucketSample = new RestoreSoftDeletedBucketSample(); + var bucketName = _fixture.GenerateBucketName(); + var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); + await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name); + + var restoredBucket = restoreSoftDeletedBucketSample.RestoreSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation.Value); + Assert.Equal(softDeleteBucket.Name, restoredBucket.Name); + Assert.Equal(softDeleteBucket.Generation, restoredBucket.Generation); + } +} From 3cea8da9a333172b28794fa846b2c03a1aa77d90 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Fri, 4 Apr 2025 06:24:35 -0700 Subject: [PATCH 13/15] test changes --- .../Storage.Samples.Tests/GetBucketTest.cs | 43 ------------------- .../Storage.Samples.Tests/ListBucketsTest.cs | 23 ---------- .../RestoreBucketTest.cs | 41 ------------------ 3 files changed, 107 deletions(-) delete mode 100644 storage/api/Storage.Samples.Tests/GetBucketTest.cs delete mode 100644 storage/api/Storage.Samples.Tests/RestoreBucketTest.cs diff --git a/storage/api/Storage.Samples.Tests/GetBucketTest.cs b/storage/api/Storage.Samples.Tests/GetBucketTest.cs deleted file mode 100644 index ac2e37ed2cb..00000000000 --- a/storage/api/Storage.Samples.Tests/GetBucketTest.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"). -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using Google.Cloud.Storage.V1; -using System.Threading.Tasks; -using Xunit; - -[Collection(nameof(StorageFixture))] -public class GetBucketTest -{ - private readonly StorageFixture _fixture; - - public GetBucketTest(StorageFixture fixture) - { - _fixture = fixture; - } - - [Fact] - public async Task SoftDeleted() - { - GetSoftDeletedBucketSample getSoftDeletedBucketSample = new GetSoftDeletedBucketSample(); - var bucketName = _fixture.GenerateBucketName(); - var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); - await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); - - var softDeleted = getSoftDeletedBucketSample.GetSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation); - Assert.Equal(softDeleteBucket.Name, softDeleted.Name); - Assert.Equal(softDeleteBucket.Generation, softDeleted.Generation); - Assert.NotNull(softDeleted.SoftDeleteTimeDateTimeOffset); - Assert.NotNull(softDeleted.HardDeleteTimeDateTimeOffset); - } -} diff --git a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs index 4caa3c0d17e..b0972bd20a1 100644 --- a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs +++ b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs @@ -40,27 +40,4 @@ public void ListBuckets() var buckets = listBucketsSample.ListBuckets(_fixture.ProjectId); Assert.Contains(buckets, c => c.Name == bucketName); } - - [Fact] - public async Task SoftDeletedOnly() - { - ListSoftDeletedBucketsSample listSoftDeletedBucketsSample = new ListSoftDeletedBucketsSample(); - var bucketName = _fixture.GenerateBucketName(); - var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); - await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); - - var actualBuckets = listSoftDeletedBucketsSample.ListSoftDeletedBuckets(_fixture.ProjectId); - // Check the list contains the bucket we just soft-deleted. - Assert.Contains(actualBuckets, bucket => bucket.Name == softDeleteBucket.Name && bucket.Generation == softDeleteBucket.Generation); - // Check all the buckets in the list are soft-deleted buckets. - Assert.All(actualBuckets, AssertSoftDeletedBucket); - } - - // Validates that the given bucket is soft-deleted. - private void AssertSoftDeletedBucket(Bucket b) - { - Assert.NotNull(b.Generation); - Assert.NotNull(b.HardDeleteTimeDateTimeOffset); - Assert.NotNull(b.SoftDeleteTimeDateTimeOffset); - } } diff --git a/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs b/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs deleted file mode 100644 index 0f3cabf3967..00000000000 --- a/storage/api/Storage.Samples.Tests/RestoreBucketTest.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"). -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using Google.Cloud.Storage.V1; -using System.Threading.Tasks; -using Xunit; - -[Collection(nameof(StorageFixture))] -public class RestoreBucketTest -{ - private readonly StorageFixture _fixture; - - public RestoreBucketTest(StorageFixture fixture) - { - _fixture = fixture; - } - - [Fact] - public async Task RestoreSoftDeletedBucket() - { - RestoreSoftDeletedBucketSample restoreSoftDeletedBucketSample = new RestoreSoftDeletedBucketSample(); - var bucketName = _fixture.GenerateBucketName(); - var softDeleteBucket = _fixture.CreateBucket(bucketName, multiVersion: false, softDelete: true, registerForDeletion: true); - await _fixture.Client.DeleteBucketAsync(softDeleteBucket.Name, new DeleteBucketOptions { DeleteObjects = true }); - - var restoredBucket = restoreSoftDeletedBucketSample.RestoreSoftDeletedBucket(softDeleteBucket.Name, softDeleteBucket.Generation.Value); - Assert.Equal(softDeleteBucket.Name, restoredBucket.Name); - Assert.Equal(softDeleteBucket.Generation, restoredBucket.Generation); - } -} From 09b32b5d4e2eb4cbcf4aa53bfa8ba7be55695872 Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Fri, 4 Apr 2025 06:28:48 -0700 Subject: [PATCH 14/15] listbucket test undo changes --- storage/api/Storage.Samples.Tests/ListBucketsTest.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs index b0972bd20a1..a0441708eca 100644 --- a/storage/api/Storage.Samples.Tests/ListBucketsTest.cs +++ b/storage/api/Storage.Samples.Tests/ListBucketsTest.cs @@ -12,11 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -using Google.Apis.Storage.v1.Data; -using Google.Cloud.Storage.V1; using System; -using System.Threading; -using System.Threading.Tasks; using Xunit; [Collection(nameof(StorageFixture))] From da5295b3db5291f8933bb35394bfbe961318905c Mon Sep 17 00:00:00 2001 From: mahendra-google Date: Wed, 9 Apr 2025 04:21:21 -0700 Subject: [PATCH 15/15] Method name changes in soft delete bucket tests --- storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs | 2 +- storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs | 2 +- .../api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs b/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs index 03fac4360c0..4e5006e7880 100644 --- a/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs +++ b/storage/api/Storage.Samples.Tests/GetSoftDeleteBucketTest.cs @@ -27,7 +27,7 @@ public GetSoftDeleteBucketTest(StorageFixture fixture) } [Fact] - public async Task SoftDeleted() + public async Task GetSoftDeleteBucket() { GetSoftDeletedBucketSample getSoftDeletedBucketSample = new GetSoftDeletedBucketSample(); var bucketName = _fixture.GenerateBucketName(); diff --git a/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs b/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs index 33e5c4c02ec..834a741b105 100644 --- a/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs +++ b/storage/api/Storage.Samples.Tests/ListSoftDeleteBucketsTest.cs @@ -27,7 +27,7 @@ public ListSoftDeleteBucketsTest(StorageFixture fixture) } [Fact] - public async Task SoftDeletedOnly() + public async Task ListSoftDeleteBuckets() { ListSoftDeletedBucketsSample listSoftDeletedBucketsSample = new ListSoftDeletedBucketsSample(); var bucketName = _fixture.GenerateBucketName(); diff --git a/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs b/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs index c244cc34847..a3217287952 100644 --- a/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs +++ b/storage/api/Storage.Samples.Tests/RestoreSoftDeleteBucketTest.cs @@ -27,7 +27,7 @@ public RestoreSoftDeleteBucketTest(StorageFixture fixture) } [Fact] - public async Task RestoreSoftDeletedBucket() + public async Task RestoreSoftDeleteBucket() { RestoreSoftDeletedBucketSample restoreSoftDeletedBucketSample = new RestoreSoftDeletedBucketSample(); var bucketName = _fixture.GenerateBucketName();