This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
312 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/resources/com/google/api/codegen/nodejs/README.md.snip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@extends "nodejs/method_sample.snip" | ||
@extends "readme.snip" | ||
|
||
@snippet generate(metadata) | ||
{@readme(metadata, exampleMethods(metadata.exampleMethods, metadata), installationLines(metadata))} | ||
@end | ||
|
||
@private exampleMethods(methods, metadata) | ||
@join method : methods on BREAK | ||
@#### {@method.apiClassName} | ||
```js | ||
var {@method.apiModuleName} = require('{@metadata.identifier}').{@metadata.majorVersion}({ | ||
// optional auth parameters. | ||
}); | ||
{@decorateSampleCode(method, sampleCode(method))} | ||
``` | ||
@end | ||
@end | ||
|
||
@private installationLines(metadata) | ||
$ npm install {@metadata.identifier} | ||
@end |
File renamed without changes.
51 changes: 51 additions & 0 deletions
51
src/test/java/com/google/api/codegen/testdata/nodejs_README_library.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
============== file: README.md ============== | ||
# NodeJS Client for Google Example Library API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-node#versioning)) | ||
|
||
Idiomatic NodeJS client for [Google Example Library API][Product Documentation] | ||
- [Client Library Documentation][] | ||
- [Product Documentation][] | ||
|
||
## 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.](https://console.cloud.google.com/project) | ||
2. [Enable the library api.](https://console.cloud.google.com/apis/api/library) | ||
3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/master/guides/authentication) | ||
|
||
### Installation | ||
``` | ||
$ npm install @google-cloud/library | ||
``` | ||
|
||
### Preview | ||
#### LibraryServiceClient | ||
```js | ||
var libraryV1 = require('@google-cloud/library').v1({ | ||
// optional auth parameters. | ||
}); | ||
|
||
var client = libraryV1.libraryServiceClient(); | ||
var formattedName = client.bookPath("testShelf-" + Date.now().toString(), projectId); | ||
var rating = libraryV1.Book.Rating.GOOD; | ||
var book = { | ||
rating : rating | ||
}; | ||
var request = { | ||
name: formattedName, | ||
book: book | ||
}; | ||
client.updateBook(request).then(function(responses) { | ||
var response = responses[0]; | ||
// doThingsWith(response) | ||
}).catch(function(err) { | ||
console.error(err); | ||
}); | ||
``` | ||
|
||
### Next Steps | ||
- Read the [Client Library Documentation][] for Google Example Library API to see other available methods on the client. | ||
- Read the [Google Example Library API Product documentation][Product Documentation] to learn more about the product and see How-to Guides. | ||
- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/README.md) to see the full list of Cloud APIs that we cover. | ||
|
||
[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/library | ||
[Product Documentation]: https://cloud.google.com/library |
26 changes: 26 additions & 0 deletions
26
src/test/java/com/google/api/codegen/testdata/nodejs_README_no_path_templates.baseline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
============== file: README.md ============== | ||
# NodeJS Client for Google Fake API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-node#versioning)) | ||
|
||
Idiomatic NodeJS client for [Google Fake API][Product Documentation] | ||
- [Client Library Documentation][] | ||
- [Product Documentation][] | ||
|
||
## 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.](https://console.cloud.google.com/project) | ||
2. [Enable the library api.](https://console.cloud.google.com/apis/api/library) | ||
3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-node/#/docs/google-cloud/master/guides/authentication) | ||
|
||
### Installation | ||
``` | ||
$ npm install example | ||
``` | ||
|
||
### Next Steps | ||
- Read the [Client Library Documentation][] for Google Fake API to see other available methods on the client. | ||
- Read the [Google Fake API Product documentation][Product Documentation] to learn more about the product and see How-to Guides. | ||
- View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-node/blob/master/README.md) to see the full list of Cloud APIs that we cover. | ||
|
||
[Client Library Documentation]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/library | ||
[Product Documentation]: https://cloud.google.com/library |
Oops, something went wrong.