How to use the google-gax.PathTemplate 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-dlp / src / v2 / dlp_service_client.js View on Github external
// identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      dlpJobPathTemplate: new gax.PathTemplate(
        'projects/{project}/dlpJobs/{dlp_job}'
      ),
      organizationPathTemplate: new gax.PathTemplate(
        'organizations/{organization}'
      ),
      organizationDeidentifyTemplatePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/deidentifyTemplates/{deidentify_template}'
      ),
      organizationInspectTemplatePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/inspectTemplates/{inspect_template}'
      ),
      organizationStoredInfoTypePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/storedInfoTypes/{stored_info_type}'
      ),
      projectPathTemplate: new gax.PathTemplate('projects/{project}'),
      projectDeidentifyTemplatePathTemplate: new gax.PathTemplate(
        'projects/{project}/deidentifyTemplates/{deidentify_template}'
      ),
      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}'
      ),
    };
github googleapis / google-cloud-node / packages / spanner / src / admin / instance / v1 / instance_admin_client.js View on Github external
return function() {
          var args = Array.prototype.slice.call(arguments, 0);
          return instanceAdminStub[methodName].apply(instanceAdminStub, args);
        };
      }),
      defaults[methodName],
      PAGE_DESCRIPTORS[methodName] || self.longrunningDescriptors[methodName]);
  });
}

// Path templates

var PROJECT_PATH_TEMPLATE = new gax.PathTemplate(
    'projects/{project}');

var INSTANCE_CONFIG_PATH_TEMPLATE = new gax.PathTemplate(
    'projects/{project}/instanceConfigs/{instance_config}');

var INSTANCE_PATH_TEMPLATE = new gax.PathTemplate(
    'projects/{project}/instances/{instance}');

/**
 * Returns a fully-qualified project resource name string.
 * @param {String} project
 * @returns {String}
 */
InstanceAdminClient.prototype.projectPath = function(project) {
  return PROJECT_PATH_TEMPLATE.render({
    project: project
  });
};
github googleapis / nodejs-logging / src / v2 / config_service_v2_client.js View on Github external
// Load the applicable protos.
    var protos = merge(
      {},
      gaxGrpc.loadProto(
        path.join(__dirname, '..', '..', 'protos'),
        'google/logging/v2/logging_config.proto'
      )
    );

    // 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'
      ),
    };
github firebase / user-privacy / functions / node_modules / @google-cloud / firestore / src / v1beta1 / firestore_client.js View on Github external
return firestoreStub[methodName].apply(firestoreStub, args);
        };
      }),
      defaults[methodName],
      PAGE_DESCRIPTORS[methodName] || STREAM_DESCRIPTORS[methodName]
    );
  });
}

// Path templates

var DATABASE_ROOT_PATH_TEMPLATE = new gax.PathTemplate(
  'projects/{project}/databases/{database}'
);

var DOCUMENT_ROOT_PATH_TEMPLATE = new gax.PathTemplate(
  'projects/{project}/databases/{database}/documents'
);

var DOCUMENT_PATH_PATH_TEMPLATE = new gax.PathTemplate(
  'projects/{project}/databases/{database}/documents/{document_path=**}'
);

var ANY_PATH_PATH_TEMPLATE = new gax.PathTemplate(
  'projects/{project}/databases/{database}/documents/{document}/{any_path=**}'
);

/**
 * Returns a fully-qualified database_root resource name string.
 * @param {String} project
 * @param {String} database
 * @returns {String}
github googleapis / google-cloud-node / packages / spanner / src / admin / instance / v1 / instance_admin_client.js View on Github external
instanceAdminStubMethods.forEach(function(methodName) {
    self['_' + methodName] = gax.createApiCall(
      instanceAdminStub.then(function(instanceAdminStub) {
        return function() {
          var args = Array.prototype.slice.call(arguments, 0);
          return instanceAdminStub[methodName].apply(instanceAdminStub, args);
        };
      }),
      defaults[methodName],
      PAGE_DESCRIPTORS[methodName] || self.longrunningDescriptors[methodName]);
  });
}

// Path templates

var PROJECT_PATH_TEMPLATE = new gax.PathTemplate(
    'projects/{project}');

var INSTANCE_CONFIG_PATH_TEMPLATE = new gax.PathTemplate(
    'projects/{project}/instanceConfigs/{instance_config}');

var INSTANCE_PATH_TEMPLATE = new gax.PathTemplate(
    'projects/{project}/instances/{instance}');

/**
 * Returns a fully-qualified project resource name string.
 * @param {String} project
 * @returns {String}
 */
