Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Readme: Update readme templates to add api summaries. #1299

Merged
merged 6 commits into from
May 26, 2017

Conversation

landrito
Copy link
Contributor

cc: @omaray

@landrito landrito requested a review from swcloud May 25, 2017 22:34
@codecov-io
Copy link

codecov-io commented May 25, 2017

Codecov Report

Merging #1299 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1299      +/-   ##
============================================
+ Coverage     86.46%   86.46%   +<.01%     
  Complexity     3827     3827              
============================================
  Files           374      374              
  Lines         15260    15261       +1     
  Branches       1705     1705              
============================================
+ Hits          13195    13196       +1     
  Misses         1609     1609              
  Partials        456      456
Impacted Files Coverage Δ Complexity Δ
...odegen/viewmodel/metadata/PackageMetadataView.java 100% <ø> (ø) 3 <0> (ø) ⬇️
...odegen/transformer/PackageMetadataTransformer.java 94.87% <100%> (+0.13%) 7 <0> (ø) ⬇️

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 dd3d83c...be5b809. Read the comment docs.

@landrito
Copy link
Contributor Author

landrito commented May 25, 2017

Example

As of commit: be5b809

Node.js Clients for Stackdriver Monitoring API (Alpha)

Stackdriver Monitoring API: Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages.

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.
  2. Enable the Stackdriver Monitoring API.
  3. Setup Authentication.

Installation

$ npm install --save @google-cloud/monitoring

Preview

MetricServiceClient

 var monitoringV3 = require('@google-cloud/monitoring').v3({
   // optional auth parameters.
 });

 var client = monitoringV3.metricServiceClient();
 var formattedName = client.projectPath(projectId);
 // Iterate over all elements.
 client.listMonitoredResourceDescriptors({name: formattedName}).then(function(responses) {
     var resources = responses[0];
     for (var i = 0; i < resources.length; ++i) {
         // doThingsWith(resources[i])
     }
 }).catch(function(err) {
     console.error(err);
 });

 // Or obtain the paged response.
 var options = {autoPaginate: false};
 function callback(responses) {
     // The actual resources in a response.
     var resources = responses[0];
     // The next request if the response shows there's more responses.
     var nextRequest = responses[1];
     // The actual response object, if necessary.
     // var rawResponse = responses[2];
     for (var i = 0; i < resources.length; ++i) {
         // doThingsWith(resources[i]);
     }
     if (nextRequest) {
         // Fetch the next page.
         return client.listMonitoredResourceDescriptors(nextRequest, options).then(callback);
     }
 }
 client.listMonitoredResourceDescriptors({name: formattedName}, options)
     .then(callback)
     .catch(function(err) {
         console.error(err);
     });

Next Steps

@landrito
Copy link
Contributor Author

Probably only need one reviewer since its a pretty simple change. Just wanted to tag all three leads so they are aware of the change.

@@ -2,7 +2,9 @@
Python Client for Google Example Library API (`Alpha`_)
==================================================================================================

Idiomatic Python client for `Google Example Library API`_
Idiomatic Python client for `Google Example Library API`_:

This comment was marked as spam.

This comment was marked as spam.

@@ -2,7 +2,9 @@
Python Client for Google Example Library API (`Alpha`_)
==================================================================================================

Idiomatic Python client for `Google Example Library API`_
Idiomatic Python client for `Google Example Library API`_:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@@ -9,6 +9,8 @@
==================================================================================================

Idiomatic {@metadata.targetLanguage} client for `{@metadata.fullName}`_
-----------------------------------------------------------------------

This comment was marked as spam.

This comment was marked as spam.

@omaray
Copy link

omaray commented May 26, 2017

This is great folks! A few notes

  • Should be singular: "Node.js Client..." instead of "Node.js Clients..."
  • Then the subtitle "Idiomatic Node.js Client for Stackdriver API" seems to add redundancy a bit with the title above and the description underneath. Perhaps we could have the title as-is, remove the subtitle, and then have the first line be:

"Idiomatic Node.js client for Stackdriver Logging API: ". Where would be "let's write logs....".

But this can also depend on whether or not also contains the words "Stackdriver logging API" as the start. Then it would be weird!

Another option.

(1) Remove the subtitle that says "Idiomatic Node.js client for Stackdriver API".
(2) Make the "Stackdriver Logging API" in the title as a link (so the docs on cloud.google.com)
(3) Have the very first sentence of the readme (that is not a title) be the description we have right now (basically what is already there).

@landrito
Copy link
Contributor Author

So the logic for the plurality of clients is correct. I think it's simply because some of the services outlined the service yaml are not generated. I'll have to think of a solution.

Gotta get going and will be OOO for the next week. I'll do the second option you said and see where that takes us!

@landrito
Copy link
Contributor Author

Updated PTAL. Feel free to merge if it looks good!

@omaray
Copy link

omaray commented May 26, 2017

Looks good. Understood for plurality (we have 2 clients). Last comment: I would remove the link from the title since it's in the first part of the description. Feels like too many links to the docs otherwise. But otherwise lgtm.

@landrito landrito merged commit 08344b7 into googleapis:master May 26, 2017
garrettjonesgoogle added a commit that referenced this pull request May 27, 2017
* Fix JSON pretty print in Ruby sample (#1254)

* Ruby: README Overhaul (feat. examples) (#1245)

* go: use new metadata methods (#1262)

Updates googleapis/google-cloud-go#624.

metadata.FromContext and metdata.NewContext
are replaced by metadata.{New,From}{Incoming,Outgoing}Context.

Generated unit tests now verify that x-goog-api-client header
is inserted.

Additionally, clients now save a string slice containing x-goog-api-client
header value instead of the value by itself.
This is a small optimization so that we don't create a new slice every time.

* Change media body from an object to a string (#1256)

Samples fail before sending a request if the media body is an object.

* Fix NONE auth Go sample (#1261)

* Change Node.js unit test require. (#1264)

* Ruby: Allow doc gapic generation to generate tests. (#1266)

* Ruby: Remove aliasing from method samples and tests (#1253)

* Ruby: Fix broken baselines from aliasing fix (#1269)

* Remove unused code (#1270)

* Python: README overhaul. (#1263)

* Ruby: Update gemspec and add useful metadata files (#1258)

* Ruby: Update gemspec and add useful metadata files

* Specify HTTP client when constructing client (#1275)

If a HTTP client is not passed to `build`, the Google API Python client
will create a default one and attempt to authenticate it. This causes
failures in environments where ADC auth is not available (Travis).

In any case, it's not useful to access any auth code in the mock tests.
This commit removes that possibility.

* Fix JSON print in Ruby (#1274)

It turns out that `to_h` is not a method available on every object
returned by the samples at the moment. Also, there's some kind of
decoding bug showing up in certain samples where the JSON module is
unable to unparse the response.

It's troublesome to have so much boilerplate just to pretty print. This
commit removes the pretty calls in favor of the vanilla `to_json` method
implemented by the base model class in the Ruby client. In the future,
once the bugs w.r.t `pretty_generate` have been resolved, we can revert.

* NodeJS: Update version index to support partial veneers (#1267)

* NodeJS: Updates to package.json (#1268)

* Migrate import disambiguation to Python MVVM (#1243)

* Fix Node package.json (#1282)

* go: use time.UnixNano instead of testutil.UIDSpace (#1279)

Since generated code should be testable from api-client-staging repo,
we want to reduce dependency on other cloud.google.com/go packages,
especially internal ones.

Clients will still depend on testutil for ProjID and TokenSource.
This is OK, since they can be easily reimplemented in google-client-staging
repo itself.

* Update Java grpc metadata for new staging structure (#1265)

* PHP: share credentials with operations client (#1283)

* java: move CredentialProvider up to ClientSettings (#1251)

This implements the client side changes to support
googleapis/gax-java#305.

* NodeJS: generate readme. (#1240)

* NodeJS: Small additions to the package.json (#1289)

* NodeJS: Use fileheader for copyright lines. (#1293)

* NodeJS: Use correct casing for partial veneers (#1295)

* NodeJS: Small readme fix from GCN reviews (#1294)

* go: make longrunning methods use generated longrunning client (#1288)

The cloud.google.com/go/longrunning package will need to change
slightly to accomodate this change.

xGoogHeader is now gone from the generated longrunnging types,
as the header will be automatically inserted by LROClient itself.

* NodeJS: Update partial veneer surface to add api documentation. (#1296)

* NodeJS: Metadata updates. (#1298)

* Readme: Update readme templates to add api summaries. (#1299)

* Add PHP Exception tests (#951)

* Add exception tests
* Remove unnecessary checks in exception tests

* Process markdown cloud links for PHP (#1091)

* Process markdown cloud links for PHP
* Restructure comment formatting

* go: return error creating LRO client instead of panicking (#1300)
andreamlin added a commit that referenced this pull request Jun 5, 2017
* merge master to Discogapic (#1304)

* Fix JSON pretty print in Ruby sample (#1254)

* Ruby: README Overhaul (feat. examples) (#1245)

* go: use new metadata methods (#1262)

Updates googleapis/google-cloud-go#624.

metadata.FromContext and metdata.NewContext
are replaced by metadata.{New,From}{Incoming,Outgoing}Context.

Generated unit tests now verify that x-goog-api-client header
is inserted.

Additionally, clients now save a string slice containing x-goog-api-client
header value instead of the value by itself.
This is a small optimization so that we don't create a new slice every time.

* Change media body from an object to a string (#1256)

Samples fail before sending a request if the media body is an object.

* Fix NONE auth Go sample (#1261)

* Change Node.js unit test require. (#1264)

* Ruby: Allow doc gapic generation to generate tests. (#1266)

* Ruby: Remove aliasing from method samples and tests (#1253)

* Ruby: Fix broken baselines from aliasing fix (#1269)

* Remove unused code (#1270)

* Python: README overhaul. (#1263)

* Ruby: Update gemspec and add useful metadata files (#1258)

* Ruby: Update gemspec and add useful metadata files

* Specify HTTP client when constructing client (#1275)

If a HTTP client is not passed to `build`, the Google API Python client
will create a default one and attempt to authenticate it. This causes
failures in environments where ADC auth is not available (Travis).

In any case, it's not useful to access any auth code in the mock tests.
This commit removes that possibility.

* Fix JSON print in Ruby (#1274)

It turns out that `to_h` is not a method available on every object
returned by the samples at the moment. Also, there's some kind of
decoding bug showing up in certain samples where the JSON module is
unable to unparse the response.

It's troublesome to have so much boilerplate just to pretty print. This
commit removes the pretty calls in favor of the vanilla `to_json` method
implemented by the base model class in the Ruby client. In the future,
once the bugs w.r.t `pretty_generate` have been resolved, we can revert.

* NodeJS: Update version index to support partial veneers (#1267)

* NodeJS: Updates to package.json (#1268)

* Migrate import disambiguation to Python MVVM (#1243)

* Fix Node package.json (#1282)

* go: use time.UnixNano instead of testutil.UIDSpace (#1279)

Since generated code should be testable from api-client-staging repo,
we want to reduce dependency on other cloud.google.com/go packages,
especially internal ones.

Clients will still depend on testutil for ProjID and TokenSource.
This is OK, since they can be easily reimplemented in google-client-staging
repo itself.

* Update Java grpc metadata for new staging structure (#1265)

* PHP: share credentials with operations client (#1283)

* java: move CredentialProvider up to ClientSettings (#1251)

This implements the client side changes to support
googleapis/gax-java#305.

* NodeJS: generate readme. (#1240)

* NodeJS: Small additions to the package.json (#1289)

* NodeJS: Use fileheader for copyright lines. (#1293)

* NodeJS: Use correct casing for partial veneers (#1295)

* NodeJS: Small readme fix from GCN reviews (#1294)

* go: make longrunning methods use generated longrunning client (#1288)

The cloud.google.com/go/longrunning package will need to change
slightly to accomodate this change.

xGoogHeader is now gone from the generated longrunnging types,
as the header will be automatically inserted by LROClient itself.

* NodeJS: Update partial veneer surface to add api documentation. (#1296)

* NodeJS: Metadata updates. (#1298)

* Readme: Update readme templates to add api summaries. (#1299)

* Add PHP Exception tests (#951)

* Add exception tests
* Remove unnecessary checks in exception tests

* Process markdown cloud links for PHP (#1091)

* Process markdown cloud links for PHP
* Restructure comment formatting

* go: return error creating LRO client instead of panicking (#1300)

* fails b/c Node.empty() uses null params

* one test passes

* all current tests pass

* tests for Node parent()

* Test

* removed Method.empty():

* reordering methods for convention

* made Node.from(Node, path) methods package private

* removed path() from Document, Schema, and Method

* removed static constructors with empty parent node
@landrito landrito deleted the metadata-fix branch September 24, 2018 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants