tech.carpentum.sdk.payment.internal.generated.model.PaymentInstructionJsonJsonAdapter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of payment-client-v2 Show documentation
Show all versions of payment-client-v2 Show documentation
Carpentum Payment system Java SDK
// 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 tech.carpentum.sdk.payment.`internal`.generated.model
import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import java.lang.NullPointerException
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.emptySet
import kotlin.text.buildString
public class PaymentInstructionJsonJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("bankingService", "companyCode")
private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
emptySet(), "bankingService")
public override fun toString(): String = buildString(44) {
append("GeneratedJsonAdapter(").append("PaymentInstructionJson").append(')') }
public override fun fromJson(reader: JsonReader): PaymentInstructionJson {
var bankingService: String? = null
var bankingServiceSet: Boolean = false
var companyCode: String? = null
var companyCodeSet: Boolean = false
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> {
bankingService = nullableStringAdapter.fromJson(reader)
bankingServiceSet = true
}
1 -> {
companyCode = nullableStringAdapter.fromJson(reader)
companyCodeSet = true
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
val result: PaymentInstructionJson
result = PaymentInstructionJson(
)
if (bankingServiceSet) {
result.bankingService = bankingService
}
if (companyCodeSet) {
result.companyCode = companyCode
}
return result
}
public override fun toJson(writer: JsonWriter, value_: PaymentInstructionJson?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("bankingService")
nullableStringAdapter.toJson(writer, value_.bankingService)
writer.name("companyCode")
nullableStringAdapter.toJson(writer, value_.companyCode)
writer.endObject()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy