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

Add Snippets for security center list_assets call #7538

Merged
merged 7 commits into from
Mar 26, 2019

Conversation

emkornfield
Copy link
Contributor

This pull requests starts adding snippets for Cloud Security Command Center (in particular the list_assets call). I tried to follow the contributing guide but apologize if I missed something.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 20, 2019
@crwilcox crwilcox added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 20, 2019
@tseaver tseaver added testing type: docs Improvement to the documentation for an API. api:securitycenter labels Mar 20, 2019
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be the old license header. Year should likely be 2019 and apache url should be be https.

#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

# list_assets returns an iterator. We convert it to a list
# here for demonstration purposes only. Processing each element
# from the iterator is recommended.
assets = list(
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I would prefer not doing a thing in a sample we wouldn't recommend. Is there a motivation to convert this to a list in the sample?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly so I can asset on size. I changed this to use enumerate and print each index and result. Please let me know if there is something more idiomatic.

@crwilcox crwilcox merged commit e5a5912 into googleapis:master Mar 26, 2019
parthea pushed a commit that referenced this pull request Jun 4, 2023
* Add Snippets for security center list_assets call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement. testing type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants