Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"check": "gts check",
"clean": "gts clean",
"compile": "tsc -p . && cp -r src/v2 build/src/v2 && cp -r protos build && cp test/*.js build/test",
"fix": "gts fix && eslint --fix 'samples/*.js' 'samples/**/*.js'",
"fix": "gts fix && eslint --fix 'samples/*.js' 'samples/**/*.js' 'src/**/*.js'",

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

"prepare": "npm run compile",
"pretest": "npm run compile",
"posttest": "npm run check",
Expand Down
3 changes: 3 additions & 0 deletions src/v2/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
Comment thread
JustinBeckwith marked this conversation as resolved.
rules:
node/no-missing-require: off
61 changes: 22 additions & 39 deletions src/v2/config_service_v2_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ class ConfigServiceV2Client {
// 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}'
),
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
sinkPathTemplate: new gax.PathTemplate('projects/{project}/sinks/{sink}'),
exclusionPathTemplate: new gax.PathTemplate(
'projects/{project}/exclusions/{exclusion}'
),
Expand All @@ -116,11 +112,7 @@ class ConfigServiceV2Client {
// (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'
),
listSinks: new gax.PageDescriptor('pageToken', 'nextPageToken', 'sinks'),
listExclusions: new gax.PageDescriptor(
'pageToken',
'nextPageToken',
Expand Down Expand Up @@ -261,7 +253,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -353,7 +345,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand All @@ -375,7 +367,7 @@ class ConfigServiceV2Client {
request,
options
);
};
}

/**
* Gets a sink.
Expand Down Expand Up @@ -404,7 +396,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -477,7 +469,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -574,7 +566,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -631,7 +623,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -695,7 +687,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -787,7 +779,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand All @@ -809,7 +801,7 @@ class ConfigServiceV2Client {
request,
options
);
};
}

/**
* Gets the description of an exclusion.
Expand Down Expand Up @@ -838,7 +830,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -898,7 +890,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -971,7 +963,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -1028,7 +1020,7 @@ class ConfigServiceV2Client {
*
* @example
*
const logging = require('@google-cloud/logging');
* const logging = require('@google-cloud/logging');
*
* const client = new logging.v2.ConfigServiceV2Client({
* // optional auth parameters.
Expand Down Expand Up @@ -1101,9 +1093,7 @@ class ConfigServiceV2Client {
* @returns {String} - A string representing the project.
*/
matchProjectFromProjectName(projectName) {
return this._pathTemplates.projectPathTemplate
.match(projectName)
.project;
return this._pathTemplates.projectPathTemplate.match(projectName).project;
}

/**
Expand All @@ -1114,9 +1104,7 @@ class ConfigServiceV2Client {
* @returns {String} - A string representing the project.
*/
matchProjectFromSinkName(sinkName) {
return this._pathTemplates.sinkPathTemplate
.match(sinkName)
.project;
return this._pathTemplates.sinkPathTemplate.match(sinkName).project;
}

/**
Expand All @@ -1127,9 +1115,7 @@ class ConfigServiceV2Client {
* @returns {String} - A string representing the sink.
*/
matchSinkFromSinkName(sinkName) {
return this._pathTemplates.sinkPathTemplate
.match(sinkName)
.sink;
return this._pathTemplates.sinkPathTemplate.match(sinkName).sink;
}

/**
Expand All @@ -1140,8 +1126,7 @@ class ConfigServiceV2Client {
* @returns {String} - A string representing the project.
*/
matchProjectFromExclusionName(exclusionName) {
return this._pathTemplates.exclusionPathTemplate
.match(exclusionName)
return this._pathTemplates.exclusionPathTemplate.match(exclusionName)
.project;
}

Expand All @@ -1153,11 +1138,9 @@ class ConfigServiceV2Client {
* @returns {String} - A string representing the exclusion.
*/
matchExclusionFromExclusionName(exclusionName) {
return this._pathTemplates.exclusionPathTemplate
.match(exclusionName)
return this._pathTemplates.exclusionPathTemplate.match(exclusionName)
.exclusion;
}
}


module.exports = ConfigServiceV2Client;
Loading