Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove weird root binding #1476

Merged
merged 1 commit into from Dec 4, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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