Send feedback
Struct BucketAutoclass (2.22.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.22.0 keyboard_arrow_down
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) throw google::cloud::Status(std::move(metadata).status());
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(
gcs::BucketAutoclass{enabled}));
if (!metadata) throw google::cloud::Status(std::move(metadata).status());
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";
}
Constructors
BucketAutoclass(bool)
Parameter Name Description e
bool
BucketAutoclass(bool, std::string)
Parameters Name Description e
bool
tsc
std::string
BucketAutoclass(bool, std::chrono::system_clock::time_point)
Parameters Name Description e
bool
tp
std::chrono::system_clock::time_point
BucketAutoclass(bool, std::chrono::system_clock::time_point, std::string, std::chrono::system_clock::time_point)
Parameters Name Description e
bool
tp
std::chrono::system_clock::time_point
tsc
std::string
tscu
std::chrono::system_clock::time_point
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-30 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-30 UTC."],[],[]]