Send feedback
Class ObjectMetadataPatchBuilder (2.15.1)
Stay organized with collections
Save and categorize content based on your preferences.
Version 2.15.1 keyboard_arrow_down
Prepares a patch for the Bucket resource.
Constructors
Functions
Returns
Type
Description
std::string
Parameter
Name
Description
v
std::vector< ObjectAccessControl > const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Warning:
Currently the server ignores requests to reset the full ACL.
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
bool
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameters
Name
Description
key
std::string const &
value
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
key
std::string const &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Parameter
Name
Description
v
bool
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
Change the custom_time
field.
Example
namespace gcs = ::google::cloud::storage;
using ::google::cloud::StatusOr;
[](gcs::Client client, std::string const& bucket_name,
std::string const& object_name) {
auto original = client.GetObjectMetadata(bucket_name, object_name);
if (!original) throw std::move(original).status();
auto const tp = std::chrono::system_clock::now() - std::chrono::hours(48);
auto updated =
client.PatchObject(bucket_name, object_name,
gcs::ObjectMetadataPatchBuilder{}.SetCustomTime(tp));
if (!updated) throw std::move(updated).status();
std::cout << "The custom time for object " << updated->name()
<< " in bucket " << updated->bucket() << " was successfully set. "
<< "Full object details: " << *updated << "\n";
}
Parameter
Name
Description
tp
std::chrono::system_clock::time_point
Returns
Type
Description
ObjectMetadataPatchBuilder &
Returns
Type
Description
ObjectMetadataPatchBuilder &
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-09-10 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-09-10 UTC."}