From 2b844cdc393adf36333ff1dcd8cf56aadfbf763b Mon Sep 17 00:00:00 2001 From: Summer Ji Date: Wed, 6 May 2020 16:39:07 -0700 Subject: [PATCH] fix: synth.py clean up for multiple version (#146) --- .../src/index.ts | 10 ++++----- .../synth.metadata | 12 +++++++++-- .../google-cloud-phishingprotection/synth.py | 21 ++++++++++--------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-phishingprotection/src/index.ts b/packages/google-cloud-phishingprotection/src/index.ts index 4f6fe37e04b..4660b3d3dcd 100644 --- a/packages/google-cloud-phishingprotection/src/index.ts +++ b/packages/google-cloud-phishingprotection/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. @@ -12,16 +12,16 @@ // 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 v1beta1 from './v1beta1'; + const PhishingProtectionServiceV1Beta1Client = v1beta1.PhishingProtectionServiceV1Beta1Client; + export {v1beta1, PhishingProtectionServiceV1Beta1Client}; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export export default {v1beta1, PhishingProtectionServiceV1Beta1Client}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-phishingprotection/synth.metadata b/packages/google-cloud-phishingprotection/synth.metadata index 63ed635a4c3..56d15fd7a2d 100644 --- a/packages/google-cloud-phishingprotection/synth.metadata +++ b/packages/google-cloud-phishingprotection/synth.metadata @@ -4,14 +4,22 @@ "git": { "name": ".", "remote": "git@github.com:googleapis/nodejs-phishing-protection.git", - "sha": "2eaf30eadd7e15701f9bfc1ddfb0049ae1a46867" + "sha": "04040e7ad95097e91239b16fca19be2ec8198dae" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "6dfd72d028a0d0a43764e060f7b15e004385c3a1", + "internalRef": "310168181" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "756bc4dfc24e8bc4c5dd4116daa41a0440ebf5a0" } } ], diff --git a/packages/google-cloud-phishingprotection/synth.py b/packages/google-cloud-phishingprotection/synth.py index 44e597f106a..24ab3cb0bb2 100644 --- a/packages/google-cloud-phishingprotection/synth.py +++ b/packages/google-cloud-phishingprotection/synth.py @@ -26,20 +26,21 @@ gapic = gcp.GAPICMicrogenerator() versions = ['v1beta1'] for version in versions: - library = gapic.typescript_library( - 'phishingprotection', version, - generator_args={ - "grpc-service-config": f"google/cloud/phishingprotection/{version}/phishingprotection_grpc_service_config.json", - "package-name": "@google-cloud/phishing-protection", - }, - proto_path=f'/google/cloud/phishingprotection/{version}', - extra_proto_files=['google/cloud/common_resources.proto'], + library = gapic.typescript_library( + 'phishingprotection', version, + generator_args={ + "grpc-service-config": f"google/cloud/phishingprotection/{version}/phishingprotection_grpc_service_config.json", + "package-name": "@google-cloud/phishing-protection", + }, + proto_path=f'/google/cloud/phishingprotection/{version}', + extra_proto_files=['google/cloud/common_resources.proto'], ) - s.copy(library, excludes=['README.md', 'package.json', 'src/index.ts']) + s.copy(library, excludes=['README.md', 'package.json']) # Copy common templates 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='v1beta1') s.copy(templates) node.postprocess_gapic_library()