Class: Dodopayments::Models::Subscription::Meter

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/subscription.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

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

Methods included from Internal::Util::SorbetRuntimeSupport

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

Constructor Details

#initialize(currency: , free_threshold: , measurement_unit: , meter_id: , name: , price_per_unit: , description: nil) ⇒ Object

Response struct representing usage-based meter cart details for a subscription

Parameters:

  • currency (Symbol, Dodopayments::Models::Currency) (defaults to: )
  • free_threshold (Integer) (defaults to: )
  • measurement_unit (String) (defaults to: )
  • meter_id (String) (defaults to: )
  • name (String) (defaults to: )
  • price_per_unit (String) (defaults to: )
  • description (String, nil) (defaults to: nil)


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
# File 'lib/dodopayments/models/subscription.rb', line 239

class Meter < Dodopayments::Internal::Type::BaseModel
  # @!attribute currency
  #
  #   @return [Symbol, Dodopayments::Models::Currency]
  required :currency, enum: -> { Dodopayments::Currency }

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

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

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

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

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

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

  # @!method initialize(currency:, free_threshold:, measurement_unit:, meter_id:, name:, price_per_unit:, description: nil)
  #   Response struct representing usage-based meter cart details for a subscription
  #
  #   @param currency [Symbol, Dodopayments::Models::Currency]
  #   @param free_threshold [Integer]
  #   @param measurement_unit [String]
  #   @param meter_id [String]
  #   @param name [String]
  #   @param price_per_unit [String]
  #   @param description [String, nil]
end

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

Returns:



243
# File 'lib/dodopayments/models/subscription.rb', line 243

required :currency, enum: -> { Dodopayments::Currency }

#descriptionString?

Returns:

  • (String, nil)


273
# File 'lib/dodopayments/models/subscription.rb', line 273

optional :description, String, nil?: true

#free_thresholdInteger

Returns:

  • (Integer)


248
# File 'lib/dodopayments/models/subscription.rb', line 248

required :free_threshold, Integer

#measurement_unitString

Returns:

  • (String)


253
# File 'lib/dodopayments/models/subscription.rb', line 253

required :measurement_unit, String

#meter_idString

Returns:

  • (String)


258
# File 'lib/dodopayments/models/subscription.rb', line 258

required :meter_id, String

#nameString

Returns:

  • (String)


263
# File 'lib/dodopayments/models/subscription.rb', line 263

required :name, String

#price_per_unitString

Returns:

  • (String)


268
# File 'lib/dodopayments/models/subscription.rb', line 268

required :price_per_unit, String