Module: Pago::V2026_04::Unions::CustomerPaymentMethodCreateResponse
- Defined in:
- lib/pago/v2026_04/unions.rb,
sig/pago/v2026_04/generated.rbs
Overview
Variants: Models::CustomerPaymentMethodCreateSucceededResponse, Models::CustomerPaymentMethodCreateRequiresActionResponse.
Constant Summary collapse
- DISCRIMINATOR =
"status"
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.
354 355 356 357 |
# File 'lib/pago/v2026_04/unions.rb', line 354 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.
340 341 342 343 344 345 |
# File 'lib/pago/v2026_04/unions.rb', line 340 def self.mapping @mapping ||= { "requires_action" => Models::CustomerPaymentMethodCreateRequiresActionResponse, "succeeded" => Models::CustomerPaymentMethodCreateSucceededResponse }.freeze end |
.variants ⇒ Array<Class>
Returns every model this union can resolve to.
348 349 350 |
# File 'lib/pago/v2026_04/unions.rb', line 348 def self.variants @variants ||= [Models::CustomerPaymentMethodCreateSucceededResponse, Models::CustomerPaymentMethodCreateRequiresActionResponse].freeze end |