Class: Pago::V2026_04::Models::CustomerCustomerMeter
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", customer_id: "customer_id", meter_id: "meter_id", consumed_units: "consumed_units", credited_units: "credited_units", balance: "balance", meter: "meter" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "customer_id", "meter_id", "consumed_units", "credited_units", "balance", "meter"].freeze
Instance Attribute Summary collapse
-
#balance ⇒ Float
readonly
The balance of the meter, i.e.
-
#consumed_units ⇒ Float
readonly
The number of consumed units.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#credited_units ⇒ Integer
readonly
The number of credited units.
-
#customer_id ⇒ String
readonly
The ID of the customer.
-
#id ⇒ String
readonly
The ID of the object.
- #meter ⇒ Models::CustomerCustomerMeterMeter 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(id:, created_at:, modified_at:, customer_id:, meter_id:, consumed_units:, credited_units:, balance:, meter:) ⇒ CustomerCustomerMeter
constructor
A new instance of CustomerCustomerMeter.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, customer_id:, meter_id:, consumed_units:, credited_units:, balance:, meter:) ⇒ CustomerCustomerMeter
Returns a new instance of CustomerCustomerMeter.
16447 16448 16449 16450 16451 16452 16453 16454 16455 16456 16457 16458 16459 16460 16461 16462 16463 16464 16465 16466 16467 16468 |
# File 'lib/pago/v2026_04/models.rb', line 16447 def initialize( id:, created_at:, modified_at:, customer_id:, meter_id:, consumed_units:, credited_units:, balance:, meter: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:customer_id, customer_id) assign(:meter_id, meter_id) assign(:consumed_units, consumed_units) assign(:credited_units, credited_units) assign(:balance, balance) assign(:meter, meter) end |
Instance Attribute Details
#balance ⇒ Float (readonly)
The balance of the meter, i.e. the difference between credited and consumed units.
16442 16443 16444 |
# File 'lib/pago/v2026_04/models.rb', line 16442 def balance @balance end |
#consumed_units ⇒ Float (readonly)
The number of consumed units.
16434 16435 16436 |
# File 'lib/pago/v2026_04/models.rb', line 16434 def consumed_units @consumed_units end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
16418 16419 16420 |
# File 'lib/pago/v2026_04/models.rb', line 16418 def created_at @created_at end |
#credited_units ⇒ Integer (readonly)
The number of credited units.
16438 16439 16440 |
# File 'lib/pago/v2026_04/models.rb', line 16438 def credited_units @credited_units end |
#customer_id ⇒ String (readonly)
The ID of the customer.
16426 16427 16428 |
# File 'lib/pago/v2026_04/models.rb', line 16426 def customer_id @customer_id end |
#id ⇒ String (readonly)
The ID of the object.
16414 16415 16416 |
# File 'lib/pago/v2026_04/models.rb', line 16414 def id @id end |
#meter ⇒ Models::CustomerCustomerMeterMeter (readonly)
16445 16446 16447 |
# File 'lib/pago/v2026_04/models.rb', line 16445 def meter @meter end |
#meter_id ⇒ String (readonly)
The ID of the meter.
16430 16431 16432 |
# File 'lib/pago/v2026_04/models.rb', line 16430 def meter_id @meter_id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
16422 16423 16424 |
# File 'lib/pago/v2026_04/models.rb', line 16422 def modified_at @modified_at end |
Class Method Details
.from_json(data) ⇒ CustomerCustomerMeter?
16472 16473 16474 16475 16476 16477 16478 16479 16480 16481 16482 16483 16484 16485 16486 16487 16488 16489 16490 16491 |
# File 'lib/pago/v2026_04/models.rb', line 16472 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET), meter_id: (data.key?("meter_id") ? data["meter_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), balance: (data.key?("balance") ? data["balance"] : ::Pago::UNSET), meter: (data.key?("meter") ? Models::CustomerCustomerMeterMeter.from_json(data["meter"]) : ::Pago::UNSET) ), data ) end |