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