Skip to content

Commit

Permalink
Re-generate library based on current tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sneeringer committed Sep 15, 2017
1 parent 7bcb0f9 commit 458e35a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
3 changes: 2 additions & 1 deletion packages/video-intelligence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"google-proto-files": "^0.12.0"
},
"devDependencies": {
"mocha": "^3.2.0"
"mocha": "^3.2.0",
"through2": "^2.0.3"
},
"scripts": {
"publish-module": "node ../../scripts/publish.js video-intelligence",
Expand Down
29 changes: 14 additions & 15 deletions packages/video-intelligence/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ var gapic = {
v1beta2: require('./v1beta2'),
};
var gaxGrpc = require('google-gax').grpc();
var googleProtoFiles = require('google-proto-files');
var path = require('path');

const VERSION = require('../package.json').version;


/**
* Create an videoIntelligenceServiceClient with additional helpers for common
* tasks.
Expand Down Expand Up @@ -54,24 +55,23 @@ const VERSION = require('../package.json').version;
* @param {string=} options.servicePath - The domain name of the
* API remote host.
*/
function videoIntelligenceV1beta1(options) {
function videoIntelligenceV1beta2(options) {
// Define the header options.
options = extend({}, options, {
libName: 'gccl',
libVersion: VERSION
});

// Create the client with the provided options.
var client = gapic.v1beta1(options).videoIntelligenceServiceClient(options);
var client = gapic.v1beta2(options).videoIntelligenceServiceClient(options);
return client;
}

var v1beta1Protos = {};
var v1beta2Protos = {};

extend(v1beta1Protos, gaxGrpc.load([{
root: require('google-proto-files')('..'),
file: 'google/cloud/videointelligence/v1beta1/video_intelligence.proto'
}]).google.cloud.videointelligence.v1beta1);
extend(v1beta2Protos, gaxGrpc.loadProto(
path.join(__dirname, '..', 'proto', 'google/cloud/videointelligence/v1beta2/video_intelligence.proto')
).google.cloud.videointelligence.v1beta2);


/**
Expand Down Expand Up @@ -103,24 +103,23 @@ extend(v1beta1Protos, gaxGrpc.load([{
* @param {string=} options.servicePath - The domain name of the
* API remote host.
*/
function videoIntelligenceV1beta2(options) {
function videoIntelligenceV1beta1(options) {
// Define the header options.
options = extend({}, options, {
libName: 'gccl',
libVersion: VERSION
});

// Create the client with the provided options.
var client = gapic.v1beta2(options).videoIntelligenceServiceClient(options);
var client = gapic.v1beta1(options).videoIntelligenceServiceClient(options);
return client;
}

var v1beta2Protos = {};
var v1beta1Protos = {};

extend(v1beta2Protos, gaxGrpc.load([{
root: require('google-proto-files')('..'),
file: 'google/cloud/videointelligence/v1beta2/video_intelligence.proto'
}]).google.cloud.videointelligence.v1beta2);
extend(v1beta1Protos, gaxGrpc.loadProto(
path.join(__dirname, '..', 'proto', 'google/cloud/videointelligence/v1beta1/video_intelligence.proto')
).google.cloud.videointelligence.v1beta1);


module.exports = videoIntelligenceV1beta2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
var configData = require('./video_intelligence_service_client_config');
var extend = require('extend');
var gax = require('google-gax');
var googleProtoFiles = require('google-proto-files');
var path = require('path');

var SERVICE_ADDRESS = 'videointelligence.googleapis.com';

Expand All @@ -51,7 +53,7 @@ var ALL_SCOPES = [
*
* @class
*/
function VideoIntelligenceServiceClient(gaxGrpc, grpcClients, opts) {
function VideoIntelligenceServiceClient(gaxGrpc, loadedProtos, opts) {
opts = extend({
servicePath: SERVICE_ADDRESS,
port: DEFAULT_SERVICE_PORT,
Expand All @@ -78,8 +80,8 @@ function VideoIntelligenceServiceClient(gaxGrpc, grpcClients, opts) {
this.longrunningDescriptors = {
annotateVideo: new gax.LongrunningDescriptor(
this.operationsClient,
grpcClients.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse.decode,
grpcClients.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress.decode)
loadedProtos.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse.decode,
loadedProtos.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress.decode)
};

var defaults = gaxGrpc.constructSettings(
Expand All @@ -92,7 +94,7 @@ function VideoIntelligenceServiceClient(gaxGrpc, grpcClients, opts) {

this.auth = gaxGrpc.auth;
var videoIntelligenceServiceStub = gaxGrpc.createStub(
grpcClients.google.cloud.videointelligence.v1beta1.VideoIntelligenceService,
loadedProtos.google.cloud.videointelligence.v1beta1.VideoIntelligenceService,
opts);
var videoIntelligenceServiceStubMethods = [
'annotateVideo'
Expand Down Expand Up @@ -260,11 +262,9 @@ function VideoIntelligenceServiceClientBuilder(gaxGrpc) {
return new VideoIntelligenceServiceClientBuilder(gaxGrpc);
}

var videoIntelligenceServiceClient = gaxGrpc.load([{
root: require('google-proto-files')('..'),
file: 'google/cloud/videointelligence/v1beta1/video_intelligence.proto'
}]);
extend(this, videoIntelligenceServiceClient.google.cloud.videointelligence.v1beta1);
var videoIntelligenceServiceStubProtos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'proto', 'google/cloud/videointelligence/v1beta1/video_intelligence.proto'));
extend(this, videoIntelligenceServiceStubProtos.google.cloud.videointelligence.v1beta1);


/**
Expand All @@ -282,7 +282,7 @@ function VideoIntelligenceServiceClientBuilder(gaxGrpc) {
* {@link gax.constructSettings} for the format.
*/
this.videoIntelligenceServiceClient = function(opts) {
return new VideoIntelligenceServiceClient(gaxGrpc, videoIntelligenceServiceClient, opts);
return new VideoIntelligenceServiceClient(gaxGrpc, videoIntelligenceServiceStubProtos, opts);
};
extend(this.videoIntelligenceServiceClient, VideoIntelligenceServiceClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
var configData = require('./video_intelligence_service_client_config');
var extend = require('extend');
var gax = require('google-gax');
var googleProtoFiles = require('google-proto-files');
var path = require('path');

var SERVICE_ADDRESS = 'videointelligence.googleapis.com';

Expand All @@ -51,7 +53,7 @@ var ALL_SCOPES = [
*
* @class
*/
function VideoIntelligenceServiceClient(gaxGrpc, grpcClients, opts) {
function VideoIntelligenceServiceClient(gaxGrpc, loadedProtos, opts) {
opts = extend({
servicePath: SERVICE_ADDRESS,
port: DEFAULT_SERVICE_PORT,
Expand All @@ -78,8 +80,8 @@ function VideoIntelligenceServiceClient(gaxGrpc, grpcClients, opts) {
this.longrunningDescriptors = {
annotateVideo: new gax.LongrunningDescriptor(
this.operationsClient,
grpcClients.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.decode,
grpcClients.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.decode)
loadedProtos.google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.decode,
loadedProtos.google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.decode)
};

var defaults = gaxGrpc.constructSettings(
Expand All @@ -92,7 +94,7 @@ function VideoIntelligenceServiceClient(gaxGrpc, grpcClients, opts) {

this.auth = gaxGrpc.auth;
var videoIntelligenceServiceStub = gaxGrpc.createStub(
grpcClients.google.cloud.videointelligence.v1beta2.VideoIntelligenceService,
loadedProtos.google.cloud.videointelligence.v1beta2.VideoIntelligenceService,
opts);
var videoIntelligenceServiceStubMethods = [
'annotateVideo'
Expand Down Expand Up @@ -260,11 +262,9 @@ function VideoIntelligenceServiceClientBuilder(gaxGrpc) {
return new VideoIntelligenceServiceClientBuilder(gaxGrpc);
}

var videoIntelligenceServiceClient = gaxGrpc.load([{
root: require('google-proto-files')('..'),
file: 'google/cloud/videointelligence/v1beta2/video_intelligence.proto'
}]);
extend(this, videoIntelligenceServiceClient.google.cloud.videointelligence.v1beta2);
var videoIntelligenceServiceStubProtos = gaxGrpc.loadProto(
path.join(__dirname, '..', '..', 'proto', 'google/cloud/videointelligence/v1beta2/video_intelligence.proto'));
extend(this, videoIntelligenceServiceStubProtos.google.cloud.videointelligence.v1beta2);


/**
Expand All @@ -282,7 +282,7 @@ function VideoIntelligenceServiceClientBuilder(gaxGrpc) {
* {@link gax.constructSettings} for the format.
*/
this.videoIntelligenceServiceClient = function(opts) {
return new VideoIntelligenceServiceClient(gaxGrpc, videoIntelligenceServiceClient, opts);
return new VideoIntelligenceServiceClient(gaxGrpc, videoIntelligenceServiceStubProtos, opts);
};
extend(this.videoIntelligenceServiceClient, VideoIntelligenceServiceClient);
}
Expand Down

0 comments on commit 458e35a

Please sign in to comment.