de.gesellix.docker.remote.api.ClusterVolumeSpecAccessModeJsonAdapter.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
The newest version!
// 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.Any
import kotlin.Int
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 ClusterVolumeSpecAccessModeJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("Scope", "Sharing", "MountVolume",
"Secrets", "AccessibilityRequirements", "CapacityRange", "Availability")
private val nullableScopeAdapter: JsonAdapter =
moshi.adapter(ClusterVolumeSpecAccessMode.Scope::class.java, emptySet(), "scope")
private val nullableSharingAdapter: JsonAdapter =
moshi.adapter(ClusterVolumeSpecAccessMode.Sharing::class.java, emptySet(), "sharing")
private val nullableAnyAdapter: JsonAdapter = moshi.adapter(Any::class.java, emptySet(),
"mountVolume")
private val nullableMutableListOfClusterVolumeSpecAccessModeSecretsInnerAdapter:
JsonAdapter?> =
moshi.adapter(Types.newParameterizedType(MutableList::class.java,
ClusterVolumeSpecAccessModeSecretsInner::class.java), emptySet(), "secrets")
private val nullableClusterVolumeSpecAccessModeAccessibilityRequirementsAdapter:
JsonAdapter =
moshi.adapter(ClusterVolumeSpecAccessModeAccessibilityRequirements::class.java, emptySet(),
"accessibilityRequirements")
private val nullableClusterVolumeSpecAccessModeCapacityRangeAdapter:
JsonAdapter =
moshi.adapter(ClusterVolumeSpecAccessModeCapacityRange::class.java, emptySet(),
"capacityRange")
private val nullableAvailabilityAdapter: JsonAdapter =
moshi.adapter(ClusterVolumeSpecAccessMode.Availability::class.java, emptySet(),
"availability")
@Volatile
private var constructorRef: Constructor? = null
public override fun toString(): String = buildString(49) {
append("GeneratedJsonAdapter(").append("ClusterVolumeSpecAccessMode").append(')') }
public override fun fromJson(reader: JsonReader): ClusterVolumeSpecAccessMode {
var scope: ClusterVolumeSpecAccessMode.Scope? = null
var sharing: ClusterVolumeSpecAccessMode.Sharing? = null
var mountVolume: Any? = null
var secrets: MutableList? = null
var accessibilityRequirements: ClusterVolumeSpecAccessModeAccessibilityRequirements? = null
var capacityRange: ClusterVolumeSpecAccessModeCapacityRange? = null
var availability: ClusterVolumeSpecAccessMode.Availability? = null
var mask0 = -1
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> {
scope = nullableScopeAdapter.fromJson(reader)
// $mask = $mask and (1 shl 0).inv()
mask0 = mask0 and 0xfffffffe.toInt()
}
1 -> {
sharing = nullableSharingAdapter.fromJson(reader)
// $mask = $mask and (1 shl 1).inv()
mask0 = mask0 and 0xfffffffd.toInt()
}
2 -> {
mountVolume = nullableAnyAdapter.fromJson(reader)
// $mask = $mask and (1 shl 2).inv()
mask0 = mask0 and 0xfffffffb.toInt()
}
3 -> {
secrets =
nullableMutableListOfClusterVolumeSpecAccessModeSecretsInnerAdapter.fromJson(reader)
// $mask = $mask and (1 shl 3).inv()
mask0 = mask0 and 0xfffffff7.toInt()
}
4 -> {
accessibilityRequirements =
nullableClusterVolumeSpecAccessModeAccessibilityRequirementsAdapter.fromJson(reader)
// $mask = $mask and (1 shl 4).inv()
mask0 = mask0 and 0xffffffef.toInt()
}
5 -> {
capacityRange = nullableClusterVolumeSpecAccessModeCapacityRangeAdapter.fromJson(reader)
// $mask = $mask and (1 shl 5).inv()
mask0 = mask0 and 0xffffffdf.toInt()
}
6 -> {
availability = nullableAvailabilityAdapter.fromJson(reader)
// $mask = $mask and (1 shl 6).inv()
mask0 = mask0 and 0xffffffbf.toInt()
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
if (mask0 == 0xffffff80.toInt()) {
// All parameters with defaults are set, invoke the constructor directly
return ClusterVolumeSpecAccessMode(
scope = scope,
sharing = sharing,
mountVolume = mountVolume,
secrets = secrets,
accessibilityRequirements = accessibilityRequirements,
capacityRange = capacityRange,
availability = availability
)
} else {
// Reflectively invoke the synthetic defaults constructor
@Suppress("UNCHECKED_CAST")
val localConstructor: Constructor = this.constructorRef ?:
ClusterVolumeSpecAccessMode::class.java.getDeclaredConstructor(ClusterVolumeSpecAccessMode.Scope::class.java,
ClusterVolumeSpecAccessMode.Sharing::class.java, Any::class.java, MutableList::class.java,
ClusterVolumeSpecAccessModeAccessibilityRequirements::class.java,
ClusterVolumeSpecAccessModeCapacityRange::class.java,
ClusterVolumeSpecAccessMode.Availability::class.java, Int::class.javaPrimitiveType,
Util.DEFAULT_CONSTRUCTOR_MARKER).also { this.constructorRef = it }
return localConstructor.newInstance(
scope,
sharing,
mountVolume,
secrets,
accessibilityRequirements,
capacityRange,
availability,
mask0,
/* DefaultConstructorMarker */ null
)
}
}
public override fun toJson(writer: JsonWriter, value_: ClusterVolumeSpecAccessMode?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("Scope")
nullableScopeAdapter.toJson(writer, value_.scope)
writer.name("Sharing")
nullableSharingAdapter.toJson(writer, value_.sharing)
writer.name("MountVolume")
nullableAnyAdapter.toJson(writer, value_.mountVolume)
writer.name("Secrets")
nullableMutableListOfClusterVolumeSpecAccessModeSecretsInnerAdapter.toJson(writer,
value_.secrets)
writer.name("AccessibilityRequirements")
nullableClusterVolumeSpecAccessModeAccessibilityRequirementsAdapter.toJson(writer,
value_.accessibilityRequirements)
writer.name("CapacityRange")
nullableClusterVolumeSpecAccessModeCapacityRangeAdapter.toJson(writer, value_.capacityRange)
writer.name("Availability")
nullableAvailabilityAdapter.toJson(writer, value_.availability)
writer.endObject()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy