@google-cloud/spanner 5.15.2 → 5.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,33 +107,286 @@ export declare class DatabaseAdminClient {
107
107
  static get scopes(): string[];
108
108
  getProjectId(): Promise<string>;
109
109
  getProjectId(callback: Callback<string, undefined, undefined>): void;
110
+ /**
111
+ * Gets the state of a Cloud Spanner database.
112
+ *
113
+ * @param {Object} request
114
+ * The request object that will be sent.
115
+ * @param {string} request.name
116
+ * Required. The name of the requested database. Values are of the form
117
+ * `projects/<project>/instances/<instance>/databases/<database>`.
118
+ * @param {object} [options]
119
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
120
+ * @returns {Promise} - The promise which resolves to an array.
121
+ * The first element of the array is an object representing [Database]{@link google.spanner.admin.database.v1.Database}.
122
+ * Please see the
123
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
124
+ * for more details and examples.
125
+ * @example <caption>include:samples/generated/v1/database_admin.get_database.js</caption>
126
+ * region_tag:spanner_v1_generated_DatabaseAdmin_GetDatabase_async
127
+ */
110
128
  getDatabase(request?: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | undefined, {} | undefined]>;
111
129
  getDatabase(request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>): void;
112
130
  getDatabase(request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, callback: Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>): void;
131
+ /**
132
+ * Drops (aka deletes) a Cloud Spanner database.
133
+ * Completed backups for the database will be retained according to their
134
+ * `expire_time`.
135
+ *
136
+ * @param {Object} request
137
+ * The request object that will be sent.
138
+ * @param {string} request.database
139
+ * Required. The database to be dropped.
140
+ * @param {object} [options]
141
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
142
+ * @returns {Promise} - The promise which resolves to an array.
143
+ * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
144
+ * Please see the
145
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
146
+ * for more details and examples.
147
+ * @example <caption>include:samples/generated/v1/database_admin.drop_database.js</caption>
148
+ * region_tag:spanner_v1_generated_DatabaseAdmin_DropDatabase_async
149
+ */
113
150
  dropDatabase(request?: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | undefined, {} | undefined]>;
114
151
  dropDatabase(request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>): void;
115
152
  dropDatabase(request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>): void;
153
+ /**
154
+ * Returns the schema of a Cloud Spanner database as a list of formatted
155
+ * DDL statements. This method does not show pending schema updates, those may
156
+ * be queried using the {@link google.longrunning.Operations|Operations} API.
157
+ *
158
+ * @param {Object} request
159
+ * The request object that will be sent.
160
+ * @param {string} request.database
161
+ * Required. The database whose schema we wish to get.
162
+ * Values are of the form
163
+ * `projects/<project>/instances/<instance>/databases/<database>`
164
+ * @param {object} [options]
165
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
166
+ * @returns {Promise} - The promise which resolves to an array.
167
+ * The first element of the array is an object representing [GetDatabaseDdlResponse]{@link google.spanner.admin.database.v1.GetDatabaseDdlResponse}.
168
+ * Please see the
169
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
170
+ * for more details and examples.
171
+ * @example <caption>include:samples/generated/v1/database_admin.get_database_ddl.js</caption>
172
+ * region_tag:spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_async
173
+ */
116
174
  getDatabaseDdl(request?: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, (protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | undefined), {} | undefined]>;
117
175
  getDatabaseDdl(request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>): void;
118
176
  getDatabaseDdl(request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, callback: Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>): void;
177
+ /**
178
+ * Sets the access control policy on a database or backup resource.
179
+ * Replaces any existing policy.
180
+ *
181
+ * Authorization requires `spanner.databases.setIamPolicy`
182
+ * permission on {@link google.iam.v1.SetIamPolicyRequest.resource|resource}.
183
+ * For backups, authorization requires `spanner.backups.setIamPolicy`
184
+ * permission on {@link google.iam.v1.SetIamPolicyRequest.resource|resource}.
185
+ *
186
+ * @param {Object} request
187
+ * The request object that will be sent.
188
+ * @param {string} request.resource
189
+ * REQUIRED: The resource for which the policy is being specified.
190
+ * See the operation documentation for the appropriate value for this field.
191
+ * @param {google.iam.v1.Policy} request.policy
192
+ * REQUIRED: The complete policy to be applied to the `resource`. The size of
193
+ * the policy is limited to a few 10s of KB. An empty policy is a
194
+ * valid policy but certain Cloud Platform services (such as Projects)
195
+ * might reject them.
196
+ * @param {object} [options]
197
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
198
+ * @returns {Promise} - The promise which resolves to an array.
199
+ * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
200
+ * Please see the
201
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
202
+ * for more details and examples.
203
+ * @example <caption>include:samples/generated/v1/database_admin.set_iam_policy.js</caption>
204
+ * region_tag:spanner_v1_generated_DatabaseAdmin_SetIamPolicy_async
205
+ */
119
206
  setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>;
120
207
  setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
121
208
  setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
209
+ /**
210
+ * Gets the access control policy for a database or backup resource.
211
+ * Returns an empty policy if a database or backup exists but does not have a
212
+ * policy set.
213
+ *
214
+ * Authorization requires `spanner.databases.getIamPolicy` permission on
215
+ * {@link google.iam.v1.GetIamPolicyRequest.resource|resource}.
216
+ * For backups, authorization requires `spanner.backups.getIamPolicy`
217
+ * permission on {@link google.iam.v1.GetIamPolicyRequest.resource|resource}.
218
+ *
219
+ * @param {Object} request
220
+ * The request object that will be sent.
221
+ * @param {string} request.resource
222
+ * REQUIRED: The resource for which the policy is being requested.
223
+ * See the operation documentation for the appropriate value for this field.
224
+ * @param {google.iam.v1.GetPolicyOptions} request.options
225
+ * OPTIONAL: A `GetPolicyOptions` object for specifying options to
226
+ * `GetIamPolicy`. This field is only used by Cloud IAM.
227
+ * @param {object} [options]
228
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
229
+ * @returns {Promise} - The promise which resolves to an array.
230
+ * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}.
231
+ * Please see the
232
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
233
+ * for more details and examples.
234
+ * @example <caption>include:samples/generated/v1/database_admin.get_iam_policy.js</caption>
235
+ * region_tag:spanner_v1_generated_DatabaseAdmin_GetIamPolicy_async
236
+ */
122
237
  getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>;
123
238
  getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
124
239
  getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
240
+ /**
241
+ * Returns permissions that the caller has on the specified database or backup
242
+ * resource.
243
+ *
244
+ * Attempting this RPC on a non-existent Cloud Spanner database will
245
+ * result in a NOT_FOUND error if the user has
246
+ * `spanner.databases.list` permission on the containing Cloud
247
+ * Spanner instance. Otherwise returns an empty set of permissions.
248
+ * Calling this method on a backup that does not exist will
249
+ * result in a NOT_FOUND error if the user has
250
+ * `spanner.backups.list` permission on the containing instance.
251
+ *
252
+ * @param {Object} request
253
+ * The request object that will be sent.
254
+ * @param {string} request.resource
255
+ * REQUIRED: The resource for which the policy detail is being requested.
256
+ * See the operation documentation for the appropriate value for this field.
257
+ * @param {string[]} request.permissions
258
+ * The set of permissions to check for the `resource`. Permissions with
259
+ * wildcards (such as '*' or 'storage.*') are not allowed. For more
260
+ * information see
261
+ * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
262
+ * @param {object} [options]
263
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
264
+ * @returns {Promise} - The promise which resolves to an array.
265
+ * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}.
266
+ * Please see the
267
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
268
+ * for more details and examples.
269
+ * @example <caption>include:samples/generated/v1/database_admin.test_iam_permissions.js</caption>
270
+ * region_tag:spanner_v1_generated_DatabaseAdmin_TestIamPermissions_async
271
+ */
125
272
  testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>;
126
273
  testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
127
274
  testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
275
+ /**
276
+ * Gets metadata on a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}.
277
+ *
278
+ * @param {Object} request
279
+ * The request object that will be sent.
280
+ * @param {string} request.name
281
+ * Required. Name of the backup.
282
+ * Values are of the form
283
+ * `projects/<project>/instances/<instance>/backups/<backup>`.
284
+ * @param {object} [options]
285
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
286
+ * @returns {Promise} - The promise which resolves to an array.
287
+ * The first element of the array is an object representing [Backup]{@link google.spanner.admin.database.v1.Backup}.
288
+ * Please see the
289
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
290
+ * for more details and examples.
291
+ * @example <caption>include:samples/generated/v1/database_admin.get_backup.js</caption>
292
+ * region_tag:spanner_v1_generated_DatabaseAdmin_GetBackup_async
293
+ */
128
294
  getBackup(request?: protos.google.spanner.admin.database.v1.IGetBackupRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | undefined, {} | undefined]>;
129
295
  getBackup(request: protos.google.spanner.admin.database.v1.IGetBackupRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void;
130
296
  getBackup(request: protos.google.spanner.admin.database.v1.IGetBackupRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void;
297
+ /**
298
+ * Updates a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}.
299
+ *
300
+ * @param {Object} request
301
+ * The request object that will be sent.
302
+ * @param {google.spanner.admin.database.v1.Backup} request.backup
303
+ * Required. The backup to update. `backup.name`, and the fields to be updated
304
+ * as specified by `update_mask` are required. Other fields are ignored.
305
+ * Update is only supported for the following fields:
306
+ * * `backup.expire_time`.
307
+ * @param {google.protobuf.FieldMask} request.updateMask
308
+ * Required. A mask specifying which fields (e.g. `expire_time`) in the
309
+ * Backup resource should be updated. This mask is relative to the Backup
310
+ * resource, not to the request message. The field mask must always be
311
+ * specified; this prevents any future fields from being erased accidentally
312
+ * by clients that do not know about them.
313
+ * @param {object} [options]
314
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
315
+ * @returns {Promise} - The promise which resolves to an array.
316
+ * The first element of the array is an object representing [Backup]{@link google.spanner.admin.database.v1.Backup}.
317
+ * Please see the
318
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
319
+ * for more details and examples.
320
+ * @example <caption>include:samples/generated/v1/database_admin.update_backup.js</caption>
321
+ * region_tag:spanner_v1_generated_DatabaseAdmin_UpdateBackup_async
322
+ */
131
323
  updateBackup(request?: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | undefined, {} | undefined]>;
132
324
  updateBackup(request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>): void;
133
325
  updateBackup(request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>): void;
326
+ /**
327
+ * Deletes a pending or completed {@link google.spanner.admin.database.v1.Backup|Backup}.
328
+ *
329
+ * @param {Object} request
330
+ * The request object that will be sent.
331
+ * @param {string} request.name
332
+ * Required. Name of the backup to delete.
333
+ * Values are of the form
334
+ * `projects/<project>/instances/<instance>/backups/<backup>`.
335
+ * @param {object} [options]
336
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
337
+ * @returns {Promise} - The promise which resolves to an array.
338
+ * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}.
339
+ * Please see the
340
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
341
+ * for more details and examples.
342
+ * @example <caption>include:samples/generated/v1/database_admin.delete_backup.js</caption>
343
+ * region_tag:spanner_v1_generated_DatabaseAdmin_DeleteBackup_async
344
+ */
134
345
  deleteBackup(request?: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | undefined, {} | undefined]>;
135
346
  deleteBackup(request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>): void;
136
347
  deleteBackup(request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>): void;
348
+ /**
349
+ * Creates a new Cloud Spanner database and starts to prepare it for serving.
350
+ * The returned {@link google.longrunning.Operation|long-running operation} will
351
+ * have a name of the format `<database_name>/operations/<operation_id>` and
352
+ * can be used to track preparation of the database. The
353
+ * {@link google.longrunning.Operation.metadata|metadata} field type is
354
+ * {@link google.spanner.admin.database.v1.CreateDatabaseMetadata|CreateDatabaseMetadata}. The
355
+ * {@link google.longrunning.Operation.response|response} field type is
356
+ * {@link google.spanner.admin.database.v1.Database|Database}, if successful.
357
+ *
358
+ * @param {Object} request
359
+ * The request object that will be sent.
360
+ * @param {string} request.parent
361
+ * Required. The name of the instance that will serve the new database.
362
+ * Values are of the form `projects/<project>/instances/<instance>`.
363
+ * @param {string} request.createStatement
364
+ * Required. A `CREATE DATABASE` statement, which specifies the ID of the
365
+ * new database. The database ID must conform to the regular expression
366
+ * `{@link a-z0-9_\-|a-z}*[a-z0-9]` and be between 2 and 30 characters in length.
367
+ * If the database ID is a reserved word or if it contains a hyphen, the
368
+ * database ID must be enclosed in backticks (`` ` ``).
369
+ * @param {string[]} [request.extraStatements]
370
+ * Optional. A list of DDL statements to run inside the newly created
371
+ * database. Statements can create tables, indexes, etc. These
372
+ * statements execute atomically with the creation of the database:
373
+ * if there is an error in any statement, the database is not created.
374
+ * @param {google.spanner.admin.database.v1.EncryptionConfig} [request.encryptionConfig]
375
+ * Optional. The encryption configuration for the database. If this field is not
376
+ * specified, Cloud Spanner will encrypt/decrypt all data at rest using
377
+ * Google default encryption.
378
+ * @param {object} [options]
379
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
380
+ * @returns {Promise} - The promise which resolves to an array.
381
+ * The first element of the array is an object representing
382
+ * a long running operation. Its `promise()` method returns a promise
383
+ * you can `await` for.
384
+ * Please see the
385
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
386
+ * for more details and examples.
387
+ * @example <caption>include:samples/generated/v1/database_admin.create_database.js</caption>
388
+ * region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
389
+ */
137
390
  createDatabase(request?: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options?: CallOptions): Promise<[LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
138
391
  createDatabase(request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
139
392
  createDatabase(request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
@@ -146,13 +399,57 @@ export declare class DatabaseAdminClient {
146
399
  * Please see the
147
400
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
148
401
  * for more details and examples.
149
- * @example
150
- * const decodedOperation = await checkCreateDatabaseProgress(name);
151
- * console.log(decodedOperation.result);
152
- * console.log(decodedOperation.done);
153
- * console.log(decodedOperation.metadata);
402
+ * @example <caption>include:samples/generated/v1/database_admin.create_database.js</caption>
403
+ * region_tag:spanner_v1_generated_DatabaseAdmin_CreateDatabase_async
154
404
  */
155
405
  checkCreateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.CreateDatabaseMetadata>>;
406
+ /**
407
+ * Updates the schema of a Cloud Spanner database by
408
+ * creating/altering/dropping tables, columns, indexes, etc. The returned
409
+ * {@link google.longrunning.Operation|long-running operation} will have a name of
410
+ * the format `<database_name>/operations/<operation_id>` and can be used to
411
+ * track execution of the schema change(s). The
412
+ * {@link google.longrunning.Operation.metadata|metadata} field type is
413
+ * {@link google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata|UpdateDatabaseDdlMetadata}. The operation has no response.
414
+ *
415
+ * @param {Object} request
416
+ * The request object that will be sent.
417
+ * @param {string} request.database
418
+ * Required. The database to update.
419
+ * @param {string[]} request.statements
420
+ * Required. DDL statements to be applied to the database.
421
+ * @param {string} request.operationId
422
+ * If empty, the new update request is assigned an
423
+ * automatically-generated operation ID. Otherwise, `operation_id`
424
+ * is used to construct the name of the resulting
425
+ * {@link google.longrunning.Operation|Operation}.
426
+ *
427
+ * Specifying an explicit operation ID simplifies determining
428
+ * whether the statements were executed in the event that the
429
+ * {@link google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} call is replayed,
430
+ * or the return value is otherwise lost: the {@link google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database|database} and
431
+ * `operation_id` fields can be combined to form the
432
+ * {@link google.longrunning.Operation.name|name} of the resulting
433
+ * {@link google.longrunning.Operation|longrunning.Operation}: `<database>/operations/<operation_id>`.
434
+ *
435
+ * `operation_id` should be unique within the database, and must be
436
+ * a valid identifier: `{@link a-z0-9_|a-z}*`. Note that
437
+ * automatically-generated operation IDs always begin with an
438
+ * underscore. If the named operation already exists,
439
+ * {@link google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} returns
440
+ * `ALREADY_EXISTS`.
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 an object representing
445
+ * a long running operation. Its `promise()` method returns a promise
446
+ * you can `await` for.
447
+ * Please see the
448
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
449
+ * for more details and examples.
450
+ * @example <caption>include:samples/generated/v1/database_admin.update_database_ddl.js</caption>
451
+ * region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
452
+ */
156
453
  updateDatabaseDdl(request?: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options?: CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
157
454
  updateDatabaseDdl(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
158
455
  updateDatabaseDdl(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
@@ -165,13 +462,57 @@ export declare class DatabaseAdminClient {
165
462
  * Please see the
166
463
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
167
464
  * for more details and examples.
168
- * @example
169
- * const decodedOperation = await checkUpdateDatabaseDdlProgress(name);
170
- * console.log(decodedOperation.result);
171
- * console.log(decodedOperation.done);
172
- * console.log(decodedOperation.metadata);
465
+ * @example <caption>include:samples/generated/v1/database_admin.update_database_ddl.js</caption>
466
+ * region_tag:spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_async
173
467
  */
174
468
  checkUpdateDatabaseDdlProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>>;
469
+ /**
470
+ * Starts creating a new Cloud Spanner Backup.
471
+ * The returned backup {@link google.longrunning.Operation|long-running operation}
472
+ * will have a name of the format
473
+ * `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
474
+ * and can be used to track creation of the backup. The
475
+ * {@link google.longrunning.Operation.metadata|metadata} field type is
476
+ * {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}. The
477
+ * {@link google.longrunning.Operation.response|response} field type is
478
+ * {@link google.spanner.admin.database.v1.Backup|Backup}, if successful. Cancelling the returned operation will stop the
479
+ * creation and delete the backup.
480
+ * There can be only one pending backup creation per database. Backup creation
481
+ * of different databases can run concurrently.
482
+ *
483
+ * @param {Object} request
484
+ * The request object that will be sent.
485
+ * @param {string} request.parent
486
+ * Required. The name of the instance in which the backup will be
487
+ * created. This must be the same instance that contains the database the
488
+ * backup will be created from. The backup will be stored in the
489
+ * location(s) specified in the instance configuration of this
490
+ * instance. Values are of the form
491
+ * `projects/<project>/instances/<instance>`.
492
+ * @param {string} request.backupId
493
+ * Required. The id of the backup to be created. The `backup_id` appended to
494
+ * `parent` forms the full backup name of the form
495
+ * `projects/<project>/instances/<instance>/backups/<backup_id>`.
496
+ * @param {google.spanner.admin.database.v1.Backup} request.backup
497
+ * Required. The backup to create.
498
+ * @param {google.spanner.admin.database.v1.CreateBackupEncryptionConfig} [request.encryptionConfig]
499
+ * Optional. The encryption configuration used to encrypt the backup. If this field is
500
+ * not specified, the backup will use the same
501
+ * encryption configuration as the database by default, namely
502
+ * {@link google.spanner.admin.database.v1.CreateBackupEncryptionConfig.encryption_type|encryption_type} =
503
+ * `USE_DATABASE_ENCRYPTION`.
504
+ * @param {object} [options]
505
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
506
+ * @returns {Promise} - The promise which resolves to an array.
507
+ * The first element of the array is an object representing
508
+ * a long running operation. Its `promise()` method returns a promise
509
+ * you can `await` for.
510
+ * Please see the
511
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
512
+ * for more details and examples.
513
+ * @example <caption>include:samples/generated/v1/database_admin.create_backup.js</caption>
514
+ * region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
515
+ */
175
516
  createBackup(request?: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options?: CallOptions): Promise<[LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
176
517
  createBackup(request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
177
518
  createBackup(request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
@@ -184,13 +525,64 @@ export declare class DatabaseAdminClient {
184
525
  * Please see the
185
526
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
186
527
  * for more details and examples.
187
- * @example
188
- * const decodedOperation = await checkCreateBackupProgress(name);
189
- * console.log(decodedOperation.result);
190
- * console.log(decodedOperation.done);
191
- * console.log(decodedOperation.metadata);
528
+ * @example <caption>include:samples/generated/v1/database_admin.create_backup.js</caption>
529
+ * region_tag:spanner_v1_generated_DatabaseAdmin_CreateBackup_async
192
530
  */
193
531
  checkCreateBackupProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CreateBackupMetadata>>;
532
+ /**
533
+ * Create a new database by restoring from a completed backup. The new
534
+ * database must be in the same project and in an instance with the same
535
+ * instance configuration as the instance containing
536
+ * the backup. The returned database [long-running
537
+ * operation][google.longrunning.Operation] has a name of the format
538
+ * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
539
+ * and can be used to track the progress of the operation, and to cancel it.
540
+ * The {@link google.longrunning.Operation.metadata|metadata} field type is
541
+ * {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
542
+ * The {@link google.longrunning.Operation.response|response} type
543
+ * is {@link google.spanner.admin.database.v1.Database|Database}, if
544
+ * successful. Cancelling the returned operation will stop the restore and
545
+ * delete the database.
546
+ * There can be only one database being restored into an instance at a time.
547
+ * Once the restore operation completes, a new restore operation can be
548
+ * initiated, without waiting for the optimize operation associated with the
549
+ * first restore to complete.
550
+ *
551
+ * @param {Object} request
552
+ * The request object that will be sent.
553
+ * @param {string} request.parent
554
+ * Required. The name of the instance in which to create the
555
+ * restored database. This instance must be in the same project and
556
+ * have the same instance configuration as the instance containing
557
+ * the source backup. Values are of the form
558
+ * `projects/<project>/instances/<instance>`.
559
+ * @param {string} request.databaseId
560
+ * Required. The id of the database to create and restore to. This
561
+ * database must not already exist. The `database_id` appended to
562
+ * `parent` forms the full database name of the form
563
+ * `projects/<project>/instances/<instance>/databases/<database_id>`.
564
+ * @param {string} request.backup
565
+ * Name of the backup from which to restore. Values are of the form
566
+ * `projects/<project>/instances/<instance>/backups/<backup>`.
567
+ * @param {google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig} [request.encryptionConfig]
568
+ * Optional. An encryption configuration describing the encryption type and key
569
+ * resources in Cloud KMS used to encrypt/decrypt the database to restore to.
570
+ * If this field is not specified, the restored database will use
571
+ * the same encryption configuration as the backup by default, namely
572
+ * {@link google.spanner.admin.database.v1.RestoreDatabaseEncryptionConfig.encryption_type|encryption_type} =
573
+ * `USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION`.
574
+ * @param {object} [options]
575
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
576
+ * @returns {Promise} - The promise which resolves to an array.
577
+ * The first element of the array is an object representing
578
+ * a long running operation. Its `promise()` method returns a promise
579
+ * you can `await` for.
580
+ * Please see the
581
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
582
+ * for more details and examples.
583
+ * @example <caption>include:samples/generated/v1/database_admin.restore_database.js</caption>
584
+ * region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
585
+ */
194
586
  restoreDatabase(request?: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options?: CallOptions): Promise<[LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>;
195
587
  restoreDatabase(request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
196
588
  restoreDatabase(request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, callback: Callback<LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
@@ -203,13 +595,38 @@ export declare class DatabaseAdminClient {
203
595
  * Please see the
204
596
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations)
205
597
  * for more details and examples.
206
- * @example
207
- * const decodedOperation = await checkRestoreDatabaseProgress(name);
208
- * console.log(decodedOperation.result);
209
- * console.log(decodedOperation.done);
210
- * console.log(decodedOperation.metadata);
598
+ * @example <caption>include:samples/generated/v1/database_admin.restore_database.js</caption>
599
+ * region_tag:spanner_v1_generated_DatabaseAdmin_RestoreDatabase_async
211
600
  */
212
601
  checkRestoreDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata>>;
602
+ /**
603
+ * Lists Cloud Spanner databases.
604
+ *
605
+ * @param {Object} request
606
+ * The request object that will be sent.
607
+ * @param {string} request.parent
608
+ * Required. The instance whose databases should be listed.
609
+ * Values are of the form `projects/<project>/instances/<instance>`.
610
+ * @param {number} request.pageSize
611
+ * Number of databases to be returned in the response. If 0 or less,
612
+ * defaults to the server's maximum allowed page size.
613
+ * @param {string} request.pageToken
614
+ * If non-empty, `page_token` should contain a
615
+ * {@link google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token|next_page_token} from a
616
+ * previous {@link google.spanner.admin.database.v1.ListDatabasesResponse|ListDatabasesResponse}.
617
+ * @param {object} [options]
618
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
619
+ * @returns {Promise} - The promise which resolves to an array.
620
+ * The first element of the array is Array of [Database]{@link google.spanner.admin.database.v1.Database}.
621
+ * The client library will perform auto-pagination by default: it will call the API as many
622
+ * times as needed and will merge results from all the pages into this array.
623
+ * Note that it can affect your quota.
624
+ * We recommend using `listDatabasesAsync()`
625
+ * method described below for async iteration which you can stop as needed.
626
+ * Please see the
627
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
628
+ * for more details and examples.
629
+ */
213
630
  listDatabases(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.database.v1.IDatabase[], protos.google.spanner.admin.database.v1.IListDatabasesRequest | null, protos.google.spanner.admin.database.v1.IListDatabasesResponse]>;
214
631
  listDatabases(request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabasesRequest, protos.google.spanner.admin.database.v1.IListDatabasesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabase>): void;
215
632
  listDatabases(request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabasesRequest, protos.google.spanner.admin.database.v1.IListDatabasesResponse | null | undefined, protos.google.spanner.admin.database.v1.IDatabase>): void;
@@ -266,13 +683,77 @@ export declare class DatabaseAdminClient {
266
683
  * Please see the
267
684
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
268
685
  * for more details and examples.
269
- * @example
270
- * const iterable = client.listDatabasesAsync(request);
271
- * for await (const response of iterable) {
272
- * // process response
273
- * }
686
+ * @example <caption>include:samples/generated/v1/database_admin.list_databases.js</caption>
687
+ * region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabases_async
274
688
  */
275
689
  listDatabasesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabase>;
690
+ /**
691
+ * Lists completed and pending backups.
692
+ * Backups returned are ordered by `create_time` in descending order,
693
+ * starting from the most recent `create_time`.
694
+ *
695
+ * @param {Object} request
696
+ * The request object that will be sent.
697
+ * @param {string} request.parent
698
+ * Required. The instance to list backups from. Values are of the
699
+ * form `projects/<project>/instances/<instance>`.
700
+ * @param {string} request.filter
701
+ * An expression that filters the list of returned backups.
702
+ *
703
+ * A filter expression consists of a field name, a comparison operator, and a
704
+ * value for filtering.
705
+ * The value must be a string, a number, or a boolean. The comparison operator
706
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
707
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
708
+ *
709
+ * The following fields in the {@link google.spanner.admin.database.v1.Backup|Backup} are eligible for filtering:
710
+ *
711
+ * * `name`
712
+ * * `database`
713
+ * * `state`
714
+ * * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
715
+ * * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
716
+ * * `version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ)
717
+ * * `size_bytes`
718
+ *
719
+ * You can combine multiple expressions by enclosing each expression in
720
+ * parentheses. By default, expressions are combined with AND logic, but
721
+ * you can specify AND, OR, and NOT logic explicitly.
722
+ *
723
+ * Here are a few examples:
724
+ *
725
+ * * `name:Howl` - The backup's name contains the string "howl".
726
+ * * `database:prod`
727
+ * - The database's name contains the string "prod".
728
+ * * `state:CREATING` - The backup is pending creation.
729
+ * * `state:READY` - The backup is fully created and ready for use.
730
+ * * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`
731
+ * - The backup name contains the string "howl" and `create_time`
732
+ * of the backup is before 2018-03-28T14:50:00Z.
733
+ * * `expire_time < \"2018-03-28T14:50:00Z\"`
734
+ * - The backup `expire_time` is before 2018-03-28T14:50:00Z.
735
+ * * `size_bytes > 10000000000` - The backup's size is greater than 10GB
736
+ * @param {number} request.pageSize
737
+ * Number of backups to be returned in the response. If 0 or
738
+ * less, defaults to the server's maximum allowed page size.
739
+ * @param {string} request.pageToken
740
+ * If non-empty, `page_token` should contain a
741
+ * {@link google.spanner.admin.database.v1.ListBackupsResponse.next_page_token|next_page_token} from a
742
+ * previous {@link google.spanner.admin.database.v1.ListBackupsResponse|ListBackupsResponse} to the same `parent` and with the same
743
+ * `filter`.
744
+ * @param {object} [options]
745
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
746
+ * @returns {Promise} - The promise which resolves to an array.
747
+ * The first element of the array is Array of [Backup]{@link google.spanner.admin.database.v1.Backup}.
748
+ * The client library will perform auto-pagination by default: it will call the API as many
749
+ * times as needed and will merge results from all the pages into this array.
750
+ * Note that it can affect your quota.
751
+ * We recommend using `listBackupsAsync()`
752
+ * method described below for async iteration which you can stop as needed.
753
+ * Please see the
754
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
755
+ * for more details and examples.
756
+ */
276
757
  listBackups(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.database.v1.IBackup[], protos.google.spanner.admin.database.v1.IListBackupsRequest | null, protos.google.spanner.admin.database.v1.IListBackupsResponse]>;
277
758
  listBackups(request: protos.google.spanner.admin.database.v1.IListBackupsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupsRequest, protos.google.spanner.admin.database.v1.IListBackupsResponse | null | undefined, protos.google.spanner.admin.database.v1.IBackup>): void;
278
759
  listBackups(request: protos.google.spanner.admin.database.v1.IListBackupsRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupsRequest, protos.google.spanner.admin.database.v1.IListBackupsResponse | null | undefined, protos.google.spanner.admin.database.v1.IBackup>): void;
@@ -403,13 +884,87 @@ export declare class DatabaseAdminClient {
403
884
  * Please see the
404
885
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
405
886
  * for more details and examples.
406
- * @example
407
- * const iterable = client.listBackupsAsync(request);
408
- * for await (const response of iterable) {
409
- * // process response
410
- * }
887
+ * @example <caption>include:samples/generated/v1/database_admin.list_backups.js</caption>
888
+ * region_tag:spanner_v1_generated_DatabaseAdmin_ListBackups_async
411
889
  */
412
890
  listBackupsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IBackup>;
891
+ /**
892
+ * Lists database {@link google.longrunning.Operation|longrunning-operations}.
893
+ * A database operation has a name of the form
894
+ * `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
895
+ * The long-running operation
896
+ * {@link google.longrunning.Operation.metadata|metadata} field type
897
+ * `metadata.type_url` describes the type of the metadata. Operations returned
898
+ * include those that have completed/failed/canceled within the last 7 days,
899
+ * and pending operations.
900
+ *
901
+ * @param {Object} request
902
+ * The request object that will be sent.
903
+ * @param {string} request.parent
904
+ * Required. The instance of the database operations.
905
+ * Values are of the form `projects/<project>/instances/<instance>`.
906
+ * @param {string} request.filter
907
+ * An expression that filters the list of returned operations.
908
+ *
909
+ * A filter expression consists of a field name, a
910
+ * comparison operator, and a value for filtering.
911
+ * The value must be a string, a number, or a boolean. The comparison operator
912
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
913
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
914
+ *
915
+ * The following fields in the {@link google.longrunning.Operation|Operation}
916
+ * are eligible for filtering:
917
+ *
918
+ * * `name` - The name of the long-running operation
919
+ * * `done` - False if the operation is in progress, else true.
920
+ * * `metadata.@type` - the type of metadata. For example, the type string
921
+ * for {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata} is
922
+ * `type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`.
923
+ * * `metadata.<field_name>` - any field in metadata.value.
924
+ * * `error` - Error associated with the long-running operation.
925
+ * * `response.@type` - the type of response.
926
+ * * `response.<field_name>` - any field in response.value.
927
+ *
928
+ * You can combine multiple expressions by enclosing each expression in
929
+ * parentheses. By default, expressions are combined with AND logic. However,
930
+ * you can specify AND, OR, and NOT logic explicitly.
931
+ *
932
+ * Here are a few examples:
933
+ *
934
+ * * `done:true` - The operation is complete.
935
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND` \
936
+ * `(metadata.source_type:BACKUP) AND` \
937
+ * `(metadata.backup_info.backup:backup_howl) AND` \
938
+ * `(metadata.name:restored_howl) AND` \
939
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
940
+ * `(error:*)` - Return operations where:
941
+ * * The operation's metadata type is {@link google.spanner.admin.database.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}.
942
+ * * The database is restored from a backup.
943
+ * * The backup name contains "backup_howl".
944
+ * * The restored database's name contains "restored_howl".
945
+ * * The operation started before 2018-03-28T14:50:00Z.
946
+ * * The operation resulted in an error.
947
+ * @param {number} request.pageSize
948
+ * Number of operations to be returned in the response. If 0 or
949
+ * less, defaults to the server's maximum allowed page size.
950
+ * @param {string} request.pageToken
951
+ * If non-empty, `page_token` should contain a
952
+ * {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse.next_page_token|next_page_token}
953
+ * from a previous {@link google.spanner.admin.database.v1.ListDatabaseOperationsResponse|ListDatabaseOperationsResponse} to the
954
+ * same `parent` and with the same `filter`.
955
+ * @param {object} [options]
956
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
957
+ * @returns {Promise} - The promise which resolves to an array.
958
+ * The first element of the array is Array of [Operation]{@link google.longrunning.Operation}.
959
+ * The client library will perform auto-pagination by default: it will call the API as many
960
+ * times as needed and will merge results from all the pages into this array.
961
+ * Note that it can affect your quota.
962
+ * We recommend using `listDatabaseOperationsAsync()`
963
+ * method described below for async iteration which you can stop as needed.
964
+ * Please see the
965
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
966
+ * for more details and examples.
967
+ */
413
968
  listDatabaseOperations(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): Promise<[protos.google.longrunning.IOperation[], protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest | null, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse]>;
414
969
  listDatabaseOperations(request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
415
970
  listDatabaseOperations(request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
@@ -550,13 +1105,87 @@ export declare class DatabaseAdminClient {
550
1105
  * Please see the
551
1106
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
552
1107
  * for more details and examples.
553
- * @example
554
- * const iterable = client.listDatabaseOperationsAsync(request);
555
- * for await (const response of iterable) {
556
- * // process response
557
- * }
1108
+ * @example <caption>include:samples/generated/v1/database_admin.list_database_operations.js</caption>
1109
+ * region_tag:spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_async
558
1110
  */
559
1111
  listDatabaseOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
1112
+ /**
1113
+ * Lists the backup {@link google.longrunning.Operation|long-running operations} in
1114
+ * the given instance. A backup operation has a name of the form
1115
+ * `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
1116
+ * The long-running operation
1117
+ * {@link google.longrunning.Operation.metadata|metadata} field type
1118
+ * `metadata.type_url` describes the type of the metadata. Operations returned
1119
+ * include those that have completed/failed/canceled within the last 7 days,
1120
+ * and pending operations. Operations returned are ordered by
1121
+ * `operation.metadata.value.progress.start_time` in descending order starting
1122
+ * from the most recently started operation.
1123
+ *
1124
+ * @param {Object} request
1125
+ * The request object that will be sent.
1126
+ * @param {string} request.parent
1127
+ * Required. The instance of the backup operations. Values are of
1128
+ * the form `projects/<project>/instances/<instance>`.
1129
+ * @param {string} request.filter
1130
+ * An expression that filters the list of returned backup operations.
1131
+ *
1132
+ * A filter expression consists of a field name, a
1133
+ * comparison operator, and a value for filtering.
1134
+ * The value must be a string, a number, or a boolean. The comparison operator
1135
+ * must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
1136
+ * Colon `:` is the contains operator. Filter rules are not case sensitive.
1137
+ *
1138
+ * The following fields in the {@link google.longrunning.Operation|operation}
1139
+ * are eligible for filtering:
1140
+ *
1141
+ * * `name` - The name of the long-running operation
1142
+ * * `done` - False if the operation is in progress, else true.
1143
+ * * `metadata.@type` - the type of metadata. For example, the type string
1144
+ * for {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata} is
1145
+ * `type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata`.
1146
+ * * `metadata.<field_name>` - any field in metadata.value.
1147
+ * * `error` - Error associated with the long-running operation.
1148
+ * * `response.@type` - the type of response.
1149
+ * * `response.<field_name>` - any field in response.value.
1150
+ *
1151
+ * You can combine multiple expressions by enclosing each expression in
1152
+ * parentheses. By default, expressions are combined with AND logic, but
1153
+ * you can specify AND, OR, and NOT logic explicitly.
1154
+ *
1155
+ * Here are a few examples:
1156
+ *
1157
+ * * `done:true` - The operation is complete.
1158
+ * * `metadata.database:prod` - The database the backup was taken from has
1159
+ * a name containing the string "prod".
1160
+ * * `(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND` \
1161
+ * `(metadata.name:howl) AND` \
1162
+ * `(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND` \
1163
+ * `(error:*)` - Returns operations where:
1164
+ * * The operation's metadata type is {@link google.spanner.admin.database.v1.CreateBackupMetadata|CreateBackupMetadata}.
1165
+ * * The backup name contains the string "howl".
1166
+ * * The operation started before 2018-03-28T14:50:00Z.
1167
+ * * The operation resulted in an error.
1168
+ * @param {number} request.pageSize
1169
+ * Number of operations to be returned in the response. If 0 or
1170
+ * less, defaults to the server's maximum allowed page size.
1171
+ * @param {string} request.pageToken
1172
+ * If non-empty, `page_token` should contain a
1173
+ * {@link google.spanner.admin.database.v1.ListBackupOperationsResponse.next_page_token|next_page_token}
1174
+ * from a previous {@link google.spanner.admin.database.v1.ListBackupOperationsResponse|ListBackupOperationsResponse} to the
1175
+ * same `parent` and with the same `filter`.
1176
+ * @param {object} [options]
1177
+ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1178
+ * @returns {Promise} - The promise which resolves to an array.
1179
+ * The first element of the array is Array of [Operation]{@link google.longrunning.Operation}.
1180
+ * The client library will perform auto-pagination by default: it will call the API as many
1181
+ * times as needed and will merge results from all the pages into this array.
1182
+ * Note that it can affect your quota.
1183
+ * We recommend using `listBackupOperationsAsync()`
1184
+ * method described below for async iteration which you can stop as needed.
1185
+ * Please see the
1186
+ * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
1187
+ * for more details and examples.
1188
+ */
560
1189
  listBackupOperations(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): Promise<[protos.google.longrunning.IOperation[], protos.google.spanner.admin.database.v1.IListBackupOperationsRequest | null, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse]>;
561
1190
  listBackupOperations(request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
562
1191
  listBackupOperations(request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void;
@@ -693,11 +1322,8 @@ export declare class DatabaseAdminClient {
693
1322
  * Please see the
694
1323
  * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination)
695
1324
  * for more details and examples.
696
- * @example
697
- * const iterable = client.listBackupOperationsAsync(request);
698
- * for await (const response of iterable) {
699
- * // process response
700
- * }
1325
+ * @example <caption>include:samples/generated/v1/database_admin.list_backup_operations.js</caption>
1326
+ * region_tag:spanner_v1_generated_DatabaseAdmin_ListBackupOperations_async
701
1327
  */
702
1328
  listBackupOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
703
1329
  /**