use of com.google.api.codegen.viewmodel.PathTemplateGetterFunctionView in project toolkit by googleapis.
the class PathTemplateTransformer method generatePathTemplateGetterFunctions.
public List<PathTemplateGetterFunctionView> generatePathTemplateGetterFunctions(GapicInterfaceContext context) {
List<PathTemplateGetterFunctionView> functions = new ArrayList<>();
SurfaceNamer namer = context.getNamer();
InterfaceConfig interfaceConfig = context.getInterfaceConfig();
for (SingleResourceNameConfig resourceNameConfig : getSingleResourceNameConfigsUsedByInterface(context)) {
PathTemplateGetterFunctionView.Builder function = PathTemplateGetterFunctionView.newBuilder().name(namer.getPathTemplateNameGetter(interfaceConfig, resourceNameConfig)).resourceName(namer.getPathTemplateResourcePhraseName(resourceNameConfig)).entityName(namer.getEntityName(resourceNameConfig)).pathTemplateName(namer.getPathTemplateName(interfaceConfig, resourceNameConfig)).pattern(resourceNameConfig.getNamePattern());
functions.add(function.build());
}
return functions;
}
Aggregations