@google-cloud/spanner
Advanced tools
@@ -23,3 +23,3 @@ /*! | ||
import { google as databaseAdmin, google, google as spannerClient } from '../protos/protos'; | ||
import { GetDatabaseOperationsOptions, GetDatabaseOperationsResponse, Instance } from './instance'; | ||
import { GetDatabaseOperationsOptions, GetDatabaseOperationsResponse, Instance, GetDatabaseOperationsCallback } from './instance'; | ||
import { PartialResultStream } from './partial-result-stream'; | ||
@@ -87,2 +87,4 @@ import { Session } from './session'; | ||
export declare type RestoreDatabaseResponse = [Database, GaxOperation, databaseAdmin.longrunning.IOperation]; | ||
export declare type GetRestoreInfoCallback = NormalCallback<IRestoreInfoTranslatedEnum>; | ||
export declare type GetStateCallback = NormalCallback<EnumKey<typeof databaseAdmin.spanner.admin.database.v1.Database.State>>; | ||
interface DatabaseRequest { | ||
@@ -180,53 +182,8 @@ (config: RequestConfig, callback: ResourceCallback<GaxOperation, IOperation>): void; | ||
getMetadata(gaxOptions: CallOptions, callback: GetMetadataCallback): void; | ||
/** | ||
* {@link google.spanner.admin.database.v1#RestoreInfo} structure with restore | ||
* source type enum translated to string form. | ||
* | ||
* @typedef {object} IRestoreInfoTranslatedEnum | ||
*/ | ||
/** | ||
* Retrieves the restore information of the database. | ||
* | ||
* @see {@link #getMetadata} | ||
* | ||
* @method Database#getRestoreInfo | ||
* @param {object} [gaxOptions] Request configuration options, outlined here: | ||
* https://googleapis.github.io/gax-nodejs/classes/CallSettings.html. | ||
* @returns {Promise<IRestoreInfoTranslatedEnum | undefined>} When resolved, | ||
* contains the restore information for the database if it was restored | ||
* from a backup. | ||
* | ||
* @example | ||
* const {Spanner} = require('@google-cloud/spanner'); | ||
* const spanner = new Spanner(); | ||
* const instance = spanner.instance('my-instance'); | ||
* const database = instance.database('my-database'); | ||
* const restoreInfo = await database.getRestoreInfo(); | ||
* console.log(`Database restored from ${restoreInfo.backupInfo.backup}`); | ||
*/ | ||
getRestoreInfo(options?: CallOptions): Promise<IRestoreInfoTranslatedEnum | undefined>; | ||
/** | ||
* Retrieves the state of the database. | ||
* | ||
* The database state indicates if the database is ready after creation or | ||
* after being restored from a backup. | ||
* | ||
* @see {@link #getMetadata} | ||
* | ||
* @method Database#getState | ||
* @param {object} [gaxOptions] Request configuration options, outlined here: | ||
* https://googleapis.github.io/gax-nodejs/classes/CallSettings.html. | ||
* @returns {Promise<EnumKey<typeof, databaseAdmin.spanner.admin.database.v1.Database.State> | undefined>} | ||
* When resolved, contains the current state of the database if the state | ||
* is defined. | ||
* | ||
* @example | ||
* const {Spanner} = require('@google-cloud/spanner'); | ||
* const spanner = new Spanner(); | ||
* const instance = spanner.instance('my-instance'); | ||
* const database = instance.database('my-database'); | ||
* const state = await database.getState(); | ||
* const isReady = (state === 'READY'); | ||
*/ | ||
getRestoreInfo(callback: GetRestoreInfoCallback): void; | ||
getRestoreInfo(options: CallOptions, callback: GetRestoreInfoCallback): void; | ||
getState(options?: CallOptions): Promise<EnumKey<typeof databaseAdmin.spanner.admin.database.v1.Database.State> | undefined>; | ||
getState(callback: GetStateCallback): void; | ||
getState(options: CallOptions, callback: GetStateCallback): void; | ||
getSchema(options?: CallOptions): Promise<GetSchemaResponse>; | ||
@@ -282,53 +239,5 @@ getSchema(callback: GetSchemaCallback): void; | ||
getTransaction(callback: GetTransactionCallback): void; | ||
/** | ||
* Query object for listing database operations. | ||
* | ||
* @typedef {object} GetDatabaseOperationsOptions | ||
* @property {string} [filter] An expression for filtering the results of the | ||
* request. Filter can be configured as outlined in | ||
* {@link v1.DatabaseAdminClient#listDatabaseOperations}. | ||
* @property {number} [pageSize] Maximum number of results per page. | ||
* @property {string} [pageToken] A previously-returned page token | ||
* representing part of the larger set of results to view. | ||
*/ | ||
/** | ||
* @typedef {array} GetDatabaseOperationsResponse | ||
* @property {IOperation[]} 0 Array of {@link IOperation} instances. | ||
* @property {object} 1 The full API response. | ||
*/ | ||
/** | ||
* List pending and completed operations for the database. | ||
* | ||
* @see {@link Instance.getDatabaseOperations} | ||
* | ||
* @param {GetDatabaseOperationsOptions} [options] Contains query object for | ||
* listing database operations and request configuration options, outlined | ||
* here: https://googleapis.github.io/gax-nodejs/classes/CallSettings.html. | ||
* @returns {Promise<GetDatabaseOperationsResponse>} When resolved, contains | ||
* a paged list of database operations. | ||
* | ||
* @example | ||
* const {Spanner} = require('@google-cloud/spanner'); | ||
* const spanner = new Spanner(); | ||
* const instance = spanner.instance('my-instance'); | ||
* const database = instance.database('my-database'); | ||
* const [operations] = await database.getOperations(); | ||
* | ||
* //- | ||
* // To manually handle pagination, set autoPaginate:false in gaxOptions. | ||
* //- | ||
* let pageToken = undefined; | ||
* do { | ||
* const [operations, , response] = await database.getOperations({ | ||
* pageSize: 3, | ||
* pageToken, | ||
* gaxOptions: {autoPaginate: false}, | ||
* }); | ||
* operations.forEach(operation => { | ||
* // Do something with operation | ||
* }); | ||
* pageToken = response.nextPageToken; | ||
* } while (pageToken); | ||
*/ | ||
getOperations(options?: GetDatabaseOperationsOptions): Promise<GetDatabaseOperationsResponse>; | ||
getOperations(callback: GetDatabaseOperationsCallback): void; | ||
getOperations(options: GetDatabaseOperationsOptions, callback: GetDatabaseOperationsCallback): void; | ||
makePooledRequest_(config: RequestConfig): Promise<Session>; | ||
@@ -335,0 +244,0 @@ makePooledRequest_(config: RequestConfig, callback: PoolRequestCallback): void; |
@@ -946,3 +946,3 @@ "use strict"; | ||
databases = rowDatabases.map(database => { | ||
const databaseInstance = self.database(database.name); | ||
const databaseInstance = self.database(database.name, { min: 0 }); | ||
databaseInstance.metadata = database; | ||
@@ -949,0 +949,0 @@ return databaseInstance; |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -38,4 +38,6 @@ import * as protos from '../../protos/protos'; | ||
* | ||
* @param {object} [options] - The configuration object. See the subsequent | ||
* parameters for more details. | ||
* @param {object} [options] - The configuration object. | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
* @param {object} [options.credentials] - Credentials object. | ||
@@ -60,2 +62,9 @@ * @param {string} [options.credentials.client_email] | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
*/ | ||
@@ -79,2 +88,3 @@ constructor(opts?: ClientOptions); | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -85,2 +95,3 @@ static get servicePath(): string; | ||
* exists for compatibility reasons. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -90,2 +101,3 @@ static get apiEndpoint(): string; | ||
* The port for this API service. | ||
* @returns {number} The default port for this service. | ||
*/ | ||
@@ -96,2 +108,3 @@ static get port(): number; | ||
* in this service. | ||
* @returns {string[]} List of default scopes. | ||
*/ | ||
@@ -101,34 +114,34 @@ static get scopes(): string[]; | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
getDatabase(request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | undefined, {} | undefined]>; | ||
getDatabase(request: protos.google.spanner.admin.database.v1.IGetDatabaseRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IGetDatabaseRequest | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
dropDatabase(request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | undefined, {} | undefined]>; | ||
dropDatabase(request: protos.google.spanner.admin.database.v1.IDropDatabaseRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDropDatabaseRequest | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
getDatabaseDdl(request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, (protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | undefined), {} | undefined]>; | ||
getDatabaseDdl(request: protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IGetDatabaseDdlResponse, protos.google.spanner.admin.database.v1.IGetDatabaseDdlRequest | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>; | ||
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; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>; | ||
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; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>; | ||
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; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void; | ||
getBackup(request: protos.google.spanner.admin.database.v1.IGetBackupRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | undefined, {} | undefined]>; | ||
getBackup(request: protos.google.spanner.admin.database.v1.IGetBackupRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IGetBackupRequest | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
updateBackup(request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | undefined, {} | undefined]>; | ||
updateBackup(request: protos.google.spanner.admin.database.v1.IUpdateBackupRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.IUpdateBackupRequest | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
deleteBackup(request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | undefined, {} | undefined]>; | ||
deleteBackup(request: protos.google.spanner.admin.database.v1.IDeleteBackupRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IDeleteBackupRequest | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
createDatabase(request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.ICreateDatabaseMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
createDatabase(request: protos.google.spanner.admin.database.v1.ICreateDatabaseRequest, options: gax.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; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Check the status of the long running operation returned by the createDatabase() method. | ||
* Check the status of the long running operation returned by `createDatabase()`. | ||
* @param {String} name | ||
@@ -138,16 +151,17 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkCreateDatabaseProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkCreateDatabaseProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
checkCreateDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.CreateDatabaseMetadata>>; | ||
updateDatabaseDdl(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
updateDatabaseDdl(request: protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.spanner.admin.database.v1.IUpdateDatabaseDdlMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Check the status of the long running operation returned by the updateDatabaseDdl() method. | ||
* Check the status of the long running operation returned by `updateDatabaseDdl()`. | ||
* @param {String} name | ||
@@ -157,16 +171,17 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkUpdateDatabaseDdlProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkUpdateDatabaseDdlProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
checkUpdateDatabaseDdlProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata>>; | ||
createBackup(request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.spanner.admin.database.v1.IBackup, protos.google.spanner.admin.database.v1.ICreateBackupMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
createBackup(request: protos.google.spanner.admin.database.v1.ICreateBackupRequest, options: gax.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; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Check the status of the long running operation returned by the createBackup() method. | ||
* Check the status of the long running operation returned by `createBackup()`. | ||
* @param {String} name | ||
@@ -176,16 +191,17 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkCreateBackupProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkCreateBackupProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
checkCreateBackupProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Backup, protos.google.spanner.admin.database.v1.CreateBackupMetadata>>; | ||
restoreDatabase(request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.spanner.admin.database.v1.IDatabase, protos.google.spanner.admin.database.v1.IRestoreDatabaseMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
restoreDatabase(request: protos.google.spanner.admin.database.v1.IRestoreDatabaseRequest, options: gax.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; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Check the status of the long running operation returned by the restoreDatabase() method. | ||
* Check the status of the long running operation returned by `restoreDatabase()`. | ||
* @param {String} name | ||
@@ -195,27 +211,17 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkRestoreDatabaseProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkRestoreDatabaseProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
checkRestoreDatabaseProgress(name: string): Promise<LROperation<protos.google.spanner.admin.database.v1.Database, protos.google.spanner.admin.database.v1.RestoreDatabaseMetadata>>; | ||
listDatabases(request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.database.v1.IDatabase[], protos.google.spanner.admin.database.v1.IListDatabasesRequest | null, protos.google.spanner.admin.database.v1.IListDatabasesResponse]>; | ||
listDatabases(request: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options: gax.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; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Equivalent to {@link listDatabases}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listDatabases} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -237,9 +243,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Database]{@link google.spanner.admin.database.v1.Database} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listDatabasesAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listDatabasesStream(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: gax.CallOptions): Transform; | ||
listDatabasesStream(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listDatabases}, but returns an iterable object. | ||
* Equivalent to `listDatabases`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -260,21 +272,21 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Database]{@link google.spanner.admin.database.v1.Database}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listDatabasesAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listDatabasesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabase>; | ||
listBackups(request: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.database.v1.IBackup[], protos.google.spanner.admin.database.v1.IListBackupsRequest | null, protos.google.spanner.admin.database.v1.IListBackupsResponse]>; | ||
listBackups(request: protos.google.spanner.admin.database.v1.IListBackupsRequest, options: gax.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; | ||
listDatabasesAsync(request?: protos.google.spanner.admin.database.v1.IListDatabasesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IDatabase>; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Equivalent to {@link listBackups}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listBackups} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -332,9 +344,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Backup]{@link google.spanner.admin.database.v1.Backup} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listBackupsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listBackupsStream(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: gax.CallOptions): Transform; | ||
listBackupsStream(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listBackups}, but returns an iterable object. | ||
* Equivalent to `listBackups`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -391,21 +409,21 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Backup]{@link google.spanner.admin.database.v1.Backup}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listBackupsAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listBackupsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IBackup>; | ||
listDatabaseOperations(request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: gax.CallOptions): Promise<[protos.google.longrunning.IOperation[], protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest | null, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse]>; | ||
listDatabaseOperations(request: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, protos.google.spanner.admin.database.v1.IListDatabaseOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void; | ||
listBackupsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.database.v1.IBackup>; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Equivalent to {@link listDatabaseOperations}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listDatabaseOperations} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -469,9 +487,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Operation]{@link google.longrunning.Operation} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listDatabaseOperationsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listDatabaseOperationsStream(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: gax.CallOptions): Transform; | ||
listDatabaseOperationsStream(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listDatabaseOperations}, but returns an iterable object. | ||
* Equivalent to `listDatabaseOperations`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -534,21 +558,21 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Operation]{@link google.longrunning.Operation}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listDatabaseOperationsAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listDatabaseOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>; | ||
listBackupOperations(request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: gax.CallOptions): Promise<[protos.google.longrunning.IOperation[], protos.google.spanner.admin.database.v1.IListBackupOperationsRequest | null, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse]>; | ||
listBackupOperations(request: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, protos.google.spanner.admin.database.v1.IListBackupOperationsResponse | null | undefined, protos.google.longrunning.IOperation>): void; | ||
listDatabaseOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListDatabaseOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>; | ||
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]>; | ||
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; | ||
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; | ||
/** | ||
* Equivalent to {@link listBackupOperations}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listBackupOperations} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -610,9 +634,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Operation]{@link google.longrunning.Operation} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listBackupOperationsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listBackupOperationsStream(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: gax.CallOptions): Transform; | ||
listBackupOperationsStream(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listBackupOperations}, but returns an iterable object. | ||
* Equivalent to `listBackupOperations`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -673,5 +703,16 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Operation]{@link google.longrunning.Operation}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listBackupOperationsAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listBackupOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>; | ||
listBackupOperationsAsync(request?: protos.google.spanner.admin.database.v1.IListBackupOperationsRequest, options?: CallOptions): AsyncIterable<protos.google.longrunning.IOperation>; | ||
/** | ||
@@ -768,7 +809,8 @@ * Return a fully-qualified backup resource name string. | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
* Terminate the gRPC channel and close the client. | ||
* | ||
* The client will no longer be usable and all future behavior is undefined. | ||
* @returns {Promise} A promise that resolves when the client is closed. | ||
*/ | ||
close(): Promise<void>; | ||
} |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -53,4 +53,6 @@ import * as protos from '../../protos/protos'; | ||
* | ||
* @param {object} [options] - The configuration object. See the subsequent | ||
* parameters for more details. | ||
* @param {object} [options] - The configuration object. | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
* @param {object} [options.credentials] - Credentials object. | ||
@@ -75,2 +77,9 @@ * @param {string} [options.credentials.client_email] | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
*/ | ||
@@ -94,2 +103,3 @@ constructor(opts?: ClientOptions); | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -100,2 +110,3 @@ static get servicePath(): string; | ||
* exists for compatibility reasons. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -105,2 +116,3 @@ static get apiEndpoint(): string; | ||
* The port for this API service. | ||
* @returns {number} The default port for this service. | ||
*/ | ||
@@ -111,2 +123,3 @@ static get port(): number; | ||
* in this service. | ||
* @returns {string[]} List of default scopes. | ||
*/ | ||
@@ -116,25 +129,25 @@ static get scopes(): string[]; | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstanceConfig, (protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | undefined), {} | undefined]>; | ||
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void; | ||
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstanceConfig, (protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | undefined), {} | undefined]>; | ||
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void; | ||
getInstanceConfig(request: protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest, callback: Callback<protos.google.spanner.admin.instance.v1.IInstanceConfig, protos.google.spanner.admin.instance.v1.IGetInstanceConfigRequest | null | undefined, {} | null | undefined>): void; | ||
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | undefined, {} | undefined]>; | ||
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void; | ||
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | undefined, {} | undefined]>; | ||
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, options: CallOptions, callback: Callback<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void; | ||
getInstance(request: protos.google.spanner.admin.instance.v1.IGetInstanceRequest, callback: Callback<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IGetInstanceRequest | null | undefined, {} | null | undefined>): void; | ||
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | undefined), {} | undefined]>; | ||
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>): void; | ||
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | undefined), {} | undefined]>; | ||
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>): void; | ||
deleteInstance(request: protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.admin.instance.v1.IDeleteInstanceRequest | null | undefined, {} | null | undefined>): void; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined]>; | ||
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; | ||
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined]>; | ||
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; | ||
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: gax.CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: gax.CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined]>; | ||
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; | ||
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void; | ||
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
createInstance(request: protos.google.spanner.admin.instance.v1.ICreateInstanceRequest, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.ICreateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the createInstance() method. | ||
* Check the status of the long running operation returned by `createInstance()`. | ||
* @param {String} name | ||
@@ -144,16 +157,17 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkCreateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkCreateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
checkCreateInstanceProgress(name: string): Promise<LROperation<protos.google.spanner.admin.instance.v1.Instance, protos.google.spanner.admin.instance.v1.CreateInstanceMetadata>>; | ||
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options?: gax.CallOptions): Promise<[LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options: gax.CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options?: CallOptions): Promise<[LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined]>; | ||
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, options: CallOptions, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
updateInstance(request: protos.google.spanner.admin.instance.v1.IUpdateInstanceRequest, callback: Callback<LROperation<protos.google.spanner.admin.instance.v1.IInstance, protos.google.spanner.admin.instance.v1.IUpdateInstanceMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void; | ||
/** | ||
* Check the status of the long running operation returned by the updateInstance() method. | ||
* Check the status of the long running operation returned by `updateInstance()`. | ||
* @param {String} name | ||
@@ -163,27 +177,17 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkUpdateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkUpdateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
checkUpdateInstanceProgress(name: string): Promise<LROperation<protos.google.spanner.admin.instance.v1.Instance, protos.google.spanner.admin.instance.v1.UpdateInstanceMetadata>>; | ||
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstanceConfig[], protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest | null, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse]>; | ||
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; | ||
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstanceConfig[], protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest | null, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse]>; | ||
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; | ||
listInstanceConfigs(request: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, protos.google.spanner.admin.instance.v1.IListInstanceConfigsResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstanceConfig>): void; | ||
/** | ||
* Equivalent to {@link listInstanceConfigs}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listInstanceConfigs} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -206,9 +210,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listInstanceConfigsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listInstanceConfigsStream(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: gax.CallOptions): Transform; | ||
listInstanceConfigsStream(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listInstanceConfigs}, but returns an iterable object. | ||
* Equivalent to `listInstanceConfigs`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -230,21 +240,21 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listInstanceConfigsAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listInstanceConfigsAsync(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.spanner.admin.instance.v1.IInstanceConfig>; | ||
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstance[], protos.google.spanner.admin.instance.v1.IListInstancesRequest | null, protos.google.spanner.admin.instance.v1.IListInstancesResponse]>; | ||
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstancesRequest, protos.google.spanner.admin.instance.v1.IListInstancesResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstance>): void; | ||
listInstanceConfigsAsync(request?: protos.google.spanner.admin.instance.v1.IListInstanceConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.instance.v1.IInstanceConfig>; | ||
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: CallOptions): Promise<[protos.google.spanner.admin.instance.v1.IInstance[], protos.google.spanner.admin.instance.v1.IListInstancesRequest | null, protos.google.spanner.admin.instance.v1.IListInstancesResponse]>; | ||
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstancesRequest, protos.google.spanner.admin.instance.v1.IListInstancesResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstance>): void; | ||
listInstances(request: protos.google.spanner.admin.instance.v1.IListInstancesRequest, callback: PaginationCallback<protos.google.spanner.admin.instance.v1.IListInstancesRequest, protos.google.spanner.admin.instance.v1.IListInstancesResponse | null | undefined, protos.google.spanner.admin.instance.v1.IInstance>): void; | ||
/** | ||
* Equivalent to {@link listInstances}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listInstances} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -286,9 +296,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Instance]{@link google.spanner.admin.instance.v1.Instance} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listInstancesAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listInstancesStream(request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: gax.CallOptions): Transform; | ||
listInstancesStream(request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listInstances}, but returns an iterable object. | ||
* Equivalent to `listInstances`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -329,5 +345,16 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Instance]{@link google.spanner.admin.instance.v1.Instance}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listInstancesAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listInstancesAsync(request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: gax.CallOptions): AsyncIterable<protos.google.spanner.admin.instance.v1.IInstance>; | ||
listInstancesAsync(request?: protos.google.spanner.admin.instance.v1.IListInstancesRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.admin.instance.v1.IInstance>; | ||
/** | ||
@@ -397,7 +424,8 @@ * Return a fully-qualified instance resource name string. | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
* Terminate the gRPC channel and close the client. | ||
* | ||
* The client will no longer be usable and all future behavior is undefined. | ||
* @returns {Promise} A promise that resolves when the client is closed. | ||
*/ | ||
close(): Promise<void>; | ||
} |
@@ -21,4 +21,10 @@ "use strict"; | ||
exports.InstanceAdminClient = void 0; | ||
/* global window */ | ||
const gax = require("google-gax"); | ||
const path = require("path"); | ||
/** | ||
* Client JSON configuration object, loaded from | ||
* `src/v1/instance_admin_client_config.json`. | ||
* This file defines retry strategy and timeouts for all API methods in this library. | ||
*/ | ||
const gapicConfig = require("./instance_admin_client_config.json"); | ||
@@ -56,4 +62,6 @@ const google_gax_1 = require("google-gax"); | ||
* | ||
* @param {object} [options] - The configuration object. See the subsequent | ||
* parameters for more details. | ||
* @param {object} [options] - The configuration object. | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
* @param {object} [options.credentials] - Credentials object. | ||
@@ -78,4 +86,12 @@ * @param {string} [options.credentials.client_email] | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
*/ | ||
constructor(opts) { | ||
var _a, _b; | ||
this._terminated = false; | ||
@@ -88,30 +104,16 @@ this.descriptors = { | ||
}; | ||
// Ensure that options include the service address and port. | ||
// Ensure that options include all the required fields. | ||
const staticMembers = this.constructor; | ||
const servicePath = opts && opts.servicePath | ||
? opts.servicePath | ||
: opts && opts.apiEndpoint | ||
? opts.apiEndpoint | ||
: staticMembers.servicePath; | ||
const port = opts && opts.port ? opts.port : staticMembers.port; | ||
if (!opts) { | ||
opts = { servicePath, port }; | ||
const servicePath = (opts === null || opts === void 0 ? void 0 : opts.servicePath) || (opts === null || opts === void 0 ? void 0 : opts.apiEndpoint) || staticMembers.servicePath; | ||
const port = (opts === null || opts === void 0 ? void 0 : opts.port) || staticMembers.port; | ||
const clientConfig = (_a = opts === null || opts === void 0 ? void 0 : opts.clientConfig) !== null && _a !== void 0 ? _a : {}; | ||
const fallback = (_b = opts === null || opts === void 0 ? void 0 : opts.fallback) !== null && _b !== void 0 ? _b : (typeof window !== 'undefined' && typeof (window === null || window === void 0 ? void 0 : window.fetch) === 'function'); | ||
opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); | ||
// If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. | ||
if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { | ||
opts['scopes'] = staticMembers.scopes; | ||
} | ||
opts.servicePath = opts.servicePath || servicePath; | ||
opts.port = opts.port || port; | ||
// users can override the config from client side, like retry codes name. | ||
// The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 | ||
// The way to override client config for Showcase API: | ||
// | ||
// const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} | ||
// const showcaseClient = new showcaseClient({ projectId, customConfig }); | ||
opts.clientConfig = opts.clientConfig || {}; | ||
// If we're running in browser, it's OK to omit `fallback` since | ||
// google-gax has `browser` field in its `package.json`. | ||
// For Electron (which does not respect `browser` field), | ||
// pass `{fallback: true}` to the InstanceAdminClient constructor. | ||
// Choose either gRPC or proto-over-HTTP implementation of google-gax. | ||
this._gaxModule = opts.fallback ? gax.fallback : gax; | ||
// Create a `gaxGrpc` object, with any grpc-specific options | ||
// sent to the client. | ||
opts.scopes = this.constructor.scopes; | ||
// Create a `gaxGrpc` object, with any grpc-specific options sent to the client. | ||
this._gaxGrpc = new this._gaxModule.GrpcClient(opts); | ||
@@ -122,2 +124,6 @@ // Save options to use in initialize() method. | ||
this.auth = this._gaxGrpc.auth; | ||
// Set the default scopes in auth client if needed. | ||
if (servicePath === staticMembers.servicePath) { | ||
this.auth.defaultScopes = staticMembers.scopes; | ||
} | ||
// Determine the client header string. | ||
@@ -245,2 +251,3 @@ const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -253,2 +260,3 @@ static get servicePath() { | ||
* exists for compatibility reasons. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -260,2 +268,3 @@ static get apiEndpoint() { | ||
* The port for this API service. | ||
* @returns {number} The default port for this service. | ||
*/ | ||
@@ -268,2 +277,3 @@ static get port() { | ||
* in this service. | ||
* @returns {string[]} List of default scopes. | ||
*/ | ||
@@ -278,4 +288,3 @@ static get scopes() { | ||
* Return the project ID used by this class. | ||
* @param {function(Error, string)} callback - the callback to | ||
* be called with the current project Id. | ||
* @returns {Promise} A promise that resolves to string containing the project ID. | ||
*/ | ||
@@ -301,3 +310,7 @@ getProjectId(callback) { | ||
* The first element of the array is an object representing [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.getInstanceConfig(request); | ||
*/ | ||
@@ -339,3 +352,7 @@ getInstanceConfig(request, optionsOrCallback, callback) { | ||
* The first element of the array is an object representing [Instance]{@link google.spanner.admin.instance.v1.Instance}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.getInstance(request); | ||
*/ | ||
@@ -383,3 +400,7 @@ getInstance(request, optionsOrCallback, callback) { | ||
* The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.deleteInstance(request); | ||
*/ | ||
@@ -426,3 +447,7 @@ deleteInstance(request, optionsOrCallback, callback) { | ||
* The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.setIamPolicy(request); | ||
*/ | ||
@@ -467,3 +492,7 @@ setIamPolicy(request, optionsOrCallback, callback) { | ||
* The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.getIamPolicy(request); | ||
*/ | ||
@@ -511,3 +540,7 @@ getIamPolicy(request, optionsOrCallback, callback) { | ||
* The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) | ||
* for more details and examples. | ||
* @example | ||
* const [response] = await client.testIamPermissions(request); | ||
*/ | ||
@@ -584,4 +617,11 @@ testIamPermissions(request, optionsOrCallback, callback) { | ||
* @returns {Promise} - The promise which resolves to an array. | ||
* The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* The first element of the array is an object representing | ||
* a long running operation. Its `promise()` method returns a promise | ||
* you can `await` for. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const [operation] = await client.createInstance(request); | ||
* const [response] = await operation.promise(); | ||
*/ | ||
@@ -608,3 +648,3 @@ createInstance(request, optionsOrCallback, callback) { | ||
/** | ||
* Check the status of the long running operation returned by the createInstance() method. | ||
* Check the status of the long running operation returned by `createInstance()`. | ||
* @param {String} name | ||
@@ -614,9 +654,10 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkCreateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkCreateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
@@ -684,4 +725,11 @@ async checkCreateInstanceProgress(name) { | ||
* @returns {Promise} - The promise which resolves to an array. | ||
* The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* The first element of the array is an object representing | ||
* a long running operation. Its `promise()` method returns a promise | ||
* you can `await` for. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const [operation] = await client.updateInstance(request); | ||
* const [response] = await operation.promise(); | ||
*/ | ||
@@ -708,3 +756,3 @@ updateInstance(request, optionsOrCallback, callback) { | ||
/** | ||
* Check the status of the long running operation returned by the updateInstance() method. | ||
* Check the status of the long running operation returned by `updateInstance()`. | ||
* @param {String} name | ||
@@ -714,9 +762,10 @@ * The operation name that will be passed. | ||
* The decoded operation object has result and metadata field to get information from. | ||
* | ||
* @example: | ||
* const decodedOperation = await checkUpdateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
* | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) | ||
* for more details and examples. | ||
* @example | ||
* const decodedOperation = await checkUpdateInstanceProgress(name); | ||
* console.log(decodedOperation.result); | ||
* console.log(decodedOperation.done); | ||
* console.log(decodedOperation.metadata); | ||
*/ | ||
@@ -749,15 +798,10 @@ async checkUpdateInstanceProgress(name) { | ||
* The first element of the array is Array of [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}. | ||
* The client library support auto-pagination by default: it will call the API as many | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed and will merge results from all the pages into this array. | ||
* | ||
* When autoPaginate: false is specified through options, the array has three elements. | ||
* The first element is Array of [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig} that corresponds to | ||
* the one page received from the API server. | ||
* If the second element is not null it contains the request object of type [ListInstanceConfigsRequest]{@link google.spanner.admin.instance.v1.ListInstanceConfigsRequest} | ||
* that can be used to obtain the next page of the results. | ||
* If it is null, the next page does not exist. | ||
* The third element contains the raw response received from the API server. Its type is | ||
* [ListInstanceConfigsResponse]{@link google.spanner.admin.instance.v1.ListInstanceConfigsResponse}. | ||
* | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Note that it can affect your quota. | ||
* We recommend using `listInstanceConfigsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
@@ -784,14 +828,3 @@ listInstanceConfigs(request, optionsOrCallback, callback) { | ||
/** | ||
* Equivalent to {@link listInstanceConfigs}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listInstanceConfigs} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -814,2 +847,9 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listInstanceConfigsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
@@ -829,6 +869,5 @@ listInstanceConfigsStream(request, options) { | ||
/** | ||
* Equivalent to {@link listInstanceConfigs}, but returns an iterable object. | ||
* Equivalent to `listInstanceConfigs`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -850,3 +889,14 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [InstanceConfig]{@link google.spanner.admin.instance.v1.InstanceConfig}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listInstanceConfigsAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
@@ -905,15 +955,10 @@ listInstanceConfigsAsync(request, options) { | ||
* The first element of the array is Array of [Instance]{@link google.spanner.admin.instance.v1.Instance}. | ||
* The client library support auto-pagination by default: it will call the API as many | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed and will merge results from all the pages into this array. | ||
* | ||
* When autoPaginate: false is specified through options, the array has three elements. | ||
* The first element is Array of [Instance]{@link google.spanner.admin.instance.v1.Instance} that corresponds to | ||
* the one page received from the API server. | ||
* If the second element is not null it contains the request object of type [ListInstancesRequest]{@link google.spanner.admin.instance.v1.ListInstancesRequest} | ||
* that can be used to obtain the next page of the results. | ||
* If it is null, the next page does not exist. | ||
* The third element contains the raw response received from the API server. Its type is | ||
* [ListInstancesResponse]{@link google.spanner.admin.instance.v1.ListInstancesResponse}. | ||
* | ||
* The promise has a method named "cancel" which cancels the ongoing API call. | ||
* Note that it can affect your quota. | ||
* We recommend using `listInstancesAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
@@ -940,14 +985,3 @@ listInstances(request, optionsOrCallback, callback) { | ||
/** | ||
* Equivalent to {@link listInstances}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listInstances} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -989,2 +1023,9 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Instance]{@link google.spanner.admin.instance.v1.Instance} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listInstancesAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
@@ -1004,6 +1045,5 @@ listInstancesStream(request, options) { | ||
/** | ||
* Equivalent to {@link listInstances}, but returns an iterable object. | ||
* Equivalent to `listInstances`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -1044,3 +1084,14 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Instance]{@link google.spanner.admin.instance.v1.Instance}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listInstancesAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
@@ -1151,5 +1202,6 @@ listInstancesAsync(request, options) { | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
* Terminate the gRPC channel and close the client. | ||
* | ||
* The client will no longer be usable and all future behavior is undefined. | ||
* @returns {Promise} A promise that resolves when the client is closed. | ||
*/ | ||
@@ -1156,0 +1208,0 @@ close() { |
/// <reference types="node" /> | ||
import * as gax from 'google-gax'; | ||
import { Callback, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax'; | ||
import { Transform } from 'stream'; | ||
@@ -35,4 +35,6 @@ import * as protos from '../../protos/protos'; | ||
* | ||
* @param {object} [options] - The configuration object. See the subsequent | ||
* parameters for more details. | ||
* @param {object} [options] - The configuration object. | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
* @param {object} [options.credentials] - Credentials object. | ||
@@ -57,2 +59,9 @@ * @param {string} [options.credentials.client_email] | ||
* API remote host. | ||
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
*/ | ||
@@ -76,2 +85,3 @@ constructor(opts?: ClientOptions); | ||
* The DNS address for this API service. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -82,2 +92,3 @@ static get servicePath(): string; | ||
* exists for compatibility reasons. | ||
* @returns {string} The DNS address for this service. | ||
*/ | ||
@@ -87,2 +98,3 @@ static get apiEndpoint(): string; | ||
* The port for this API service. | ||
* @returns {number} The default port for this service. | ||
*/ | ||
@@ -93,2 +105,3 @@ static get port(): number; | ||
* in this service. | ||
* @returns {string[]} List of default scopes. | ||
*/ | ||
@@ -98,37 +111,37 @@ static get scopes(): string[]; | ||
getProjectId(callback: Callback<string, undefined, undefined>): void; | ||
createSession(request: protos.google.spanner.v1.ICreateSessionRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | undefined, {} | undefined]>; | ||
createSession(request: protos.google.spanner.v1.ICreateSessionRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | null | undefined, {} | null | undefined>): void; | ||
createSession(request: protos.google.spanner.v1.ICreateSessionRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | undefined, {} | undefined]>; | ||
createSession(request: protos.google.spanner.v1.ICreateSessionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | null | undefined, {} | null | undefined>): void; | ||
createSession(request: protos.google.spanner.v1.ICreateSessionRequest, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | null | undefined, {} | null | undefined>): void; | ||
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | undefined, {} | undefined]>; | ||
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void; | ||
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | undefined, {} | undefined]>; | ||
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void; | ||
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void; | ||
getSession(request: protos.google.spanner.v1.IGetSessionRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | undefined, {} | undefined]>; | ||
getSession(request: protos.google.spanner.v1.IGetSessionRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void; | ||
getSession(request: protos.google.spanner.v1.IGetSessionRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | undefined, {} | undefined]>; | ||
getSession(request: protos.google.spanner.v1.IGetSessionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void; | ||
getSession(request: protos.google.spanner.v1.IGetSessionRequest, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void; | ||
deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | undefined, {} | undefined]>; | ||
deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | null | undefined, {} | null | undefined>): void; | ||
deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | undefined, {} | undefined]>; | ||
deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | null | undefined, {} | null | undefined>): void; | ||
deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | null | undefined, {} | null | undefined>): void; | ||
executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | undefined, {} | undefined]>; | ||
executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void; | ||
executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | undefined, {} | undefined]>; | ||
executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void; | ||
executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void; | ||
executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | undefined, {} | undefined]>; | ||
executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | null | undefined, {} | null | undefined>): void; | ||
executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | undefined, {} | undefined]>; | ||
executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | null | undefined, {} | null | undefined>): void; | ||
executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, callback: Callback<protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | null | undefined, {} | null | undefined>): void; | ||
read(request: protos.google.spanner.v1.IReadRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | undefined, {} | undefined]>; | ||
read(request: protos.google.spanner.v1.IReadRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | null | undefined, {} | null | undefined>): void; | ||
read(request: protos.google.spanner.v1.IReadRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | undefined, {} | undefined]>; | ||
read(request: protos.google.spanner.v1.IReadRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | null | undefined, {} | null | undefined>): void; | ||
read(request: protos.google.spanner.v1.IReadRequest, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | undefined, {} | undefined]>; | ||
beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | undefined, {} | undefined]>; | ||
beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, callback: Callback<protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.spanner.v1.ICommitRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | undefined, {} | undefined]>; | ||
commit(request: protos.google.spanner.v1.ICommitRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.spanner.v1.ICommitRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | undefined, {} | undefined]>; | ||
commit(request: protos.google.spanner.v1.ICommitRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
commit(request: protos.google.spanner.v1.ICommitRequest, callback: Callback<protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.spanner.v1.IRollbackRequest, options?: gax.CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | undefined, {} | undefined]>; | ||
rollback(request: protos.google.spanner.v1.IRollbackRequest, options: gax.CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.spanner.v1.IRollbackRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | undefined, {} | undefined]>; | ||
rollback(request: protos.google.spanner.v1.IRollbackRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
rollback(request: protos.google.spanner.v1.IRollbackRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void; | ||
partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | undefined, {} | undefined]>; | ||
partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | null | undefined, {} | null | undefined>): void; | ||
partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | undefined, {} | undefined]>; | ||
partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | null | undefined, {} | null | undefined>): void; | ||
partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | null | undefined, {} | null | undefined>): void; | ||
partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | undefined, {} | undefined]>; | ||
partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, options: gax.CallOptions, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | null | undefined, {} | null | undefined>): void; | ||
partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | undefined, {} | undefined]>; | ||
partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | null | undefined, {} | null | undefined>): void; | ||
partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -214,4 +227,11 @@ /** | ||
* An object stream which emits [PartialResultSet]{@link google.spanner.v1.PartialResultSet} on 'data' event. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) | ||
* for more details and examples. | ||
* @example | ||
* const stream = client.executeStreamingSql(request); | ||
* stream.on('data', (response) => { ... }); | ||
* stream.on('end', () => { ... }); | ||
*/ | ||
executeStreamingSql(request?: protos.google.spanner.v1.IExecuteSqlRequest, options?: gax.CallOptions): gax.CancellableStream; | ||
executeStreamingSql(request?: protos.google.spanner.v1.IExecuteSqlRequest, options?: CallOptions): gax.CancellableStream; | ||
/** | ||
@@ -273,20 +293,16 @@ * Like {@link google.spanner.v1.Spanner.Read|Read}, except returns the result set as a | ||
* An object stream which emits [PartialResultSet]{@link google.spanner.v1.PartialResultSet} on 'data' event. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming) | ||
* for more details and examples. | ||
* @example | ||
* const stream = client.streamingRead(request); | ||
* stream.on('data', (response) => { ... }); | ||
* stream.on('end', () => { ... }); | ||
*/ | ||
streamingRead(request?: protos.google.spanner.v1.IReadRequest, options?: gax.CallOptions): gax.CancellableStream; | ||
listSessions(request: protos.google.spanner.v1.IListSessionsRequest, options?: gax.CallOptions): Promise<[protos.google.spanner.v1.ISession[], protos.google.spanner.v1.IListSessionsRequest | null, protos.google.spanner.v1.IListSessionsResponse]>; | ||
listSessions(request: protos.google.spanner.v1.IListSessionsRequest, options: gax.CallOptions, callback: PaginationCallback<protos.google.spanner.v1.IListSessionsRequest, protos.google.spanner.v1.IListSessionsResponse | null | undefined, protos.google.spanner.v1.ISession>): void; | ||
streamingRead(request?: protos.google.spanner.v1.IReadRequest, options?: CallOptions): gax.CancellableStream; | ||
listSessions(request: protos.google.spanner.v1.IListSessionsRequest, options?: CallOptions): Promise<[protos.google.spanner.v1.ISession[], protos.google.spanner.v1.IListSessionsRequest | null, protos.google.spanner.v1.IListSessionsResponse]>; | ||
listSessions(request: protos.google.spanner.v1.IListSessionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.v1.IListSessionsRequest, protos.google.spanner.v1.IListSessionsResponse | null | undefined, protos.google.spanner.v1.ISession>): void; | ||
listSessions(request: protos.google.spanner.v1.IListSessionsRequest, callback: PaginationCallback<protos.google.spanner.v1.IListSessionsRequest, protos.google.spanner.v1.IListSessionsResponse | null | undefined, protos.google.spanner.v1.ISession>): void; | ||
/** | ||
* Equivalent to {@link listSessions}, but returns a NodeJS Stream object. | ||
* | ||
* This fetches the paged responses for {@link listSessions} continuously | ||
* and invokes the callback registered for 'data' event for each element in the | ||
* responses. | ||
* | ||
* The returned object has 'end' method when no more elements are required. | ||
* | ||
* autoPaginate option will be ignored. | ||
* | ||
* @see {@link https://nodejs.org/api/stream.html} | ||
* | ||
* Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. | ||
* @param {Object} request | ||
@@ -318,9 +334,15 @@ * The request object that will be sent. | ||
* An object stream which emits an object representing [Session]{@link google.spanner.v1.Session} on 'data' event. | ||
* The client library will perform auto-pagination by default: it will call the API as many | ||
* times as needed. Note that it can affect your quota. | ||
* We recommend using `listSessionsAsync()` | ||
* method described below for async iteration which you can stop as needed. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
*/ | ||
listSessionsStream(request?: protos.google.spanner.v1.IListSessionsRequest, options?: gax.CallOptions): Transform; | ||
listSessionsStream(request?: protos.google.spanner.v1.IListSessionsRequest, options?: CallOptions): Transform; | ||
/** | ||
* Equivalent to {@link listSessions}, but returns an iterable object. | ||
* Equivalent to `listSessions`, but returns an iterable object. | ||
* | ||
* for-await-of syntax is used with the iterable to recursively get response element on-demand. | ||
* | ||
* `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. | ||
* @param {Object} request | ||
@@ -351,5 +373,16 @@ * The request object that will be sent. | ||
* @returns {Object} | ||
* An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. | ||
* An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). | ||
* When you iterate the returned iterable, each element will be an object representing | ||
* [Session]{@link google.spanner.v1.Session}. The API will be called under the hood as needed, once per the page, | ||
* so you can stop the iteration when you don't need more results. | ||
* Please see the | ||
* [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) | ||
* for more details and examples. | ||
* @example | ||
* const iterable = client.listSessionsAsync(request); | ||
* for await (const response of iterable) { | ||
* // process response | ||
* } | ||
*/ | ||
listSessionsAsync(request?: protos.google.spanner.v1.IListSessionsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.spanner.v1.ISession>; | ||
listSessionsAsync(request?: protos.google.spanner.v1.IListSessionsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.v1.ISession>; | ||
/** | ||
@@ -431,7 +464,8 @@ * Return a fully-qualified database resource name string. | ||
/** | ||
* Terminate the GRPC channel and close the client. | ||
* Terminate the gRPC channel and close the client. | ||
* | ||
* The client will no longer be usable and all future behavior is undefined. | ||
* @returns {Promise} A promise that resolves when the client is closed. | ||
*/ | ||
close(): Promise<void>; | ||
} |
@@ -7,2 +7,19 @@ # Changelog | ||
## [5.4.0](https://www.github.com/googleapis/nodejs-spanner/compare/v5.3.0...v5.4.0) (2020-12-02) | ||
### Features | ||
* support callbacks with database getRestoreInfo(), getState(), getOperations() ([#1230](https://www.github.com/googleapis/nodejs-spanner/issues/1230)) ([b56758b](https://www.github.com/googleapis/nodejs-spanner/commit/b56758b0e832c6471d14bd88b4580d21d5696fdd)) | ||
### Bug Fixes | ||
* **browser:** check for fetch on window ([32ac608](https://www.github.com/googleapis/nodejs-spanner/commit/32ac6082383d5265f5022d97f23173e8786f4a82)) | ||
* do not modify options object, use defaultScopes ([#1264](https://www.github.com/googleapis/nodejs-spanner/issues/1264)) ([6628c6a](https://www.github.com/googleapis/nodejs-spanner/commit/6628c6a81d427b8bb8bb1a42ae63f991b1cf73c9)) | ||
* **deps:** update dependency big.js to v6 ([#1244](https://www.github.com/googleapis/nodejs-spanner/issues/1244)) ([259a51e](https://www.github.com/googleapis/nodejs-spanner/commit/259a51ee0726aa8f0b7717acd5253ecb77b16038)) | ||
* do not create sessions after getDatabases call ([#1228](https://www.github.com/googleapis/nodejs-spanner/issues/1228)) ([53d5f37](https://www.github.com/googleapis/nodejs-spanner/commit/53d5f371d54c64dd095ac9ec721d05adf2c7d064)) | ||
* **deps:** update dependency @google-cloud/precise-date to v2 ([#1240](https://www.github.com/googleapis/nodejs-spanner/issues/1240)) ([38dfec2](https://www.github.com/googleapis/nodejs-spanner/commit/38dfec22dd00f4d69750fc20e66c2395a9c6d3b3)) | ||
* **deps:** update dependency yargs to v16 ([#1233](https://www.github.com/googleapis/nodejs-spanner/issues/1233)) ([75fd09a](https://www.github.com/googleapis/nodejs-spanner/commit/75fd09acb5a9a728a8b6403f44351e4b9b44b723)) | ||
## [5.3.0](https://www.github.com/googleapis/nodejs-spanner/compare/v5.2.1...v5.3.0) (2020-09-04) | ||
@@ -9,0 +26,0 @@ |
{ | ||
"name": "@google-cloud/spanner", | ||
"description": "Cloud Spanner Client Library for Node.js", | ||
"version": "5.3.0", | ||
"version": "5.4.0", | ||
"license": "Apache-2.0", | ||
@@ -58,6 +58,6 @@ "author": "Google Inc.", | ||
"@google-cloud/promisify": "^2.0.0", | ||
"@types/big.js": "^4.0.5", | ||
"@types/big.js": "^6.0.0", | ||
"@types/stack-trace": "0.0.29", | ||
"arrify": "^2.0.0", | ||
"big.js": "^5.2.2", | ||
"big.js": "^6.0.0", | ||
"checkpoint-stream": "^0.1.1", | ||
@@ -67,3 +67,3 @@ "events-intercept": "^2.0.0", | ||
"google-auth-library": "^6.0.0", | ||
"google-gax": "^2.7.0", | ||
"google-gax": "^2.9.2", | ||
"grpc-gcp": "^0.3.2", | ||
@@ -82,3 +82,4 @@ "is": "^3.2.1", | ||
"@grpc/proto-loader": "^0.5.1", | ||
"@types/big.js": "^4.0.5", | ||
"@microsoft/api-documenter": "^7.8.10", | ||
"@microsoft/api-extractor": "^7.8.10", | ||
"@types/concat-stream": "^1.6.0", | ||
@@ -123,6 +124,4 @@ "@types/extend": "^3.0.0", | ||
"uuid": "^8.0.0", | ||
"yargs": "^15.0.0", | ||
"@microsoft/api-documenter": "^7.8.10", | ||
"@microsoft/api-extractor": "^7.8.10" | ||
"yargs": "^16.0.0" | ||
} | ||
} |
@@ -109,2 +109,5 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
| Instance | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/instance.js,samples/README.md) | | ||
| Numeric-add-column | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/numeric-add-column.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-add-column.js,samples/README.md) | | ||
| Numeric-query-parameter | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/numeric-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-query-parameter.js,samples/README.md) | | ||
| Numeric-update-data | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/numeric-update-data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/numeric-update-data.js,samples/README.md) | | ||
| Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) | | ||
@@ -128,3 +131,3 @@ | Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | ||
Client libraries targetting some end-of-life versions of Node.js are available, and | ||
Client libraries targeting some end-of-life versions of Node.js are available, and | ||
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). | ||
@@ -131,0 +134,0 @@ The dist-tags follow the naming convention `legacy-(version)`. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5102791
1.01%43
-2.27%81993
1.03%187
1.63%