Search in sources :

Example 1 with PackageMetadataTransformer

use of com.google.api.codegen.transformer.PackageMetadataTransformer in project toolkit by googleapis.

the class PythonGrpcMetadataTransformer method transform.

public List<PackageMetadataView> transform(ApiModel model, PackageMetadataConfig config) {
    ArrayList<PackageMetadataView> views = new ArrayList<>();
    PythonSurfaceNamer surfaceNamer = new PythonSurfaceNamer(config.packageName(TargetLanguage.PYTHON));
    PackageMetadataTransformer transformer = new PackageMetadataTransformer();
    for (String snippetFilename : SNIPPETS) {
        PackageMetadataView view = transformer.generateMetadataView(new PackageMetadataNamer(), config, model, snippetFilename, outputPath(snippetFilename), TargetLanguage.PYTHON, PROTO_PACKAGE_DEPENDENCY_WHITELIST).namespacePackages(copierResult.namespacePackages()).developmentStatus(surfaceNamer.getReleaseAnnotation(config.releaseLevel(TargetLanguage.PYTHON))).build();
        views.add(view);
    }
    return views;
}
Also used : PythonSurfaceNamer(com.google.api.codegen.transformer.py.PythonSurfaceNamer) PackageMetadataTransformer(com.google.api.codegen.transformer.PackageMetadataTransformer) ArrayList(java.util.ArrayList) PackageMetadataView(com.google.api.codegen.viewmodel.metadata.PackageMetadataView) PackageMetadataNamer(com.google.api.codegen.transformer.PackageMetadataNamer)

Aggregations

PackageMetadataNamer (com.google.api.codegen.transformer.PackageMetadataNamer)1 PackageMetadataTransformer (com.google.api.codegen.transformer.PackageMetadataTransformer)1 PythonSurfaceNamer (com.google.api.codegen.transformer.py.PythonSurfaceNamer)1 PackageMetadataView (com.google.api.codegen.viewmodel.metadata.PackageMetadataView)1 ArrayList (java.util.ArrayList)1