Skip to content

Commit

Permalink
Regenerate spanner API clients. (#2066)
Browse files Browse the repository at this point in the history
Updates #2019, and fixes #2063.
  • Loading branch information
jmuk authored and stephenplusplus committed Mar 9, 2017
1 parent 42551aa commit 1939dea
Show file tree
Hide file tree
Showing 9 changed files with 121 additions and 131 deletions.
2 changes: 1 addition & 1 deletion packages/spanner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"events-intercept": "^2.0.0",
"extend": "^3.0.0",
"generic-pool": "^3.1.4",
"google-gax": "^0.12.2",
"google-gax": "^0.12.3",
"google-proto-files": "^0.10.0",
"is": "^3.1.0",
"lodash.chunk": "^4.2.0",
Expand Down
69 changes: 30 additions & 39 deletions packages/spanner/src/admin/database/v1/database_admin_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var SERVICE_ADDRESS = 'spanner.googleapis.com';

var DEFAULT_SERVICE_PORT = 443;

var CODE_GEN_NAME_VERSION = 'gapic/0.1.0';
var CODE_GEN_NAME_VERSION = 'gapic/0.7.1';

var PAGE_DESCRIPTORS = {
listDatabases: new gax.PageDescriptor(
Expand Down Expand Up @@ -65,40 +65,37 @@ var ALL_SCOPES = [
* @see {@link databaseAdminClient}
*
* @example
* var spannerV1 = require('@google-cloud/spanner').v1.admin.database({
* var spannerV1 = require('@google-cloud/spanner').admin.database.v1({
* // optional auth parameters.
* });
* var client = spannerV1.databaseAdminClient();
*
* @class
*/
function DatabaseAdminClient(gaxGrpc, grpcClients, opts) {
opts = opts || {};
var servicePath = opts.servicePath || SERVICE_ADDRESS;
var port = opts.port || DEFAULT_SERVICE_PORT;
var sslCreds = opts.sslCreds || null;
var clientConfig = opts.clientConfig || {};
var appName = opts.appName || 'gax';
var appVersion = opts.appVersion || gax.version;
opts = extend({
servicePath: SERVICE_ADDRESS,
port: DEFAULT_SERVICE_PORT,
clientConfig: {}
}, opts);

var googleApiClient = [
appName + '/' + appVersion,
'gl-node/' + process.versions.node
];
if (opts.libName && opts.libVersion) {
googleApiClient.push(opts.libName + '/' + opts.libVersion);
}
googleApiClient.push(
CODE_GEN_NAME_VERSION,
'gax/' + gax.version,
'nodejs/' + process.version].join(' ');
'grpc/' + gaxGrpc.grpcVersion
);


this.operationsClient = new gax.lro({
auth: gaxGrpc.auth,
grpc: gaxGrpc.grpc
}).operationsClient({
servicePath: servicePath,
port: port,
sslCreds: sslCreds,
clientConfig: clientConfig,
appName: appName,
appVersion: appVersion
});
}).operationsClient(opts);

this.longrunningDescriptors = {
createDatabase: new gax.LongrunningDescriptor(
Expand All @@ -114,17 +111,15 @@ function DatabaseAdminClient(gaxGrpc, grpcClients, opts) {
var defaults = gaxGrpc.constructSettings(
'google.spanner.admin.database.v1.DatabaseAdmin',
configData,
clientConfig,
{'x-goog-api-client': googleApiClient});
opts.clientConfig,
{'x-goog-api-client': googleApiClient.join(' ')});

var self = this;

this.auth = gaxGrpc.auth;
var databaseAdminStub = gaxGrpc.createStub(
servicePath,
port,
grpcClients.google.spanner.admin.database.v1.DatabaseAdmin,
{sslCreds: sslCreds});
opts);
var databaseAdminStubMethods = [
'listDatabases',
'createDatabase',
Expand Down Expand Up @@ -285,7 +280,7 @@ DatabaseAdminClient.prototype.getProjectId = function(callback) {
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedParent = client.instancePath("[PROJECT]", "[INSTANCE]");
* // Iterate over all elements.
* client.listDatabases({parent: formattedParent}).then(function(responses) {
Expand Down Expand Up @@ -364,7 +359,7 @@ DatabaseAdminClient.prototype.listDatabases = function(request, options, callbac
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedParent = client.instancePath("[PROJECT]", "[INSTANCE]");
* client.listDatabasesStream({parent: formattedParent}).on('data', function(element) {
* // doThingsWith(element)
Expand Down Expand Up @@ -417,7 +412,7 @@ DatabaseAdminClient.prototype.listDatabasesStream = function(request, options) {
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedParent = client.instancePath("[PROJECT]", "[INSTANCE]");
* var createStatement = '';
* var request = {
Expand Down Expand Up @@ -503,7 +498,7 @@ DatabaseAdminClient.prototype.createDatabase = function(request, options, callba
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedName = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* client.getDatabase({name: formattedName}).then(function(responses) {
* var response = responses[0];
Expand Down Expand Up @@ -554,7 +549,7 @@ DatabaseAdminClient.prototype.getDatabase = function(request, options, callback)
* {@link longrunning.Operation}: `<database>/operations/<operation_id>`.
*
* `operation_id` should be unique within the database, and must be
* a valid identifier: `[a-zA-Z][a-zA-Z0-9_]*`. Note that
* a valid identifier: `[a-z][a-z0-9_]*`. Note that
* automatically-generated operation IDs always begin with an
* underscore. If the named operation already exists,
* {@link UpdateDatabaseDdl} returns
Expand All @@ -572,7 +567,7 @@ DatabaseAdminClient.prototype.getDatabase = function(request, options, callback)
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedDatabase = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* var statements = [];
* var request = {
Expand Down Expand Up @@ -654,7 +649,7 @@ DatabaseAdminClient.prototype.updateDatabaseDdl = function(request, options, cal
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedDatabase = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* client.dropDatabase({database: formattedDatabase}).catch(function(err) {
* console.error(err);
Expand Down Expand Up @@ -694,7 +689,7 @@ DatabaseAdminClient.prototype.dropDatabase = function(request, options, callback
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedDatabase = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* client.getDatabaseDdl({database: formattedDatabase}).then(function(responses) {
* var response = responses[0];
Expand Down Expand Up @@ -748,7 +743,7 @@ DatabaseAdminClient.prototype.getDatabaseDdl = function(request, options, callba
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedResource = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* var policy = {};
* var request = {
Expand Down Expand Up @@ -800,7 +795,7 @@ DatabaseAdminClient.prototype.setIamPolicy = function(request, options, callback
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedResource = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* client.getIamPolicy({resource: formattedResource}).then(function(responses) {
* var response = responses[0];
Expand Down Expand Up @@ -853,7 +848,7 @@ DatabaseAdminClient.prototype.getIamPolicy = function(request, options, callback
*
* @example
*
* var client = spannerAdmin.databaseAdminClient();
* var client = spannerV1.databaseAdminClient();
* var formattedResource = client.databasePath("[PROJECT]", "[INSTANCE]", "[DATABASE]");
* var permissions = [];
* var request = {
Expand Down Expand Up @@ -904,10 +899,6 @@ function DatabaseAdminClientBuilder(gaxGrpc) {
* @param {Object=} opts.clientConfig
* The customized config to build the call settings. See
* {@link gax.constructSettings} for the format.
* @param {number=} opts.appName
* The codename of the calling service.
* @param {String=} opts.appVersion
* The version of the calling service.
*/
this.databaseAdminClient = function(opts) {
return new DatabaseAdminClient(gaxGrpc, databaseAdminClient, opts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"interfaces": {
"google.spanner.admin.database.v1.DatabaseAdmin": {
"retry_codes": {
"retry_codes_def": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
}
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": [
"UNAVAILABLE"
]
},
"retry_params": {
"default": {
Expand Down
Loading

0 comments on commit 1939dea

Please sign in to comment.