Search in sources :

Example 6 with InterfaceView

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

the class PythonGapicSurfaceTransformer method topLevelRequireViews.

private List<VersionIndexRequireView> topLevelRequireViews(Model model, GapicProductConfig productConfig, SurfaceNamer namer) {
    ImmutableList.Builder<VersionIndexRequireView> views = ImmutableList.builder();
    Iterable<Interface> apiInterfaces = new InterfaceView().getElementIterable(model);
    for (Interface apiInterface : apiInterfaces) {
        views.add(VersionIndexRequireView.newBuilder().clientName(namer.getApiWrapperClassName(productConfig.getInterfaceConfig(apiInterface))).localName(namer.getApiWrapperVariableName(productConfig.getInterfaceConfig(apiInterface))).fileName(namer.getNotImplementedString("VersionIndexRequireView.fileName")).build());
    }
    return views.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) InterfaceView(com.google.api.codegen.InterfaceView) Interface(com.google.api.tools.framework.model.Interface) VersionIndexRequireView(com.google.api.codegen.viewmodel.metadata.VersionIndexRequireView)

Example 7 with InterfaceView

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

the class PythonImportSectionTransformer method generateTopLevelEntryPointAppImports.

private List<ImportFileView> generateTopLevelEntryPointAppImports(Model model, GapicProductConfig productConfig, SurfaceNamer namer, boolean packageHasEnums) {
    Set<ImportFileView> imports = new TreeSet<>(importFileViewComparator());
    for (Interface apiInterface : new InterfaceView().getElementIterable(model)) {
        imports.add(createImport(namer.getVersionedDirectoryNamespace(), namer.getApiWrapperClassName(productConfig.getInterfaceConfig(apiInterface))));
    }
    if (packageHasEnums) {
        imports.add(createImport(namer.getVersionedDirectoryNamespace(), "enums"));
    }
    imports.add(createImport(namer.getVersionedDirectoryNamespace(), "types"));
    return ImmutableList.<ImportFileView>builder().addAll(imports).build();
}
Also used : ImportFileView(com.google.api.codegen.viewmodel.ImportFileView) TreeSet(java.util.TreeSet) InterfaceView(com.google.api.codegen.InterfaceView) Interface(com.google.api.tools.framework.model.Interface)

Aggregations

InterfaceView (com.google.api.codegen.InterfaceView)7 Interface (com.google.api.tools.framework.model.Interface)7 ImmutableList (com.google.common.collect.ImmutableList)3 ImportFileView (com.google.api.codegen.viewmodel.ImportFileView)2 VersionIndexRequireView (com.google.api.codegen.viewmodel.metadata.VersionIndexRequireView)2 ClientConfigGapicContext (com.google.api.codegen.clientconfig.ClientConfigGapicContext)1 ClientConfigSnippetSetRunner (com.google.api.codegen.clientconfig.ClientConfigSnippetSetRunner)1 PhpClientConfigGapicContext (com.google.api.codegen.clientconfig.php.PhpClientConfigGapicContext)1 GapicInterfaceConfig (com.google.api.codegen.config.GapicInterfaceConfig)1 GapicMethodConfig (com.google.api.codegen.config.GapicMethodConfig)1 InterfaceConfig (com.google.api.codegen.config.InterfaceConfig)1 MethodConfig (com.google.api.codegen.config.MethodConfig)1 NodeJSCodePathMapper (com.google.api.codegen.nodejs.NodeJSCodePathMapper)1 PhpGapicCodePathMapper (com.google.api.codegen.php.PhpGapicCodePathMapper)1 CommonSnippetSetRunner (com.google.api.codegen.rendering.CommonSnippetSetRunner)1 CSharpGapicClientTransformer (com.google.api.codegen.transformer.csharp.CSharpGapicClientTransformer)1 CSharpGapicSmokeTestTransformer (com.google.api.codegen.transformer.csharp.CSharpGapicSmokeTestTransformer)1 CSharpGapicSnippetsTransformer (com.google.api.codegen.transformer.csharp.CSharpGapicSnippetsTransformer)1 CSharpGapicUnitTestTransformer (com.google.api.codegen.transformer.csharp.CSharpGapicUnitTestTransformer)1 GoGapicSurfaceTestTransformer (com.google.api.codegen.transformer.go.GoGapicSurfaceTestTransformer)1