Skip to content

feat(storage): add samples for soft delete (objects) #2085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

thiyaguk09
Copy link
Contributor

Added Storage Samples:

  • List Soft Deleted Objects
  • List Versions of Soft Deleted Objects
  • Restore Deleted Objects
  • Disable Soft Delete Policy
  • Get Soft Delete Policy
  • Set Soft Delete Policy

@product-auto-label product-auto-label bot added api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples. labels May 16, 2025
@thiyaguk09 thiyaguk09 marked this pull request as ready for review May 19, 2025 12:39
@thiyaguk09 thiyaguk09 requested review from a team as code owners May 19, 2025 12:39
Copy link

snippet-bot bot commented May 19, 2025

Here is the summary of changes.

You are about to add 6 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

$bucket = $storage->bucket($bucketName);
$bucket->update([
'softDeletePolicy' => [
'retentionDurationSeconds' => 864000,
Copy link

@TimothyLiuAtGoogle TimothyLiuAtGoogle May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between the value 864000 and 604800s (with a s suffix as below)? Also, IIUC, the type of 864000 is integer, the type of 604800s is string. Thanks :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right — the value 864000 is an integer, while 604800s (with the s suffix) is a string. My bad on that — we’re using integers only here. I've updated it accordingly. Thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants