Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
32 changes: 17 additions & 15 deletions src/v1/database_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,11 @@ class DatabaseAdminClient {
};
let protoFilesRoot = new gax.GoogleProtoFilesRoot();
protoFilesRoot = protobuf.loadSync(
path.join(
__dirname,
'..',
'..',
'protos',
'google/spanner/admin/database/v1/spanner_database_admin.proto'
),
path.join(__dirname, '..', '..', 'protos', 'google/spanner/admin/database/v1/spanner_database_admin.proto'),
protoFilesRoot
);


// This API contains "long-running operations", which return a
// an Operation object that allows for tracking of the operation,
// rather than holding a request open.
Expand Down Expand Up @@ -216,8 +211,7 @@ class DatabaseAdminClient {
}
),
defaults[methodName],
this._descriptors.page[methodName] ||
this._descriptors.longrunning[methodName]
this._descriptors.page[methodName] || this._descriptors.longrunning[methodName]
);
}
}
Expand Down Expand Up @@ -409,7 +403,7 @@ class DatabaseAdminClient {
request,
options
);
}
};

/**
* Creates a new Cloud Spanner database and starts to prepare it for serving.
Expand Down Expand Up @@ -998,7 +992,9 @@ class DatabaseAdminClient {
* @returns {String} - A string representing the project.
*/
matchProjectFromInstanceName(instanceName) {
return this._pathTemplates.instancePathTemplate.match(instanceName).project;
return this._pathTemplates.instancePathTemplate
.match(instanceName)
.project;
}

/**
Expand All @@ -1009,7 +1005,8 @@ class DatabaseAdminClient {
* @returns {String} - A string representing the instance.
*/
matchInstanceFromInstanceName(instanceName) {
return this._pathTemplates.instancePathTemplate.match(instanceName)
return this._pathTemplates.instancePathTemplate
.match(instanceName)
.instance;
}

Expand All @@ -1021,7 +1018,9 @@ class DatabaseAdminClient {
* @returns {String} - A string representing the project.
*/
matchProjectFromDatabaseName(databaseName) {
return this._pathTemplates.databasePathTemplate.match(databaseName).project;
return this._pathTemplates.databasePathTemplate
.match(databaseName)
.project;
}

/**
Expand All @@ -1032,7 +1031,8 @@ class DatabaseAdminClient {
* @returns {String} - A string representing the instance.
*/
matchInstanceFromDatabaseName(databaseName) {
return this._pathTemplates.databasePathTemplate.match(databaseName)
return this._pathTemplates.databasePathTemplate
.match(databaseName)
.instance;
}

Expand All @@ -1044,9 +1044,11 @@ class DatabaseAdminClient {
* @returns {String} - A string representing the database.
*/
matchDatabaseFromDatabaseName(databaseName) {
return this._pathTemplates.databasePathTemplate.match(databaseName)
return this._pathTemplates.databasePathTemplate
.match(databaseName)
.database;
}
}


module.exports = DatabaseAdminClient;
44 changes: 23 additions & 21 deletions src/v1/instance_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ class InstanceAdminClient {
// identifiers to uniquely identify resources within the API.
// Create useful helper objects for these.
this._pathTemplates = {
projectPathTemplate: new gax.PathTemplate('projects/{project}'),
projectPathTemplate: new gax.PathTemplate(
'projects/{project}'
),
instanceConfigPathTemplate: new gax.PathTemplate(
'projects/{project}/instanceConfigs/{instance_config}'
),
Expand All @@ -147,16 +149,11 @@ class InstanceAdminClient {
};
let protoFilesRoot = new gax.GoogleProtoFilesRoot();
protoFilesRoot = protobuf.loadSync(
path.join(
__dirname,
'..',
'..',
'protos',
'google/spanner/admin/instance/v1/spanner_instance_admin.proto'
),
path.join(__dirname, '..', '..', 'protos', 'google/spanner/admin/instance/v1/spanner_instance_admin.proto'),
protoFilesRoot
);


// This API contains "long-running operations", which return a
// an Operation object that allows for tracking of the operation,
// rather than holding a request open.
Expand Down Expand Up @@ -239,8 +236,7 @@ class InstanceAdminClient {
}
),
defaults[methodName],
this._descriptors.page[methodName] ||
this._descriptors.longrunning[methodName]
this._descriptors.page[methodName] || this._descriptors.longrunning[methodName]
);
}
}
Expand Down Expand Up @@ -434,7 +430,7 @@ class InstanceAdminClient {
request,
options
);
}
};

/**
* Gets information about a particular instance configuration.
Expand Down Expand Up @@ -672,7 +668,7 @@ class InstanceAdminClient {
request,
options
);
}
};

/**
* Gets information about a particular instance.
Expand Down Expand Up @@ -1283,7 +1279,9 @@ class InstanceAdminClient {
* @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 @@ -1294,9 +1292,9 @@ class InstanceAdminClient {
* @returns {String} - A string representing the project.
*/
matchProjectFromInstanceConfigName(instanceConfigName) {
return this._pathTemplates.instanceConfigPathTemplate.match(
instanceConfigName
).project;
return this._pathTemplates.instanceConfigPathTemplate
.match(instanceConfigName)
.project;
}

/**
Expand All @@ -1307,9 +1305,9 @@ class InstanceAdminClient {
* @returns {String} - A string representing the instance_config.
*/
matchInstanceConfigFromInstanceConfigName(instanceConfigName) {
return this._pathTemplates.instanceConfigPathTemplate.match(
instanceConfigName
).instance_config;
return this._pathTemplates.instanceConfigPathTemplate
.match(instanceConfigName)
.instance_config;
}

/**
Expand All @@ -1320,7 +1318,9 @@ class InstanceAdminClient {
* @returns {String} - A string representing the project.
*/
matchProjectFromInstanceName(instanceName) {
return this._pathTemplates.instancePathTemplate.match(instanceName).project;
return this._pathTemplates.instancePathTemplate
.match(instanceName)
.project;
}

/**
Expand All @@ -1331,9 +1331,11 @@ class InstanceAdminClient {
* @returns {String} - A string representing the instance.
*/
matchInstanceFromInstanceName(instanceName) {
return this._pathTemplates.instancePathTemplate.match(instanceName)
return this._pathTemplates.instancePathTemplate
.match(instanceName)
.instance;
}
}


module.exports = InstanceAdminClient;
36 changes: 23 additions & 13 deletions src/v1/spanner_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ class SpannerClient {
// Some of the methods on this service provide streaming responses.
// Provide descriptors for these.
this._descriptors.stream = {
executeStreamingSql: new gax.StreamDescriptor(
gax.StreamType.SERVER_STREAMING
),
executeStreamingSql: new gax.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
streamingRead: new gax.StreamDescriptor(gax.StreamType.SERVER_STREAMING),
};

Expand Down Expand Up @@ -182,8 +180,7 @@ class SpannerClient {
}
),
defaults[methodName],
this._descriptors.page[methodName] ||
this._descriptors.stream[methodName]
this._descriptors.page[methodName] || this._descriptors.stream[methodName]
);
}
}
Expand Down Expand Up @@ -511,7 +508,7 @@ class SpannerClient {
request,
options
);
}
};

/**
* Ends a session, releasing server resources associated with it.
Expand Down Expand Up @@ -1435,7 +1432,9 @@ class SpannerClient {
* @returns {String} - A string representing the project.
*/
matchProjectFromDatabaseName(databaseName) {
return this._pathTemplates.databasePathTemplate.match(databaseName).project;
return this._pathTemplates.databasePathTemplate
.match(databaseName)
.project;
}

/**
Expand All @@ -1446,7 +1445,8 @@ class SpannerClient {
* @returns {String} - A string representing the instance.
*/
matchInstanceFromDatabaseName(databaseName) {
return this._pathTemplates.databasePathTemplate.match(databaseName)
return this._pathTemplates.databasePathTemplate
.match(databaseName)
.instance;
}

Expand All @@ -1458,7 +1458,8 @@ class SpannerClient {
* @returns {String} - A string representing the database.
*/
matchDatabaseFromDatabaseName(databaseName) {
return this._pathTemplates.databasePathTemplate.match(databaseName)
return this._pathTemplates.databasePathTemplate
.match(databaseName)
.database;
}

Expand All @@ -1470,7 +1471,9 @@ class SpannerClient {
* @returns {String} - A string representing the project.
*/
matchProjectFromSessionName(sessionName) {
return this._pathTemplates.sessionPathTemplate.match(sessionName).project;
return this._pathTemplates.sessionPathTemplate
.match(sessionName)
.project;
}

/**
Expand All @@ -1481,7 +1484,9 @@ class SpannerClient {
* @returns {String} - A string representing the instance.
*/
matchInstanceFromSessionName(sessionName) {
return this._pathTemplates.sessionPathTemplate.match(sessionName).instance;
return this._pathTemplates.sessionPathTemplate
.match(sessionName)
.instance;
}

/**
Expand All @@ -1492,7 +1497,9 @@ class SpannerClient {
* @returns {String} - A string representing the database.
*/
matchDatabaseFromSessionName(sessionName) {
return this._pathTemplates.sessionPathTemplate.match(sessionName).database;
return this._pathTemplates.sessionPathTemplate
.match(sessionName)
.database;
}

/**
Expand All @@ -1503,8 +1510,11 @@ class SpannerClient {
* @returns {String} - A string representing the session.
*/
matchSessionFromSessionName(sessionName) {
return this._pathTemplates.sessionPathTemplate.match(sessionName).session;
return this._pathTemplates.sessionPathTemplate
.match(sessionName)
.session;
}
}


module.exports = SpannerClient;
6 changes: 3 additions & 3 deletions synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateTime": "2019-02-13T12:25:28.245272Z",
"updateTime": "2019-02-16T12:21:04.483545Z",
"sources": [
{
"generator": {
Expand All @@ -12,8 +12,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ca61898878f0926dd9dcc68ba90764f17133efe4",
"internalRef": "233680013"
"sha": "1a4f0f12777dc2f8bf2c2ce84438329639c75e29",
"internalRef": "234149430"
}
},
{
Expand Down
Loading