1 | /// <reference types="node" />
|
2 | import * as gax from 'google-gax';
|
3 | import { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax';
|
4 | import { Transform } from 'stream';
|
5 | import * as protos from '../../protos/protos';
|
6 | /**
|
7 | * Google Cloud Datastore Admin API
|
8 | *
|
9 | *
|
10 | * The Datastore Admin API provides several admin services for Cloud Datastore.
|
11 | *
|
12 | * -----------------------------------------------------------------------------
|
13 | * ## Concepts
|
14 | *
|
15 | * Project, namespace, kind, and entity as defined in the Google Cloud Datastore
|
16 | * API.
|
17 | *
|
18 | * Operation: An Operation represents work being performed in the background.
|
19 | *
|
20 | * EntityFilter: Allows specifying a subset of entities in a project. This is
|
21 | * specified as a combination of kinds and namespaces (either or both of which
|
22 | * may be all).
|
23 | *
|
24 | * -----------------------------------------------------------------------------
|
25 | * ## Services
|
26 | *
|
27 | * # Export/Import
|
28 | *
|
29 | * The Export/Import service provides the ability to copy all or a subset of
|
30 | * entities to/from Google Cloud Storage.
|
31 | *
|
32 | * Exported data may be imported into Cloud Datastore for any Google Cloud
|
33 | * Platform project. It is not restricted to the export source project. It is
|
34 | * possible to export from one project and then import into another.
|
35 | *
|
36 | * Exported data can also be loaded into Google BigQuery for analysis.
|
37 | *
|
38 | * Exports and imports are performed asynchronously. An Operation resource is
|
39 | * created for each export/import. The state (including any errors encountered)
|
40 | * of the export/import may be queried via the Operation resource.
|
41 | *
|
42 | * # Index
|
43 | *
|
44 | * The index service manages Cloud Datastore composite indexes.
|
45 | *
|
46 | * Index creation and deletion are performed asynchronously.
|
47 | * An Operation resource is created for each such asynchronous operation.
|
48 | * The state of the operation (including any errors encountered)
|
49 | * may be queried via the Operation resource.
|
50 | *
|
51 | * # Operation
|
52 | *
|
53 | * The Operations collection provides a record of actions performed for the
|
54 | * specified project (including any operations in progress). Operations are not
|
55 | * created directly but through calls on other collections or resources.
|
56 | *
|
57 | * An operation that is not yet done may be cancelled. The request to cancel is
|
58 | * asynchronous and the operation may continue to run for some time after the
|
59 | * request to cancel is made.
|
60 | *
|
61 | * An operation that is done may be deleted so that it is no longer listed as
|
62 | * part of the Operation collection.
|
63 | *
|
64 | * ListOperations returns all pending operations, but not completed operations.
|
65 | *
|
66 | * Operations are created by service DatastoreAdmin,
|
67 | * but are accessed via service google.longrunning.Operations.
|
68 | * @class
|
69 | * @memberof v1
|
70 | */
|
71 | export declare class DatastoreAdminClient {
|
72 | private _terminated;
|
73 | private _opts;
|
74 | private _providedCustomServicePath;
|
75 | private _gaxModule;
|
76 | private _gaxGrpc;
|
77 | private _protos;
|
78 | private _defaults;
|
79 | auth: gax.GoogleAuth;
|
80 | descriptors: Descriptors;
|
81 | warn: (code: string, message: string, warnType?: string) => void;
|
82 | innerApiCalls: {
|
83 | [name: string]: Function;
|
84 | };
|
85 | operationsClient: gax.OperationsClient;
|
86 | datastoreAdminStub?: Promise<{
|
87 | [name: string]: Function;
|
88 | }>;
|
89 | /**
|
90 | * Construct an instance of DatastoreAdminClient.
|
91 | *
|
92 | * @param {object} [options] - The configuration object.
|
93 | * The options accepted by the constructor are described in detail
|
94 | * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance).
|
95 | * The common options are:
|
96 | * @param {object} [options.credentials] - Credentials object.
|
97 | * @param {string} [options.credentials.client_email]
|
98 | * @param {string} [options.credentials.private_key]
|
99 | * @param {string} [options.email] - Account email address. Required when
|
100 | * using a .pem or .p12 keyFilename.
|
101 | * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
102 | * .p12 key downloaded from the Google Developers Console. If you provide
|
103 | * a path to a JSON file, the projectId option below is not necessary.
|
104 | * NOTE: .pem and .p12 require you to specify options.email as well.
|
105 | * @param {number} [options.port] - The port on which to connect to
|
106 | * the remote host.
|
107 | * @param {string} [options.projectId] - The project ID from the Google
|
108 | * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
109 | * the environment variable GCLOUD_PROJECT for your project ID. If your
|
110 | * app is running in an environment which supports
|
111 | * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
|
112 | * your project ID will be detected automatically.
|
113 | * @param {string} [options.apiEndpoint] - The domain name of the
|
114 | * API remote host.
|
115 | * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
116 | * Follows the structure of {@link gapicConfig}.
|
117 | * @param {boolean} [options.fallback] - Use HTTP fallback mode.
|
118 | * In fallback mode, a special browser-compatible transport implementation is used
|
119 | * instead of gRPC transport. In browser context (if the `window` object is defined)
|
120 | * the fallback mode is enabled automatically; set `options.fallback` to `false`
|
121 | * if you need to override this behavior.
|
122 | */
|
123 | constructor(opts?: ClientOptions);
|
124 | /**
|
125 | * Initialize the client.
|
126 | * Performs asynchronous operations (such as authentication) and prepares the client.
|
127 | * This function will be called automatically when any class method is called for the
|
128 | * first time, but if you need to initialize it before calling an actual method,
|
129 | * feel free to call initialize() directly.
|
130 | *
|
131 | * You can await on this method if you want to make sure the client is initialized.
|
132 | *
|
133 | * @returns {Promise} A promise that resolves to an authenticated service stub.
|
134 | */
|
135 | initialize(): Promise<{
|
136 | [name: string]: Function;
|
137 | }>;
|
138 | /**
|
139 | * The DNS address for this API service.
|
140 | * @returns {string} The DNS address for this service.
|
141 | */
|
142 | static get servicePath(): string;
|
143 | /**
|
144 | * The DNS address for this API service - same as servicePath(),
|
145 | * exists for compatibility reasons.
|
146 | * @returns {string} The DNS address for this service.
|
147 | */
|
148 | static get apiEndpoint(): string;
|
149 | /**
|
150 | * The port for this API service.
|
151 | * @returns {number} The default port for this service.
|
152 | */
|
153 | static get port(): number;
|
154 | /**
|
155 | * The scopes needed to make gRPC calls for every method defined
|
156 | * in this service.
|
157 | * @returns {string[]} List of default scopes.
|
158 | */
|
159 | static get scopes(): string[];
|
160 | getProjectId(): Promise<string>;
|
161 | getProjectId(callback: Callback<string, undefined, undefined>): void;
|
162 | /**
|
163 | * Gets an index.
|
164 | *
|
165 | * @param {Object} request
|
166 | * The request object that will be sent.
|
167 | * @param {string} request.projectId
|
168 | * Project ID against which to make the request.
|
169 | * @param {string} request.indexId
|
170 | * The resource ID of the index to get.
|
171 | * @param {object} [options]
|
172 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
173 | * @returns {Promise} - The promise which resolves to an array.
|
174 | * The first element of the array is an object representing [Index]{@link google.datastore.admin.v1.Index}.
|
175 | * Please see the
|
176 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
|
177 | * for more details and examples.
|
178 | * @example <caption>include:samples/generated/v1/datastore_admin.get_index.js</caption>
|
179 | * region_tag:datastore_v1_generated_DatastoreAdmin_GetIndex_async
|
180 | */
|
181 | getIndex(request?: protos.google.datastore.admin.v1.IGetIndexRequest, options?: CallOptions): Promise<[
|
182 | protos.google.datastore.admin.v1.IIndex,
|
183 | protos.google.datastore.admin.v1.IGetIndexRequest | undefined,
|
184 | {} | undefined
|
185 | ]>;
|
186 | getIndex(request: protos.google.datastore.admin.v1.IGetIndexRequest, options: CallOptions, callback: Callback<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, {} | null | undefined>): void;
|
187 | getIndex(request: protos.google.datastore.admin.v1.IGetIndexRequest, callback: Callback<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, {} | null | undefined>): void;
|
188 | /**
|
189 | * Exports a copy of all or a subset of entities from Google Cloud Datastore
|
190 | * to another storage system, such as Google Cloud Storage. Recent updates to
|
191 | * entities may not be reflected in the export. The export occurs in the
|
192 | * background and its progress can be monitored and managed via the
|
193 | * Operation resource that is created. The output of an export may only be
|
194 | * used once the associated operation is done. If an export operation is
|
195 | * cancelled before completion it may leave partial data behind in Google
|
196 | * Cloud Storage.
|
197 | *
|
198 | * @param {Object} request
|
199 | * The request object that will be sent.
|
200 | * @param {string} request.projectId
|
201 | * Required. Project ID against which to make the request.
|
202 | * @param {number[]} request.labels
|
203 | * Client-assigned labels.
|
204 | * @param {google.datastore.admin.v1.EntityFilter} request.entityFilter
|
205 | * Description of what data from the project is included in the export.
|
206 | * @param {string} request.outputUrlPrefix
|
207 | * Required. Location for the export metadata and data files.
|
208 | *
|
209 | * The full resource URL of the external storage location. Currently, only
|
210 | * Google Cloud Storage is supported. So output_url_prefix should be of the
|
211 | * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
|
212 | * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud
|
213 | * Storage namespace path (this is not a Cloud Datastore namespace). For more
|
214 | * information about Cloud Storage namespace paths, see
|
215 | * [Object name
|
216 | * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
|
217 | *
|
218 | * The resulting files will be nested deeper than the specified URL prefix.
|
219 | * The final output URL will be provided in the
|
220 | * {@link google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url} field. That
|
221 | * value should be used for subsequent ImportEntities operations.
|
222 | *
|
223 | * By nesting the data files deeper, the same Cloud Storage bucket can be used
|
224 | * in multiple ExportEntities operations without conflict.
|
225 | * @param {object} [options]
|
226 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
227 | * @returns {Promise} - The promise which resolves to an array.
|
228 | * The first element of the array is an object representing
|
229 | * a long running operation. Its `promise()` method returns a promise
|
230 | * you can `await` for.
|
231 | * Please see the
|
232 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
233 | * for more details and examples.
|
234 | * @example <caption>include:samples/generated/v1/datastore_admin.export_entities.js</caption>
|
235 | * region_tag:datastore_v1_generated_DatastoreAdmin_ExportEntities_async
|
236 | */
|
237 | exportEntities(request?: protos.google.datastore.admin.v1.IExportEntitiesRequest, options?: CallOptions): Promise<[
|
238 | LROperation<protos.google.datastore.admin.v1.IExportEntitiesResponse, protos.google.datastore.admin.v1.IExportEntitiesMetadata>,
|
239 | protos.google.longrunning.IOperation | undefined,
|
240 | {} | undefined
|
241 | ]>;
|
242 | exportEntities(request: protos.google.datastore.admin.v1.IExportEntitiesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.datastore.admin.v1.IExportEntitiesResponse, protos.google.datastore.admin.v1.IExportEntitiesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
243 | exportEntities(request: protos.google.datastore.admin.v1.IExportEntitiesRequest, callback: Callback<LROperation<protos.google.datastore.admin.v1.IExportEntitiesResponse, protos.google.datastore.admin.v1.IExportEntitiesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
244 | /**
|
245 | * Check the status of the long running operation returned by `exportEntities()`.
|
246 | * @param {String} name
|
247 | * The operation name that will be passed.
|
248 | * @returns {Promise} - The promise which resolves to an object.
|
249 | * The decoded operation object has result and metadata field to get information from.
|
250 | * Please see the
|
251 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
252 | * for more details and examples.
|
253 | * @example <caption>include:samples/generated/v1/datastore_admin.export_entities.js</caption>
|
254 | * region_tag:datastore_v1_generated_DatastoreAdmin_ExportEntities_async
|
255 | */
|
256 | checkExportEntitiesProgress(name: string): Promise<LROperation<protos.google.datastore.admin.v1.ExportEntitiesResponse, protos.google.datastore.admin.v1.ExportEntitiesMetadata>>;
|
257 | /**
|
258 | * Imports entities into Google Cloud Datastore. Existing entities with the
|
259 | * same key are overwritten. The import occurs in the background and its
|
260 | * progress can be monitored and managed via the Operation resource that is
|
261 | * created. If an ImportEntities operation is cancelled, it is possible
|
262 | * that a subset of the data has already been imported to Cloud Datastore.
|
263 | *
|
264 | * @param {Object} request
|
265 | * The request object that will be sent.
|
266 | * @param {string} request.projectId
|
267 | * Required. Project ID against which to make the request.
|
268 | * @param {number[]} request.labels
|
269 | * Client-assigned labels.
|
270 | * @param {string} request.inputUrl
|
271 | * Required. The full resource URL of the external storage location. Currently, only
|
272 | * Google Cloud Storage is supported. So input_url should be of the form:
|
273 | * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where
|
274 | * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is
|
275 | * an optional Cloud Storage namespace path (this is not a Cloud Datastore
|
276 | * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written
|
277 | * by the ExportEntities operation. For more information about Cloud Storage
|
278 | * namespace paths, see
|
279 | * [Object name
|
280 | * considerations](https://cloud.google.com/storage/docs/naming#object-considerations).
|
281 | *
|
282 | * For more information, see
|
283 | * {@link google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url}.
|
284 | * @param {google.datastore.admin.v1.EntityFilter} request.entityFilter
|
285 | * Optionally specify which kinds/namespaces are to be imported. If provided,
|
286 | * the list must be a subset of the EntityFilter used in creating the export,
|
287 | * otherwise a FAILED_PRECONDITION error will be returned. If no filter is
|
288 | * specified then all entities from the export are imported.
|
289 | * @param {object} [options]
|
290 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
291 | * @returns {Promise} - The promise which resolves to an array.
|
292 | * The first element of the array is an object representing
|
293 | * a long running operation. Its `promise()` method returns a promise
|
294 | * you can `await` for.
|
295 | * Please see the
|
296 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
297 | * for more details and examples.
|
298 | * @example <caption>include:samples/generated/v1/datastore_admin.import_entities.js</caption>
|
299 | * region_tag:datastore_v1_generated_DatastoreAdmin_ImportEntities_async
|
300 | */
|
301 | importEntities(request?: protos.google.datastore.admin.v1.IImportEntitiesRequest, options?: CallOptions): Promise<[
|
302 | LROperation<protos.google.protobuf.IEmpty, protos.google.datastore.admin.v1.IImportEntitiesMetadata>,
|
303 | protos.google.longrunning.IOperation | undefined,
|
304 | {} | undefined
|
305 | ]>;
|
306 | importEntities(request: protos.google.datastore.admin.v1.IImportEntitiesRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.datastore.admin.v1.IImportEntitiesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
307 | importEntities(request: protos.google.datastore.admin.v1.IImportEntitiesRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.datastore.admin.v1.IImportEntitiesMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
308 | /**
|
309 | * Check the status of the long running operation returned by `importEntities()`.
|
310 | * @param {String} name
|
311 | * The operation name that will be passed.
|
312 | * @returns {Promise} - The promise which resolves to an object.
|
313 | * The decoded operation object has result and metadata field to get information from.
|
314 | * Please see the
|
315 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
316 | * for more details and examples.
|
317 | * @example <caption>include:samples/generated/v1/datastore_admin.import_entities.js</caption>
|
318 | * region_tag:datastore_v1_generated_DatastoreAdmin_ImportEntities_async
|
319 | */
|
320 | checkImportEntitiesProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.datastore.admin.v1.ImportEntitiesMetadata>>;
|
321 | /**
|
322 | * Creates the specified index.
|
323 | * A newly created index's initial state is `CREATING`. On completion of the
|
324 | * returned {@link google.longrunning.Operation|google.longrunning.Operation}, the state will be `READY`.
|
325 | * If the index already exists, the call will return an `ALREADY_EXISTS`
|
326 | * status.
|
327 | *
|
328 | * During index creation, the process could result in an error, in which
|
329 | * case the index will move to the `ERROR` state. The process can be recovered
|
330 | * by fixing the data that caused the error, removing the index with
|
331 | * {@link google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete}, then
|
332 | * re-creating the index with [create]
|
333 | * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
|
334 | *
|
335 | * Indexes with a single property cannot be created.
|
336 | *
|
337 | * @param {Object} request
|
338 | * The request object that will be sent.
|
339 | * @param {string} request.projectId
|
340 | * Project ID against which to make the request.
|
341 | * @param {google.datastore.admin.v1.Index} request.index
|
342 | * The index to create. The name and state fields are output only and will be
|
343 | * ignored. Single property indexes cannot be created or deleted.
|
344 | * @param {object} [options]
|
345 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
346 | * @returns {Promise} - The promise which resolves to an array.
|
347 | * The first element of the array is an object representing
|
348 | * a long running operation. Its `promise()` method returns a promise
|
349 | * you can `await` for.
|
350 | * Please see the
|
351 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
352 | * for more details and examples.
|
353 | * @example <caption>include:samples/generated/v1/datastore_admin.create_index.js</caption>
|
354 | * region_tag:datastore_v1_generated_DatastoreAdmin_CreateIndex_async
|
355 | */
|
356 | createIndex(request?: protos.google.datastore.admin.v1.ICreateIndexRequest, options?: CallOptions): Promise<[
|
357 | LROperation<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IIndexOperationMetadata>,
|
358 | protos.google.longrunning.IOperation | undefined,
|
359 | {} | undefined
|
360 | ]>;
|
361 | createIndex(request: protos.google.datastore.admin.v1.ICreateIndexRequest, options: CallOptions, callback: Callback<LROperation<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
362 | createIndex(request: protos.google.datastore.admin.v1.ICreateIndexRequest, callback: Callback<LROperation<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
363 | /**
|
364 | * Check the status of the long running operation returned by `createIndex()`.
|
365 | * @param {String} name
|
366 | * The operation name that will be passed.
|
367 | * @returns {Promise} - The promise which resolves to an object.
|
368 | * The decoded operation object has result and metadata field to get information from.
|
369 | * Please see the
|
370 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
371 | * for more details and examples.
|
372 | * @example <caption>include:samples/generated/v1/datastore_admin.create_index.js</caption>
|
373 | * region_tag:datastore_v1_generated_DatastoreAdmin_CreateIndex_async
|
374 | */
|
375 | checkCreateIndexProgress(name: string): Promise<LROperation<protos.google.datastore.admin.v1.Index, protos.google.datastore.admin.v1.IndexOperationMetadata>>;
|
376 | /**
|
377 | * Deletes an existing index.
|
378 | * An index can only be deleted if it is in a `READY` or `ERROR` state. On
|
379 | * successful execution of the request, the index will be in a `DELETING`
|
380 | * {@link google.datastore.admin.v1.Index.State|state}. And on completion of the
|
381 | * returned {@link google.longrunning.Operation|google.longrunning.Operation}, the index will be removed.
|
382 | *
|
383 | * During index deletion, the process could result in an error, in which
|
384 | * case the index will move to the `ERROR` state. The process can be recovered
|
385 | * by fixing the data that caused the error, followed by calling
|
386 | * {@link google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete} again.
|
387 | *
|
388 | * @param {Object} request
|
389 | * The request object that will be sent.
|
390 | * @param {string} request.projectId
|
391 | * Project ID against which to make the request.
|
392 | * @param {string} request.indexId
|
393 | * The resource ID of the index to delete.
|
394 | * @param {object} [options]
|
395 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
396 | * @returns {Promise} - The promise which resolves to an array.
|
397 | * The first element of the array is an object representing
|
398 | * a long running operation. Its `promise()` method returns a promise
|
399 | * you can `await` for.
|
400 | * Please see the
|
401 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
402 | * for more details and examples.
|
403 | * @example <caption>include:samples/generated/v1/datastore_admin.delete_index.js</caption>
|
404 | * region_tag:datastore_v1_generated_DatastoreAdmin_DeleteIndex_async
|
405 | */
|
406 | deleteIndex(request?: protos.google.datastore.admin.v1.IDeleteIndexRequest, options?: CallOptions): Promise<[
|
407 | LROperation<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IIndexOperationMetadata>,
|
408 | protos.google.longrunning.IOperation | undefined,
|
409 | {} | undefined
|
410 | ]>;
|
411 | deleteIndex(request: protos.google.datastore.admin.v1.IDeleteIndexRequest, options: CallOptions, callback: Callback<LROperation<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
412 | deleteIndex(request: protos.google.datastore.admin.v1.IDeleteIndexRequest, callback: Callback<LROperation<protos.google.datastore.admin.v1.IIndex, protos.google.datastore.admin.v1.IIndexOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
|
413 | /**
|
414 | * Check the status of the long running operation returned by `deleteIndex()`.
|
415 | * @param {String} name
|
416 | * The operation name that will be passed.
|
417 | * @returns {Promise} - The promise which resolves to an object.
|
418 | * The decoded operation object has result and metadata field to get information from.
|
419 | * Please see the
|
420 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
|
421 | * for more details and examples.
|
422 | * @example <caption>include:samples/generated/v1/datastore_admin.delete_index.js</caption>
|
423 | * region_tag:datastore_v1_generated_DatastoreAdmin_DeleteIndex_async
|
424 | */
|
425 | checkDeleteIndexProgress(name: string): Promise<LROperation<protos.google.datastore.admin.v1.Index, protos.google.datastore.admin.v1.IndexOperationMetadata>>;
|
426 | /**
|
427 | * Lists the indexes that match the specified filters. Datastore uses an
|
428 | * eventually consistent query to fetch the list of indexes and may
|
429 | * occasionally return stale results.
|
430 | *
|
431 | * @param {Object} request
|
432 | * The request object that will be sent.
|
433 | * @param {string} request.projectId
|
434 | * Project ID against which to make the request.
|
435 | * @param {string} request.filter
|
436 | * @param {number} request.pageSize
|
437 | * The maximum number of items to return. If zero, then all results will be
|
438 | * returned.
|
439 | * @param {string} request.pageToken
|
440 | * The next_page_token value returned from a previous List request, if any.
|
441 | * @param {object} [options]
|
442 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
443 | * @returns {Promise} - The promise which resolves to an array.
|
444 | * The first element of the array is Array of [Index]{@link google.datastore.admin.v1.Index}.
|
445 | * The client library will perform auto-pagination by default: it will call the API as many
|
446 | * times as needed and will merge results from all the pages into this array.
|
447 | * Note that it can affect your quota.
|
448 | * We recommend using `listIndexesAsync()`
|
449 | * method described below for async iteration which you can stop as needed.
|
450 | * Please see the
|
451 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
452 | * for more details and examples.
|
453 | */
|
454 | listIndexes(request?: protos.google.datastore.admin.v1.IListIndexesRequest, options?: CallOptions): Promise<[
|
455 | protos.google.datastore.admin.v1.IIndex[],
|
456 | protos.google.datastore.admin.v1.IListIndexesRequest | null,
|
457 | protos.google.datastore.admin.v1.IListIndexesResponse
|
458 | ]>;
|
459 | listIndexes(request: protos.google.datastore.admin.v1.IListIndexesRequest, options: CallOptions, callback: PaginationCallback<protos.google.datastore.admin.v1.IListIndexesRequest, protos.google.datastore.admin.v1.IListIndexesResponse | null | undefined, protos.google.datastore.admin.v1.IIndex>): void;
|
460 | listIndexes(request: protos.google.datastore.admin.v1.IListIndexesRequest, callback: PaginationCallback<protos.google.datastore.admin.v1.IListIndexesRequest, protos.google.datastore.admin.v1.IListIndexesResponse | null | undefined, protos.google.datastore.admin.v1.IIndex>): void;
|
461 | /**
|
462 | * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object.
|
463 | * @param {Object} request
|
464 | * The request object that will be sent.
|
465 | * @param {string} request.projectId
|
466 | * Project ID against which to make the request.
|
467 | * @param {string} request.filter
|
468 | * @param {number} request.pageSize
|
469 | * The maximum number of items to return. If zero, then all results will be
|
470 | * returned.
|
471 | * @param {string} request.pageToken
|
472 | * The next_page_token value returned from a previous List request, if any.
|
473 | * @param {object} [options]
|
474 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
475 | * @returns {Stream}
|
476 | * An object stream which emits an object representing [Index]{@link google.datastore.admin.v1.Index} on 'data' event.
|
477 | * The client library will perform auto-pagination by default: it will call the API as many
|
478 | * times as needed. Note that it can affect your quota.
|
479 | * We recommend using `listIndexesAsync()`
|
480 | * method described below for async iteration which you can stop as needed.
|
481 | * Please see the
|
482 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
483 | * for more details and examples.
|
484 | */
|
485 | listIndexesStream(request?: protos.google.datastore.admin.v1.IListIndexesRequest, options?: CallOptions): Transform;
|
486 | /**
|
487 | * Equivalent to `listIndexes`, but returns an iterable object.
|
488 | *
|
489 | * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
|
490 | * @param {Object} request
|
491 | * The request object that will be sent.
|
492 | * @param {string} request.projectId
|
493 | * Project ID against which to make the request.
|
494 | * @param {string} request.filter
|
495 | * @param {number} request.pageSize
|
496 | * The maximum number of items to return. If zero, then all results will be
|
497 | * returned.
|
498 | * @param {string} request.pageToken
|
499 | * The next_page_token value returned from a previous List request, if any.
|
500 | * @param {object} [options]
|
501 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
502 | * @returns {Object}
|
503 | * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols).
|
504 | * When you iterate the returned iterable, each element will be an object representing
|
505 | * [Index]{@link google.datastore.admin.v1.Index}. The API will be called under the hood as needed, once per the page,
|
506 | * so you can stop the iteration when you don't need more results.
|
507 | * Please see the
|
508 | * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
|
509 | * for more details and examples.
|
510 | * @example <caption>include:samples/generated/v1/datastore_admin.list_indexes.js</caption>
|
511 | * region_tag:datastore_v1_generated_DatastoreAdmin_ListIndexes_async
|
512 | */
|
513 | listIndexesAsync(request?: protos.google.datastore.admin.v1.IListIndexesRequest, options?: CallOptions): AsyncIterable<protos.google.datastore.admin.v1.IIndex>;
|
514 | /**
|
515 | * Gets the latest state of a long-running operation. Clients can use this
|
516 | * method to poll the operation result at intervals as recommended by the API
|
517 | * service.
|
518 | *
|
519 | * @param {Object} request - The request object that will be sent.
|
520 | * @param {string} request.name - The name of the operation resource.
|
521 | * @param {Object=} options
|
522 | * Optional parameters. You can override the default settings for this call,
|
523 | * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
524 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
525 | * details.
|
526 | * @param {function(?Error, ?Object)=} callback
|
527 | * The function which will be called with the result of the API call.
|
528 | *
|
529 | * The second parameter to the callback is an object representing
|
530 | * [google.longrunning.Operation]{@link
|
531 | * external:"google.longrunning.Operation"}.
|
532 | * @return {Promise} - The promise which resolves to an array.
|
533 | * The first element of the array is an object representing
|
534 | * [google.longrunning.Operation]{@link
|
535 | * external:"google.longrunning.Operation"}. The promise has a method named
|
536 | * "cancel" which cancels the ongoing API call.
|
537 | *
|
538 | * @example
|
539 | * ```
|
540 | * const client = longrunning.operationsClient();
|
541 | * const name = '';
|
542 | * const [response] = await client.getOperation({name});
|
543 | * // doThingsWith(response)
|
544 | * ```
|
545 | */
|
546 | getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;
|
547 | /**
|
548 | * Lists operations that match the specified filter in the request. If the
|
549 | * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
550 | *
|
551 | * For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
552 | *
|
553 | * @param {Object} request - The request object that will be sent.
|
554 | * @param {string} request.name - The name of the operation collection.
|
555 | * @param {string} request.filter - The standard list filter.
|
556 | * @param {number=} request.pageSize -
|
557 | * The maximum number of resources contained in the underlying API
|
558 | * response. If page streaming is performed per-resource, this
|
559 | * parameter does not affect the return value. If page streaming is
|
560 | * performed per-page, this determines the maximum number of
|
561 | * resources in a page.
|
562 | * @param {Object=} options
|
563 | * Optional parameters. You can override the default settings for this call,
|
564 | * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
565 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
566 | * details.
|
567 | * @returns {Object}
|
568 | * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols.
|
569 | *
|
570 | * @example
|
571 | * ```
|
572 | * const client = longrunning.operationsClient();
|
573 | * for await (const response of client.listOperationsAsync(request));
|
574 | * // doThingsWith(response)
|
575 | * ```
|
576 | */
|
577 | listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
|
578 | /**
|
579 | * Starts asynchronous cancellation on a long-running operation. The server
|
580 | * makes a best effort to cancel the operation, but success is not
|
581 | * guaranteed. If the server doesn't support this method, it returns
|
582 | * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
583 | * {@link Operations.GetOperation} or
|
584 | * other methods to check whether the cancellation succeeded or whether the
|
585 | * operation completed despite cancellation. On successful cancellation,
|
586 | * the operation is not deleted; instead, it becomes an operation with
|
587 | * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
588 | * 1, corresponding to `Code.CANCELLED`.
|
589 | *
|
590 | * @param {Object} request - The request object that will be sent.
|
591 | * @param {string} request.name - The name of the operation resource to be cancelled.
|
592 | * @param {Object=} options
|
593 | * Optional parameters. You can override the default settings for this call,
|
594 | * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
595 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
596 | * details.
|
597 | * @param {function(?Error)=} callback
|
598 | * The function which will be called with the result of the API call.
|
599 | * @return {Promise} - The promise which resolves when API call finishes.
|
600 | * The promise has a method named "cancel" which cancels the ongoing API
|
601 | * call.
|
602 | *
|
603 | * @example
|
604 | * ```
|
605 | * const client = longrunning.operationsClient();
|
606 | * await client.cancelOperation({name: ''});
|
607 | * ```
|
608 | */
|
609 | cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;
|
610 | /**
|
611 | * Deletes a long-running operation. This method indicates that the client is
|
612 | * no longer interested in the operation result. It does not cancel the
|
613 | * operation. If the server doesn't support this method, it returns
|
614 | * `google.rpc.Code.UNIMPLEMENTED`.
|
615 | *
|
616 | * @param {Object} request - The request object that will be sent.
|
617 | * @param {string} request.name - The name of the operation resource to be deleted.
|
618 | * @param {Object=} options
|
619 | * Optional parameters. You can override the default settings for this call,
|
620 | * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link
|
621 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the
|
622 | * details.
|
623 | * @param {function(?Error)=} callback
|
624 | * The function which will be called with the result of the API call.
|
625 | * @return {Promise} - The promise which resolves when API call finishes.
|
626 | * The promise has a method named "cancel" which cancels the ongoing API
|
627 | * call.
|
628 | *
|
629 | * @example
|
630 | * ```
|
631 | * const client = longrunning.operationsClient();
|
632 | * await client.deleteOperation({name: ''});
|
633 | * ```
|
634 | */
|
635 | deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;
|
636 | /**
|
637 | * Terminate the gRPC channel and close the client.
|
638 | *
|
639 | * The client will no longer be usable and all future behavior is undefined.
|
640 | * @returns {Promise} A promise that resolves when the client is closed.
|
641 | */
|
642 | close(): Promise<void>;
|
643 | }
|