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

fix: use pagination types from gax #136

Merged
merged 2 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 templates/typescript_gapic/package.json.njk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ limitations under the License.
"test": "mocha build/test"
},
"dependencies": {
"google-gax": "^1.10.0"
"google-gax": "^1.11.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
Expand Down
24 changes: 4 additions & 20 deletions templates/typescript_gapic/src/$version/$service_client.ts.njk
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ limitations under the License.
{% import "../../_util.njk" as util -%}

import * as gax from 'google-gax';
{% if service.longRunning.length > 0 -%}
import {APICallback, Callback, CallOptions, LROperation, Descriptors, ClientOptions} from 'google-gax';
{%- else -%}
import {APICallback, Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
{%- endif %}
import {APICallback, Callback, CallOptions, Descriptors, ClientOptions
{%- if service.longRunning.length > 0 %}, LROperation{%- endif -%}
{%- if service.paging.length > 0 %}, PaginationCallback, PaginationResponse{%- endif -%}
} from 'google-gax';
import * as path from 'path';
{% if (service.paging.length > 0) %}
import { Transform } from 'stream';
Expand All @@ -34,21 +33,6 @@ import * as gapicConfig from './{{ service.name.toSnakeCase() }}_client_config.j

const version = require('../../../package.json').version;

{% if (service.paging.length > 0) %}
export interface PaginationCallback<
RequestObject, ResponseObject, ResponseType> {
(err: Error|null, values?: ResponseType[], nextPageRequest?: RequestObject,
rawResponse?: ResponseObject): void;
}

export interface PaginationResponse<
RequestObject, ResponseObject, ResponseType> {
values?: ResponseType[];
nextPageRequest?: RequestObject;
rawResponse?: ResponseObject;
}
{% endif %}

/**
{{- util.printCommentsForService(service) }}
* @class
Expand Down
2 changes: 1 addition & 1 deletion typescript/test/testdata/keymanager/package.json.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "mocha build/test"
},
"dependencies": {
"google-gax": "^1.10.0"
"google-gax": "^1.11.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {APICallback, Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax';
import {APICallback, Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, PaginationResponse} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand All @@ -26,21 +26,6 @@ import * as gapicConfig from './key_management_service_client_config.json';

const version = require('../../../package.json').version;


export interface PaginationCallback<
RequestObject, ResponseObject, ResponseType> {
(err: Error|null, values?: ResponseType[], nextPageRequest?: RequestObject,
rawResponse?: ResponseObject): void;
}

export interface PaginationResponse<
RequestObject, ResponseObject, ResponseType> {
values?: ResponseType[];
nextPageRequest?: RequestObject;
rawResponse?: ResponseObject;
}


/**
* Google Cloud Key Management Service
*
Expand Down
2 changes: 1 addition & 1 deletion typescript/test/testdata/showcase/package.json.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "mocha build/test"
},
"dependencies": {
"google-gax": "^1.10.0"
"google-gax": "^1.11.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {APICallback, Callback, CallOptions, LROperation, Descriptors, ClientOptions} from 'google-gax';
import {APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, PaginationResponse} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand All @@ -26,21 +26,6 @@ import * as gapicConfig from './echo_client_config.json';

const version = require('../../../package.json').version;


export interface PaginationCallback<
RequestObject, ResponseObject, ResponseType> {
(err: Error|null, values?: ResponseType[], nextPageRequest?: RequestObject,
rawResponse?: ResponseObject): void;
}

export interface PaginationResponse<
RequestObject, ResponseObject, ResponseType> {
values?: ResponseType[];
nextPageRequest?: RequestObject;
rawResponse?: ResponseObject;
}


/**
* This service is used showcase the four main types of rpcs - unary, server
* side streaming, client side streaming, and bidirectional streaming. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "mocha build/test"
},
"dependencies": {
"google-gax": "^1.10.0"
"google-gax": "^1.11.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import * as gapicConfig from './text_to_speech_client_config.json';

const version = require('../../../package.json').version;



/**
* Service that implements Google Cloud Text-to-Speech API.
* @class
Expand Down
2 changes: 1 addition & 1 deletion typescript/test/testdata/translate/package.json.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test": "mocha build/test"
},
"dependencies": {
"google-gax": "^1.10.0"
"google-gax": "^1.11.0"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// ** All changes to this file may be overwritten. **

import * as gax from 'google-gax';
import {APICallback, Callback, CallOptions, LROperation, Descriptors, ClientOptions} from 'google-gax';
import {APICallback, Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, PaginationResponse} from 'google-gax';
import * as path from 'path';

import { Transform } from 'stream';
Expand All @@ -26,21 +26,6 @@ import * as gapicConfig from './translation_service_client_config.json';

const version = require('../../../package.json').version;


export interface PaginationCallback<
RequestObject, ResponseObject, ResponseType> {
(err: Error|null, values?: ResponseType[], nextPageRequest?: RequestObject,
rawResponse?: ResponseObject): void;
}

export interface PaginationResponse<
RequestObject, ResponseObject, ResponseType> {
values?: ResponseType[];
nextPageRequest?: RequestObject;
rawResponse?: ResponseObject;
}


/**
* Provides natural language translation operations.
* @class
Expand Down