The autoclass configuration for a Bucket.
- Example
namespace gcs = ::google::cloud::storage;
[](gcs::Client client, std::string const& bucket_name) {
auto metadata = client.GetBucketMetadata(bucket_name);
if (!metadata->has_autoclass()) {
std::cout << "The bucket " << metadata->name() << " does not have an"
<< " autoclass configuration.\n";
return;
}
std::cout << "Autoclass is "
<< (metadata->autoclass().enabled ? "enabled" : "disabled")
<< " for bucket " << metadata->name() << ". "
<< " The bucket's full autoclass configuration is "
<< metadata->autoclass() << "\n";
}
- Example
namespace gcs = ::google::cloud::storage;
[](gcs::Client client, std::string
const& bucket_name,
bool enabled) {
auto metadata = client.PatchBucket(
bucket_name, gcs::BucketMetadataPatchBuilder().SetAutoclass(
std::cout << "The autoclass configuration for bucket " << bucket_name
<< " was successfully updated.";
if (!metadata->has_autoclass()) {
std::cout << " The bucket no longer has an autoclass configuration.\n";
return;
}
std::cout << " The new configuration is " << metadata->autoclass() << "\n";
}
bool enabled
Definition: bucket_autoclass.h:44