Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan committed Mar 5, 2024
1 parent 20e71ac commit ab544ef
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions google/cloud/storage/object_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,12 @@ class ObjectMetadata {
/// Returns true if the object has a soft delete timestamp.
bool has_soft_delete_time() const { return soft_delete_time_.has_value(); }

/// The timestamp when the object became soft deleted. Objects that are not
/// soft deleted return a default initialized time point.
/**
* This is the time when the object became soft-deleted.
*
* Soft-deleted objects are only accessible if a `soft_delete_policy` is
* enabled in their bucket. Also see `hard_delete_time()`.
*/
std::chrono::system_clock::time_point soft_delete_time() const {
return soft_delete_time_.value_or(std::chrono::system_clock::time_point{});
}
Expand All @@ -527,11 +531,17 @@ class ObjectMetadata {
return *this;
}

/// Returns true if the object has a soft delete timestamp.
/// Returns true if the object has a hard delete timestamp.
bool has_hard_delete_time() const { return hard_delete_time_.has_value(); }

/// The timestamp when the object will be hard deleted. Objects that are not
/// soft deleted return a default initialized time point.
/**
* The time when the object will be permanently deleted.
*
* Soft-deleted objects are permanently deleted after some time, based on the
* `soft_delete_policy` in their bucket. This is only set on soft-deleted
* objects, and indicates the earliest time at which the object will be
* permanently deleted.
*/
std::chrono::system_clock::time_point hard_delete_time() const {
return hard_delete_time_.value_or(std::chrono::system_clock::time_point{});
}
Expand All @@ -543,7 +553,7 @@ class ObjectMetadata {
return *this;
}

/// @note THis is only intended for mocking.
/// @note This is only intended for mocking.
ObjectMetadata& reset_hard_delete_time() {
hard_delete_time_.reset();
return *this;
Expand Down

0 comments on commit ab544ef

Please sign in to comment.