Module: Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body

Extended by:
Internal::Type::Union
Defined in:
lib/dodopayments/models/subscription_update_payment_method_params.rb

Defined Under Namespace

Classes: Existing, New

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Instance Method Details

#initialize(return_url: nil, type: :new) ⇒ Object

Parameters:

  • return_url (String, nil) (defaults to: nil)
  • type (Symbol, :new) (defaults to: :new)


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/dodopayments/models/subscription_update_payment_method_params.rb', line 25

module Body
  extend Dodopayments::Internal::Type::Union

  discriminator :type

  variant :new, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body::New }

  variant :existing, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body::Existing }

  class New < Dodopayments::Internal::Type::BaseModel
    # @!attribute type
    #
    #   @return [Symbol, :new]
    required :type, const: :new

    # @!attribute return_url
    #
    #   @return [String, nil]
    optional :return_url, String, nil?: true

    # @!method initialize(return_url: nil, type: :new)
    #   @param return_url [String, nil]
    #   @param type [Symbol, :new]
  end

  class Existing < Dodopayments::Internal::Type::BaseModel
    # @!attribute payment_method_id
    #
    #   @return [String]
    required :payment_method_id, String

    # @!attribute type
    #
    #   @return [Symbol, :existing]
    required :type, const: :existing

    # @!method initialize(payment_method_id:, type: :existing)
    #   @param payment_method_id [String]
    #   @param type [Symbol, :existing]
  end

  # @!method self.variants
  #   @return [Array(Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing)]
end