InstanceAdminClient.prototype.projectPath = function(project) {
  return PROJECT_PATH_TEMPLATE.render({
    project: project
github googleapis / nodejs-dlp / src / v2 / dlp_service_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 = {
      dlpJobPathTemplate: new gax.PathTemplate(
        'projects/{project}/dlpJobs/{dlp_job}'
      ),
      organizationPathTemplate: new gax.PathTemplate(
        'organizations/{organization}'
      ),
      organizationDeidentifyTemplatePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/deidentifyTemplates/{deidentify_template}'
      ),
      organizationInspectTemplatePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/inspectTemplates/{inspect_template}'
      ),
      organizationStoredInfoTypePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/storedInfoTypes/{stored_info_type}'
      ),
      projectPathTemplate: new gax.PathTemplate('projects/{project}'),
      projectDeidentifyTemplatePathTemplate: new gax.PathTemplate(
        'projects/{project}/deidentifyTemplates/{deidentify_template}'
      ),
      projectInspectTemplatePathTemplate: new gax.PathTemplate(
        'projects/{project}/inspectTemplates/{inspect_template}'
      ),
      projectJobTriggerPathTemplate: new gax.PathTemplate(
        'projects/{project}/jobTriggers/{job_trigger}'
      ),
      projectStoredInfoTypePathTemplate: new gax.PathTemplate(
github googleapis / nodejs-dlp / src / v2 / dlp_service_client.js View on Github external
}

    // Load the applicable protos.
    const protos = gaxGrpc.loadProto(
      path.join(__dirname, '..', '..', 'protos'),
      ['google/privacy/dlp/v2/dlp.proto']
    );

    // This API contains "path templates"; forward-slash-separated
    // identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      dlpJobPathTemplate: new gax.PathTemplate(
        'projects/{project}/dlpJobs/{dlp_job}'
      ),
      organizationPathTemplate: new gax.PathTemplate(
        'organizations/{organization}'
      ),
      organizationDeidentifyTemplatePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/deidentifyTemplates/{deidentify_template}'
      ),
      organizationInspectTemplatePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/inspectTemplates/{inspect_template}'
      ),
      organizationStoredInfoTypePathTemplate: new gax.PathTemplate(
        'organizations/{organization}/storedInfoTypes/{stored_info_type}'
      ),
      projectPathTemplate: new gax.PathTemplate('projects/{project}'),
      projectDeidentifyTemplatePathTemplate: new gax.PathTemplate(
        'projects/{project}/deidentifyTemplates/{deidentify_template}'
      ),
      projectInspectTemplatePathTemplate: new gax.PathTemplate(
github googleapis / nodejs-logging / src / v2 / config_service_v2_client.js View on Github external
}

    // Load the applicable protos.
    var protos = merge(
      {},
      gaxGrpc.loadProto(
        path.join(__dirname, '..', '..', 'protos'),
        'google/logging/v2/logging_config.proto'
      )
    );

    // 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'
      ),
github googleapis / nodejs-logging / src / v2 / metrics_service_v2_client.js View on Github external
}

    // Load the applicable protos.
    var protos = merge(
      {},
      gaxGrpc.loadProto(
        path.join(__dirname, '..', '..', 'protos'),
        'google/logging/v2/logging_metrics.proto'
      )
    );

    // 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}'),
      metricPathTemplate: new gax.PathTemplate(
        'projects/{project}/metrics/{metric}'
      ),
    };

    // 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 = {
      listLogMetrics: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',
        'metrics'
      ),
    };
github googleapis / nodejs-logging / src / v2 / metrics_service_v2_client.js View on Github external
}

    // Load the applicable protos.
    const protos = gaxGrpc.loadProto(
      path.join(__dirname, '..', '..', 'protos'),
      ['google/logging/v2/logging_metrics.proto']
    );

    // This API contains "path templates"; forward-slash-separated
    // identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      billingPathTemplate: new gax.PathTemplate(
        'billingAccounts/{billing_account}'
      ),
      folderPathTemplate: new gax.PathTemplate('folders/{folder}'),
      metricPathTemplate: new gax.PathTemplate(
        'projects/{project}/metrics/{metric}'
      ),
      organizationPathTemplate: new gax.PathTemplate(
        'organizations/{organization}'
      ),
      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 = {
      listLogMetrics: new gax.PageDescriptor(
        'pageToken',
        'nextPageToken',