tech.carpentum.sdk.payment.internal.generated.model.P2AV2MethodResponseJsonJsonAdapter.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 java.time.OffsetDateTime
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.AccountResponseP2AV2
import tech.carpentum.sdk.payment.model.ExternalReference
import tech.carpentum.sdk.payment.model.IdPayin
import tech.carpentum.sdk.payment.model.IdPayment
import tech.carpentum.sdk.payment.model.MoneyPaymentResponse
import tech.carpentum.sdk.payment.model.MoneyVat
import tech.carpentum.sdk.payment.model.PaymentAddress
import tech.carpentum.sdk.payment.model.PaymentOperatorIncoming
public class P2AV2MethodResponseJsonJsonAdapter(
moshi: Moshi,
) : JsonAdapter() {
private val options: JsonReader.Options = JsonReader.Options.of("idPayin", "idPayment", "account",
"money", "vat", "merchantName", "paymentAddress", "qrName", "qrCode", "reference",
"externalReference", "returnUrl", "paymentOperator", "acceptedAt", "expireAt",
"paymentMethodCode")
private val nullableIdPayinAdapter: JsonAdapter = moshi.adapter(IdPayin::class.java,
emptySet(), "idPayin")
private val nullableIdPaymentAdapter: JsonAdapter =
moshi.adapter(IdPayment::class.java, emptySet(), "idPayment")
private val nullableAccountResponseP2AV2Adapter: JsonAdapter =
moshi.adapter(AccountResponseP2AV2::class.java, emptySet(), "account")
private val nullableMoneyPaymentResponseAdapter: JsonAdapter =
moshi.adapter(MoneyPaymentResponse::class.java, emptySet(), "money")
private val nullableMoneyVatAdapter: JsonAdapter = moshi.adapter(MoneyVat::class.java,
emptySet(), "vat")
private val nullableStringAdapter: JsonAdapter = moshi.adapter(String::class.java,
emptySet(), "merchantName")
private val nullablePaymentAddressAdapter: JsonAdapter =
moshi.adapter(PaymentAddress::class.java, emptySet(), "paymentAddress")
private val nullableExternalReferenceAdapter: JsonAdapter =
moshi.adapter(ExternalReference::class.java, emptySet(), "externalReference")
private val nullablePaymentOperatorIncomingAdapter: JsonAdapter =
moshi.adapter(PaymentOperatorIncoming::class.java, emptySet(), "paymentOperator")
private val nullableOffsetDateTimeAdapter: JsonAdapter =
moshi.adapter(OffsetDateTime::class.java, emptySet(), "acceptedAt")
public override fun toString(): String = buildString(45) {
append("GeneratedJsonAdapter(").append("P2AV2MethodResponseJson").append(')') }
public override fun fromJson(reader: JsonReader): P2AV2MethodResponseJson {
var idPayin: IdPayin? = null
var idPayinSet: Boolean = false
var idPayment: IdPayment? = null
var idPaymentSet: Boolean = false
var account: AccountResponseP2AV2? = null
var accountSet: Boolean = false
var money: MoneyPaymentResponse? = null
var moneySet: Boolean = false
var vat: MoneyVat? = null
var vatSet: Boolean = false
var merchantName: String? = null
var merchantNameSet: Boolean = false
var paymentAddress: PaymentAddress? = null
var paymentAddressSet: Boolean = false
var qrName: String? = null
var qrNameSet: Boolean = false
var qrCode: String? = null
var qrCodeSet: Boolean = false
var reference: String? = null
var referenceSet: Boolean = false
var externalReference: ExternalReference? = null
var externalReferenceSet: Boolean = false
var returnUrl: String? = null
var returnUrlSet: Boolean = false
var paymentOperator: PaymentOperatorIncoming? = null
var paymentOperatorSet: Boolean = false
var acceptedAt: OffsetDateTime? = null
var acceptedAtSet: Boolean = false
var expireAt: OffsetDateTime? = null
var expireAtSet: Boolean = false
var paymentMethodCode: String? = null
var paymentMethodCodeSet: Boolean = false
reader.beginObject()
while (reader.hasNext()) {
when (reader.selectName(options)) {
0 -> {
idPayin = nullableIdPayinAdapter.fromJson(reader)
idPayinSet = true
}
1 -> {
idPayment = nullableIdPaymentAdapter.fromJson(reader)
idPaymentSet = true
}
2 -> {
account = nullableAccountResponseP2AV2Adapter.fromJson(reader)
accountSet = true
}
3 -> {
money = nullableMoneyPaymentResponseAdapter.fromJson(reader)
moneySet = true
}
4 -> {
vat = nullableMoneyVatAdapter.fromJson(reader)
vatSet = true
}
5 -> {
merchantName = nullableStringAdapter.fromJson(reader)
merchantNameSet = true
}
6 -> {
paymentAddress = nullablePaymentAddressAdapter.fromJson(reader)
paymentAddressSet = true
}
7 -> {
qrName = nullableStringAdapter.fromJson(reader)
qrNameSet = true
}
8 -> {
qrCode = nullableStringAdapter.fromJson(reader)
qrCodeSet = true
}
9 -> {
reference = nullableStringAdapter.fromJson(reader)
referenceSet = true
}
10 -> {
externalReference = nullableExternalReferenceAdapter.fromJson(reader)
externalReferenceSet = true
}
11 -> {
returnUrl = nullableStringAdapter.fromJson(reader)
returnUrlSet = true
}
12 -> {
paymentOperator = nullablePaymentOperatorIncomingAdapter.fromJson(reader)
paymentOperatorSet = true
}
13 -> {
acceptedAt = nullableOffsetDateTimeAdapter.fromJson(reader)
acceptedAtSet = true
}
14 -> {
expireAt = nullableOffsetDateTimeAdapter.fromJson(reader)
expireAtSet = true
}
15 -> {
paymentMethodCode = nullableStringAdapter.fromJson(reader)
paymentMethodCodeSet = true
}
-1 -> {
// Unknown name, skip it.
reader.skipName()
reader.skipValue()
}
}
}
reader.endObject()
val result: P2AV2MethodResponseJson
result = P2AV2MethodResponseJson(
)
if (idPayinSet) {
result.idPayin = idPayin
}
if (idPaymentSet) {
result.idPayment = idPayment
}
if (accountSet) {
result.account = account
}
if (moneySet) {
result.money = money
}
if (vatSet) {
result.vat = vat
}
if (merchantNameSet) {
result.merchantName = merchantName
}
if (paymentAddressSet) {
result.paymentAddress = paymentAddress
}
if (qrNameSet) {
result.qrName = qrName
}
if (qrCodeSet) {
result.qrCode = qrCode
}
if (referenceSet) {
result.reference = reference
}
if (externalReferenceSet) {
result.externalReference = externalReference
}
if (returnUrlSet) {
result.returnUrl = returnUrl
}
if (paymentOperatorSet) {
result.paymentOperator = paymentOperator
}
if (acceptedAtSet) {
result.acceptedAt = acceptedAt
}
if (expireAtSet) {
result.expireAt = expireAt
}
if (paymentMethodCodeSet) {
result.paymentMethodCode = paymentMethodCode
}
return result
}
public override fun toJson(writer: JsonWriter, value_: P2AV2MethodResponseJson?): Unit {
if (value_ == null) {
throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
}
writer.beginObject()
writer.name("idPayin")
nullableIdPayinAdapter.toJson(writer, value_.idPayin)
writer.name("idPayment")
nullableIdPaymentAdapter.toJson(writer, value_.idPayment)
writer.name("account")
nullableAccountResponseP2AV2Adapter.toJson(writer, value_.account)
writer.name("money")
nullableMoneyPaymentResponseAdapter.toJson(writer, value_.money)
writer.name("vat")
nullableMoneyVatAdapter.toJson(writer, value_.vat)
writer.name("merchantName")
nullableStringAdapter.toJson(writer, value_.merchantName)
writer.name("paymentAddress")
nullablePaymentAddressAdapter.toJson(writer, value_.paymentAddress)
writer.name("qrName")
nullableStringAdapter.toJson(writer, value_.qrName)
writer.name("qrCode")
nullableStringAdapter.toJson(writer, value_.qrCode)
writer.name("reference")
nullableStringAdapter.toJson(writer, value_.reference)
writer.name("externalReference")
nullableExternalReferenceAdapter.toJson(writer, value_.externalReference)
writer.name("returnUrl")
nullableStringAdapter.toJson(writer, value_.returnUrl)
writer.name("paymentOperator")
nullablePaymentOperatorIncomingAdapter.toJson(writer, value_.paymentOperator)
writer.name("acceptedAt")
nullableOffsetDateTimeAdapter.toJson(writer, value_.acceptedAt)
writer.name("expireAt")
nullableOffsetDateTimeAdapter.toJson(writer, value_.expireAt)
writer.name("paymentMethodCode")
nullableStringAdapter.toJson(writer, value_.paymentMethodCode)
writer.endObject()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy