Skip to content

samples(storage): add object soft delete policy snippets#34674

Open
shubhangi-google wants to merge 1 commit into
googleapis:mainfrom
shubhangi-google:samples_soft_delete_policy
Open

samples(storage): add object soft delete policy snippets#34674
shubhangi-google wants to merge 1 commit into
googleapis:mainfrom
shubhangi-google:samples_soft_delete_policy

Conversation

@shubhangi-google

Copy link
Copy Markdown
Contributor

This PR introduces following sample:

  • storage_disable_soft_delete
  • storage_get_soft_delete_policy
  • storage_set_soft_delete_policy
  • storage_list_soft_deleted_objects
  • storage_list_soft_deleted_object_versions
  • storage_restore_object

@shubhangi-google shubhangi-google changed the title Samples(storage): soft delete policy Samples(storage): Object soft delete policy Jun 29, 2026
@shubhangi-google shubhangi-google marked this pull request as ready for review June 29, 2026 13:04
@shubhangi-google shubhangi-google requested review from a team and yoshi-approver as code owners June 29, 2026 13:04
@snippet-bot

snippet-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

@torreypayne torreypayne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@shubhangi-google can you update the commit message and PR to lowercase samples, and also add a verb? Something like samples(storage): add object soft delete policy snippets

storage = Google::Cloud::Storage.new
bucket = storage.bucket bucket_name

file = bucket.restore_file file_name, generation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see we call .to_i on retention_duration_seconds in 'google-cloud-storage/samples/storage_set_soft_delete_policy.rb', since CLI arguments are strings. Should we do similarly for generation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@torreypayne torreypayne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I also saw your commit messages weren't formatted as conventional commits; can you update those so release-please can properly format the changelog?

@shubhangi-google shubhangi-google changed the title Samples(storage): Object soft delete policy samples(storage): add object soft delete policy snippets Jul 7, 2026
@shubhangi-google shubhangi-google force-pushed the samples_soft_delete_policy branch from 0eef952 to 402431d Compare July 7, 2026 12:01
@shubhangi-google

Copy link
Copy Markdown
Contributor Author

@shubhangi-google can you update the commit message and PR to lowercase samples, and also add a verb? Something like samples(storage): add object soft delete policy snippets

done

@shubhangi-google

Copy link
Copy Markdown
Contributor Author

I also saw your commit messages weren't formatted as conventional commits; can you update those so release-please can properly format the changelog?

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants