Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.

Commit a356064

Browse files
fix: clean up synth.py for multiple version (#396)
1 parent 3edf825 commit a356064

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC
1+
// Copyright 2020 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -12,17 +12,17 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
//
15-
// ** This file is automatically generated by gapic-generator-typescript. **
16-
// ** https://github.com/googleapis/gapic-generator-typescript **
15+
// ** This file is automatically generated by synthtool. **
16+
// ** https://github.com/googleapis/synthtool **
1717
// ** All changes to this file may be overwritten. **
1818

1919
import * as v1 from './v1';
2020
import * as v1beta1 from './v1beta1';
21+
2122
const AutoMlClient = v1.AutoMlClient;
2223
const PredictionServiceClient = v1.PredictionServiceClient;
24+
2325
export {v1, v1beta1, AutoMlClient, PredictionServiceClient};
24-
// For compatibility with JavaScript libraries we need to provide this default export:
25-
// tslint:disable-next-line no-default-export
2626
export default {v1, v1beta1, AutoMlClient, PredictionServiceClient};
2727
import * as protos from '../protos/protos';
2828
export {protos};

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"client": {
2121
"source": "googleapis",
2222
"apiName": "automl",
23-
"apiVersion": "v1beta1",
23+
"apiVersion": "v1",
2424
"language": "typescript",
2525
"generator": "gapic-generator-typescript"
2626
}
@@ -29,7 +29,7 @@
2929
"client": {
3030
"source": "googleapis",
3131
"apiName": "automl",
32-
"apiVersion": "v1",
32+
"apiVersion": "v1beta1",
3333
"language": "typescript",
3434
"generator": "gapic-generator-typescript"
3535
}

synth.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,23 @@
2323

2424

2525
gapic = gcp.GAPICMicrogenerator()
26-
versions = ['v1beta1', 'v1']
26+
versions = ['v1', 'v1beta1']
2727
for version in versions:
2828
library = gapic.typescript_library(
2929
'automl', version,
3030
generator_args={
3131
"grpc-service-config": f"google/cloud/automl/{version}/automl_grpc_service_config.json",
3232
"package-name": "@google-cloud/automl",
3333
"main-service": "automl"
34-
},
34+
},
3535
proto_path=f'/google/cloud/automl/{version}',
3636
extra_proto_files=['google/cloud/common_resources.proto'],
3737
)
38-
s.copy(library, excludes=['src/index.ts', 'README.md', 'package.json'])
38+
s.copy(library, excludes=['README.md', 'package.json'])
3939

4040
common_templates = gcp.CommonTemplates()
41-
templates = common_templates.node_library(source_location='build/src')
41+
templates = common_templates.node_library(
42+
source_location='build/src', versions=versions, default_version='v1')
4243
s.copy(templates)
4344

4445
node.postprocess_gapic_library()

0 commit comments

Comments
 (0)