UNPKG

1.82 kBTypeScriptView Raw
1/**
2 * Copyright 2020 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16/// <reference types="node" />
17import { Transform } from 'stream';
18import { APICaller } from '../apiCaller';
19import { GaxCall, RequestType } from '../apitypes';
20import { Descriptor } from '../descriptor';
21import { CallSettings } from '../gax';
22export interface ResponseType {
23 [index: string]: string;
24}
25/**
26 * A descriptor for methods that support pagination.
27 */
28export declare class PageDescriptor implements Descriptor {
29 requestPageTokenField: string;
30 responsePageTokenField: string;
31 requestPageSizeField?: string;
32 resourceField: string;
33 constructor(requestPageTokenField: string, responsePageTokenField: string, resourceField: string);
34 /**
35 * Creates a new object Stream which emits the resource on 'data' event.
36 */
37 createStream(apiCall: GaxCall, request: {}, options: CallSettings): Transform;
38 /**
39 * Create an async iterable which can be recursively called for data on-demand.
40 */
41 asyncIterate(apiCall: GaxCall, request: RequestType, options?: CallSettings): AsyncIterable<{} | undefined>;
42 createIterator(apiCall: GaxCall, request: RequestType, options: CallSettings): AsyncIterable<{} | undefined>;
43 getApiCaller(settings: CallSettings): APICaller;
44}