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

org.http4k.connect.kafka.schemaregistry.schemaregistryExtensions.kt Maven / Gradle / Ivy

package org.http4k.connect.kafka.schemaregistry

import dev.forkhandles.result4k.Result
import kotlin.Array
import kotlin.collections.List
import org.apache.avro.Schema
import org.http4k.connect.RemoteFailure
import org.http4k.connect.kafka.schemaregistry.action.CheckSchemaRegistered
import org.http4k.connect.kafka.schemaregistry.action.GetSchemaById
import org.http4k.connect.kafka.schemaregistry.action.GetSubjectVersion
import org.http4k.connect.kafka.schemaregistry.action.GetSubjectVersions
import org.http4k.connect.kafka.schemaregistry.action.GetSubjects
import org.http4k.connect.kafka.schemaregistry.action.References
import org.http4k.connect.kafka.schemaregistry.action.RegisterSchema
import org.http4k.connect.kafka.schemaregistry.action.RegisteredSchema
import org.http4k.connect.kafka.schemaregistry.action.RegisteredSchemaVersion
import org.http4k.connect.kafka.schemaregistry.action.SchemaById
import org.http4k.connect.kafka.schemaregistry.model.SchemaId
import org.http4k.connect.kafka.schemaregistry.model.SchemaType
import org.http4k.connect.kafka.schemaregistry.model.Subject
import org.http4k.connect.kafka.schemaregistry.model.Version

/**
 * @see org.http4k.connect.kafka.schemaregistry.action.CheckSchemaRegistered
 */
public fun SchemaRegistry.checkSchemaRegistered(subject: Subject, schema: Schema):
    Result = invoke(CheckSchemaRegistered(subject, schema))

/**
 * @see org.http4k.connect.kafka.schemaregistry.action.GetSchemaById
 */
public fun SchemaRegistry.getSchemaById(id: SchemaId): Result =
    invoke(GetSchemaById(id))

/**
 * @see org.http4k.connect.kafka.schemaregistry.action.GetSubjectVersion
 */
public fun SchemaRegistry.getSubjectVersion(subject: Subject, version: Version):
    Result = invoke(GetSubjectVersion(subject, version))

/**
 * @see org.http4k.connect.kafka.schemaregistry.action.GetSubjectVersions
 */
public fun SchemaRegistry.getSubjectVersions(subject: Subject):
    Result, RemoteFailure> = invoke(GetSubjectVersions(subject))

/**
 * @see org.http4k.connect.kafka.schemaregistry.action.GetSubjects
 */
public fun SchemaRegistry.getSubjects(): Result, RemoteFailure> = invoke(GetSubjects)

/**
 * @see org.http4k.connect.kafka.schemaregistry.action.RegisterSchema
 */
public fun SchemaRegistry.registerSchema(
  subject: Subject,
  schema: Schema,
  schemaType: SchemaType,
  references: List,
): Result = invoke(RegisterSchema(subject, schema, schemaType,
    references))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy