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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): augment types to manage response streams #2188

Merged
merged 1 commit into from
May 27, 2020
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
],
"dependencies": {
"google-auth-library": "^6.0.0",
"googleapis-common": "^4.1.0"
"googleapis-common": "^4.2.0"
},
"devDependencies": {
"@compodoc/compodoc": "^1.1.10",
Expand Down
2 changes: 1 addition & 1 deletion src/apis/abusiveexperiencereport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"webpack": "webpack"
},
"dependencies": {
"googleapis-common": "^4.1.0"
"googleapis-common": "^4.2.0"
},
"devDependencies": {
"gts": "^2.0.0",
Expand Down
62 changes: 52 additions & 10 deletions src/apis/abusiveexperiencereport/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import {
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';

export namespace abusiveexperiencereport_v1 {
export interface Options extends GlobalOptions {
Expand Down Expand Up @@ -225,10 +227,19 @@ export namespace abusiveexperiencereport_v1 {
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
get(
params: Params$Resource$Sites$Get,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
get(
params?: Params$Resource$Sites$Get,
options?: MethodOptions
): GaxiosPromise<Schema$SiteSummaryResponse>;
get(
params: Params$Resource$Sites$Get,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
get(
params: Params$Resource$Sites$Get,
options: MethodOptions | BodyResponseCallback<Schema$SiteSummaryResponse>,
Expand All @@ -242,12 +253,20 @@ export namespace abusiveexperiencereport_v1 {
get(
paramsOrCallback?:
| Params$Resource$Sites$Get
| BodyResponseCallback<Schema$SiteSummaryResponse>,
| BodyResponseCallback<Schema$SiteSummaryResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| BodyResponseCallback<Schema$SiteSummaryResponse>,
callback?: BodyResponseCallback<Schema$SiteSummaryResponse>
): void | GaxiosPromise<Schema$SiteSummaryResponse> {
| StreamMethodOptions
| BodyResponseCallback<Schema$SiteSummaryResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$SiteSummaryResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$SiteSummaryResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Sites$Get;
let options = (optionsOrCallback || {}) as MethodOptions;

Expand Down Expand Up @@ -278,7 +297,10 @@ export namespace abusiveexperiencereport_v1 {
context: this.context,
};
if (callback) {
createAPIRequest<Schema$SiteSummaryResponse>(parameters, callback);
createAPIRequest<Schema$SiteSummaryResponse>(
parameters,
callback as BodyResponseCallback<{} | void>
);
} else {
return createAPIRequest<Schema$SiteSummaryResponse>(parameters);
}
Expand Down Expand Up @@ -351,10 +373,19 @@ export namespace abusiveexperiencereport_v1 {
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
list(
params: Params$Resource$Violatingsites$List,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
list(
params?: Params$Resource$Violatingsites$List,
options?: MethodOptions
): GaxiosPromise<Schema$ViolatingSitesResponse>;
list(
params: Params$Resource$Violatingsites$List,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
list(
params: Params$Resource$Violatingsites$List,
options:
Expand All @@ -370,12 +401,20 @@ export namespace abusiveexperiencereport_v1 {
list(
paramsOrCallback?:
| Params$Resource$Violatingsites$List
| BodyResponseCallback<Schema$ViolatingSitesResponse>,
| BodyResponseCallback<Schema$ViolatingSitesResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| BodyResponseCallback<Schema$ViolatingSitesResponse>,
callback?: BodyResponseCallback<Schema$ViolatingSitesResponse>
): void | GaxiosPromise<Schema$ViolatingSitesResponse> {
| StreamMethodOptions
| BodyResponseCallback<Schema$ViolatingSitesResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$ViolatingSitesResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$ViolatingSitesResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Violatingsites$List;
let options = (optionsOrCallback || {}) as MethodOptions;
Expand Down Expand Up @@ -407,7 +446,10 @@ export namespace abusiveexperiencereport_v1 {
context: this.context,
};
if (callback) {
createAPIRequest<Schema$ViolatingSitesResponse>(parameters, callback);
createAPIRequest<Schema$ViolatingSitesResponse>(
parameters,
callback as BodyResponseCallback<{} | void>
);
} else {
return createAPIRequest<Schema$ViolatingSitesResponse>(parameters);
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/acceleratedmobilepageurl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"webpack": "webpack"
},
"dependencies": {
"googleapis-common": "^4.1.0"
"googleapis-common": "^4.2.0"
},
"devDependencies": {
"gts": "^2.0.0",
Expand Down
32 changes: 27 additions & 5 deletions src/apis/acceleratedmobilepageurl/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import {
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';

export namespace acceleratedmobilepageurl_v1 {
export interface Options extends GlobalOptions {
Expand Down Expand Up @@ -239,10 +241,19 @@ export namespace acceleratedmobilepageurl_v1 {
* @param {callback} callback The callback that handles the response.
* @return {object} Request object
*/
batchGet(
params: Params$Resource$Ampurls$Batchget,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
batchGet(
params?: Params$Resource$Ampurls$Batchget,
options?: MethodOptions
): GaxiosPromise<Schema$BatchGetAmpUrlsResponse>;
batchGet(
params: Params$Resource$Ampurls$Batchget,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
batchGet(
params: Params$Resource$Ampurls$Batchget,
options:
Expand All @@ -260,12 +271,20 @@ export namespace acceleratedmobilepageurl_v1 {
batchGet(
paramsOrCallback?:
| Params$Resource$Ampurls$Batchget
| BodyResponseCallback<Schema$BatchGetAmpUrlsResponse>,
| BodyResponseCallback<Schema$BatchGetAmpUrlsResponse>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| BodyResponseCallback<Schema$BatchGetAmpUrlsResponse>,
callback?: BodyResponseCallback<Schema$BatchGetAmpUrlsResponse>
): void | GaxiosPromise<Schema$BatchGetAmpUrlsResponse> {
| StreamMethodOptions
| BodyResponseCallback<Schema$BatchGetAmpUrlsResponse>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$BatchGetAmpUrlsResponse>
| BodyResponseCallback<Readable>
):
| void
| GaxiosPromise<Schema$BatchGetAmpUrlsResponse>
| GaxiosPromise<Readable> {
let params = (paramsOrCallback || {}) as Params$Resource$Ampurls$Batchget;
let options = (optionsOrCallback || {}) as MethodOptions;

Expand Down Expand Up @@ -299,7 +318,10 @@ export namespace acceleratedmobilepageurl_v1 {
context: this.context,
};
if (callback) {
createAPIRequest<Schema$BatchGetAmpUrlsResponse>(parameters, callback);
createAPIRequest<Schema$BatchGetAmpUrlsResponse>(
parameters,
callback as BodyResponseCallback<{} | void>
);
} else {
return createAPIRequest<Schema$BatchGetAmpUrlsResponse>(parameters);
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/accessapproval/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"webpack": "webpack"
},
"dependencies": {
"googleapis-common": "^4.1.0"
"googleapis-common": "^4.2.0"
},
"devDependencies": {
"gts": "^2.0.0",
Expand Down