How to use the google-gax.PageDescriptor 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 / config_service_v2_client.js View on Github external
// This API contains "path templates"; forward-slash-separated
    // identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      projectPathTemplate: new gax.PathTemplate('projects/{project}'),
      sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'),
      exclusionPathTemplate: new gax.PathTemplate(
        'projects/{project}/exclusions/{exclusion}'
      ),
    };

    // Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listSinks: new gax.PageDescriptor('pageToken', 'nextPageToken', 'sinks'),
      listExclusions: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'exclusions'
      ),
    };

    // Put together the default options sent with requests.
    var defaults = gaxGrpc.constructSettings(
      'google.logging.v2.ConfigServiceV2',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
github googleapis / nodejs-dlp / src / v2 / dlp_service_client.js View on Github external
// Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listInspectTemplates: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'inspectTemplates'
      ),
      listDeidentifyTemplates: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'deidentifyTemplates'
      ),
      listDlpJobs: new gax.PageDescriptor('pageToken', 'nextPageToken', 'jobs'),
      listJobTriggers: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'jobTriggers'
      ),
      listStoredInfoTypes: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'storedInfoTypes'
      ),
    };

    // Put together the default options sent with requests.
    const defaults = gaxGrpc.constructSettings(
      'google.privacy.dlp.v2.DlpService',
      gapicConfig,
github googleapis / google-cloud-node / packages / spanner / src / admin / instance / v1 / instance_admin_client.js View on Github external
/* TODO: introduce line-wrapping so that it never exceeds the limit. */
/* jscs: disable maximumLineLength */
'use strict';

var configData = require('./instance_admin_client_config');
var extend = require('extend');
var gax = require('google-gax');

var SERVICE_ADDRESS = 'spanner.googleapis.com';

var DEFAULT_SERVICE_PORT = 443;

var CODE_GEN_NAME_VERSION = 'gapic/0.7.1';

var PAGE_DESCRIPTORS = {
  listInstanceConfigs: new gax.PageDescriptor(
      'pageToken',
      'nextPageToken',
      'instanceConfigs'),
  listInstances: new gax.PageDescriptor(
      'pageToken',
      'nextPageToken',
      'instances')
};

/**
 * The scopes needed to make gRPC calls to all of the methods defined in
 * this service.
 */
var ALL_SCOPES = [
  'https://www.googleapis.com/auth/cloud-platform',
  'https://www.googleapis.com/auth/spanner.admin'
github googleapis / nodejs-logging / src / v2 / config_service_v2_client.js View on Github external
// identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      projectPathTemplate: new gax.PathTemplate('projects/{project}'),
      sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'),
      exclusionPathTemplate: new gax.PathTemplate(
        'projects/{project}/exclusions/{exclusion}'
      ),
    };

    // Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listSinks: new gax.PageDescriptor('pageToken', 'nextPageToken', 'sinks'),
      listExclusions: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'exclusions'
      ),
    };

    // Put together the default options sent with requests.
    var defaults = gaxGrpc.constructSettings(
      'google.logging.v2.ConfigServiceV2',
      gapicConfig,
      opts.clientConfig,
      {'x-goog-api-client': clientHeader.join(' ')}
    );

    // Set up a dictionary of "inner API calls"; the core implementation
    // of calling the API is handled in `google-gax`, with this code
github googleapis / nodejs-logging / src / v2 / logging_service_v2_client.js View on Github external
// Create useful helper objects for these.
    this._pathTemplates = {
      logPathTemplate: new gax.PathTemplate('projects/{project}/logs/{log}'),
      projectPathTemplate: new gax.PathTemplate('projects/{project}'),
    };

    // Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listLogEntries: new gax.PageDescriptor(
        '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,
        '..',
        '..',
github googleapis / nodejs-logging / src / v2 / logging_service_v2_client.js View on Github external
// Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listLogEntries: new gax.PageDescriptor(
        '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
    );
