How to use the google-gax.GoogleProtoFilesRoot function in google-gax

To help you get started, we’ve selected a few google-gax examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-logging / src / v2 / logging_service_v2_client.js View on Github external
'pageToken',
        'nextPageToken',
        'entries'
      ),
      listMonitoredResourceDescriptors: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'resourceDescriptors'
      ),
      listLogs: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'logNames'
      ),
    };
    var protoFilesRoot = new gax.GoogleProtoFilesRoot();
    protoFilesRoot = protobuf.loadSync(
      path.join(
        __dirname,
        '..',
        '..',
        'protos',
        'google/logging/v2/logging.proto'
      ),
      protoFilesRoot
    );

    // Some methods on this API support automatically batching
    // requests; denote this.
    this._descriptors.batching = {
      writeLogEntries: new gax.BundleDescriptor(
        'entries',
github googleapis / nodejs-spanner / src / transaction.ts View on Github external
/**
 * Metadata retry info key.
 *
 * @private
 */
const RETRY_INFO_KEY = 'google.rpc.retryinfo-bin';

/**
 * Default timeout for Transactions.
 *
 * @private
 */
const DEFAULT_TRANSACTION_TIMEOUT = config.methods.Commit.timeout_millis;

const root = new gax.GoogleProtoFilesRoot();
const protoFilesRoot = protobuf.loadSync(
    path.join(__dirname, '..', 'protos', 'google/rpc/error_details.proto'),
    root);

// tslint:disable-next-line variable-name
const RetryInfo = protoFilesRoot.lookup('google.rpc.RetryInfo');

/**
 * Read/write transaction options.
 *
 * @typedef {object} TransactionOptions
 * @property {number} [timeout=3600000] Specify a timeout (in milliseconds) for
 *     the transaction. The transaction will be ran in its entirety, however if
 *     an abort error is returned the transaction will be retried if the timeout
 *     has not been met.
 * @property {boolean} [readOnly=false] Specifies if the transaction is