All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.carpentum.sdk.payment.internal.generated.model.PayoutMethodJsonAdapter.kt Maven / Gradle / Ivy

There is a newer version: 2.1021.0
Show newest version
//THE FILE IS GENERATED, DO NOT MODIFY IT MANUALLY!!!
package tech.carpentum.sdk.payment.internal.generated.model;

import tech.carpentum.sdk.payment.model.PayoutMethod
import tech.carpentum.sdk.payment.model.PayoutMethod.PaymentMethodCode

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.PolymorphicJsonAdapterFactory
import java.lang.reflect.Type

class PayoutMethodJsonAdapter : JsonAdapter.Factory {
    override fun create(type: Type, annotations: MutableSet, moshi: Moshi): JsonAdapter<*>? {
        return PolymorphicJsonAdapterFactory
            .of(PayoutMethod::class.java, PayoutMethod.DISCRIMINATOR)
            .withSubtype(BankTransferMethodImpl::class.java, PaymentMethodCode.BANK_TRANSFER.toString())
            .withSubtype(CryptoTransferMethodImpl::class.java, PaymentMethodCode.CRYPTO_TRANSFER.toString())
            .withSubtype(WalletTransferMethodImpl::class.java, PaymentMethodCode.WALLET_TRANSFER.toString())
            .create(type, annotations, moshi)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy