tech.carpentum.sdk.payment.internal.generated.model.PayinJsonJsonAdapter.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
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 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
import tech.carpentum.sdk.payment.model.PayinMethod
import tech.carpentum.sdk.payment.model.PaymentRequested
public class PayinJsonJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("paymentRequested",
"paymentMethod", "callbackUrl", "returnUrl", "customerIp")
private val nullablePaymentRequestedAdapter: JsonAdapter =
moshi.adapter(PaymentRequested::class.java, emptySet(), "paymentRequested")
private val nullablePayinMethodAdapter: JsonAdapter =
moshi.adapter(PayinMethod::class.java, emptySet(), "paymentMethod")
private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
emptySet(), "callbackUrl")
public override fun toString(): String = buildString(31) {
append("GeneratedJsonAdapter(").append("PayinJson").append(')') }
public override fun fromJson(reader: JsonReader): PayinJson {
var paymentRequested: PaymentRequested? = null
var paymentRequestedSet: Boolean = false
var paymentMethod: PayinMethod? = null
var paymentMethodSet: Boolean = false
var callbackUrl: String? = null
var callbackUrlSet: Boolean = false
var returnUrl: String? = null
var returnUrlSet: Boolean = false
var customerIp: String? = null
var customerIpSet: Boolean = false
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> {
paymentRequested = nullablePaymentRequestedAdapter.fromJson(reader)
paymentRequestedSet = true
}
1 -> {
paymentMethod = nullablePayinMethodAdapter.fromJson(reader)
paymentMethodSet = true
}
2 -> {
callbackUrl = nullableStringAdapter.fromJson(reader)
callbackUrlSet = true
}
3 -> {
returnUrl = nullableStringAdapter.fromJson(reader)
returnUrlSet = true
}
4 -> {
customerIp = nullableStringAdapter.fromJson(reader)
customerIpSet = true
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
val result: PayinJson
result = PayinJson(
)
if (paymentRequestedSet) {
result.paymentRequested = paymentRequested
}
if (paymentMethodSet) {
result.paymentMethod = paymentMethod
}
if (callbackUrlSet) {
result.callbackUrl = callbackUrl
}
if (returnUrlSet) {
result.returnUrl = returnUrl
}
if (customerIpSet) {
result.customerIp = customerIp
}
return result
}
public override fun toJson(writer: JsonWriter, value_: PayinJson?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("paymentRequested")
nullablePaymentRequestedAdapter.toJson(writer, value_.paymentRequested)
writer.name("paymentMethod")
nullablePayinMethodAdapter.toJson(writer, value_.paymentMethod)
writer.name("callbackUrl")
nullableStringAdapter.toJson(writer, value_.callbackUrl)
writer.name("returnUrl")
nullableStringAdapter.toJson(writer, value_.returnUrl)
writer.name("customerIp")
nullableStringAdapter.toJson(writer, value_.customerIp)
writer.endObject()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy