Skip to content
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

samples(storage): add samples for object retention #26158

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

bajajneha27
Copy link
Contributor

closes: #24866

Copy link

snippet-bot bot commented Jun 24, 2024

Here is the summary of changes.

You are about to add 2 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

@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 Jun 24, 2024
# bucket_name = "your-unique-bucket-name"

# The content to upload to the file
# content = "these are my content"
Copy link
Member

Choose a reason for hiding this comment

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

Nit: "this is my content" is grammatically less awkward.


# To modify an existing policy on an unlocked file object, pass in the override parameter.
new_retention_date = DateTime.now + 9 # 9 days
new_retention_params = { mode: "Unlocked", retain_until_time: new_retention_date, override_unlocked_retention: true }
Copy link
Member

Choose a reason for hiding this comment

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

Best to limit to 80 columns for samples, to reduce horizontal scrolling when it appears on web-based documentation pages.

@bajajneha27 bajajneha27 merged commit 0398d42 into googleapis:main Jun 26, 2024
14 checks passed
@yoshi-approver yoshi-approver added the release-please:force-run To run release-please label Jun 26, 2024
@release-please release-please bot removed the release-please:force-run To run release-please label Jun 26, 2024
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.

storage: add object retention samples
3 participants