de.gesellix.docker.remote.api.ContainerInspectResponseJsonAdapter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docker-remote-api-model-1-45 Show documentation
Show all versions of docker-remote-api-model-1-45 Show documentation
API model for the Docker remote api v1.45
// 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.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 ContainerInspectResponseJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("Id", "Created", "Path", "Args",
"State", "Image", "ResolvConfPath", "HostnamePath", "HostsPath", "LogPath", "Name",
"RestartCount", "Driver", "Platform", "MountLabel", "ProcessLabel", "AppArmorProfile",
"ExecIDs", "HostConfig", "GraphDriver", "SizeRw", "SizeRootFs", "Mounts", "Config",
"NetworkSettings")
private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
emptySet(), "id")
private val nullableMutableListOfStringAdapter: JsonAdapter?> =
moshi.adapter(Types.newParameterizedType(MutableList::class.java, String::class.java),
emptySet(), "args")
private val nullableContainerStateAdapter: JsonAdapter =
moshi.adapter(ContainerState::class.java, emptySet(), "state")
private val nullableIntAdapter: JsonAdapter = moshi.adapter(Int::class.javaObjectType,
emptySet(), "restartCount")
private val nullableHostConfigAdapter: JsonAdapter =
moshi.adapter(HostConfig::class.java, emptySet(), "hostConfig")
private val nullableGraphDriverDataAdapter: JsonAdapter =
moshi.adapter(GraphDriverData::class.java, emptySet(), "graphDriver")
private val nullableLongAdapter: JsonAdapter = moshi.adapter(Long::class.javaObjectType,
emptySet(), "sizeRw")
private val nullableMutableListOfMountPointAdapter: JsonAdapter?> =
moshi.adapter(Types.newParameterizedType(MutableList::class.java, MountPoint::class.java),
emptySet(), "mounts")
private val nullableContainerConfigAdapter: JsonAdapter =
moshi.adapter(ContainerConfig::class.java, emptySet(), "config")
private val nullableNetworkSettingsAdapter: JsonAdapter =
moshi.adapter(NetworkSettings::class.java, emptySet(), "networkSettings")
@Volatile
private var constructorRef: Constructor? = null
public override fun toString(): String = buildString(46) {
append("GeneratedJsonAdapter(").append("ContainerInspectResponse").append(')') }
public override fun fromJson(reader: JsonReader): ContainerInspectResponse {
var id: String? = null
var created: String? = null
var path: String? = null
var args: MutableList? = null
var state: ContainerState? = null
var image: String? = null
var resolvConfPath: String? = null
var hostnamePath: String? = null
var hostsPath: String? = null
var logPath: String? = null
var name: String? = null
var restartCount: Int? = null
var driver: String? = null
var platform: String? = null
var mountLabel: String? = null
var processLabel: String? = null
var appArmorProfile: String? = null
var execIDs: MutableList? = null
var hostConfig: HostConfig? = null
var graphDriver: GraphDriverData? = null
var sizeRw: Long? = null
var sizeRootFs: Long? = null
var mounts: MutableList? = null
var config: ContainerConfig? = null
var networkSettings: NetworkSettings? = null
var mask0 = -1
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> {
id = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 0).inv()
mask0 = mask0 and 0xfffffffe.toInt()
}
1 -> {
created = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 1).inv()
mask0 = mask0 and 0xfffffffd.toInt()
}
2 -> {
path = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 2).inv()
mask0 = mask0 and 0xfffffffb.toInt()
}
3 -> {
args = nullableMutableListOfStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 3).inv()
mask0 = mask0 and 0xfffffff7.toInt()
}
4 -> {
state = nullableContainerStateAdapter.fromJson(reader)
// $mask = $mask and (1 shl 4).inv()
mask0 = mask0 and 0xffffffef.toInt()
}
5 -> {
image = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 5).inv()
mask0 = mask0 and 0xffffffdf.toInt()
}
6 -> {
resolvConfPath = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 6).inv()
mask0 = mask0 and 0xffffffbf.toInt()
}
7 -> {
hostnamePath = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 7).inv()
mask0 = mask0 and 0xffffff7f.toInt()
}
8 -> {
hostsPath = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 8).inv()
mask0 = mask0 and 0xfffffeff.toInt()
}
9 -> {
logPath = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 9).inv()
mask0 = mask0 and 0xfffffdff.toInt()
}
10 -> {
name = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 10).inv()
mask0 = mask0 and 0xfffffbff.toInt()
}
11 -> {
restartCount = nullableIntAdapter.fromJson(reader)
// $mask = $mask and (1 shl 11).inv()
mask0 = mask0 and 0xfffff7ff.toInt()
}
12 -> {
driver = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 12).inv()
mask0 = mask0 and 0xffffefff.toInt()
}
13 -> {
platform = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 13).inv()
mask0 = mask0 and 0xffffdfff.toInt()
}
14 -> {
mountLabel = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 14).inv()
mask0 = mask0 and 0xffffbfff.toInt()
}
15 -> {
processLabel = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 15).inv()
mask0 = mask0 and 0xffff7fff.toInt()
}
16 -> {
appArmorProfile = nullableStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 16).inv()
mask0 = mask0 and 0xfffeffff.toInt()
}
17 -> {
execIDs = nullableMutableListOfStringAdapter.fromJson(reader)
// $mask = $mask and (1 shl 17).inv()
mask0 = mask0 and 0xfffdffff.toInt()
}
18 -> {
hostConfig = nullableHostConfigAdapter.fromJson(reader)
// $mask = $mask and (1 shl 18).inv()
mask0 = mask0 and 0xfffbffff.toInt()
}
19 -> {
graphDriver = nullableGraphDriverDataAdapter.fromJson(reader)
// $mask = $mask and (1 shl 19).inv()
mask0 = mask0 and 0xfff7ffff.toInt()
}
20 -> {
sizeRw = nullableLongAdapter.fromJson(reader)
// $mask = $mask and (1 shl 20).inv()
mask0 = mask0 and 0xffefffff.toInt()
}
21 -> {
sizeRootFs = nullableLongAdapter.fromJson(reader)
// $mask = $mask and (1 shl 21).inv()
mask0 = mask0 and 0xffdfffff.toInt()
}
22 -> {
mounts = nullableMutableListOfMountPointAdapter.fromJson(reader)
// $mask = $mask and (1 shl 22).inv()
mask0 = mask0 and 0xffbfffff.toInt()
}
23 -> {
config = nullableContainerConfigAdapter.fromJson(reader)
// $mask = $mask and (1 shl 23).inv()
mask0 = mask0 and 0xff7fffff.toInt()
}
24 -> {
networkSettings = nullableNetworkSettingsAdapter.fromJson(reader)
// $mask = $mask and (1 shl 24).inv()
mask0 = mask0 and 0xfeffffff.toInt()
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
if (mask0 == 0xfe000000.toInt()) {
// All parameters with defaults are set, invoke the constructor directly
return ContainerInspectResponse(
id = id,
created = created,
path = path,
args = args,
state = state,
image = image,
resolvConfPath = resolvConfPath,
hostnamePath = hostnamePath,
hostsPath = hostsPath,
logPath = logPath,
name = name,
restartCount = restartCount,
driver = driver,
platform = platform,
mountLabel = mountLabel,
processLabel = processLabel,
appArmorProfile = appArmorProfile,
execIDs = execIDs,
hostConfig = hostConfig,
graphDriver = graphDriver,
sizeRw = sizeRw,
sizeRootFs = sizeRootFs,
mounts = mounts,
config = config,
networkSettings = networkSettings
)
} else {
// Reflectively invoke the synthetic defaults constructor
@Suppress("UNCHECKED_CAST")
val localConstructor: Constructor = this.constructorRef ?:
ContainerInspectResponse::class.java.getDeclaredConstructor(String::class.java,
String::class.java, String::class.java, MutableList::class.java,
ContainerState::class.java, String::class.java, String::class.java, String::class.java,
String::class.java, String::class.java, String::class.java, Int::class.javaObjectType,
String::class.java, String::class.java, String::class.java, String::class.java,
String::class.java, MutableList::class.java, HostConfig::class.java,
GraphDriverData::class.java, Long::class.javaObjectType, Long::class.javaObjectType,
MutableList::class.java, ContainerConfig::class.java, NetworkSettings::class.java,
Int::class.javaPrimitiveType, Util.DEFAULT_CONSTRUCTOR_MARKER).also {
this.constructorRef = it }
return localConstructor.newInstance(
id,
created,
path,
args,
state,
image,
resolvConfPath,
hostnamePath,
hostsPath,
logPath,
name,
restartCount,
driver,
platform,
mountLabel,
processLabel,
appArmorProfile,
execIDs,
hostConfig,
graphDriver,
sizeRw,
sizeRootFs,
mounts,
config,
networkSettings,
mask0,
/* DefaultConstructorMarker */ null
)
}
}
public override fun toJson(writer: JsonWriter, value_: ContainerInspectResponse?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("Id")
nullableStringAdapter.toJson(writer, value_.id)
writer.name("Created")
nullableStringAdapter.toJson(writer, value_.created)
writer.name("Path")
nullableStringAdapter.toJson(writer, value_.path)
writer.name("Args")
nullableMutableListOfStringAdapter.toJson(writer, value_.args)
writer.name("State")
nullableContainerStateAdapter.toJson(writer, value_.state)
writer.name("Image")
nullableStringAdapter.toJson(writer, value_.image)
writer.name("ResolvConfPath")
nullableStringAdapter.toJson(writer, value_.resolvConfPath)
writer.name("HostnamePath")
nullableStringAdapter.toJson(writer, value_.hostnamePath)
writer.name("HostsPath")
nullableStringAdapter.toJson(writer, value_.hostsPath)
writer.name("LogPath")
nullableStringAdapter.toJson(writer, value_.logPath)
writer.name("Name")
nullableStringAdapter.toJson(writer, value_.name)
writer.name("RestartCount")
nullableIntAdapter.toJson(writer, value_.restartCount)
writer.name("Driver")
nullableStringAdapter.toJson(writer, value_.driver)
writer.name("Platform")
nullableStringAdapter.toJson(writer, value_.platform)
writer.name("MountLabel")
nullableStringAdapter.toJson(writer, value_.mountLabel)
writer.name("ProcessLabel")
nullableStringAdapter.toJson(writer, value_.processLabel)
writer.name("AppArmorProfile")
nullableStringAdapter.toJson(writer, value_.appArmorProfile)
writer.name("ExecIDs")
nullableMutableListOfStringAdapter.toJson(writer, value_.execIDs)
writer.name("HostConfig")
nullableHostConfigAdapter.toJson(writer, value_.hostConfig)
writer.name("GraphDriver")
nullableGraphDriverDataAdapter.toJson(writer, value_.graphDriver)
writer.name("SizeRw")
nullableLongAdapter.toJson(writer, value_.sizeRw)
writer.name("SizeRootFs")
nullableLongAdapter.toJson(writer, value_.sizeRootFs)
writer.name("Mounts")
nullableMutableListOfMountPointAdapter.toJson(writer, value_.mounts)
writer.name("Config")
nullableContainerConfigAdapter.toJson(writer, value_.config)
writer.name("NetworkSettings")
nullableNetworkSettingsAdapter.toJson(writer, value_.networkSettings)
writer.endObject()
}
}