Skip to content

Commit 6625d5f

Browse files
samples(storage): add the bucket soft delete related tags (#15154)
1 parent 7fe2884 commit 6625d5f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

google/cloud/storage/examples/storage_bucket_soft_delete_samples.cc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void CreateBucketWithSoftDelete(google::cloud::storage::Client client,
5050

5151
void SetBucketSoftDeletePolicy(google::cloud::storage::Client client,
5252
std::vector<std::string> const& argv) {
53+
//! [storage_set_soft_delete_policy]
5354
namespace gcs = ::google::cloud::storage;
5455
using ::google::cloud::StatusOr;
5556
[](gcs::Client client, std::string const& bucket_name) {
@@ -64,11 +65,14 @@ void SetBucketSoftDeletePolicy(google::cloud::storage::Client client,
6465
std::cout << "Successfully updated bucket " << bucket_name
6566
<< " the updated soft-delete policy is "
6667
<< bucket->soft_delete_policy() << "\n";
67-
}(std::move(client), argv.at(0));
68+
}
69+
//! [storage_set_soft_delete_policy]
70+
(std::move(client), argv.at(0));
6871
}
6972

7073
void ResetBucketSoftDeletePolicy(google::cloud::storage::Client client,
7174
std::vector<std::string> const& argv) {
75+
//! [storage_disable_soft_delete]
7276
namespace gcs = ::google::cloud::storage;
7377
using ::google::cloud::StatusOr;
7478
[](gcs::Client client, std::string const& bucket_name) {
@@ -84,11 +88,14 @@ void ResetBucketSoftDeletePolicy(google::cloud::storage::Client client,
8488
std::cout << "Updated bucket " << bucket_name
8589
<< " still has a soft-delete policy: "
8690
<< bucket->soft_delete_policy() << "\n";
87-
}(std::move(client), argv.at(0));
91+
}
92+
//! [storage_disable_soft_delete]
93+
(std::move(client), argv.at(0));
8894
}
8995

9096
void GetBucketSoftDeletePolicy(google::cloud::storage::Client client,
9197
std::vector<std::string> const& argv) {
98+
//! [storage_get_soft_delete_policy]
9299
namespace gcs = ::google::cloud::storage;
93100
using ::google::cloud::StatusOr;
94101
[](gcs::Client client, std::string const& bucket_name) {
@@ -103,7 +110,9 @@ void GetBucketSoftDeletePolicy(google::cloud::storage::Client client,
103110
std::cout << "Bucket " << bucket->name()
104111
<< " has a soft-delete policy set: "
105112
<< bucket->soft_delete_policy() << "\n";
106-
}(std::move(client), argv.at(0));
113+
}
114+
//! [storage_get_soft_delete_policy]
115+
(std::move(client), argv.at(0));
107116
}
108117

109118
void RunAll(std::vector<std::string> const& argv) {

0 commit comments

Comments
 (0)