Class: Pago::V2026_04::Models::CustomerSubscriptionMeter
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
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", meter: "meter" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "consumed_units", "credited_units", "amount", "meter_id", "meter"].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 ⇒ Models::CustomerSubscriptionMeterMeter readonly
-
#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:, meter:) ⇒ CustomerSubscriptionMeter
constructor
A new instance of CustomerSubscriptionMeter.
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:, meter:) ⇒ CustomerSubscriptionMeter
Returns a new instance of CustomerSubscriptionMeter.
21119 21120 21121 21122 21123 21124 21125 21126 21127 21128 21129 21130 21131 21132 21133 21134 21135 21136 21137 21138 |
# File 'lib/pago/v2026_04/models.rb', line 21119 def initialize( created_at:, modified_at:, id:, consumed_units:, credited_units:, amount:, meter_id:, meter: ) 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) assign(:meter, meter) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
The amount due in cents so far in this billing period.
21110 21111 21112 |
# File 'lib/pago/v2026_04/models.rb', line 21110 def amount @amount end |
#consumed_units ⇒ Float (readonly)
The number of consumed units so far in this billing period.
21102 21103 21104 |
# File 'lib/pago/v2026_04/models.rb', line 21102 def consumed_units @consumed_units end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
21090 21091 21092 |
# File 'lib/pago/v2026_04/models.rb', line 21090 def created_at @created_at end |
#credited_units ⇒ Integer (readonly)
The number of credited units so far in this billing period.
21106 21107 21108 |
# File 'lib/pago/v2026_04/models.rb', line 21106 def credited_units @credited_units end |
#id ⇒ String (readonly)
The ID of the object.
21098 21099 21100 |
# File 'lib/pago/v2026_04/models.rb', line 21098 def id @id end |
#meter ⇒ Models::CustomerSubscriptionMeterMeter (readonly)
21117 21118 21119 |
# File 'lib/pago/v2026_04/models.rb', line 21117 def meter @meter end |
#meter_id ⇒ String (readonly)
The ID of the meter.
21114 21115 21116 |
# File 'lib/pago/v2026_04/models.rb', line 21114 def meter_id @meter_id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
21094 21095 21096 |
# File 'lib/pago/v2026_04/models.rb', line 21094 def modified_at @modified_at end |
Class Method Details
.from_json(data) ⇒ CustomerSubscriptionMeter?
21142 21143 21144 21145 21146 21147 21148 21149 21150 21151 21152 21153 21154 21155 21156 21157 21158 21159 21160 |
# File 'lib/pago/v2026_04/models.rb', line 21142 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), meter: (data.key?("meter") ? Models::CustomerSubscriptionMeterMeter.from_json(data["meter"]) : ::Pago::UNSET) ), data ) end |