Returns the list of classes defined in oneOf.
require 'synctera'
Synctera::CustomerInBody.openapi_one_of
# =>
# [
# :'Customer',
# :'Prospect'
# ]
Returns the discriminator's property name.
require 'synctera'
Synctera::CustomerInBody.openapi_discriminator_name
# => :'status'
Returns the discriminator's mapping.
require 'synctera'
Synctera::CustomerInBody.openapi_discriminator_mapping
# =>
# {
# :'ACTIVE' => :'Customer',
# :'DECEASED' => :'Customer',
# :'DENIED' => :'Customer',
# :'DORMANT' => :'Customer',
# :'ESCHEAT' => :'Customer',
# :'FROZEN' => :'Customer',
# :'INACTIVE' => :'Customer',
# :'PROSPECT' => :'Prospect',
# :'SANCTION' => :'Customer'
# }
Find the appropriate object from the openapi_one_of
list and casts the data into it.
require 'synctera'
Synctera::CustomerInBody.build(data)
# => #<Customer:0x00007fdd4aab02a0>
Synctera::CustomerInBody.build(data_that_doesnt_match)
# => nil
Name | Type | Description |
---|---|---|
data | Mixed | data to be matched against the list of oneOf items |
Customer
Prospect
nil
(if no type matches)