Skip to content

Commit

Permalink
change from veneer to gapic_combo
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Dec 7, 2021
1 parent c8cc6e9 commit 6b2f148
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions rules_typescript_gapic/typescript_gapic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def typescript_gapic_library(
metadata = None,
transport = None,
diregapic = None,
veneer = None,
gapic_combo = None,
legacy_proto_load = None,
extra_protoc_parameters = [],
extra_protoc_file_parameters = {},
Expand All @@ -43,8 +43,8 @@ def typescript_gapic_library(
plugin_args_dict["transport"] = transport
if diregapic:
plugin_args_dict["diregapic"] = "true"
if veneer:
plugin_args_dict["veneer"] = "true"
if gapic_combo:
plugin_args_dict["gapic_combo"] = "true"
if legacy_proto_load:
plugin_args_dict["legacy-proto-load"] = "true"

Expand Down
12 changes: 6 additions & 6 deletions typescript/src/gapic-generator-typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ yargs.describe(
'DIREGAPIC represents Discovery Rest GAPICs. Set to true for GCE API or non-gRPC APIs with a Discovery doc description.'
);
yargs.describe(
'veneer',
'Set to true if the library has a handwritten veneer over GAPIC layer.'
'gapic_combo',
'Set to true if the library has a handwritten gapic_combo over GAPIC layer.'
);
yargs.describe(
'legacy_proto_load',
Expand Down Expand Up @@ -120,7 +120,7 @@ export interface IArguments {
descriptor?: string;
transport?: string;
diregapic?: boolean;
veneer?: boolean;
gapic_combo?: boolean;
legacyProtoLoad?: boolean;
_: string[];
$0: string;
Expand All @@ -139,7 +139,7 @@ const validation = (argv.validation as string | undefined) ?? 'true';
const metadata = argv.metadata as boolean | undefined;
const transport = argv.transport as string | undefined;
const diregapic = argv.diregapic as boolean | undefined;
const veneer = argv.veneer as boolean | undefined;
const gapic_combo = argv.gapic_combo as boolean | undefined;
const legacyProtoLoad = argv.legacyProtoLoad as boolean | undefined;

// --protoc can be passed from BUILD.bazel and overridden from the command line
Expand Down Expand Up @@ -200,8 +200,8 @@ if (metadata) {
if (diregapic) {
protocCommand.push('--typescript_gapic_opt="diregapic"');
}
if (veneer) {
protocCommand.push('--typescript_gapic_opt="veneer"');
if (gapic_combo) {
protocCommand.push('--typescript_gapic_opt="gapic_combo"');
}
if (transport && transport === 'rest') {
protocCommand.push('--typescript_gapic_opt="transport=rest"');
Expand Down
12 changes: 6 additions & 6 deletions typescript/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Generator {
// This is for services using mixin services (e.g. google.iam.v1.Policy).
// As long as the mixin service is defined under 'apis' in the service yaml file, the generator will include it in the client library.
serviceYaml?: ServiceYaml;
veneer?: boolean;
gapic_combo?: boolean;
templates: string[];
metadata?: boolean;
rest?: boolean;
Expand Down Expand Up @@ -202,9 +202,9 @@ export class Generator {
}
}

private readVeneer() {
if (this.paramMap['veneer'] === 'true') {
this.veneer = true;
private readGapicCombo() {
if (this.paramMap['gapic_combo'] === 'true') {
this.gapic_combo = true;
}
}

Expand All @@ -229,7 +229,7 @@ export class Generator {
this.readTemplates();
this.readRest();
this.readDiregapic();
this.readVeneer();
this.readGapicCombo();
this.readLegacyProtoLoad();
}
}
Expand Down Expand Up @@ -270,7 +270,7 @@ export class Generator {
serviceYaml: this.serviceYaml,
rest: this.rest,
diregapic: this.diregapic,
veneer: this.veneer,
gapic_combo: this.gapic_combo,
legacyProtoLoad: this.legacyProtoLoad,
});
return api;
Expand Down
6 changes: 3 additions & 3 deletions typescript/src/schema/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class API {
packageName: string;
rest?: boolean;
diregapic?: boolean;
veneer?: boolean;
gapic_combo?: boolean;
legacyProtoLoad: boolean;

static isIgnoredService(
Expand Down Expand Up @@ -89,7 +89,7 @@ export class API {
// users specify the actual package name, if not, set it to product name.
this.publishName =
options.publishName || this.naming.productName.toKebabCase();
this.veneer = options.veneer ?? false;
this.gapic_combo = options.gapic_combo ?? false;
this.rest = options.rest;
this.diregapic = options.diregapic ?? false;
this.legacyProtoLoad = options.legacyProtoLoad ?? false;
Expand Down Expand Up @@ -215,7 +215,7 @@ export class API {
services: this.services,
rest: this.rest,
diregapic: this.diregapic,
veneer: this.veneer,
gapic_combo: this.gapic_combo,
legacyProtoLoad: this.legacyProtoLoad,
});
}
Expand Down
2 changes: 1 addition & 1 deletion typescript/src/schema/naming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface Options {
serviceYaml?: ServiceYaml;
rest?: boolean;
diregapic?: boolean;
veneer?: boolean;
gapic_combo?: boolean;
legacyProtoLoad?: boolean;
}

Expand Down

0 comments on commit 6b2f148

Please sign in to comment.