Search in sources :

Example 6 with PackageMetadataView

use of com.google.api.codegen.viewmodel.metadata.PackageMetadataView in project toolkit by googleapis.

the class PythonGrpcPackageTransformer method transform.

public List<PackageMetadataView> transform(ApiModel model, PackageMetadataConfig config) {
    ArrayList<PackageMetadataView> views = new ArrayList<>();
    PythonSurfaceNamer surfaceNamer = new PythonSurfaceNamer(config.packageName());
    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())).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

PackageMetadataView (com.google.api.codegen.viewmodel.metadata.PackageMetadataView)6 ArrayList (java.util.ArrayList)5 ProtoApiModel (com.google.api.codegen.config.ProtoApiModel)4 CommonSnippetSetRunner (com.google.api.codegen.rendering.CommonSnippetSetRunner)4 ImmutableMap (com.google.common.collect.ImmutableMap)4 GeneratedResult (com.google.api.codegen.common.GeneratedResult)2 PackageMetadataNamer (com.google.api.codegen.transformer.PackageMetadataNamer)2 PackageMetadataTransformer (com.google.api.codegen.transformer.PackageMetadataTransformer)2 PythonSurfaceNamer (com.google.api.codegen.transformer.py.PythonSurfaceNamer)2 Doc (com.google.api.tools.framework.snippet.Doc)2