Skip to content

Commit bf9929e

Browse files
swcloudstephenplusplus
authored andcommitted
Introduce Gapic-generated files for pubsub API (#1550)
1 parent 0369db1 commit bf9929e

7 files changed

+1413
-0
lines changed

packages/pubsub/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151
],
5252
"dependencies": {
5353
"@google-cloud/common": "^0.1.0",
54+
"arguejs": "^0.2.3",
5455
"arrify": "^1.0.0",
5556
"extend": "^3.0.0",
57+
"google-gax": "^0.6.0",
5658
"is": "^3.0.1",
5759
"modelo": "^4.2.0",
5860
"propprop": "^0.3.0"

packages/pubsub/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,3 +579,4 @@ PubSub.Subscription = Subscription;
579579
PubSub.Topic = Topic;
580580

581581
module.exports = PubSub;
582+
module.exports.v1 = require('./v1');

packages/pubsub/src/v1/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*!
2+
* Copyright 2016 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
'use strict';
17+
18+
var publisherApi = require('./publisher_api');
19+
var subscriberApi = require('./subscriber_api');
20+
var extend = require('extend');
21+
var gax = require('google-gax');
22+
23+
function v1(options) {
24+
options = extend({
25+
scopes: v1.ALL_SCOPES
26+
}, options);
27+
var gaxGrpc = gax.grpc(options);
28+
var result = {};
29+
extend(result, publisherApi(gaxGrpc));
30+
extend(result, subscriberApi(gaxGrpc));
31+
return result;
32+
}
33+
34+
v1.SERVICE_ADDRESS = publisherApi.SERVICE_ADDRESS;
35+
v1.ALL_SCOPES = publisherApi.ALL_SCOPES;
36+
module.exports = v1;

0 commit comments

Comments
 (0)