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