use of com.google.api.codegen.viewmodel.PathTemplateView in project toolkit by googleapis.
the class PathTemplateTransformer method generatePathTemplates.
public List<PathTemplateView> generatePathTemplates(InterfaceContext context) {
List<PathTemplateView> pathTemplates = new ArrayList<>();
if (!context.getFeatureConfig().enableStringFormatFunctions()) {
return pathTemplates;
}
for (SingleResourceNameConfig resourceNameConfig : getSingleResourceNameConfigsUsedByInterface(context)) {
PathTemplateView.Builder pathTemplate = PathTemplateView.newBuilder();
pathTemplate.name(context.getNamer().getPathTemplateName(context.getInterfaceConfig(), resourceNameConfig));
pathTemplate.pattern(resourceNameConfig.getNamePattern());
pathTemplates.add(pathTemplate.build());
}
return pathTemplates;
}
Aggregations