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

Commit ee1c250

Browse files
fix!: synth.py clean up for multiple version (#172)
BREAKING CHANGE: Remove RecaptchaEnterpriseServiceV1Beta1Client.
1 parent 05f1aca commit ee1c250

File tree

5 files changed

+28
-39
lines changed

5 files changed

+28
-39
lines changed

src/index.ts

Lines changed: 8 additions & 20 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,28 +12,16 @@
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

19-
import * as v1beta1 from './v1beta1';
2019
import * as v1 from './v1';
21-
const RecaptchaEnterpriseServiceV1Beta1Client =
22-
v1beta1.RecaptchaEnterpriseServiceV1Beta1Client;
20+
import * as v1beta1 from './v1beta1';
21+
2322
const RecaptchaEnterpriseServiceClient = v1.RecaptchaEnterpriseServiceClient;
24-
export {
25-
v1,
26-
v1beta1,
27-
RecaptchaEnterpriseServiceV1Beta1Client,
28-
RecaptchaEnterpriseServiceClient,
29-
};
30-
// For compatibility with JavaScript libraries we need to provide this default export:
31-
// tslint:disable-next-line no-default-export
32-
export default {
33-
v1,
34-
v1beta1,
35-
RecaptchaEnterpriseServiceV1Beta1Client,
36-
RecaptchaEnterpriseServiceClient,
37-
};
23+
24+
export {v1, v1beta1, RecaptchaEnterpriseServiceClient};
25+
export default {v1, v1beta1, RecaptchaEnterpriseServiceClient};
3826
import * as protos from '../protos/protos';
3927
export {protos};

synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "https://github.com/googleapis/nodejs-recaptcha-enterprise.git",
7-
"sha": "42cd9f66c60fb4b989a3f6ea60510ca1e5a5080e"
6+
"remote": "git@github.com:googleapis/nodejs-recaptcha-enterprise.git",
7+
"sha": "05f1acabb9834dd291475598f343ecf7ae62b128"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "a3a0bf0f6291d69f2ff3df7fcd63d28ee20ac727",
15-
"internalRef": "310060413"
14+
"sha": "aed11c01e52921613b9ee469c2d85f5f33175fb7",
15+
"internalRef": "310660461"
1616
}
1717
},
1818
{
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4"
22+
"sha": "98c50772ec23295c64cf0d2ddf199ea52961fd4c"
2323
}
2424
}
2525
],

synth.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,21 @@
2727
gapic = gcp.GAPICMicrogenerator()
2828
versions = ['v1', 'v1beta1']
2929
for version in versions:
30-
library = gapic.typescript_library(
31-
'recaptchaenterprise', version,
32-
generator_args={
33-
"grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json",
34-
"package-name": f"@google-cloud/recaptcha-enterprise",
35-
},
36-
proto_path=f'/google/cloud/recaptchaenterprise/{version}',
37-
extra_proto_files=['google/cloud/common_resources.proto']
38-
)
39-
s.copy(library, excludes=['package.json', 'src/index.ts'])
30+
library = gapic.typescript_library(
31+
'recaptchaenterprise', version,
32+
generator_args={
33+
"grpc-service-config": f"google/cloud/recaptchaenterprise/{version}/recaptchaenterprise_grpc_service_config.json",
34+
"package-name": f"@google-cloud/recaptcha-enterprise",
35+
},
36+
proto_path=f'/google/cloud/recaptchaenterprise/{version}',
37+
extra_proto_files=['google/cloud/common_resources.proto']
38+
)
39+
s.copy(library, excludes=['package.json'])
4040

4141
# Copy common templates
4242
common_templates = gcp.CommonTemplates()
43-
templates = common_templates.node_library(source_location='build/src')
43+
templates = common_templates.node_library(
44+
source_location='build/src', versions=versions, default_version='v1')
4445
s.copy(templates)
4546

4647
node.postprocess_gapic_library()

system-test/fixtures/sample/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
const recaptchaenterprise = require('@google-cloud/recaptcha-enterprise');
2121

2222
function main() {
23-
const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.RecaptchaEnterpriseServiceV1Beta1Client();
23+
const recaptchaEnterpriseServiceV1Beta1Client = new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client();
2424
}
2525

2626
main();

system-test/fixtures/sample/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
// ** https://github.com/googleapis/gapic-generator-typescript **
1717
// ** All changes to this file may be overwritten. **
1818

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

2121
function main() {
22-
new RecaptchaEnterpriseServiceV1Beta1Client();
22+
new recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client();
2323
}
2424

2525
main();

0 commit comments

Comments
 (0)