Skip to content

Commit 0fe11fc

Browse files
feat: initial generation of library (#3)
Release-As: v0.1.0 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 2e7c5bb commit 0fe11fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+41130
-8
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/node_modules
2+
**/coverage
3+
test/fixtures
4+
build/
5+
docs/
6+
protos/
7+
samples/generated/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./node_modules/gts"
3+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.ts text eol=lf
2+
*.js text eol=lf
3+
protos/* linguist-generated
4+
**/api-extractor.json linguist-language=JSON-with-Comments
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
docker:
15+
image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest
16+
17+
deep-remove-regex:
18+
- /owl-bot-staging
19+
20+
deep-copy-regex:
21+
- source: /google/cloud/bigquery/dataexchange/(.*)/.*-nodejs/(.*)
22+
dest: /owl-bot-staging/$1/$2
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**/*.log
2+
**/node_modules
3+
.coverage
4+
coverage
5+
.nyc_output
6+
docs/
7+
out/
8+
build/
9+
system-test/secrets.js
10+
system-test/*key.json
11+
*.lock
12+
.DS_Store
13+
package-lock.json
14+
__pycache__
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// ** This file is automatically generated by gapic-generator-typescript. **
16+
// ** https://github.com/googleapis/gapic-generator-typescript **
17+
// ** All changes to this file may be overwritten. **
18+
19+
'use strict';
20+
21+
module.exports = {
22+
opts: {
23+
readme: './README.md',
24+
package: './package.json',
25+
template: './node_modules/jsdoc-fresh',
26+
recurse: true,
27+
verbose: true,
28+
destination: './docs/'
29+
},
30+
plugins: [
31+
'plugins/markdown',
32+
'jsdoc-region-tag'
33+
],
34+
source: {
35+
excludePattern: '(^|\\/|\\\\)[._]',
36+
include: [
37+
'build/src',
38+
'protos'
39+
],
40+
includePattern: '\\.js$'
41+
},
42+
templates: {
43+
copyright: 'Copyright 2022 Google LLC',
44+
includeDate: false,
45+
sourceFiles: false,
46+
systemName: '@google-cloud/bigquery-data-exchange',
47+
theme: 'lumen',
48+
default: {
49+
outputSourceFiles: false
50+
}
51+
},
52+
markdown: {
53+
idInHeadings: true
54+
}
55+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
const config = {
15+
"enable-source-maps": true,
16+
"throw-deprecation": true,
17+
"timeout": 10000,
18+
"recursive": true
19+
}
20+
if (process.env.MOCHA_THROW_DEPRECATION === 'false') {
21+
delete config['throw-deprecation'];
22+
}
23+
if (process.env.MOCHA_REPORTER) {
24+
config.reporter = process.env.MOCHA_REPORTER;
25+
}
26+
if (process.env.MOCHA_REPORTER_OUTPUT) {
27+
config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`;
28+
}
29+
module.exports = config
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"report-dir": "./.coverage",
3+
"reporter": ["text", "lcov"],
4+
"exclude": [
5+
"**/*-test",
6+
"**/.coverage",
7+
"**/apis",
8+
"**/benchmark",
9+
"**/conformance",
10+
"**/docs",
11+
"**/samples",
12+
"**/scripts",
13+
"**/protos",
14+
"**/test",
15+
"**/*.d.ts",
16+
".jsdoc.js",
17+
"**/.jsdoc.js",
18+
"karma.conf.js",
19+
"webpack-tests.config.js",
20+
"webpack.config.js"
21+
],
22+
"exclude-after-remap": false,
23+
"all": true
24+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
**/node_modules
2+
**/coverage
3+
test/fixtures
4+
build/
5+
docs/
6+
protos/
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
module.exports = {
16+
...require('gts/.prettierrc.json')
17+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "analyticshub",
3+
"name_pretty": "Analytics Hub API",
4+
"product_documentation": "https://cloud.google.com/analytics-hub",
5+
"client_documentation": "https://cloud.google.com/nodejs/docs/reference/analyticshub/latest",
6+
"issue_tracker": "https://github.com/googleapis/nodejs-bigquery-data-exchange/issues",
7+
"release_level": "beta",
8+
"language": "nodejs",
9+
"repo": "googleapis/nodejs-bigquery-data-exchange",
10+
"distribution_name": "@google-cloud/bigquery-data-exchange",
11+
"api_id": "analyticshub.googleapis.com",
12+
"default_version": "v1beta1",
13+
"requires_billing": true,
14+
"library_type": "GAPIC_AUTO"
15+
}
16+

packages/google-cloud-bigquery-dataexchange/README.md

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ analyticshub client for Node.js
1414

1515

1616
A comprehensive list of changes in each version may be found in
17-
[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/master/CHANGELOG.md).
17+
[the CHANGELOG](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/main/CHANGELOG.md).
1818

1919
* [Analytics Hub API Node.js Client API Reference][client-docs]
20-
20+
* [Analytics Hub API Documentation][product-docs]
2121
* [github.com/googleapis/nodejs-bigquery-data-exchange](https://github.com/googleapis/nodejs-bigquery-data-exchange)
2222

2323
Read more about the client libraries for Cloud APIs, including the older
@@ -31,8 +31,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].
3131
* [Quickstart](#quickstart)
3232
* [Before you begin](#before-you-begin)
3333
* [Installing the client library](#installing-the-client-library)
34-
35-
34+
* [Using the client library](#using-the-client-library)
35+
* [Samples](#samples)
3636
* [Versioning](#versioning)
3737
* [Contributing](#contributing)
3838
* [License](#license)
@@ -54,6 +54,61 @@ npm install @google-cloud/bigquery-data-exchange
5454
```
5555

5656

57+
### Using the client library
58+
59+
```javascript
60+
/**
61+
* TODO(developer): Uncomment these variables before running the sample.
62+
*/
63+
/**
64+
* Required. The parent resource path of the DataExchanges.
65+
* e.g. `projects/myproject/locations/US`.
66+
*/
67+
// const parent = 'abc123'
68+
/**
69+
* The maximum number of results to return in a single response page. Leverage
70+
* the page tokens to iterate through the entire collection.
71+
*/
72+
// const pageSize = 1234
73+
/**
74+
* Page token, returned by a previous call, to request the next page of
75+
* results.
76+
*/
77+
// const pageToken = 'abc123'
78+
79+
// Imports the Dataexchange library
80+
const {AnalyticsHubServiceClient} =
81+
require('@google-cloud/bigquery-data-exchange').v1beta1;
82+
83+
// Instantiates a client
84+
const dataexchangeClient = new AnalyticsHubServiceClient();
85+
86+
async function callListDataExchanges() {
87+
// Construct request
88+
const request = {
89+
parent,
90+
};
91+
92+
// Run request
93+
const iterable = await dataexchangeClient.listDataExchangesAsync(request);
94+
for await (const response of iterable) {
95+
console.log(response);
96+
}
97+
}
98+
99+
callListDataExchanges();
100+
101+
```
102+
103+
104+
105+
## Samples
106+
107+
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-bigquery-data-exchange/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
108+
109+
| Sample | Source Code | Try it |
110+
| --------------------------- | --------------------------------- | ------ |
111+
| Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-data-exchange&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
57112

58113

59114

@@ -103,7 +158,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages]
103158

104159
## Contributing
105160

106-
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/master/CONTRIBUTING.md).
161+
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/main/CONTRIBUTING.md).
107162

108163
Please note that this `README.md`, the `samples/README.md`,
109164
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
@@ -115,10 +170,10 @@ to its templates in
115170

116171
Apache Version 2.0
117172

118-
See [LICENSE](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/master/LICENSE)
119-
120-
[client-docs]: https://cloud.google.com/nodejs/docs/reference/dataexchange/latest
173+
See [LICENSE](https://github.com/googleapis/nodejs-bigquery-data-exchange/blob/main/LICENSE)
121174

175+
[client-docs]: https://cloud.google.com/nodejs/docs/reference/analyticshub/latest
176+
[product-docs]: https://cloud.google.com/analytics-hub
122177
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
123178
[projects]: https://console.cloud.google.com/project
124179
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"recurse": true,
3+
"skip": [
4+
"https://codecov.io/gh/googleapis/",
5+
"www.googleapis.com",
6+
"img.shields.io",
7+
"https://console.cloud.google.com/cloudshell",
8+
"https://support.google.com"
9+
],
10+
"silent": true,
11+
"concurrency": 5,
12+
"retry": true,
13+
"retryErrors": true,
14+
"retryErrorsCount": 5,
15+
"retryErrorsJitter": 3000
16+
}

0 commit comments

Comments
 (0)