Skip to content

Commit

Permalink
Refactor gapic method config (googleapis#2715)
Browse files Browse the repository at this point in the history
* Refactor GapicMethodConfig to add builder and break apart
* Refactor for separate methods to create GapicMethodConfig
* Rename common gapic creation method
  • Loading branch information
michaelbausor authored and busunkim96 committed Nov 7, 2019
1 parent 8a418cc commit 35b2686
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 158 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,33 @@ private static ImmutableMap<String, GapicMethodConfig> createMethodConfigMap(
for (Entry<Method, MethodConfigProto> methodEntry : methodsToGenerate.entrySet()) {
MethodConfigProto methodConfigProto = methodEntry.getValue();
Method method = methodEntry.getKey();
GapicMethodConfig methodConfig =
GapicMethodConfig.createMethodConfig(
diagCollector,
language,
defaultPackageName,
methodConfigProto,
method,
messageConfigs,
resourceNameConfigs,
retryCodesConfig,
retryParamsConfigNames,
protoParser);
GapicMethodConfig methodConfig;
if (protoParser.isProtoAnnotationsEnabled()) {
methodConfig =
GapicMethodConfig.createGapicMethodConfigFromProto(
diagCollector,
language,
defaultPackageName,
methodConfigProto,
method,
messageConfigs,
resourceNameConfigs,
retryCodesConfig,
retryParamsConfigNames,
protoParser);
} else {
methodConfig =
GapicMethodConfig.createGapicMethodConfigFromGapicYaml(
diagCollector,
language,
defaultPackageName,
methodConfigProto,
method,
messageConfigs,
resourceNameConfigs,
retryCodesConfig,
retryParamsConfigNames);
}
if (methodConfig == null) {
continue;
}
Expand Down
Loading

0 comments on commit 35b2686

Please sign in to comment.