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

de.gesellix.docker.remote.api.HostConfigAllOfJsonAdapter.kt Maven / Gradle / Ivy

// Code generated by moshi-kotlin-codegen. Do not edit.
@file:Suppress("DEPRECATION", "unused", "UNUSED_PARAMETER", "ClassName", "REDUNDANT_PROJECTION",
    "RedundantExplicitType", "LocalVariableName", "RedundantVisibilityModifier",
    "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION")

package de.gesellix.docker.remote.api

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types
import com.squareup.moshi.`internal`.Util
import java.lang.NullPointerException
import java.lang.reflect.Constructor
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.MutableList
import kotlin.collections.MutableMap
import kotlin.collections.emptySet
import kotlin.jvm.Volatile
import kotlin.text.buildString

public class HostConfigAllOfJsonAdapter(
  moshi: Moshi,
) : JsonAdapter() {
  private val options: JsonReader.Options = JsonReader.Options.of("Binds", "ContainerIDFile",
      "LogConfig", "NetworkMode", "PortBindings", "RestartPolicy", "AutoRemove", "VolumeDriver",
      "VolumesFrom", "Mounts", "CapAdd", "CapDrop", "CgroupnsMode", "Dns", "DnsOptions",
      "DnsSearch", "ExtraHosts", "GroupAdd", "IpcMode", "Cgroup", "Links", "OomScoreAdj", "PidMode",
      "Privileged", "PublishAllPorts", "ReadonlyRootfs", "SecurityOpt", "StorageOpt", "Tmpfs",
      "UTSMode", "UsernsMode", "ShmSize", "Sysctls", "Runtime", "ConsoleSize", "Isolation",
      "MaskedPaths", "ReadonlyPaths")

  private val nullableMutableListOfStringAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java, String::class.java),
      emptySet(), "binds")

  private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
      emptySet(), "containerIDFile")

  private val nullableHostConfigAllOfLogConfigAdapter: JsonAdapter =
      moshi.adapter(HostConfigAllOfLogConfig::class.java, emptySet(), "logConfig")

  private val nullableMutableMapOfStringMutableListOfPortBindingAdapter:
      JsonAdapter>?> =
      moshi.adapter(Types.newParameterizedType(MutableMap::class.java, String::class.java,
      Types.newParameterizedType(MutableList::class.java, PortBinding::class.java)), emptySet(),
      "portBindings")

  private val nullableRestartPolicyAdapter: JsonAdapter =
      moshi.adapter(RestartPolicy::class.java, emptySet(), "restartPolicy")

  private val nullableBooleanAdapter: JsonAdapter =
      moshi.adapter(Boolean::class.javaObjectType, emptySet(), "autoRemove")

  private val nullableMutableListOfMountAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java, Mount::class.java),
      emptySet(), "mounts")

  private val nullableCgroupnsModeAdapter: JsonAdapter =
      moshi.adapter(HostConfigAllOf.CgroupnsMode::class.java, emptySet(), "cgroupnsMode")

  private val nullableIntAdapter: JsonAdapter = moshi.adapter(Int::class.javaObjectType,
      emptySet(), "oomScoreAdj")

  private val nullableMutableMapOfStringStringAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableMap::class.java, String::class.java,
      String::class.java), emptySet(), "storageOpt")

  private val nullableLongAdapter: JsonAdapter = moshi.adapter(Long::class.javaObjectType,
      emptySet(), "shmSize")

  private val nullableMutableListOfIntAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java, Int::class.javaObjectType),
      emptySet(), "consoleSize")

  private val nullableIsolationAdapter: JsonAdapter =
      moshi.adapter(HostConfigAllOf.Isolation::class.java, emptySet(), "isolation")

  @Volatile
  private var constructorRef: Constructor? = null

  public override fun toString(): String = buildString(37) {
      append("GeneratedJsonAdapter(").append("HostConfigAllOf").append(')') }

  public override fun fromJson(reader: JsonReader): HostConfigAllOf {
    var binds: MutableList? = null
    var containerIDFile: String? = null
    var logConfig: HostConfigAllOfLogConfig? = null
    var networkMode: String? = null
    var portBindings: MutableMap>? = null
    var restartPolicy: RestartPolicy? = null
    var autoRemove: Boolean? = null
    var volumeDriver: String? = null
    var volumesFrom: MutableList? = null
    var mounts: MutableList? = null
    var capAdd: MutableList? = null
    var capDrop: MutableList? = null
    var cgroupnsMode: HostConfigAllOf.CgroupnsMode? = null
    var dns: MutableList? = null
    var dnsOptions: MutableList? = null
    var dnsSearch: MutableList? = null
    var extraHosts: MutableList? = null
    var groupAdd: MutableList? = null
    var ipcMode: String? = null
    var cgroup: String? = null
    var links: MutableList? = null
    var oomScoreAdj: Int? = null
    var pidMode: String? = null
    var privileged: Boolean? = null
    var publishAllPorts: Boolean? = null
    var readonlyRootfs: Boolean? = null
    var securityOpt: MutableList? = null
    var storageOpt: MutableMap? = null
    var tmpfs: MutableMap? = null
    var utSMode: String? = null
    var usernsMode: String? = null
    var shmSize: Long? = null
    var sysctls: MutableMap? = null
    var runtime: String? = null
    var consoleSize: MutableList? = null
    var isolation: HostConfigAllOf.Isolation? = null
    var maskedPaths: MutableList? = null
    var readonlyPaths: MutableList? = null
    var mask0 = -1
    var mask1 = -1
    reader.beginObject()
    while (reader.hasNext()) {
      when (reader.selectName(options)) {
        0 -> {
          binds = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 0).inv()
          mask0 = mask0 and 0xfffffffe.toInt()
        }
        1 -> {
          containerIDFile = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 1).inv()
          mask0 = mask0 and 0xfffffffd.toInt()
        }
        2 -> {
          logConfig = nullableHostConfigAllOfLogConfigAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 2).inv()
          mask0 = mask0 and 0xfffffffb.toInt()
        }
        3 -> {
          networkMode = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 3).inv()
          mask0 = mask0 and 0xfffffff7.toInt()
        }
        4 -> {
          portBindings = nullableMutableMapOfStringMutableListOfPortBindingAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 4).inv()
          mask0 = mask0 and 0xffffffef.toInt()
        }
        5 -> {
          restartPolicy = nullableRestartPolicyAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 5).inv()
          mask0 = mask0 and 0xffffffdf.toInt()
        }
        6 -> {
          autoRemove = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 6).inv()
          mask0 = mask0 and 0xffffffbf.toInt()
        }
        7 -> {
          volumeDriver = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 7).inv()
          mask0 = mask0 and 0xffffff7f.toInt()
        }
        8 -> {
          volumesFrom = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 8).inv()
          mask0 = mask0 and 0xfffffeff.toInt()
        }
        9 -> {
          mounts = nullableMutableListOfMountAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 9).inv()
          mask0 = mask0 and 0xfffffdff.toInt()
        }
        10 -> {
          capAdd = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 10).inv()
          mask0 = mask0 and 0xfffffbff.toInt()
        }
        11 -> {
          capDrop = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 11).inv()
          mask0 = mask0 and 0xfffff7ff.toInt()
        }
        12 -> {
          cgroupnsMode = nullableCgroupnsModeAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 12).inv()
          mask0 = mask0 and 0xffffefff.toInt()
        }
        13 -> {
          dns = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 13).inv()
          mask0 = mask0 and 0xffffdfff.toInt()
        }
        14 -> {
          dnsOptions = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 14).inv()
          mask0 = mask0 and 0xffffbfff.toInt()
        }
        15 -> {
          dnsSearch = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 15).inv()
          mask0 = mask0 and 0xffff7fff.toInt()
        }
        16 -> {
          extraHosts = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 16).inv()
          mask0 = mask0 and 0xfffeffff.toInt()
        }
        17 -> {
          groupAdd = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 17).inv()
          mask0 = mask0 and 0xfffdffff.toInt()
        }
        18 -> {
          ipcMode = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 18).inv()
          mask0 = mask0 and 0xfffbffff.toInt()
        }
        19 -> {
          cgroup = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 19).inv()
          mask0 = mask0 and 0xfff7ffff.toInt()
        }
        20 -> {
          links = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 20).inv()
          mask0 = mask0 and 0xffefffff.toInt()
        }
        21 -> {
          oomScoreAdj = nullableIntAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 21).inv()
          mask0 = mask0 and 0xffdfffff.toInt()
        }
        22 -> {
          pidMode = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 22).inv()
          mask0 = mask0 and 0xffbfffff.toInt()
        }
        23 -> {
          privileged = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 23).inv()
          mask0 = mask0 and 0xff7fffff.toInt()
        }
        24 -> {
          publishAllPorts = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 24).inv()
          mask0 = mask0 and 0xfeffffff.toInt()
        }
        25 -> {
          readonlyRootfs = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 25).inv()
          mask0 = mask0 and 0xfdffffff.toInt()
        }
        26 -> {
          securityOpt = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 26).inv()
          mask0 = mask0 and 0xfbffffff.toInt()
        }
        27 -> {
          storageOpt = nullableMutableMapOfStringStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 27).inv()
          mask0 = mask0 and 0xf7ffffff.toInt()
        }
        28 -> {
          tmpfs = nullableMutableMapOfStringStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 28).inv()
          mask0 = mask0 and 0xefffffff.toInt()
        }
        29 -> {
          utSMode = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 29).inv()
          mask0 = mask0 and 0xdfffffff.toInt()
        }
        30 -> {
          usernsMode = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 30).inv()
          mask0 = mask0 and 0xbfffffff.toInt()
        }
        31 -> {
          shmSize = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 31).inv()
          mask0 = mask0 and 0x7fffffff.toInt()
        }
        32 -> {
          sysctls = nullableMutableMapOfStringStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 0).inv()
          mask1 = mask1 and 0xfffffffe.toInt()
        }
        33 -> {
          runtime = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 1).inv()
          mask1 = mask1 and 0xfffffffd.toInt()
        }
        34 -> {
          consoleSize = nullableMutableListOfIntAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 2).inv()
          mask1 = mask1 and 0xfffffffb.toInt()
        }
        35 -> {
          isolation = nullableIsolationAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 3).inv()
          mask1 = mask1 and 0xfffffff7.toInt()
        }
        36 -> {
          maskedPaths = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 4).inv()
          mask1 = mask1 and 0xffffffef.toInt()
        }
        37 -> {
          readonlyPaths = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 5).inv()
          mask1 = mask1 and 0xffffffdf.toInt()
        }
        -1 -> {
          // Unknown name, skip it.
          reader.skipName()
          reader.skipValue()
        }
      }
    }
    reader.endObject()
    if (mask0 == 0x0.toInt() && mask1 == 0xffffffc0.toInt()) {
      // All parameters with defaults are set, invoke the constructor directly
      return  HostConfigAllOf(
          binds = binds,
          containerIDFile = containerIDFile,
          logConfig = logConfig,
          networkMode = networkMode,
          portBindings = portBindings,
          restartPolicy = restartPolicy,
          autoRemove = autoRemove,
          volumeDriver = volumeDriver,
          volumesFrom = volumesFrom,
          mounts = mounts,
          capAdd = capAdd,
          capDrop = capDrop,
          cgroupnsMode = cgroupnsMode,
          dns = dns,
          dnsOptions = dnsOptions,
          dnsSearch = dnsSearch,
          extraHosts = extraHosts,
          groupAdd = groupAdd,
          ipcMode = ipcMode,
          cgroup = cgroup,
          links = links,
          oomScoreAdj = oomScoreAdj,
          pidMode = pidMode,
          privileged = privileged,
          publishAllPorts = publishAllPorts,
          readonlyRootfs = readonlyRootfs,
          securityOpt = securityOpt,
          storageOpt = storageOpt,
          tmpfs = tmpfs,
          utSMode = utSMode,
          usernsMode = usernsMode,
          shmSize = shmSize,
          sysctls = sysctls,
          runtime = runtime,
          consoleSize = consoleSize,
          isolation = isolation,
          maskedPaths = maskedPaths,
          readonlyPaths = readonlyPaths
      )
    } else {
      // Reflectively invoke the synthetic defaults constructor
      @Suppress("UNCHECKED_CAST")
      val localConstructor: Constructor = this.constructorRef ?:
          HostConfigAllOf::class.java.getDeclaredConstructor(MutableList::class.java,
          String::class.java, HostConfigAllOfLogConfig::class.java, String::class.java,
          MutableMap::class.java, RestartPolicy::class.java, Boolean::class.javaObjectType,
          String::class.java, MutableList::class.java, MutableList::class.java,
          MutableList::class.java, MutableList::class.java,
          HostConfigAllOf.CgroupnsMode::class.java, MutableList::class.java,
          MutableList::class.java, MutableList::class.java, MutableList::class.java,
          MutableList::class.java, String::class.java, String::class.java, MutableList::class.java,
          Int::class.javaObjectType, String::class.java, Boolean::class.javaObjectType,
          Boolean::class.javaObjectType, Boolean::class.javaObjectType, MutableList::class.java,
          MutableMap::class.java, MutableMap::class.java, String::class.java, String::class.java,
          Long::class.javaObjectType, MutableMap::class.java, String::class.java,
          MutableList::class.java, HostConfigAllOf.Isolation::class.java, MutableList::class.java,
          MutableList::class.java, Int::class.javaPrimitiveType, Int::class.javaPrimitiveType,
          Util.DEFAULT_CONSTRUCTOR_MARKER).also { this.constructorRef = it }
      return localConstructor.newInstance(
          binds,
          containerIDFile,
          logConfig,
          networkMode,
          portBindings,
          restartPolicy,
          autoRemove,
          volumeDriver,
          volumesFrom,
          mounts,
          capAdd,
          capDrop,
          cgroupnsMode,
          dns,
          dnsOptions,
          dnsSearch,
          extraHosts,
          groupAdd,
          ipcMode,
          cgroup,
          links,
          oomScoreAdj,
          pidMode,
          privileged,
          publishAllPorts,
          readonlyRootfs,
          securityOpt,
          storageOpt,
          tmpfs,
          utSMode,
          usernsMode,
          shmSize,
          sysctls,
          runtime,
          consoleSize,
          isolation,
          maskedPaths,
          readonlyPaths,
          mask0, mask1,
          /* DefaultConstructorMarker */ null
      )
    }
  }

  public override fun toJson(writer: JsonWriter, value_: HostConfigAllOf?): Unit {
    if (value_ == null) {
      throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
    }
    writer.beginObject()
    writer.name("Binds")
    nullableMutableListOfStringAdapter.toJson(writer, value_.binds)
    writer.name("ContainerIDFile")
    nullableStringAdapter.toJson(writer, value_.containerIDFile)
    writer.name("LogConfig")
    nullableHostConfigAllOfLogConfigAdapter.toJson(writer, value_.logConfig)
    writer.name("NetworkMode")
    nullableStringAdapter.toJson(writer, value_.networkMode)
    writer.name("PortBindings")
    nullableMutableMapOfStringMutableListOfPortBindingAdapter.toJson(writer, value_.portBindings)
    writer.name("RestartPolicy")
    nullableRestartPolicyAdapter.toJson(writer, value_.restartPolicy)
    writer.name("AutoRemove")
    nullableBooleanAdapter.toJson(writer, value_.autoRemove)
    writer.name("VolumeDriver")
    nullableStringAdapter.toJson(writer, value_.volumeDriver)
    writer.name("VolumesFrom")
    nullableMutableListOfStringAdapter.toJson(writer, value_.volumesFrom)
    writer.name("Mounts")
    nullableMutableListOfMountAdapter.toJson(writer, value_.mounts)
    writer.name("CapAdd")
    nullableMutableListOfStringAdapter.toJson(writer, value_.capAdd)
    writer.name("CapDrop")
    nullableMutableListOfStringAdapter.toJson(writer, value_.capDrop)
    writer.name("CgroupnsMode")
    nullableCgroupnsModeAdapter.toJson(writer, value_.cgroupnsMode)
    writer.name("Dns")
    nullableMutableListOfStringAdapter.toJson(writer, value_.dns)
    writer.name("DnsOptions")
    nullableMutableListOfStringAdapter.toJson(writer, value_.dnsOptions)
    writer.name("DnsSearch")
    nullableMutableListOfStringAdapter.toJson(writer, value_.dnsSearch)
    writer.name("ExtraHosts")
    nullableMutableListOfStringAdapter.toJson(writer, value_.extraHosts)
    writer.name("GroupAdd")
    nullableMutableListOfStringAdapter.toJson(writer, value_.groupAdd)
    writer.name("IpcMode")
    nullableStringAdapter.toJson(writer, value_.ipcMode)
    writer.name("Cgroup")
    nullableStringAdapter.toJson(writer, value_.cgroup)
    writer.name("Links")
    nullableMutableListOfStringAdapter.toJson(writer, value_.links)
    writer.name("OomScoreAdj")
    nullableIntAdapter.toJson(writer, value_.oomScoreAdj)
    writer.name("PidMode")
    nullableStringAdapter.toJson(writer, value_.pidMode)
    writer.name("Privileged")
    nullableBooleanAdapter.toJson(writer, value_.privileged)
    writer.name("PublishAllPorts")
    nullableBooleanAdapter.toJson(writer, value_.publishAllPorts)
    writer.name("ReadonlyRootfs")
    nullableBooleanAdapter.toJson(writer, value_.readonlyRootfs)
    writer.name("SecurityOpt")
    nullableMutableListOfStringAdapter.toJson(writer, value_.securityOpt)
    writer.name("StorageOpt")
    nullableMutableMapOfStringStringAdapter.toJson(writer, value_.storageOpt)
    writer.name("Tmpfs")
    nullableMutableMapOfStringStringAdapter.toJson(writer, value_.tmpfs)
    writer.name("UTSMode")
    nullableStringAdapter.toJson(writer, value_.utSMode)
    writer.name("UsernsMode")
    nullableStringAdapter.toJson(writer, value_.usernsMode)
    writer.name("ShmSize")
    nullableLongAdapter.toJson(writer, value_.shmSize)
    writer.name("Sysctls")
    nullableMutableMapOfStringStringAdapter.toJson(writer, value_.sysctls)
    writer.name("Runtime")
    nullableStringAdapter.toJson(writer, value_.runtime)
    writer.name("ConsoleSize")
    nullableMutableListOfIntAdapter.toJson(writer, value_.consoleSize)
    writer.name("Isolation")
    nullableIsolationAdapter.toJson(writer, value_.isolation)
    writer.name("MaskedPaths")
    nullableMutableListOfStringAdapter.toJson(writer, value_.maskedPaths)
    writer.name("ReadonlyPaths")
    nullableMutableListOfStringAdapter.toJson(writer, value_.readonlyPaths)
    writer.endObject()
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy