1 | import type * as gax from 'google-gax';
|
2 | import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax';
|
3 | import * as protos from '../../protos/protos';
|
4 | /**
|
5 | * Each RPC normalizes the partition IDs of the keys in its input entities,
|
6 | * and always returns entities with keys with normalized partition IDs.
|
7 | * This applies to all keys and entities, including those in values, except keys
|
8 | * with both an empty path and an empty or unset partition ID. Normalization of
|
9 | * input keys sets the project ID (if not already set) to the project ID from
|
10 | * the request.
|
11 | *
|
12 | * @class
|
13 | * @memberof v1
|
14 | */
|
15 | export declare class DatastoreClient {
|
16 | private _terminated;
|
17 | private _opts;
|
18 | private _providedCustomServicePath;
|
19 | private _gaxModule;
|
20 | private _gaxGrpc;
|
21 | private _protos;
|
22 | private _defaults;
|
23 | private _universeDomain;
|
24 | private _servicePath;
|
25 | auth: gax.GoogleAuth;
|
26 | descriptors: Descriptors;
|
27 | warn: (code: string, message: string, warnType?: string) => void;
|
28 | innerApiCalls: {
|
29 | [name: string]: Function;
|
30 | };
|
31 | operationsClient: gax.OperationsClient;
|
32 | datastoreStub?: Promise<{
|
33 | [name: string]: Function;
|
34 | }>;
|
35 | /**
|
36 | * Construct an instance of DatastoreClient.
|
37 | *
|
38 | * @param {object} [options] - The configuration object.
|
39 | * The options accepted by the constructor are described in detail
|
40 | * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
41 | * The common options are:
|
42 | * @param {object} [options.credentials] - Credentials object.
|
43 | * @param {string} [options.credentials.client_email]
|
44 | * @param {string} [options.credentials.private_key]
|
45 | * @param {string} [options.email] - Account email address. Required when
|
46 | * using a .pem or .p12 keyFilename.
|
47 | * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
48 | * .p12 key downloaded from the Google Developers Console. If you provide
|
49 | * a path to a JSON file, the projectId option below is not necessary.
|
50 | * NOTE: .pem and .p12 require you to specify options.email as well.
|
51 | * @param {number} [options.port] - The port on which to connect to
|
52 | * the remote host.
|
53 | * @param {string} [options.projectId] - The project ID from the Google
|
54 | * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
55 | * the environment variable GCLOUD_PROJECT for your project ID. If your
|
56 | * app is running in an environment which supports
|
57 | * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials},
|
58 | * your project ID will be detected automatically.
|
59 | * @param {string} [options.apiEndpoint] - The domain name of the
|
60 | * API remote host.
|
61 | * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
62 | * Follows the structure of {@link gapicConfig}.
|
63 | * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
64 | * For more information, please check the
|
65 | * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
66 | * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
67 | * need to avoid loading the default gRPC version and want to use the fallback
|
68 | * HTTP implementation. Load only fallback version and pass it to the constructor:
|
69 | * ```
|
70 | * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
71 | * const client = new DatastoreClient({fallback: true}, gax);
|
72 | * ```
|
73 | */
|
74 | constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
75 | /**
|
76 | * Initialize the client.
|
77 | * Performs asynchronous operations (such as authentication) and prepares the client.
|
78 | * This function will be called automatically when any class method is called for the
|
79 | * first time, but if you need to initialize it before calling an actual method,
|
80 | * feel free to call initialize() directly.
|
81 | *
|
82 | * You can await on this method if you want to make sure the client is initialized.
|
83 | *
|
84 | * @returns {Promise} A promise that resolves to an authenticated service stub.
|
85 | */
|
86 | initialize(): Promise<{
|
87 | [name: string]: Function;
|
88 | }>;
|
89 | /**
|
90 | * The DNS address for this API service.
|
91 | * @deprecated Use the apiEndpoint method of the client instance.
|
92 | * @returns {string} The DNS address for this service.
|
93 | */
|
94 | static get servicePath(): string;
|
95 | /**
|
96 | * The DNS address for this API service - same as servicePath.
|
97 | * @deprecated Use the apiEndpoint method of the client instance.
|
98 | * @returns {string} The DNS address for this service.
|
99 | */
|
100 | static get apiEndpoint(): string;
|
101 | /**
|
102 | * The DNS address for this API service.
|
103 | * @returns {string} The DNS address for this service.
|
104 | */
|
105 | get apiEndpoint(): string;
|
106 | get universeDomain(): string;
|
107 | /**
|
108 | * The port for this API service.
|
109 | * @returns {number} The default port for this service.
|
110 | */
|
111 | static get port(): number;
|
112 | /**
|
113 | * The scopes needed to make gRPC calls for every method defined
|
114 | * in this service.
|
115 | * @returns {string[]} List of default scopes.
|
116 | */
|
117 | static get scopes(): string[];
|
118 | getProjectId(): Promise<string>;
|
119 | getProjectId(callback: Callback<string, undefined, undefined>): void;
|
120 | /**
|
121 | * Looks up entities by key.
|
122 | *
|
123 | * @param {Object} request
|
124 | * The request object that will be sent.
|
125 | * @param {string} request.projectId
|
126 | * Required. The ID of the project against which to make the request.
|
127 | * @param {string} request.databaseId
|
128 | * The ID of the database against which to make the request.
|
129 | *
|
130 | * '(default)' is not allowed; please use empty string '' to refer the default
|
131 | * database.
|
132 | * @param {google.datastore.v1.ReadOptions} request.readOptions
|
133 | * The options for this lookup request.
|
134 | * @param {number[]} request.keys
|
135 | * Required. Keys of entities to look up.
|
136 | * @param {google.datastore.v1.PropertyMask} request.propertyMask
|
137 | * The properties to return. Defaults to returning all properties.
|
138 | *
|
139 | * If this field is set and an entity has a property not referenced in the
|
140 | * mask, it will be absent from {@link protos.|LookupResponse.found.entity.properties}.
|
141 | *
|
142 | * The entity's key is always returned.
|
143 | * @param {object} [options]
|
144 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
145 | * @returns {Promise} - The promise which resolves to an array.
|
146 | * The first element of the array is an object representing {@link protos.google.datastore.v1.LookupResponse|LookupResponse}.
|
147 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
148 | * for more details and examples.
|
149 | * @example <caption>include:samples/generated/v1/datastore.lookup.js</caption>
|
150 | * region_tag:datastore_v1_generated_Datastore_Lookup_async
|
151 | */
|
152 | lookup(request?: protos.google.datastore.v1.ILookupRequest, options?: CallOptions): Promise<[
|
153 | protos.google.datastore.v1.ILookupResponse,
|
154 | protos.google.datastore.v1.ILookupRequest | undefined,
|
155 | {} | undefined
|
156 | ]>;
|
157 | lookup(request: protos.google.datastore.v1.ILookupRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.ILookupResponse, protos.google.datastore.v1.ILookupRequest | null | undefined, {} | null | undefined>): void;
|
158 | lookup(request: protos.google.datastore.v1.ILookupRequest, callback: Callback<protos.google.datastore.v1.ILookupResponse, protos.google.datastore.v1.ILookupRequest | null | undefined, {} | null | undefined>): void;
|
159 | /**
|
160 | * Queries for entities.
|
161 | *
|
162 | * @param {Object} request
|
163 | * The request object that will be sent.
|
164 | * @param {string} request.projectId
|
165 | * Required. The ID of the project against which to make the request.
|
166 | * @param {string} request.databaseId
|
167 | * The ID of the database against which to make the request.
|
168 | *
|
169 | * '(default)' is not allowed; please use empty string '' to refer the default
|
170 | * database.
|
171 | * @param {google.datastore.v1.PartitionId} request.partitionId
|
172 | * Entities are partitioned into subsets, identified by a partition ID.
|
173 | * Queries are scoped to a single partition.
|
174 | * This partition ID is normalized with the standard default context
|
175 | * partition ID.
|
176 | * @param {google.datastore.v1.ReadOptions} request.readOptions
|
177 | * The options for this query.
|
178 | * @param {google.datastore.v1.Query} request.query
|
179 | * The query to run.
|
180 | * @param {google.datastore.v1.GqlQuery} request.gqlQuery
|
181 | * The GQL query to run. This query must be a non-aggregation query.
|
182 | * @param {google.datastore.v1.PropertyMask} request.propertyMask
|
183 | * The properties to return.
|
184 | * This field must not be set for a projection query.
|
185 | *
|
186 | * See
|
187 | * {@link protos.google.datastore.v1.LookupRequest.property_mask|LookupRequest.property_mask}.
|
188 | * @param {google.datastore.v1.ExplainOptions} [request.explainOptions]
|
189 | * Optional. Explain options for the query. If set, additional query
|
190 | * statistics will be returned. If not, only query results will be returned.
|
191 | * @param {object} [options]
|
192 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
193 | * @returns {Promise} - The promise which resolves to an array.
|
194 | * The first element of the array is an object representing {@link protos.google.datastore.v1.RunQueryResponse|RunQueryResponse}.
|
195 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
196 | * for more details and examples.
|
197 | * @example <caption>include:samples/generated/v1/datastore.run_query.js</caption>
|
198 | * region_tag:datastore_v1_generated_Datastore_RunQuery_async
|
199 | */
|
200 | runQuery(request?: protos.google.datastore.v1.IRunQueryRequest, options?: CallOptions): Promise<[
|
201 | protos.google.datastore.v1.IRunQueryResponse,
|
202 | protos.google.datastore.v1.IRunQueryRequest | undefined,
|
203 | {} | undefined
|
204 | ]>;
|
205 | runQuery(request: protos.google.datastore.v1.IRunQueryRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.IRunQueryResponse, protos.google.datastore.v1.IRunQueryRequest | null | undefined, {} | null | undefined>): void;
|
206 | runQuery(request: protos.google.datastore.v1.IRunQueryRequest, callback: Callback<protos.google.datastore.v1.IRunQueryResponse, protos.google.datastore.v1.IRunQueryRequest | null | undefined, {} | null | undefined>): void;
|
207 | /**
|
208 | * Runs an aggregation query.
|
209 | *
|
210 | * @param {Object} request
|
211 | * The request object that will be sent.
|
212 | * @param {string} request.projectId
|
213 | * Required. The ID of the project against which to make the request.
|
214 | * @param {string} request.databaseId
|
215 | * The ID of the database against which to make the request.
|
216 | *
|
217 | * '(default)' is not allowed; please use empty string '' to refer the default
|
218 | * database.
|
219 | * @param {google.datastore.v1.PartitionId} request.partitionId
|
220 | * Entities are partitioned into subsets, identified by a partition ID.
|
221 | * Queries are scoped to a single partition.
|
222 | * This partition ID is normalized with the standard default context
|
223 | * partition ID.
|
224 | * @param {google.datastore.v1.ReadOptions} request.readOptions
|
225 | * The options for this query.
|
226 | * @param {google.datastore.v1.AggregationQuery} request.aggregationQuery
|
227 | * The query to run.
|
228 | * @param {google.datastore.v1.GqlQuery} request.gqlQuery
|
229 | * The GQL query to run. This query must be an aggregation query.
|
230 | * @param {google.datastore.v1.ExplainOptions} [request.explainOptions]
|
231 | * Optional. Explain options for the query. If set, additional query
|
232 | * statistics will be returned. If not, only query results will be returned.
|
233 | * @param {object} [options]
|
234 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
235 | * @returns {Promise} - The promise which resolves to an array.
|
236 | * The first element of the array is an object representing {@link protos.google.datastore.v1.RunAggregationQueryResponse|RunAggregationQueryResponse}.
|
237 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
238 | * for more details and examples.
|
239 | * @example <caption>include:samples/generated/v1/datastore.run_aggregation_query.js</caption>
|
240 | * region_tag:datastore_v1_generated_Datastore_RunAggregationQuery_async
|
241 | */
|
242 | runAggregationQuery(request?: protos.google.datastore.v1.IRunAggregationQueryRequest, options?: CallOptions): Promise<[
|
243 | protos.google.datastore.v1.IRunAggregationQueryResponse,
|
244 | protos.google.datastore.v1.IRunAggregationQueryRequest | undefined,
|
245 | {} | undefined
|
246 | ]>;
|
247 | runAggregationQuery(request: protos.google.datastore.v1.IRunAggregationQueryRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.IRunAggregationQueryResponse, protos.google.datastore.v1.IRunAggregationQueryRequest | null | undefined, {} | null | undefined>): void;
|
248 | runAggregationQuery(request: protos.google.datastore.v1.IRunAggregationQueryRequest, callback: Callback<protos.google.datastore.v1.IRunAggregationQueryResponse, protos.google.datastore.v1.IRunAggregationQueryRequest | null | undefined, {} | null | undefined>): void;
|
249 | /**
|
250 | * Begins a new transaction.
|
251 | *
|
252 | * @param {Object} request
|
253 | * The request object that will be sent.
|
254 | * @param {string} request.projectId
|
255 | * Required. The ID of the project against which to make the request.
|
256 | * @param {string} request.databaseId
|
257 | * The ID of the database against which to make the request.
|
258 | *
|
259 | * '(default)' is not allowed; please use empty string '' to refer the default
|
260 | * database.
|
261 | * @param {google.datastore.v1.TransactionOptions} request.transactionOptions
|
262 | * Options for a new transaction.
|
263 | * @param {object} [options]
|
264 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
265 | * @returns {Promise} - The promise which resolves to an array.
|
266 | * The first element of the array is an object representing {@link protos.google.datastore.v1.BeginTransactionResponse|BeginTransactionResponse}.
|
267 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
268 | * for more details and examples.
|
269 | * @example <caption>include:samples/generated/v1/datastore.begin_transaction.js</caption>
|
270 | * region_tag:datastore_v1_generated_Datastore_BeginTransaction_async
|
271 | */
|
272 | beginTransaction(request?: protos.google.datastore.v1.IBeginTransactionRequest, options?: CallOptions): Promise<[
|
273 | protos.google.datastore.v1.IBeginTransactionResponse,
|
274 | protos.google.datastore.v1.IBeginTransactionRequest | undefined,
|
275 | {} | undefined
|
276 | ]>;
|
277 | beginTransaction(request: protos.google.datastore.v1.IBeginTransactionRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.IBeginTransactionResponse, protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void;
|
278 | beginTransaction(request: protos.google.datastore.v1.IBeginTransactionRequest, callback: Callback<protos.google.datastore.v1.IBeginTransactionResponse, protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void;
|
279 | /**
|
280 | * Commits a transaction, optionally creating, deleting or modifying some
|
281 | * entities.
|
282 | *
|
283 | * @param {Object} request
|
284 | * The request object that will be sent.
|
285 | * @param {string} request.projectId
|
286 | * Required. The ID of the project against which to make the request.
|
287 | * @param {string} request.databaseId
|
288 | * The ID of the database against which to make the request.
|
289 | *
|
290 | * '(default)' is not allowed; please use empty string '' to refer the default
|
291 | * database.
|
292 | * @param {google.datastore.v1.CommitRequest.Mode} request.mode
|
293 | * The type of commit to perform. Defaults to `TRANSACTIONAL`.
|
294 | * @param {Buffer} request.transaction
|
295 | * The identifier of the transaction associated with the commit. A
|
296 | * transaction identifier is returned by a call to
|
297 | * {@link protos.google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}.
|
298 | * @param {google.datastore.v1.TransactionOptions} request.singleUseTransaction
|
299 | * Options for beginning a new transaction for this request.
|
300 | * The transaction is committed when the request completes. If specified,
|
301 | * {@link protos.google.datastore.v1.TransactionOptions|TransactionOptions.mode} must be
|
302 | * {@link protos.google.datastore.v1.TransactionOptions.ReadWrite|TransactionOptions.ReadWrite}.
|
303 | * @param {number[]} request.mutations
|
304 | * The mutations to perform.
|
305 | *
|
306 | * When mode is `TRANSACTIONAL`, mutations affecting a single entity are
|
307 | * applied in order. The following sequences of mutations affecting a single
|
308 | * entity are not permitted in a single `Commit` request:
|
309 | *
|
310 | * - `insert` followed by `insert`
|
311 | * - `update` followed by `insert`
|
312 | * - `upsert` followed by `insert`
|
313 | * - `delete` followed by `update`
|
314 | *
|
315 | * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single
|
316 | * entity.
|
317 | * @param {object} [options]
|
318 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
319 | * @returns {Promise} - The promise which resolves to an array.
|
320 | * The first element of the array is an object representing {@link protos.google.datastore.v1.CommitResponse|CommitResponse}.
|
321 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
322 | * for more details and examples.
|
323 | * @example <caption>include:samples/generated/v1/datastore.commit.js</caption>
|
324 | * region_tag:datastore_v1_generated_Datastore_Commit_async
|
325 | */
|
326 | commit(request?: protos.google.datastore.v1.ICommitRequest, options?: CallOptions): Promise<[
|
327 | protos.google.datastore.v1.ICommitResponse,
|
328 | protos.google.datastore.v1.ICommitRequest | undefined,
|
329 | {} | undefined
|
330 | ]>;
|
331 | commit(request: protos.google.datastore.v1.ICommitRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.ICommitResponse, protos.google.datastore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
|
332 | commit(request: protos.google.datastore.v1.ICommitRequest, callback: Callback<protos.google.datastore.v1.ICommitResponse, protos.google.datastore.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
|
333 | /**
|
334 | * Rolls back a transaction.
|
335 | *
|
336 | * @param {Object} request
|
337 | * The request object that will be sent.
|
338 | * @param {string} request.projectId
|
339 | * Required. The ID of the project against which to make the request.
|
340 | * @param {string} request.databaseId
|
341 | * The ID of the database against which to make the request.
|
342 | *
|
343 | * '(default)' is not allowed; please use empty string '' to refer the default
|
344 | * database.
|
345 | * @param {Buffer} request.transaction
|
346 | * Required. The transaction identifier, returned by a call to
|
347 | * {@link protos.google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}.
|
348 | * @param {object} [options]
|
349 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
350 | * @returns {Promise} - The promise which resolves to an array.
|
351 | * The first element of the array is an object representing {@link protos.google.datastore.v1.RollbackResponse|RollbackResponse}.
|
352 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
353 | * for more details and examples.
|
354 | * @example <caption>include:samples/generated/v1/datastore.rollback.js</caption>
|
355 | * region_tag:datastore_v1_generated_Datastore_Rollback_async
|
356 | */
|
357 | rollback(request?: protos.google.datastore.v1.IRollbackRequest, options?: CallOptions): Promise<[
|
358 | protos.google.datastore.v1.IRollbackResponse,
|
359 | protos.google.datastore.v1.IRollbackRequest | undefined,
|
360 | {} | undefined
|
361 | ]>;
|
362 | rollback(request: protos.google.datastore.v1.IRollbackRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.IRollbackResponse, protos.google.datastore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
|
363 | rollback(request: protos.google.datastore.v1.IRollbackRequest, callback: Callback<protos.google.datastore.v1.IRollbackResponse, protos.google.datastore.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
|
364 | /**
|
365 | * Allocates IDs for the given keys, which is useful for referencing an entity
|
366 | * before it is inserted.
|
367 | *
|
368 | * @param {Object} request
|
369 | * The request object that will be sent.
|
370 | * @param {string} request.projectId
|
371 | * Required. The ID of the project against which to make the request.
|
372 | * @param {string} request.databaseId
|
373 | * The ID of the database against which to make the request.
|
374 | *
|
375 | * '(default)' is not allowed; please use empty string '' to refer the default
|
376 | * database.
|
377 | * @param {number[]} request.keys
|
378 | * Required. A list of keys with incomplete key paths for which to allocate
|
379 | * IDs. No key may be reserved/read-only.
|
380 | * @param {object} [options]
|
381 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
382 | * @returns {Promise} - The promise which resolves to an array.
|
383 | * The first element of the array is an object representing {@link protos.google.datastore.v1.AllocateIdsResponse|AllocateIdsResponse}.
|
384 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
385 | * for more details and examples.
|
386 | * @example <caption>include:samples/generated/v1/datastore.allocate_ids.js</caption>
|
387 | * region_tag:datastore_v1_generated_Datastore_AllocateIds_async
|
388 | */
|
389 | allocateIds(request?: protos.google.datastore.v1.IAllocateIdsRequest, options?: CallOptions): Promise<[
|
390 | protos.google.datastore.v1.IAllocateIdsResponse,
|
391 | protos.google.datastore.v1.IAllocateIdsRequest | undefined,
|
392 | {} | undefined
|
393 | ]>;
|
394 | allocateIds(request: protos.google.datastore.v1.IAllocateIdsRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.IAllocateIdsResponse, protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, {} | null | undefined>): void;
|
395 | allocateIds(request: protos.google.datastore.v1.IAllocateIdsRequest, callback: Callback<protos.google.datastore.v1.IAllocateIdsResponse, protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, {} | null | undefined>): void;
|
396 | /**
|
397 | * Prevents the supplied keys' IDs from being auto-allocated by Cloud
|
398 | * Datastore.
|
399 | *
|
400 | * @param {Object} request
|
401 | * The request object that will be sent.
|
402 | * @param {string} request.projectId
|
403 | * Required. The ID of the project against which to make the request.
|
404 | * @param {string} request.databaseId
|
405 | * The ID of the database against which to make the request.
|
406 | *
|
407 | * '(default)' is not allowed; please use empty string '' to refer the default
|
408 | * database.
|
409 | * @param {number[]} request.keys
|
410 | * Required. A list of keys with complete key paths whose numeric IDs should
|
411 | * not be auto-allocated.
|
412 | * @param {object} [options]
|
413 | * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
414 | * @returns {Promise} - The promise which resolves to an array.
|
415 | * The first element of the array is an object representing {@link protos.google.datastore.v1.ReserveIdsResponse|ReserveIdsResponse}.
|
416 | * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
417 | * for more details and examples.
|
418 | * @example <caption>include:samples/generated/v1/datastore.reserve_ids.js</caption>
|
419 | * region_tag:datastore_v1_generated_Datastore_ReserveIds_async
|
420 | */
|
421 | reserveIds(request?: protos.google.datastore.v1.IReserveIdsRequest, options?: CallOptions): Promise<[
|
422 | protos.google.datastore.v1.IReserveIdsResponse,
|
423 | protos.google.datastore.v1.IReserveIdsRequest | undefined,
|
424 | {} | undefined
|
425 | ]>;
|
426 | reserveIds(request: protos.google.datastore.v1.IReserveIdsRequest, options: CallOptions, callback: Callback<protos.google.datastore.v1.IReserveIdsResponse, protos.google.datastore.v1.IReserveIdsRequest | null | undefined, {} | null | undefined>): void;
|
427 | reserveIds(request: protos.google.datastore.v1.IReserveIdsRequest, callback: Callback<protos.google.datastore.v1.IReserveIdsResponse, protos.google.datastore.v1.IReserveIdsRequest | null | undefined, {} | null | undefined>): void;
|
428 | /**
|
429 | * Gets the latest state of a long-running operation. Clients can use this
|
430 | * method to poll the operation result at intervals as recommended by the API
|
431 | * service.
|
432 | *
|
433 | * @param {Object} request - The request object that will be sent.
|
434 | * @param {string} request.name - The name of the operation resource.
|
435 | * @param {Object=} options
|
436 | * Optional parameters. You can override the default settings for this call,
|
437 | * e.g, timeout, retries, paginations, etc. See {@link
|
438 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
439 | * for the details.
|
440 | * @param {function(?Error, ?Object)=} callback
|
441 | * The function which will be called with the result of the API call.
|
442 | *
|
443 | * The second parameter to the callback is an object representing
|
444 | * {@link google.longrunning.Operation | google.longrunning.Operation}.
|
445 | * @return {Promise} - The promise which resolves to an array.
|
446 | * The first element of the array is an object representing
|
447 | * {@link google.longrunning.Operation | google.longrunning.Operation}.
|
448 | * The promise has a method named "cancel" which cancels the ongoing API call.
|
449 | *
|
450 | * @example
|
451 | * ```
|
452 | * const client = longrunning.operationsClient();
|
453 | * const name = '';
|
454 | * const [response] = await client.getOperation({name});
|
455 | * // doThingsWith(response)
|
456 | * ```
|
457 | */
|
458 | 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]>;
|
459 | /**
|
460 | * Lists operations that match the specified filter in the request. If the
|
461 | * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object.
|
462 | *
|
463 | * For-await-of syntax is used with the iterable to recursively get response element on-demand.
|
464 | *
|
465 | * @param {Object} request - The request object that will be sent.
|
466 | * @param {string} request.name - The name of the operation collection.
|
467 | * @param {string} request.filter - The standard list filter.
|
468 | * @param {number=} request.pageSize -
|
469 | * The maximum number of resources contained in the underlying API
|
470 | * response. If page streaming is performed per-resource, this
|
471 | * parameter does not affect the return value. If page streaming is
|
472 | * performed per-page, this determines the maximum number of
|
473 | * resources in a page.
|
474 | * @param {Object=} options
|
475 | * Optional parameters. You can override the default settings for this call,
|
476 | * e.g, timeout, retries, paginations, etc. See {@link
|
477 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
478 | * details.
|
479 | * @returns {Object}
|
480 | * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}.
|
481 | *
|
482 | * @example
|
483 | * ```
|
484 | * const client = longrunning.operationsClient();
|
485 | * for await (const response of client.listOperationsAsync(request));
|
486 | * // doThingsWith(response)
|
487 | * ```
|
488 | */
|
489 | listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
|
490 | /**
|
491 | * Starts asynchronous cancellation on a long-running operation. The server
|
492 | * makes a best effort to cancel the operation, but success is not
|
493 | * guaranteed. If the server doesn't support this method, it returns
|
494 | * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
495 | * {@link Operations.GetOperation} or
|
496 | * other methods to check whether the cancellation succeeded or whether the
|
497 | * operation completed despite cancellation. On successful cancellation,
|
498 | * the operation is not deleted; instead, it becomes an operation with
|
499 | * an {@link Operation.error} value with a {@link google.rpc.Status.code} of
|
500 | * 1, corresponding to `Code.CANCELLED`.
|
501 | *
|
502 | * @param {Object} request - The request object that will be sent.
|
503 | * @param {string} request.name - The name of the operation resource to be cancelled.
|
504 | * @param {Object=} options
|
505 | * Optional parameters. You can override the default settings for this call,
|
506 | * e.g, timeout, retries, paginations, etc. See {@link
|
507 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the
|
508 | * details.
|
509 | * @param {function(?Error)=} callback
|
510 | * The function which will be called with the result of the API call.
|
511 | * @return {Promise} - The promise which resolves when API call finishes.
|
512 | * The promise has a method named "cancel" which cancels the ongoing API
|
513 | * call.
|
514 | *
|
515 | * @example
|
516 | * ```
|
517 | * const client = longrunning.operationsClient();
|
518 | * await client.cancelOperation({name: ''});
|
519 | * ```
|
520 | */
|
521 | 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>;
|
522 | /**
|
523 | * Deletes a long-running operation. This method indicates that the client is
|
524 | * no longer interested in the operation result. It does not cancel the
|
525 | * operation. If the server doesn't support this method, it returns
|
526 | * `google.rpc.Code.UNIMPLEMENTED`.
|
527 | *
|
528 | * @param {Object} request - The request object that will be sent.
|
529 | * @param {string} request.name - The name of the operation resource to be deleted.
|
530 | * @param {Object=} options
|
531 | * Optional parameters. You can override the default settings for this call,
|
532 | * e.g, timeout, retries, paginations, etc. See {@link
|
533 | * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions}
|
534 | * for the details.
|
535 | * @param {function(?Error)=} callback
|
536 | * The function which will be called with the result of the API call.
|
537 | * @return {Promise} - The promise which resolves when API call finishes.
|
538 | * The promise has a method named "cancel" which cancels the ongoing API
|
539 | * call.
|
540 | *
|
541 | * @example
|
542 | * ```
|
543 | * const client = longrunning.operationsClient();
|
544 | * await client.deleteOperation({name: ''});
|
545 | * ```
|
546 | */
|
547 | 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>;
|
548 | /**
|
549 | * Terminate the gRPC channel and close the client.
|
550 | *
|
551 | * The client will no longer be usable and all future behavior is undefined.
|
552 | * @returns {Promise} A promise that resolves when the client is closed.
|
553 | */
|
554 | close(): Promise<void>;
|
555 | }
|