Class: Pago::V2026_04::Models::CustomerStateSubscriptionMeter
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Current consumption and spending for a subscription meter.
Constant Summary collapse
- JSON_KEYS =
{ created_at: "created_at", modified_at: "modified_at", id: "id", consumed_units: "consumed_units", credited_units: "credited_units", amount: "amount", meter_id: "meter_id" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "consumed_units", "credited_units", "amount", "meter_id"].freeze
Instance Attribute Summary collapse
-
#amount ⇒ Integer
readonly
The amount due in cents so far in this billing period.
-
#consumed_units ⇒ Float
readonly
The number of consumed units so far in this billing period.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#credited_units ⇒ Integer
readonly
The number of credited units so far in this billing period.
-
#id ⇒ String
readonly
The ID of the object.
-
#meter_id ⇒ String
readonly
The ID of the meter.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, consumed_units:, credited_units:, amount:, meter_id:) ⇒ CustomerStateSubscriptionMeter
constructor
A new instance of CustomerStateSubscriptionMeter.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(created_at:, modified_at:, id:, consumed_units:, credited_units:, amount:, meter_id:) ⇒ CustomerStateSubscriptionMeter
Returns a new instance of CustomerStateSubscriptionMeter.
20498 20499 20500 20501 20502 20503 20504 20505 20506 20507 20508 20509 20510 20511 20512 20513 20514 20515 |
# File 'lib/pago/v2026_04/models.rb', line 20498 def initialize( created_at:, modified_at:, id:, consumed_units:, credited_units:, amount:, meter_id: ) super() assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:consumed_units, consumed_units) assign(:credited_units, credited_units) assign(:amount, amount) assign(:meter_id, meter_id) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
The amount due in cents so far in this billing period.
20492 20493 20494 |
# File 'lib/pago/v2026_04/models.rb', line 20492 def amount @amount end |
#consumed_units ⇒ Float (readonly)
The number of consumed units so far in this billing period.
20484 20485 20486 |
# File 'lib/pago/v2026_04/models.rb', line 20484 def consumed_units @consumed_units end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
20472 20473 20474 |
# File 'lib/pago/v2026_04/models.rb', line 20472 def created_at @created_at end |
#credited_units ⇒ Integer (readonly)
The number of credited units so far in this billing period.
20488 20489 20490 |
# File 'lib/pago/v2026_04/models.rb', line 20488 def credited_units @credited_units end |
#id ⇒ String (readonly)
The ID of the object.
20480 20481 20482 |
# File 'lib/pago/v2026_04/models.rb', line 20480 def id @id end |
#meter_id ⇒ String (readonly)
The ID of the meter.
20496 20497 20498 |
# File 'lib/pago/v2026_04/models.rb', line 20496 def meter_id @meter_id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
20476 20477 20478 |
# File 'lib/pago/v2026_04/models.rb', line 20476 def modified_at @modified_at end |
Class Method Details
.from_json(data) ⇒ CustomerStateSubscriptionMeter?
20519 20520 20521 20522 20523 20524 20525 20526 20527 20528 20529 20530 20531 20532 20533 20534 20535 20536 |
# File 'lib/pago/v2026_04/models.rb', line 20519 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), id: (data.key?("id") ? data["id"] : ::Pago::UNSET), consumed_units: (data.key?("consumed_units") ? data["consumed_units"] : ::Pago::UNSET), credited_units: (data.key?("credited_units") ? data["credited_units"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), meter_id: (data.key?("meter_id") ? data["meter_id"] : ::Pago::UNSET) ), data ) end |