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

Commit

Permalink
fix!: synth.py clean up for multiple version (#172)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Remove RecaptchaEnterpriseServiceV1Beta1Client.
  • Loading branch information
summer-ji-eng authored May 12, 2020
1 parent 05f1aca commit ee1c250
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 39 deletions.
28 changes: 8 additions & 20 deletions 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,28 +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';
import * as v1 from './v1';
const RecaptchaEnterpriseServiceV1Beta1Client =
v1beta1.RecaptchaEnterpriseServiceV1Beta1Client;
import * as v1beta1 from './v1beta1';

const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient;
export {
v1,
v1beta1,
RecaptchaEnterpriseServiceV1Beta1Client,
RecaptchaEnterpriseServiceClient,
};
// For compatibility with JavaScript libraries we need to provide this default export:
// tslint:disable-next-line no-default-export
export default {
v1,
v1beta1,
RecaptchaEnterpriseServiceV1Beta1Client,
RecaptchaEnterpriseServiceClient,
};

export {v1, v1beta1, RecaptchaEnterpriseServiceClient};
export default {v1, v1beta1, RecaptchaEnterpriseServiceClient};
import * as protos from '../protos/protos';
export {protos};
10 changes: 5 additions & 5 deletions 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-recaptcha-enterprise.git",
"sha": "42cd9f66c60fb4b989a3f6ea60510ca1e5a5080e"
"remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git",
"sha": "05f1acabb9834dd291475598f343ecf7ae62b128"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727",
"internalRef": "310060413"
"sha": "aed11c01e52921613b9ee469c2d85f5f33175fb7",
"internalRef": "310660461"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4"
"sha": "98c50772ec23295c64cf0d2ddf199ea52961fd4c"
}
}
],
Expand Down
23 changes: 12 additions & 11 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@
gapic = gcp.GAPICMicrogenerator()
versions = ['v1', 'v1beta1']
for version in versions:
library = gapic.typescript_library(
'recaptchaenterprise', version,
generator_args={
"grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json",
"package-name": f"@google-cloud/recaptcha-enterprise",
},
proto_path=f'/google/cloud/recaptchaenterprise/{version}',
extra_proto_files=['google/cloud/common_resources.proto']
)
s.copy(library, excludes=['package.json', 'src/index.ts'])
library = gapic.typescript_library(
'recaptchaenterprise', version,
generator_args={
"grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json",
"package-name": f"@google-cloud/recaptcha-enterprise",
},
proto_path=f'/google/cloud/recaptchaenterprise/{version}',
extra_proto_files=['google/cloud/common_resources.proto']
)
s.copy(library, excludes=['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='v1')
s.copy(templates)

node.postprocess_gapic_library()
2 changes: 1 addition & 1 deletion system-test/fixtures/sample/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise');

function main() {
const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client();
const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client();
}

main();
4 changes: 2 additions & 2 deletions system-test/fixtures/sample/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

import {RecaptchaEnterpriseServiceV1Beta1Client} from '@google-cloud/recaptcha-enterprise';
import * as recaptchaenterprise from '@google-cloud/recaptcha-enterprise';

function main() {
new RecaptchaEnterpriseServiceV1Beta1Client();
new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client();
}

main();

0 comments on commit ee1c250

Please sign in to comment.