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

feat(samples): add sample code for ListAssets v1p5beta1 #355

Merged
merged 3 commits into from
Jul 8, 2020

Conversation

Larittic-GG
Copy link
Contributor

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:

  • 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
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #354 🦕

@Larittic-GG Larittic-GG requested a review from a team as a code owner July 6, 2020 22:29
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 6, 2020
@codecov
Copy link

codecov bot commented Jul 6, 2020

Codecov Report

Merging #355 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #355   +/-   ##
=======================================
  Coverage   96.63%   96.63%           
=======================================
  Files          15       15           
  Lines        5532     5532           
  Branches      276      276           
=======================================
  Hits         5346     5346           
  Misses        180      180           
  Partials        6        6           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ff2b6f...a5e12ac. Read the comment docs.

@bcoe bcoe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 7, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 7, 2020
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

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

Noticed a couple things, let me know your thoughts.

const projectResource = `projects/${projectId}`;
// TODO(developer): Choose types of assets to list, such as 'storage.googleapis.com/Bucket':
// const assetTypesList = ['storage.googleapis.com/Bucket', 'bigquery.googleapis.com/Table'];
// Or simply use empty list to list all types of assets:
Copy link
Contributor

Choose a reason for hiding this comment

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

what we tend to do in comments here, is leave the expected variable commented out, such that someone could simply remove the // and have a functional sample:

https://github.com/googleapis/nodejs-secret-manager/blob/master/samples/getSecretVersion.js#L22

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I changed the comments to use "const assetTypes = ..." directly, in order to align with the params used below.

const result = await client.listAssets(request);
// Handle the response.
console.log(util.inspect(result, {depth: null}));
// [END asset_quickstart_list_assets]
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should be moved down to below listAssets();, such. that the code between START and END is a self contained functional block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this! I was following the samples for other APIs. Now it seems the other samples need updating too.

@bcoe bcoe added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 8, 2020
@bcoe bcoe changed the title feat: add sample code for ListAssets v1p5beta1 feat(samples): add sample code for ListAssets v1p5beta1 Jul 8, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 8, 2020
@bcoe bcoe merged commit 1f4cef8 into googleapis:master Jul 8, 2020
gcf-merge-on-green bot pushed a commit that referenced this pull request Jul 10, 2020
🤖 I have created a release \*beep\* \*boop\* 
---
## [3.5.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.4.0...v3.5.0) (2020-07-08)


### Features

* **samples:** add sample code for ListAssets v1p5beta1 ([#355](https://www.github.com/googleapis/nodejs-asset/issues/355)) ([1f4cef8](https://www.github.com/googleapis/nodejs-asset/commit/1f4cef8af558cc000aec52c4e92afc1774141c53))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sample code for ListAssets v1p5beta1
4 participants