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

Commit

Permalink
fix: clean up synth.py for multiple version (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed May 6, 2020
1 parent 3edf825 commit a356064
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
@@ -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,17 +12,17 @@
// 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 v1beta1 from './v1beta1';

const AutoMlClient = v1.AutoMlClient;
const PredictionServiceClient = v1.PredictionServiceClient;

export {v1, v1beta1, AutoMlClient, PredictionServiceClient};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {v1, v1beta1, AutoMlClient, PredictionServiceClient};
import * as protos from '../protos/protos';
export {protos};
4 changes: 2 additions & 2 deletions synth.metadata
Expand Up @@ -20,7 +20,7 @@
"client": {
"source": "googleapis",
"apiName": "automl",
"apiVersion": "v1beta1",
"apiVersion": "v1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand All @@ -29,7 +29,7 @@
"client": {
"source": "googleapis",
"apiName": "automl",
"apiVersion": "v1",
"apiVersion": "v1beta1",
"language": "typescript",
"generator": "gapic-generator-typescript"
}
Expand Down
9 changes: 5 additions & 4 deletions synth.py
Expand Up @@ -23,22 +23,23 @@


gapic = gcp.GAPICMicrogenerator()
versions = ['v1beta1', 'v1']
versions = ['v1', 'v1beta1']
for version in versions:
library = gapic.typescript_library(
'automl', version,
generator_args={
"grpc-service-config": f"google/cloud/automl/{version}/automl_grpc_service_config.json",
"package-name": "@google-cloud/automl",
"main-service": "automl"
},
},
proto_path=f'/google/cloud/automl/{version}',
extra_proto_files=['google/cloud/common_resources.proto'],
)
s.copy(library, excludes=['src/index.ts', 'README.md', 'package.json'])
s.copy(library, excludes=['README.md', 'package.json'])

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

node.postprocess_gapic_library()

0 comments on commit a356064

Please sign in to comment.