Search in sources :

Example 6 with NamePath

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);
}
Also used : NamePath(com.google.api.codegen.util.NamePath)

Aggregations

NamePath (com.google.api.codegen.util.NamePath)6 ProtoInterfaceModel (com.google.api.codegen.config.ProtoInterfaceModel)2