Some or all of the information on this page might not apply to Trusted Cloud by S3NS.
Struct BucketAutoclass (2.38.0)
Note: Some or all of the information on this page might not apply
to Trusted Cloud. For a list of services that are available in
Trusted Cloud, see Services available for
Trusted Cloud .
Version 2.38.0keyboard_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
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 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]