-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Kms samples #496
Kms samples #496
Conversation
|
||
DestroyCryptoKeyVersionRequest destroyRequest = new DestroyCryptoKeyVersionRequest(); | ||
|
||
CryptoKeyVersion destroyed = kms.projects().locations().keyRings().cryptoKeys() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably what our style guide says to do, but it seems like
kms.projects()
.locations()
.keyRings()
.cryptoKeys()
.cryptoKeyVersions()
.destroy(cryptoKeyVersion, destroyRequest)
.execute();
is more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of like having most of the path in the same line, because it's just boilerplate to get to the main thing you care about (which is on the next line). That way the thing you care about is distinct
from the noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the whole, I really like this. We should start using kohsuke everywhere.
Feel free to ignore all but the "huh?".
for (Binding b : bindings) { | ||
if (role.equals(b.getRole()) && b.getMembers().contains(member)) { | ||
b.getMembers().remove(member); | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Right.
Since .remove
can be optionally implemented, I wasn't sure if the List
returned by getMembers()
had it, so this was the contingency plan. Turns out it does, so this works, but I forgot I had the contingency here :-) Removed.
and can see the available snippet commands with: | ||
|
||
java -cp target/kms-samples-1.0.0-jar-with-dependencies.jar \ | ||
com.example.Snippets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to mention any of the command line arguments here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After you run this, it'll show you the available arguments, which you can run, which will in turn show the available arguments for that subcommand.
I suppose having an actual example invocation wouldn't hurt..
5f358a5
to
c64baac
Compare
Updated - renamed a bunch of the command-line arguments to be more verbose, to be consistent with the naming from the API (and normalized some other inconsistent naming I had). Having trouble with ADC while running tests 😫 It's mentioning a mysterious project id... sigh... |
Once you figure out your mystery, you might wish to add the sample to the parent pom.xml to get tested. |
…496) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.9.0` -> `21.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/compatibility-slim/20.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/confidence-slim/20.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-tasks).
…496) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:libraries-bom](https://togithub.com/GoogleCloudPlatform/cloud-opensource-java) | `20.9.0` -> `21.0.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/compatibility-slim/20.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:libraries-bom/21.0.0/confidence-slim/20.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-tasks).
Working on tests, but figured I'd send this out first to start the review.