github googleapis / nodejs-dlp / src / v2 / dlp_service_client.js View on Github external
projectInspectTemplatePathTemplate: new gax.PathTemplate(
        'projects/{project}/inspectTemplates/{inspect_template}'
      ),
      projectJobTriggerPathTemplate: new gax.PathTemplate(
        'projects/{project}/jobTriggers/{job_trigger}'
      ),
      projectStoredInfoTypePathTemplate: new gax.PathTemplate(
        'projects/{project}/storedInfoTypes/{stored_info_type}'
      ),
    };

    // Some of the methods on this service return "paged" results,
    // (e.g. 50 results at a time, with tokens to get subsequent
    // pages). Denote the keys used for pagination and results.
    this._descriptors.page = {
      listInspectTemplates: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'inspectTemplates'
      ),
      listDeidentifyTemplates: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'deidentifyTemplates'
      ),
      listDlpJobs: new gax.PageDescriptor('pageToken', 'nextPageToken', 'jobs'),
      listJobTriggers: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'jobTriggers'
      ),
      listStoredInfoTypes: new gax.PageDescriptor(
github firebase / user-privacy / functions / node_modules / @google-cloud / firestore / src / v1beta1 / firestore_client.js View on Github external
*/
'use strict';

var configData = require('./firestore_client_config');
var extend = require('extend');
var gax = require('google-gax');
var path = require('path');

var SERVICE_ADDRESS = 'firestore.googleapis.com';

var DEFAULT_SERVICE_PORT = 443;

var CODE_GEN_NAME_VERSION = 'gapic/0.0.5';

var PAGE_DESCRIPTORS = {
  listDocuments: new gax.PageDescriptor(
    'pageToken',
    'nextPageToken',
    'documents'
  ),
  listCollectionIds: new gax.PageDescriptor(
    'pageToken',
    'nextPageToken',
    'collectionIds'
  ),
};

var STREAM_DESCRIPTORS = {
  batchGetDocuments: new gax.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
  runQuery: new gax.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
  write: new gax.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
  listen: new gax.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
github firebase / user-privacy / functions / node_modules / @google-cloud / firestore / src / v1beta1 / firestore_client.js View on Github external
var gax = require('google-gax');
var path = require('path');

var SERVICE_ADDRESS = 'firestore.googleapis.com';

var DEFAULT_SERVICE_PORT = 443;

var CODE_GEN_NAME_VERSION = 'gapic/0.0.5';

var PAGE_DESCRIPTORS = {
  listDocuments: new gax.PageDescriptor(
    'pageToken',
    'nextPageToken',
    'documents'
  ),
  listCollectionIds: new gax.PageDescriptor(
    'pageToken',
    'nextPageToken',
    'collectionIds'
  ),
};

var STREAM_DESCRIPTORS = {
  batchGetDocuments: new gax.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
  runQuery: new gax.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
  write: new gax.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
  listen: new gax.StreamDescriptor(gax.StreamType.BIDI_STREAMING),
};

/*!
 * The scopes needed to make gRPC calls to all of the methods defined in
 * this service.
github googleapis / google-cloud-node / packages / spanner / src / admin / instance / v1 / instance_admin_client.js View on Github external
var configData = require('./instance_admin_client_config');
var extend = require('extend');
var gax = require('google-gax');

var SERVICE_ADDRESS = 'spanner.googleapis.com';

var DEFAULT_SERVICE_PORT = 443;

var CODE_GEN_NAME_VERSION = 'gapic/0.7.1';

var PAGE_DESCRIPTORS = {
  listInstanceConfigs: new gax.PageDescriptor(
      'pageToken',
      'nextPageToken',
      'instanceConfigs'),
  listInstances: new gax.PageDescriptor(
      'pageToken',
      'nextPageToken',
      'instances')
};

/**
 * The scopes needed to make gRPC calls to all of the methods defined in
 * this service.
 */
var ALL_SCOPES = [
  'https://www.googleapis.com/auth/cloud-platform',
  'https://www.googleapis.com/auth/spanner.admin'
];

/**
 * Cloud Spanner Instance Admin API