Module: Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem

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

Defined Under Namespace

Classes: Addon, Meter, Subscription

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_preview_change_plan_response.rb', line 142

Instance Method Details

#initialize(effective_at:, line_items:, summary:) ⇒ Object



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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/dodopayments/models/subscription_preview_change_plan_response.rb', line 51

module LineItem
  extend Dodopayments::Internal::Type::Union

  variant -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription }

  variant -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon }

  variant -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter }

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

    # @!attribute currency
    #
    #   @return [Symbol, Dodopayments::Models::Currency]
    required :currency, enum: -> { Dodopayments::Currency }

    # @!attribute product_id
    #
    #   @return [String]
    required :product_id, String

    # @!attribute proration_factor
    #
    #   @return [Float]
    required :proration_factor, Float

    # @!attribute quantity
    #
    #   @return [Integer]
    required :quantity, Integer

    # @!attribute tax_inclusive
    #
    #   @return [Boolean]
    required :tax_inclusive, Dodopayments::Internal::Type::Boolean

    # @!attribute type
    #
    #   @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription::Type]
    required :type,
             enum: -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription::Type }

    # @!attribute unit_price
    #
    #   @return [Integer]
    required :unit_price, Integer

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

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

    # @!attribute tax
    #
    #   @return [Integer, nil]
    optional :tax, Integer, nil?: true

    # @!attribute tax_rate
    #
    #   @return [Float, nil]
    optional :tax_rate, Float, nil?: true

    # @!method initialize(id:, currency:, product_id:, proration_factor:, quantity:, tax_inclusive:, type:, unit_price:, description: nil, name: nil, tax: nil, tax_rate: nil)
    #   @param id [String]
    #   @param currency [Symbol, Dodopayments::Models::Currency]
    #   @param product_id [String]
    #   @param proration_factor [Float]
    #   @param quantity [Integer]
    #   @param tax_inclusive [Boolean]
    #   @param type [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription::Type]
    #   @param unit_price [Integer]
    #   @param description [String, nil]
    #   @param name [String, nil]
    #   @param tax [Integer, nil]
    #   @param tax_rate [Float, nil]

    # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription#type
    module Type
      extend Dodopayments::Internal::Type::Enum

      SUBSCRIPTION = :subscription

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

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

    # @!attribute currency
    #
    #   @return [Symbol, Dodopayments::Models::Currency]
    required :currency, enum: -> { Dodopayments::Currency }

    # @!attribute name
    #
    #   @return [String]
    required :name, String

    # @!attribute proration_factor
    #
    #   @return [Float]
    required :proration_factor, Float

    # @!attribute quantity
    #
    #   @return [Integer]
    required :quantity, Integer

    # @!attribute tax_category
    #   Represents the different categories of taxation applicable to various products
    #   and services.
    #
    #   @return [Symbol, Dodopayments::Models::TaxCategory]
    required :tax_category, enum: -> { Dodopayments::TaxCategory }

    # @!attribute tax_inclusive
    #
    #   @return [Boolean]
    required :tax_inclusive, Dodopayments::Internal::Type::Boolean

    # @!attribute tax_rate
    #
    #   @return [Float]
    required :tax_rate, Float

    # @!attribute type
    #
    #   @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon::Type]
    required :type,
             enum: -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon::Type }

    # @!attribute unit_price
    #
    #   @return [Integer]
    required :unit_price, Integer

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

    # @!attribute tax
    #
    #   @return [Integer, nil]
    optional :tax, Integer, nil?: true

    # @!method initialize(id:, currency:, name:, proration_factor:, quantity:, tax_category:, tax_inclusive:, tax_rate:, type:, unit_price:, description: nil, tax: nil)
    #   Some parameter documentations has been truncated, see
    #   {Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon}
    #   for more details.
    #
    #   @param id [String]
    #
    #   @param currency [Symbol, Dodopayments::Models::Currency]
    #
    #   @param name [String]
    #
    #   @param proration_factor [Float]
    #
    #   @param quantity [Integer]
    #
    #   @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
    #
    #   @param tax_inclusive [Boolean]
    #
    #   @param tax_rate [Float]
    #
    #   @param type [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon::Type]
    #
    #   @param unit_price [Integer]
    #
    #   @param description [String, nil]
    #
    #   @param tax [Integer, nil]

    # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon#type
    module Type
      extend Dodopayments::Internal::Type::Enum

      ADDON = :addon

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

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

    # @!attribute chargeable_units
    #
    #   @return [String]
    required :chargeable_units, String

    # @!attribute currency
    #
    #   @return [Symbol, Dodopayments::Models::Currency]
    required :currency, enum: -> { Dodopayments::Currency }

    # @!attribute free_threshold
    #
    #   @return [Integer]
    required :free_threshold, Integer

    # @!attribute name
    #
    #   @return [String]
    required :name, String

    # @!attribute price_per_unit
    #
    #   @return [String]
    required :price_per_unit, String

    # @!attribute subtotal
    #
    #   @return [Integer]
    required :subtotal, Integer

    # @!attribute tax_inclusive
    #
    #   @return [Boolean]
    required :tax_inclusive, Dodopayments::Internal::Type::Boolean

    # @!attribute tax_rate
    #
    #   @return [Float]
    required :tax_rate, Float

    # @!attribute type
    #
    #   @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter::Type]
    required :type,
             enum: -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter::Type }

    # @!attribute units_consumed
    #
    #   @return [String]
    required :units_consumed, String

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

    # @!attribute tax
    #
    #   @return [Integer, nil]
    optional :tax, Integer, nil?: true

    # @!method initialize(id:, chargeable_units:, currency:, free_threshold:, name:, price_per_unit:, subtotal:, tax_inclusive:, tax_rate:, type:, units_consumed:, description: nil, tax: nil)
    #   @param id [String]
    #   @param chargeable_units [String]
    #   @param currency [Symbol, Dodopayments::Models::Currency]
    #   @param free_threshold [Integer]
    #   @param name [String]
    #   @param price_per_unit [String]
    #   @param subtotal [Integer]
    #   @param tax_inclusive [Boolean]
    #   @param tax_rate [Float]
    #   @param type [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter::Type]
    #   @param units_consumed [String]
    #   @param description [String, nil]
    #   @param tax [Integer, nil]

    # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter#type
    module Type
      extend Dodopayments::Internal::Type::Enum

      METER = :meter

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

  # @!method self.variants
  #   @return [Array(Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter)]
end