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

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/dodopayments/models/subscription_update_payment_method_params.rb', line 53

Instance Method Details

#initialize(subscription_id:, body:, request_options: {}) ⇒ Object



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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/dodopayments/models/subscription_update_payment_method_params.rb', line 25

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

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

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

  class New < Dodopayments::Internal::Type::BaseModel
    # @!attribute type
    #
    #   @return [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New::Type]
    required :type, enum: -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body::New::Type }

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

    # @!method initialize(type:, return_url: nil)
    #   @param type [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New::Type]
    #   @param return_url [String, nil]

    # @see Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::New#type
    module Type
      extend Dodopayments::Internal::Type::Enum

      NEW = :new

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

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

    # @!attribute type
    #
    #   @return [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing::Type]
    required :type, enum: -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Body::Existing::Type }

    # @!method initialize(payment_method_id:, type:)
    #   @param payment_method_id [String]
    #   @param type [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing::Type]

    # @see Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Body::Existing#type
    module Type
      extend Dodopayments::Internal::Type::Enum

      EXISTING = :existing

      # @!method self.values
      #   @return [Array<Symbol>]
    end
  end

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