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 declare type GetIndexCallback = GenericIndexCallback<IIndex>;
|
8 | export declare type GetIndexResponse = [Index, IIndex];
|
9 | export declare type IndexGetMetadataCallback = (err?: ServiceError | null, metadata?: IIndex | null) => void;
|
10 | export declare 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 declare type GetIndexesResponse = [Index[], GetIndexesOptions, google.datastore.admin.v1.IListIndexesResponse];
|
19 | export declare type GetIndexesCallback = (err?: ServiceError | null, indexes?: Index[], nextQuery?: GetIndexesOptions, apiResponse?: google.datastore.admin.v1.IListIndexesResponse) => void;
|
20 | export declare type IIndex = google.datastore.admin.v1.IIndex;
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export declare class Index {
|
34 | datastore: Datastore;
|
35 | id: string;
|
36 | metadata?: IIndex;
|
37 | constructor(datastore: Datastore, id: string);
|
38 | /**
|
39 | * Get an index if it exists.
|
40 | *
|
41 | * @param {object} [gaxOptions] Request configuration options, outlined here:
|
42 | * https:
|
43 | * @param {function} callback The callback function.
|
44 | * @param {?error} callback.err An error returned while making this request.
|
45 | * @param {Index} callback.index The Index instance.
|
46 | * @param {object} callback.apiResponse The full API response.
|
47 | */
|
48 | get(gaxOptions?: CallOptions): Promise<GetIndexResponse>;
|
49 | get(callback: GetIndexCallback): void;
|
50 | get(gaxOptions: CallOptions, callback: GetIndexCallback): void;
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | getMetadata(gaxOptions?: CallOptions): Promise<IndexGetMetadataResponse>;
|
61 | getMetadata(callback: IndexGetMetadataCallback): void;
|
62 | getMetadata(gaxOptions: CallOptions, callback: IndexGetMetadataCallback): void;
|
63 | }
|