wire-kotlin-generator / com.squareup.wire.kotlin / KotlinGenerator

KotlinGenerator

class KotlinGenerator

Properties

schema

val schema: Schema

Functions

generateService

fun generateService(service: Service, onlyRpc: Rpc? = null): TypeSpec

If onlyRpc isn't null, this will generate code only for this onlyRpc; otherwise, all RPCs of the service will be code generated.

generateType

fun generateType(type: Type): TypeSpec

generatedServiceName

fun generatedServiceName(service: Service, rpc: Rpc? = null): ClassName

Returns the full name of the class generated for service#rpc. This returns a name like RouteGuideClient or RouteGuideGetFeatureBlockingServer.

generatedTypeName

fun generatedTypeName(type: Type): ClassName

Returns the full name of the class generated for type.

Companion Object Functions

invoke

operator fun invoke(schema: Schema, emitAndroid: Boolean = false, javaInterop: Boolean = false, rpcCallStyle: RpcCallStyle = RpcCallStyle.SUSPENDING, rpcRole: RpcRole = RpcRole.CLIENT): KotlinGenerator