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

net.nemerosa.ontrack.kdsl.spec.settings.SettingsInterface.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.kdsl.spec.settings

import net.nemerosa.ontrack.json.parseInto
import net.nemerosa.ontrack.kdsl.connector.Connected
import net.nemerosa.ontrack.kdsl.connector.Connector
import kotlin.reflect.KClass

class SettingsInterface(
    connector: Connector,
    val id: String,
    val type: KClass,
) : Connected(connector) {

    fun get(): T = connector.get("/rest/settings/$id")
        .body.asJson().parseInto(type)

    fun set(value: T) {
        connector.put("/rest/settings/$id", body = value)
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy