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

de.gesellix.docker.remote.api.ContainerUpdateRequestJsonAdapter.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.emptySet
import kotlin.jvm.Volatile
import kotlin.text.buildString

public class ContainerUpdateRequestJsonAdapter(
  moshi: Moshi,
) : JsonAdapter() {
  private val options: JsonReader.Options = JsonReader.Options.of("CpuShares", "Memory",
      "CgroupParent", "BlkioWeight", "BlkioWeightDevice", "BlkioDeviceReadBps",
      "BlkioDeviceWriteBps", "BlkioDeviceReadIOps", "BlkioDeviceWriteIOps", "CpuPeriod", "CpuQuota",
      "CpuRealtimePeriod", "CpuRealtimeRuntime", "CpusetCpus", "CpusetMems", "Devices",
      "DeviceCgroupRules", "DeviceRequests", "KernelMemoryTCP", "MemoryReservation", "MemorySwap",
      "MemorySwappiness", "NanoCpus", "OomKillDisable", "Init", "PidsLimit", "Ulimits", "CpuCount",
      "CpuPercent", "IOMaximumIOps", "IOMaximumBandwidth", "RestartPolicy")

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

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

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

  private val nullableMutableListOfResourcesBlkioWeightDeviceInnerAdapter:
      JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java,
      ResourcesBlkioWeightDeviceInner::class.java), emptySet(), "blkioWeightDevice")

  private val nullableMutableListOfThrottleDeviceAdapter: JsonAdapter?>
      = moshi.adapter(Types.newParameterizedType(MutableList::class.java,
      ThrottleDevice::class.java), emptySet(), "blkioDeviceReadBps")

  private val nullableMutableListOfDeviceMappingAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java, DeviceMapping::class.java),
      emptySet(), "devices")

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

  private val nullableMutableListOfDeviceRequestAdapter: JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java, DeviceRequest::class.java),
      emptySet(), "deviceRequests")

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

  private val nullableMutableListOfResourcesUlimitsInnerAdapter:
      JsonAdapter?> =
      moshi.adapter(Types.newParameterizedType(MutableList::class.java,
      ResourcesUlimitsInner::class.java), emptySet(), "ulimits")

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

  @Volatile
  private var constructorRef: Constructor? = null

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

  public override fun fromJson(reader: JsonReader): ContainerUpdateRequest {
    var cpuShares: Int? = null
    var memory: Long? = null
    var cgroupParent: String? = null
    var blkioWeight: Int? = null
    var blkioWeightDevice: MutableList? = null
    var blkioDeviceReadBps: MutableList? = null
    var blkioDeviceWriteBps: MutableList? = null
    var blkioDeviceReadIOps: MutableList? = null
    var blkioDeviceWriteIOps: MutableList? = null
    var cpuPeriod: Long? = null
    var cpuQuota: Long? = null
    var cpuRealtimePeriod: Long? = null
    var cpuRealtimeRuntime: Long? = null
    var cpusetCpus: String? = null
    var cpusetMems: String? = null
    var devices: MutableList? = null
    var deviceCgroupRules: MutableList? = null
    var deviceRequests: MutableList? = null
    var kernelMemoryTCP: Long? = null
    var memoryReservation: Long? = null
    var memorySwap: Long? = null
    var memorySwappiness: Long? = null
    var nanoCpus: Long? = null
    var oomKillDisable: Boolean? = null
    var init_: Boolean? = null
    var pidsLimit: Long? = null
    var ulimits: MutableList? = null
    var cpuCount: Long? = null
    var cpuPercent: Long? = null
    var ioMaximumIOps: Long? = null
    var ioMaximumBandwidth: Long? = null
    var restartPolicy: RestartPolicy? = null
    var mask0 = -1
    reader.beginObject()
    while (reader.hasNext()) {
      when (reader.selectName(options)) {
        0 -> {
          cpuShares = nullableIntAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 0).inv()
          mask0 = mask0 and 0xfffffffe.toInt()
        }
        1 -> {
          memory = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 1).inv()
          mask0 = mask0 and 0xfffffffd.toInt()
        }
        2 -> {
          cgroupParent = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 2).inv()
          mask0 = mask0 and 0xfffffffb.toInt()
        }
        3 -> {
          blkioWeight = nullableIntAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 3).inv()
          mask0 = mask0 and 0xfffffff7.toInt()
        }
        4 -> {
          blkioWeightDevice =
              nullableMutableListOfResourcesBlkioWeightDeviceInnerAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 4).inv()
          mask0 = mask0 and 0xffffffef.toInt()
        }
        5 -> {
          blkioDeviceReadBps = nullableMutableListOfThrottleDeviceAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 5).inv()
          mask0 = mask0 and 0xffffffdf.toInt()
        }
        6 -> {
          blkioDeviceWriteBps = nullableMutableListOfThrottleDeviceAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 6).inv()
          mask0 = mask0 and 0xffffffbf.toInt()
        }
        7 -> {
          blkioDeviceReadIOps = nullableMutableListOfThrottleDeviceAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 7).inv()
          mask0 = mask0 and 0xffffff7f.toInt()
        }
        8 -> {
          blkioDeviceWriteIOps = nullableMutableListOfThrottleDeviceAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 8).inv()
          mask0 = mask0 and 0xfffffeff.toInt()
        }
        9 -> {
          cpuPeriod = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 9).inv()
          mask0 = mask0 and 0xfffffdff.toInt()
        }
        10 -> {
          cpuQuota = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 10).inv()
          mask0 = mask0 and 0xfffffbff.toInt()
        }
        11 -> {
          cpuRealtimePeriod = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 11).inv()
          mask0 = mask0 and 0xfffff7ff.toInt()
        }
        12 -> {
          cpuRealtimeRuntime = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 12).inv()
          mask0 = mask0 and 0xffffefff.toInt()
        }
        13 -> {
          cpusetCpus = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 13).inv()
          mask0 = mask0 and 0xffffdfff.toInt()
        }
        14 -> {
          cpusetMems = nullableStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 14).inv()
          mask0 = mask0 and 0xffffbfff.toInt()
        }
        15 -> {
          devices = nullableMutableListOfDeviceMappingAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 15).inv()
          mask0 = mask0 and 0xffff7fff.toInt()
        }
        16 -> {
          deviceCgroupRules = nullableMutableListOfStringAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 16).inv()
          mask0 = mask0 and 0xfffeffff.toInt()
        }
        17 -> {
          deviceRequests = nullableMutableListOfDeviceRequestAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 17).inv()
          mask0 = mask0 and 0xfffdffff.toInt()
        }
        18 -> {
          kernelMemoryTCP = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 18).inv()
          mask0 = mask0 and 0xfffbffff.toInt()
        }
        19 -> {
          memoryReservation = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 19).inv()
          mask0 = mask0 and 0xfff7ffff.toInt()
        }
        20 -> {
          memorySwap = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 20).inv()
          mask0 = mask0 and 0xffefffff.toInt()
        }
        21 -> {
          memorySwappiness = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 21).inv()
          mask0 = mask0 and 0xffdfffff.toInt()
        }
        22 -> {
          nanoCpus = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 22).inv()
          mask0 = mask0 and 0xffbfffff.toInt()
        }
        23 -> {
          oomKillDisable = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 23).inv()
          mask0 = mask0 and 0xff7fffff.toInt()
        }
        24 -> {
          init_ = nullableBooleanAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 24).inv()
          mask0 = mask0 and 0xfeffffff.toInt()
        }
        25 -> {
          pidsLimit = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 25).inv()
          mask0 = mask0 and 0xfdffffff.toInt()
        }
        26 -> {
          ulimits = nullableMutableListOfResourcesUlimitsInnerAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 26).inv()
          mask0 = mask0 and 0xfbffffff.toInt()
        }
        27 -> {
          cpuCount = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 27).inv()
          mask0 = mask0 and 0xf7ffffff.toInt()
        }
        28 -> {
          cpuPercent = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 28).inv()
          mask0 = mask0 and 0xefffffff.toInt()
        }
        29 -> {
          ioMaximumIOps = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 29).inv()
          mask0 = mask0 and 0xdfffffff.toInt()
        }
        30 -> {
          ioMaximumBandwidth = nullableLongAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 30).inv()
          mask0 = mask0 and 0xbfffffff.toInt()
        }
        31 -> {
          restartPolicy = nullableRestartPolicyAdapter.fromJson(reader)
          // $mask = $mask and (1 shl 31).inv()
          mask0 = mask0 and 0x7fffffff.toInt()
        }
        -1 -> {
          // Unknown name, skip it.
          reader.skipName()
          reader.skipValue()
        }
      }
    }
    reader.endObject()
    if (mask0 == 0x0.toInt()) {
      // All parameters with defaults are set, invoke the constructor directly
      return  ContainerUpdateRequest(
          cpuShares = cpuShares,
          memory = memory,
          cgroupParent = cgroupParent,
          blkioWeight = blkioWeight,
          blkioWeightDevice = blkioWeightDevice,
          blkioDeviceReadBps = blkioDeviceReadBps,
          blkioDeviceWriteBps = blkioDeviceWriteBps,
          blkioDeviceReadIOps = blkioDeviceReadIOps,
          blkioDeviceWriteIOps = blkioDeviceWriteIOps,
          cpuPeriod = cpuPeriod,
          cpuQuota = cpuQuota,
          cpuRealtimePeriod = cpuRealtimePeriod,
          cpuRealtimeRuntime = cpuRealtimeRuntime,
          cpusetCpus = cpusetCpus,
          cpusetMems = cpusetMems,
          devices = devices,
          deviceCgroupRules = deviceCgroupRules,
          deviceRequests = deviceRequests,
          kernelMemoryTCP = kernelMemoryTCP,
          memoryReservation = memoryReservation,
          memorySwap = memorySwap,
          memorySwappiness = memorySwappiness,
          nanoCpus = nanoCpus,
          oomKillDisable = oomKillDisable,
          `init` = init_,
          pidsLimit = pidsLimit,
          ulimits = ulimits,
          cpuCount = cpuCount,
          cpuPercent = cpuPercent,
          ioMaximumIOps = ioMaximumIOps,
          ioMaximumBandwidth = ioMaximumBandwidth,
          restartPolicy = restartPolicy
      )
    } else {
      // Reflectively invoke the synthetic defaults constructor
      @Suppress("UNCHECKED_CAST")
      val localConstructor: Constructor = this.constructorRef ?:
          ContainerUpdateRequest::class.java.getDeclaredConstructor(Int::class.javaObjectType,
          Long::class.javaObjectType, String::class.java, Int::class.javaObjectType,
          MutableList::class.java, MutableList::class.java, MutableList::class.java,
          MutableList::class.java, MutableList::class.java, Long::class.javaObjectType,
          Long::class.javaObjectType, Long::class.javaObjectType, Long::class.javaObjectType,
          String::class.java, String::class.java, MutableList::class.java, MutableList::class.java,
          MutableList::class.java, Long::class.javaObjectType, Long::class.javaObjectType,
          Long::class.javaObjectType, Long::class.javaObjectType, Long::class.javaObjectType,
          Boolean::class.javaObjectType, Boolean::class.javaObjectType, Long::class.javaObjectType,
          MutableList::class.java, Long::class.javaObjectType, Long::class.javaObjectType,
          Long::class.javaObjectType, Long::class.javaObjectType, RestartPolicy::class.java,
          Int::class.javaPrimitiveType, Util.DEFAULT_CONSTRUCTOR_MARKER).also {
          this.constructorRef = it }
      return localConstructor.newInstance(
          cpuShares,
          memory,
          cgroupParent,
          blkioWeight,
          blkioWeightDevice,
          blkioDeviceReadBps,
          blkioDeviceWriteBps,
          blkioDeviceReadIOps,
          blkioDeviceWriteIOps,
          cpuPeriod,
          cpuQuota,
          cpuRealtimePeriod,
          cpuRealtimeRuntime,
          cpusetCpus,
          cpusetMems,
          devices,
          deviceCgroupRules,
          deviceRequests,
          kernelMemoryTCP,
          memoryReservation,
          memorySwap,
          memorySwappiness,
          nanoCpus,
          oomKillDisable,
          init_,
          pidsLimit,
          ulimits,
          cpuCount,
          cpuPercent,
          ioMaximumIOps,
          ioMaximumBandwidth,
          restartPolicy,
          mask0,
          /* DefaultConstructorMarker */ null
      )
    }
  }

  public override fun toJson(writer: JsonWriter, value_: ContainerUpdateRequest?): Unit {
    if (value_ == null) {
      throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
    }
    writer.beginObject()
    writer.name("CpuShares")
    nullableIntAdapter.toJson(writer, value_.cpuShares)
    writer.name("Memory")
    nullableLongAdapter.toJson(writer, value_.memory)
    writer.name("CgroupParent")
    nullableStringAdapter.toJson(writer, value_.cgroupParent)
    writer.name("BlkioWeight")
    nullableIntAdapter.toJson(writer, value_.blkioWeight)
    writer.name("BlkioWeightDevice")
    nullableMutableListOfResourcesBlkioWeightDeviceInnerAdapter.toJson(writer,
        value_.blkioWeightDevice)
    writer.name("BlkioDeviceReadBps")
    nullableMutableListOfThrottleDeviceAdapter.toJson(writer, value_.blkioDeviceReadBps)
    writer.name("BlkioDeviceWriteBps")
    nullableMutableListOfThrottleDeviceAdapter.toJson(writer, value_.blkioDeviceWriteBps)
    writer.name("BlkioDeviceReadIOps")
    nullableMutableListOfThrottleDeviceAdapter.toJson(writer, value_.blkioDeviceReadIOps)
    writer.name("BlkioDeviceWriteIOps")
    nullableMutableListOfThrottleDeviceAdapter.toJson(writer, value_.blkioDeviceWriteIOps)
    writer.name("CpuPeriod")
    nullableLongAdapter.toJson(writer, value_.cpuPeriod)
    writer.name("CpuQuota")
    nullableLongAdapter.toJson(writer, value_.cpuQuota)
    writer.name("CpuRealtimePeriod")
    nullableLongAdapter.toJson(writer, value_.cpuRealtimePeriod)
    writer.name("CpuRealtimeRuntime")
    nullableLongAdapter.toJson(writer, value_.cpuRealtimeRuntime)
    writer.name("CpusetCpus")
    nullableStringAdapter.toJson(writer, value_.cpusetCpus)
    writer.name("CpusetMems")
    nullableStringAdapter.toJson(writer, value_.cpusetMems)
    writer.name("Devices")
    nullableMutableListOfDeviceMappingAdapter.toJson(writer, value_.devices)
    writer.name("DeviceCgroupRules")
    nullableMutableListOfStringAdapter.toJson(writer, value_.deviceCgroupRules)
    writer.name("DeviceRequests")
    nullableMutableListOfDeviceRequestAdapter.toJson(writer, value_.deviceRequests)
    writer.name("KernelMemoryTCP")
    nullableLongAdapter.toJson(writer, value_.kernelMemoryTCP)
    writer.name("MemoryReservation")
    nullableLongAdapter.toJson(writer, value_.memoryReservation)
    writer.name("MemorySwap")
    nullableLongAdapter.toJson(writer, value_.memorySwap)
    writer.name("MemorySwappiness")
    nullableLongAdapter.toJson(writer, value_.memorySwappiness)
    writer.name("NanoCpus")
    nullableLongAdapter.toJson(writer, value_.nanoCpus)
    writer.name("OomKillDisable")
    nullableBooleanAdapter.toJson(writer, value_.oomKillDisable)
    writer.name("Init")
    nullableBooleanAdapter.toJson(writer, value_.`init`)
    writer.name("PidsLimit")
    nullableLongAdapter.toJson(writer, value_.pidsLimit)
    writer.name("Ulimits")
    nullableMutableListOfResourcesUlimitsInnerAdapter.toJson(writer, value_.ulimits)
    writer.name("CpuCount")
    nullableLongAdapter.toJson(writer, value_.cpuCount)
    writer.name("CpuPercent")
    nullableLongAdapter.toJson(writer, value_.cpuPercent)
    writer.name("IOMaximumIOps")
    nullableLongAdapter.toJson(writer, value_.ioMaximumIOps)
    writer.name("IOMaximumBandwidth")
    nullableLongAdapter.toJson(writer, value_.ioMaximumBandwidth)
    writer.name("RestartPolicy")
    nullableRestartPolicyAdapter.toJson(writer, value_.restartPolicy)
    writer.endObject()
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy