Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

docs(samples): Add filtered listing samples #209

Merged
merged 7 commits into from Nov 8, 2021
Merged

docs(samples): Add filtered listing samples #209

merged 7 commits into from Nov 8, 2021

Conversation

gwhitehawk
Copy link
Contributor

@gwhitehawk gwhitehawk commented Oct 5, 2021

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • [x ] Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • [ x] Ensure the tests and linter pass
  • [ x] Code coverage does not decrease (if any source code was changed)
  • [ x] Appropriate docs were updated (if necessary)

Fixes #208 馃

@gwhitehawk gwhitehawk requested a review from a team as a code owner October 5, 2021 19:35
@snippet-bot
Copy link

snippet-bot bot commented Oct 5, 2021

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 the api: secretmanager Issues related to the googleapis/python-secret-manager API. label Oct 5, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 5, 2021
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Oct 5, 2021
@parthea parthea changed the title feat: Add filtered listing samples docs(samples): Add filtered listing samples Oct 7, 2021
# [END secretmanager_list_secret_versions_with_filter]


if __name__ == "__main__":
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: Adding the CLI is not encouraged or required, although it is a common pattern in many existing samples. Please keep this only if you think it is valuable for your users.

Code Snippet Style Guide

We expect that most developers will copy/paste the code from Code Snippets on cloud.google.com into their own codebase rather than attempt to run the Code Snippets as Sample Applications. Therefore, it's not critical that Code Snippets be runnable from the command line.

CLIs for Code Snippets have been very expensive to maintain in the past. We will not be creating new CLIs for Code Snippets and will be removing ones that exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.



# [START secretmanager_list_secret_versions_with_filter]
def list_secret_versions_with_filter(project_id, secret_id, filter_str):
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider pre-filling with a valid filter_str = "..." to help users. The state:ENABLED passed in the test seems like a good option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@busunkim96 busunkim96 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 12, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 12, 2021
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Nov 4, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 4, 2021
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Nov 4, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 4, 2021
@google-cla
Copy link

google-cla bot commented Nov 8, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

鈩癸笍 Googlers: Go here for more info.

@google-cla google-cla bot removed the cla: yes This human has signed the Contributor License Agreement. label Nov 8, 2021
@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Nov 8, 2021
@parthea parthea added cla: yes This human has signed the Contributor License Agreement. kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Nov 8, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Nov 8, 2021
@parthea parthea merged commit 316de2d into googleapis:main Nov 8, 2021
gcf-merge-on-green bot pushed a commit that referenced this pull request Nov 9, 2021
馃 I have created a release \*beep\* \*boop\*
---
## [2.8.0](https://www.github.com/googleapis/python-secret-manager/compare/v2.7.3...v2.8.0) (2021-11-08)


### Features

* add context manager support in client ([#210](https://www.github.com/googleapis/python-secret-manager/issues/210)) ([8d247d4](https://www.github.com/googleapis/python-secret-manager/commit/8d247d4b7f96faa61532ac09ef95e2599c523702))
* add support for python 3.10 ([#214](https://www.github.com/googleapis/python-secret-manager/issues/214)) ([5e3cc7e](https://www.github.com/googleapis/python-secret-manager/commit/5e3cc7ef9a0e3660c9734f989d5b1e82a18d336c))


### Bug Fixes

* **deps:** drop packaging dependency ([6aac11f](https://www.github.com/googleapis/python-secret-manager/commit/6aac11f08d396835f7c4ca71c7a2f2a2a48e96db))
* **deps:** require google-api-core >= 1.28.0 ([6aac11f](https://www.github.com/googleapis/python-secret-manager/commit/6aac11f08d396835f7c4ca71c7a2f2a2a48e96db))


### Documentation

* list oneofs in docstring ([6aac11f](https://www.github.com/googleapis/python-secret-manager/commit/6aac11f08d396835f7c4ca71c7a2f2a2a48e96db))
* **samples:** Add filtered listing samples ([#209](https://www.github.com/googleapis/python-secret-manager/issues/209)) ([316de2d](https://www.github.com/googleapis/python-secret-manager/commit/316de2d68283e4c1da7f4fdc24fc7e6d65adbfd0))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: secretmanager Issues related to the googleapis/python-secret-manager API. cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add samples for filtered listing of secrets and secret versions.
4 participants