Skip to content

Commit

Permalink
refactor: remove weird root binding (#1476)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Dec 5, 2018
1 parent d59bc21 commit 8244127
Show file tree
Hide file tree
Showing 218 changed files with 9,672 additions and 23,135 deletions.
1 change: 1 addition & 0 deletions .kokoro/test.sh
Expand Up @@ -22,5 +22,6 @@ cd $(dirname $0)/..

npm install
npm test
./node_modules/nyc/bin/nyc.js report

bash $KOKORO_GFILE_DIR/codecov.sh
3 changes: 2 additions & 1 deletion .nycrc
Expand Up @@ -3,7 +3,8 @@
"exclude": [
"src/*{/*,/**/*}.js",
"src/*/v*/*.js",
"test/**/*.js"
"test/**/*.js",
"build/test"
],
"watermarks": {
"branches": [
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -32,7 +32,6 @@
"compile": "tsc -p .",
"build-tools": "tsc -p tsconfig.tools.json",
"clean": "gts clean",
"codecov": "nyc report && codecov -f .coverage/*.json",
"fix": "eslint --fix '**/*.js' && gts fix",
"pregenerate": "npm run build-tools",
"generate": "node build/src/generator/generate.js",
Expand Down
44 changes: 10 additions & 34 deletions src/apis/abusiveexperiencereport/v1.ts
Expand Up @@ -16,7 +16,7 @@

import {AxiosPromise} from 'axios';
import {Compute, JWT, OAuth2Client, UserRefreshClient} from 'google-auth-library';
import {BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';
import {APIRequestContext, BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';

// tslint:disable: no-any
// tslint:disable: class-name
Expand All @@ -29,6 +29,8 @@ export namespace abusiveexperiencereport_v1 {
version: 'v1';
}

let context: APIRequestContext;

interface StandardParameters {
/**
* V1 error format.
Expand Down Expand Up @@ -97,24 +99,14 @@ export namespace abusiveexperiencereport_v1 {
* @param {object=} options Options for Abusiveexperiencereport
*/
export class Abusiveexperiencereport {
_options: GlobalOptions;
google?: GoogleConfigurable;
root = this;

sites: Resource$Sites;
violatingSites: Resource$Violatingsites;

constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this._options = options || {};
this.google = google;
this.getRoot.bind(this);
context = {_options: options || {}, google};

this.sites = new Resource$Sites(this);
this.violatingSites = new Resource$Violatingsites(this);
}

getRoot() {
return this.root;
this.sites = new Resource$Sites();
this.violatingSites = new Resource$Violatingsites();
}
}

Expand Down Expand Up @@ -163,15 +155,7 @@ export namespace abusiveexperiencereport_v1 {


export class Resource$Sites {
root: Abusiveexperiencereport;
constructor(root: Abusiveexperiencereport) {
this.root = root;
this.getRoot.bind(this);
}

getRoot() {
return this.root;
}
constructor() {}


/**
Expand Down Expand Up @@ -226,7 +210,7 @@ export namespace abusiveexperiencereport_v1 {
params,
requiredParams: ['name'],
pathParams: ['name'],
context: this.getRoot()
context
};
if (callback) {
createAPIRequest<Schema$SiteSummaryResponse>(parameters, callback);
Expand Down Expand Up @@ -257,15 +241,7 @@ export namespace abusiveexperiencereport_v1 {


export class Resource$Violatingsites {
root: Abusiveexperiencereport;
constructor(root: Abusiveexperiencereport) {
this.root = root;
this.getRoot.bind(this);
}

getRoot() {
return this.root;
}
constructor() {}


/**
Expand Down Expand Up @@ -325,7 +301,7 @@ export namespace abusiveexperiencereport_v1 {
params,
requiredParams: [],
pathParams: [],
context: this.getRoot()
context
};
if (callback) {
createAPIRequest<Schema$ViolatingSitesResponse>(parameters, callback);
Expand Down
30 changes: 7 additions & 23 deletions src/apis/acceleratedmobilepageurl/v1.ts
Expand Up @@ -16,7 +16,7 @@

import {AxiosPromise} from 'axios';
import {Compute, JWT, OAuth2Client, UserRefreshClient} from 'google-auth-library';
import {BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';
import {APIRequestContext, BodyResponseCallback, createAPIRequest, GlobalOptions, GoogleConfigurable, MethodOptions} from 'googleapis-common';

// tslint:disable: no-any
// tslint:disable: class-name
Expand All @@ -29,6 +29,8 @@ export namespace acceleratedmobilepageurl_v1 {
version: 'v1';
}

let context: APIRequestContext;

interface StandardParameters {
/**
* V1 error format.
Expand Down Expand Up @@ -97,22 +99,12 @@ export namespace acceleratedmobilepageurl_v1 {
* @param {object=} options Options for Acceleratedmobilepageurl
*/
export class Acceleratedmobilepageurl {
_options: GlobalOptions;
google?: GoogleConfigurable;
root = this;

ampUrls: Resource$Ampurls;

constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this._options = options || {};
this.google = google;
this.getRoot.bind(this);

this.ampUrls = new Resource$Ampurls(this);
}
context = {_options: options || {}, google};

getRoot() {
return this.root;
this.ampUrls = new Resource$Ampurls();
}
}

Expand Down Expand Up @@ -185,15 +177,7 @@ export namespace acceleratedmobilepageurl_v1 {


export class Resource$Ampurls {
root: Acceleratedmobilepageurl;
constructor(root: Acceleratedmobilepageurl) {
this.root = root;
this.getRoot.bind(this);
}

getRoot() {
return this.root;
}
constructor() {}


/**
Expand Down Expand Up @@ -256,7 +240,7 @@ export namespace acceleratedmobilepageurl_v1 {
params,
requiredParams: [],
pathParams: [],
context: this.getRoot()
context
};
if (callback) {
createAPIRequest<Schema$BatchGetAmpUrlsResponse>(parameters, callback);
Expand Down

0 comments on commit 8244127

Please sign in to comment.