All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vrap.codegen.languages.python.client.RootInitFileProducer.kt Maven / Gradle / Ivy

Go to download

RAML API client code generators based on the REST Modeling Framework. https://github.com/vrapio/rest-modeling-framework

There is a newer version: 1.0.0-20241120142200
Show newest version
/**
 *  Copyright 2021 Michael van Tellingen
 */
package io.vrap.codegen.languages.python.client

import io.vrap.codegen.languages.python.pyGeneratedComment
import io.vrap.rmf.codegen.io.TemplateFile
import io.vrap.rmf.codegen.rendering.FileProducer
import io.vrap.rmf.codegen.types.VrapTypeProvider
import io.vrap.rmf.codegen.di.BasePackageName

class RootInitFileProducer constructor(
    val vrapTypeProvider: VrapTypeProvider,
    @BasePackageName
    val basePackageName: String
) : FileProducer {

    override fun produceFiles(): List {
        return listOf(produceRootInitFile())
    }

    fun produceRootInitFile(): TemplateFile {
        return TemplateFile(
            relativePath = "$basePackageName/__init__.py",
            content = """|
                |$pyGeneratedComment
                |from .client import Client
            """.trimMargin()
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy