Module: Pago::V2026_04::Unions::LegacyRecurringProductPrice
- Defined in:
- lib/pago/v2026_04/unions.rb,
sig/pago/v2026_04/generated.rbs
Overview
Variants: Models::LegacyRecurringProductPriceFixed, Models::LegacyRecurringProductPriceCustom.
Constant Summary collapse
- DISCRIMINATOR =
"amount_type"
Class Method Summary collapse
-
.from_json(data) ⇒ Object?
The resolved variant, or the raw payload.
-
.mapping ⇒ Hash{String => Class}
Discriminator value to model class.
-
.variants ⇒ Array<Class>
Every model this union can resolve to.
Class Method Details
.from_json(data) ⇒ Object?
Returns the resolved variant, or the raw payload.
548 549 550 551 |
# File 'lib/pago/v2026_04/unions.rb', line 548 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) ::Pago::Serde.union(data, discriminator: DISCRIMINATOR, mapping: mapping, variants: variants) end |
.mapping ⇒ Hash{String => Class}
Returns discriminator value to model class.
534 535 536 537 538 539 |
# File 'lib/pago/v2026_04/unions.rb', line 534 def self.mapping @mapping ||= { "custom" => Models::LegacyRecurringProductPriceCustom, "fixed" => Models::LegacyRecurringProductPriceFixed }.freeze end |
.variants ⇒ Array<Class>
Returns every model this union can resolve to.
542 543 544 |
# File 'lib/pago/v2026_04/unions.rb', line 542 def self.variants @variants ||= [Models::LegacyRecurringProductPriceFixed, Models::LegacyRecurringProductPriceCustom].freeze end |