1 | import { CallOptions, ServiceError } from 'google-gax';
|
2 | import { Datastore } from './';
|
3 | import { google } from '../protos/protos';
|
4 | export interface GenericIndexCallback<T> {
|
5 | (err?: ServiceError | null, index?: Index | null, apiResponse?: T | null): void;
|
6 | }
|
7 | export type GetIndexCallback = GenericIndexCallback<IIndex>;
|
8 | export type GetIndexResponse = [Index, IIndex];
|
9 | export type IndexGetMetadataCallback = (err?: ServiceError | null, metadata?: IIndex | null) => void;
|
10 | export type IndexGetMetadataResponse = [IIndex];
|
11 | export interface GetIndexesOptions {
|
12 | filter?: string;
|
13 | gaxOptions?: CallOptions;
|
14 | pageSize?: number;
|
15 | pageToken?: string;
|
16 | autoPaginate?: boolean;
|
17 | }
|
18 | export type GetIndexesResponse = [
|
19 | Index[],
|
20 | GetIndexesOptions,
|
21 | google.datastore.admin.v1.IListIndexesResponse
|
22 | ];
|
23 | export type GetIndexesCallback = (err?: ServiceError | null, indexes?: Index[], nextQuery?: GetIndexesOptions, apiResponse?: google.datastore.admin.v1.IListIndexesResponse) => void;
|
24 | export type IIndex = google.datastore.admin.v1.IIndex;
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export declare class Index {
|
38 | datastore: Datastore;
|
39 | id: string;
|
40 | metadata?: IIndex;
|
41 | constructor(datastore: Datastore, id: string);
|
42 | /**
|
43 | * Get an index if it exists.
|
44 | *
|
45 | * @param {object} [gaxOptions] Request configuration options, outlined here:
|
46 | * https:
|
47 | * @param {function} callback The callback function.
|
48 | * @param {?error} callback.err An error returned while making this request.
|
49 | * @param {Index} callback.index The Index instance.
|
50 | * @param {object} callback.apiResponse The full API response.
|
51 | */
|
52 | get(gaxOptions?: CallOptions): Promise<GetIndexResponse>;
|
53 | get(callback: GetIndexCallback): void;
|
54 | get(gaxOptions: CallOptions, callback: GetIndexCallback): void;
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | getMetadata(gaxOptions?: CallOptions): Promise<IndexGetMetadataResponse>;
|
65 | getMetadata(callback: IndexGetMetadataCallback): void;
|
66 | getMetadata(gaxOptions: CallOptions, callback: IndexGetMetadataCallback): void;
|
67 | }
|