Returns the list of classes defined in oneOf.
require 'conekta'
Conekta::ChargeResponsePaymentMethod.openapi_one_of
# =>
# [
# :'PaymentMethodBankTransfer',
# :'PaymentMethodCard',
# :'PaymentMethodCash'
# ]
Returns the discriminator's property name.
require 'conekta'
Conekta::ChargeResponsePaymentMethod.openapi_discriminator_name
# => :'object'
Returns the discriminator's mapping.
require 'conekta'
Conekta::ChargeResponsePaymentMethod.openapi_discriminator_mapping
# =>
# {
# :'bank_transfer_payment' => :'PaymentMethodBankTransfer',
# :'card_payment' => :'PaymentMethodCard',
# :'cash_payment' => :'PaymentMethodCash'
# }
Find the appropriate object from the openapi_one_of
list and casts the data into it.
require 'conekta'
Conekta::ChargeResponsePaymentMethod.build(data)
# => #<PaymentMethodBankTransfer:0x00007fdd4aab02a0>
Conekta::ChargeResponsePaymentMethod.build(data_that_doesnt_match)
# => nil
Name | Type | Description |
---|---|---|
data | Mixed | data to be matched against the list of oneOf items |
PaymentMethodBankTransfer
PaymentMethodCard
PaymentMethodCash
nil
(if no type matches)