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

Enable gts fix #98

Merged
merged 1 commit into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained].

```javascript
// Imports the Google Cloud client library
const DNS = require('@google-cloud/dns');
const {DNS} = require('@google-cloud/dns');

// Your Google Cloud Platform project ID
const projectId = 'YOUR_PROJECT_ID';
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"scripts": {
"docs": "jsdoc -c .jsdoc.js",
"generate-scaffolding": "repo-tools generate all && repo-tools generate lib_samples_readme -l samples/ --config ../.cloud-repo-tools.json",
"lint": "echo lint not enabled 👻 # gts check && eslint samples/",
"lint": "gts check && eslint samples/",
"test": "nyc mocha build/test",
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
"presystem-test": "npm run compile",
Expand Down Expand Up @@ -81,6 +81,8 @@
"@types/mocha": "^5.2.5",
"@types/node": "^10.9.4",
"@types/proxyquire": "^1.3.28",
"@types/request": "^2.47.1",
"@types/tmp": "0.0.33",
"@types/uuid": "^3.4.4",
"async": "^2.6.1",
"codecov": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

// [START dns_quickstart]
// Imports the Google Cloud client library
const DNS = require('@google-cloud/dns');
const {DNS} = require('@google-cloud/dns');

// Your Google Cloud Platform project ID
const projectId = 'YOUR_PROJECT_ID';
Expand Down
4 changes: 3 additions & 1 deletion samples/system-test/quickstart.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ test.cb(`should list zones`, t => {

setTimeout(() => {
proxyquire(`../quickstart`, {
'@google-cloud/dns': sinon.stub().returns(dnsMock),
'@google-cloud/dns': {
DNS: sinon.stub().returns(dnsMock),
},
});
}, 5000);
});
22 changes: 12 additions & 10 deletions src/change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import {promisifyAll} from '@google-cloud/promisify';
* @param {string} id ID of the change.
*
* @example
* const DNS = require('@google-cloud/dns');
* const {DNS} = require('@google-cloud/dns');
* const dns = new DNS();
* const zone = dns.zone('zone-id');
* const change = zone.change('change-id');
*/
export class Change extends ServiceObject {
constructor(zone, id) {
constructor(zone, id?) {
const methods = {
/**
* @typedef {array} ChangeExistsResponse
Expand All @@ -52,7 +52,7 @@ export class Change extends ServiceObject {
* @returns {Promise<ChangeExistsResponse>}
*
* @example
* const DNS = require('@google-cloud/dns');
* const {DNS} = require('@google-cloud/dns');
* const dns = new DNS();
* const zone = dns.zone('zone-id');
* const change = zone.change('change-id');
Expand Down Expand Up @@ -81,10 +81,10 @@ export class Change extends ServiceObject {
/**
* Get a change if it exists.
*
* You may optionally use this to "get or create" an object by providing an
* object with `autoCreate` set to `true`. Any extra configuration that is
* normally required for the `create` method must be contained within this
* object as well.
* You may optionally use this to "get or create" an object by providing
* an object with `autoCreate` set to `true`. Any extra configuration that
* is normally required for the `create` method must be contained within
* this object as well.
*
* @method Change#get
* @param {options} [options] Configuration object.
Expand All @@ -94,7 +94,7 @@ export class Change extends ServiceObject {
* @returns {Promise<GetChangeResponse>}
*
* @example
* const DNS = require('@google-cloud/dns');
* const {DNS} = require('@google-cloud/dns');
* const dns = new DNS();
* const zone = dns.zone('zone-id');
* const change = zone.change('change-id');
Expand Down Expand Up @@ -133,7 +133,7 @@ export class Change extends ServiceObject {
* @returns {Promise<GetChangeMetadataResponse>}
*
* @example
* const DNS = require('@google-cloud/dns');
* const {DNS} = require('@google-cloud/dns');
* const dns = new DNS();
* const zone = dns.zone('zone-id');
* const change = zone.change('change-id');
Expand Down Expand Up @@ -180,6 +180,7 @@ export class Change extends ServiceObject {
*/
id,
methods,
// tslint:disable-next-line:no-any
requestModule: teenyRequest as any,
});
}
Expand All @@ -192,7 +193,7 @@ export class Change extends ServiceObject {
* @returns {Promise<CreateChangeResponse>}
*
* @example
* const DNS = require('@google-cloud/dns');
* const {DNS} = require('@google-cloud/dns');
* const dns = new DNS();
* const zone = dns.zone('zone-id');
* const change = zone.change('change-id');
Expand All @@ -218,6 +219,7 @@ export class Change extends ServiceObject {
* });
*/
create(config, callback?) {
// tslint:disable-next-line:no-any
(this.parent as any).createChange(config, (err, change, apiResponse) => {
if (err) {
callback(err, null, apiResponse);
Expand Down
Loading