use of com.google.api.codegen.util.NamePath in project toolkit by googleapis.
the class PythonGapicSurfaceTransformer method topLevelEntryPointFileName.
private String topLevelEntryPointFileName(SurfaceNamer namer) {
NamePath namePath = NamePath.dotted(namer.getVersionedDirectoryNamespace());
String name = namePath.getHead();
int lastUnderscoreIndex = name.lastIndexOf("_");
if (lastUnderscoreIndex > -1 && VersionMatcher.isVersion(name.substring(lastUnderscoreIndex + 1))) {
name = name.substring(0, lastUnderscoreIndex);
}
String topLevelPath = namePath.withHead(name).toSlashed();
return String.format("%s.py", topLevelPath);
}
Aggregations