/**
 * This code is generated using [[https://www.scala-sbt.org/contraband]].
 */

// DO NOT EDIT MANUALLY
package sbt.internal.worker.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait NativeRunInfoFormats { self: sbt.internal.worker.codec.FilePathFormats & sjsonnew.BasicJsonProtocol =>
given NativeRunInfoFormat: JsonFormat[sbt.internal.worker.NativeRunInfo] = new JsonFormat[sbt.internal.worker.NativeRunInfo] {
  override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.worker.NativeRunInfo = {
    __jsOpt match {
      case Some(__js) =>
      unbuilder.beginObject(__js)
      val cmd = unbuilder.readField[String]("cmd")
      val args = unbuilder.readField[Vector[String]]("args")
      val connectInput = unbuilder.readField[Boolean]("connectInput")
      val outputStrategy = unbuilder.readField[Option[String]]("outputStrategy")
      val workingDirectory = unbuilder.readField[Option[java.net.URI]]("workingDirectory")
      val environmentVariables = unbuilder.readField[scala.collection.immutable.Map[String, String]]("environmentVariables")
      val inputs = unbuilder.readField[Vector[sbt.internal.worker.FilePath]]("inputs")
      val outputs = unbuilder.readField[Vector[sbt.internal.worker.FilePath]]("outputs")
      unbuilder.endObject()
      sbt.internal.worker.NativeRunInfo(cmd, args, connectInput, outputStrategy, workingDirectory, environmentVariables, inputs, outputs)
      case None =>
      deserializationError("Expected JsObject but found None")
    }
  }
  override def write[J](obj: sbt.internal.worker.NativeRunInfo, builder: Builder[J]): Unit = {
    builder.beginObject()
    builder.addField("cmd", obj.cmd)
    builder.addField("args", obj.args)
    builder.addField("connectInput", obj.connectInput)
    builder.addField("outputStrategy", obj.outputStrategy)
    builder.addField("workingDirectory", obj.workingDirectory)
    builder.addField("environmentVariables", obj.environmentVariables)
    builder.addField("inputs", obj.inputs)
    builder.addField("outputs", obj.outputs)
    builder.endObject()
  }
}
}
