Skip to content

Commit

Permalink
fix!: synth.py clean up for multiple version (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng authored Jun 2, 2020
1 parent 04045bb commit 59efd7a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
16 changes: 7 additions & 9 deletions packages/google-cloud-videointelligence/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,35 +12,33 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** This file is automatically generated by synthtool. **
// ** https://github.com/googleapis/synthtool **
// ** All changes to this file may be overwritten. **

import * as v1 from './v1';
import * as v1beta2 from './v1beta2';
import * as v1p1beta1 from './v1p1beta1';
import * as v1p2beta1 from './v1p2beta1';
import * as v1p3beta1 from './v1p3beta1';

const VideoIntelligenceServiceClient = v1.VideoIntelligenceServiceClient;
const StreamingVideoIntelligenceServiceClient =
v1p3beta1.StreamingVideoIntelligenceServiceClient;

export {
v1,
v1beta2,
v1p1beta1,
v1p2beta1,
v1p3beta1,
VideoIntelligenceServiceClient,
StreamingVideoIntelligenceServiceClient,
};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {
v1,
v1beta2,
v1p1beta1,
v1p2beta1,
v1p3beta1,
VideoIntelligenceServiceClient,
StreamingVideoIntelligenceServiceClient,
};
import * as protos from '../protos/protos';
export {protos};
20 changes: 10 additions & 10 deletions packages/google-cloud-videointelligence/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
{
"git": {
"name": ".",
"remote": "https://github.com/googleapis/nodejs-video-intelligence.git",
"sha": "5b8a638478f5b344f5d774b2231bba39e96044f8"
"remote": "git@github.com:googleapis/nodejs-video-intelligence.git",
"sha": "920a31d31edb068cd70db427698cd3b7b8620da5"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "d1a9f02fd4fb263bae0383b4a5af0bbef33753d6",
"internalRef": "312101156"
"sha": "ce56112c3585cae794cc6c066eee175b931bebbc",
"internalRef": "314387187"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4"
"sha": "cb3c683e958a4b5c016bb3734436fc1cb887eb7b"
}
}
],
Expand All @@ -28,7 +28,7 @@
"client": {
"source": "googleapis",
"apiName": "video-intelligence",
"apiVersion": "v1",
"apiVersion": "v1beta2",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -37,7 +37,7 @@
"client": {
"source": "googleapis",
"apiName": "video-intelligence",
"apiVersion": "v1beta2",
"apiVersion": "v1p1beta1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -46,7 +46,7 @@
"client": {
"source": "googleapis",
"apiName": "video-intelligence",
"apiVersion": "v1p1beta1",
"apiVersion": "v1p2beta1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -55,7 +55,7 @@
"client": {
"source": "googleapis",
"apiName": "video-intelligence",
"apiVersion": "v1p2beta1",
"apiVersion": "v1p3beta1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -64,7 +64,7 @@
"client": {
"source": "googleapis",
"apiName": "video-intelligence",
"apiVersion": "v1p3beta1",
"apiVersion": "v1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand Down
13 changes: 10 additions & 3 deletions packages/google-cloud-videointelligence/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
common_templates = gcp.CommonTemplates()

versions = ["v1", "v1beta2", "v1p1beta1", "v1p2beta1", "v1p3beta1"]
default_version = "v1"

for version in versions:
# Rearrange the default version to the last item in the array, to generate appropriate system-test
order_versions = versions.copy()
order_versions.append(order_versions.pop(
order_versions.index(default_version)))

for version in order_versions:
library = gapic.typescript_library(
"video-intelligence",
version,
Expand All @@ -25,9 +31,10 @@
)

# skip index, protos, package.json, and README.md
s.copy(library, excludes=["package.json", "README.md", "src/index.ts"])
s.copy(library, excludes=["package.json", "README.md"])

templates = common_templates.node_library(source_location='build/src')
templates = common_templates.node_library(
source_location="build/src", versions=versions, default_version=default_version)
s.copy(templates)

node.postprocess_gapic_library()
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
const videointelligence = require('@google-cloud/video-intelligence');

function main() {
const streamingVideoIntelligenceServiceClient = new videointelligence.StreamingVideoIntelligenceServiceClient();
const videoIntelligenceServiceClient = new videointelligence.VideoIntelligenceServiceClient();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

import {
StreamingVideoIntelligenceServiceClient,
VideoIntelligenceServiceClient,
} from '@google-cloud/video-intelligence';
import {VideoIntelligenceServiceClient} from '@google-cloud/video-intelligence';

function main() {
new StreamingVideoIntelligenceServiceClient();
new VideoIntelligenceServiceClient();
}

Expand Down

0 comments on commit 59efd7a

Please sign in to comment.