Class: Pago::V2026_04::Models::SubscriptionMeter
- 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", 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::Meter 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:) ⇒ SubscriptionMeter
constructor
A new instance of SubscriptionMeter.
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:) ⇒ SubscriptionMeter
Returns a new instance of SubscriptionMeter.
40834 40835 40836 40837 40838 40839 40840 40841 40842 40843 40844 40845 40846 40847 40848 40849 40850 40851 40852 40853 |
# File 'lib/pago/v2026_04/models.rb', line 40834 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.
40825 40826 40827 |
# File 'lib/pago/v2026_04/models.rb', line 40825 def amount @amount end |
#consumed_units ⇒ Float (readonly)
The number of consumed units so far in this billing period.
40817 40818 40819 |
# File 'lib/pago/v2026_04/models.rb', line 40817 def consumed_units @consumed_units end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
40805 40806 40807 |
# File 'lib/pago/v2026_04/models.rb', line 40805 def created_at @created_at end |
#credited_units ⇒ Integer (readonly)
The number of credited units so far in this billing period.
40821 40822 40823 |
# File 'lib/pago/v2026_04/models.rb', line 40821 def credited_units @credited_units end |
#id ⇒ String (readonly)
The ID of the object.
40813 40814 40815 |
# File 'lib/pago/v2026_04/models.rb', line 40813 def id @id end |
#meter ⇒ Models::Meter (readonly)
40832 40833 40834 |
# File 'lib/pago/v2026_04/models.rb', line 40832 def meter @meter end |
#meter_id ⇒ String (readonly)
The ID of the meter.
40829 40830 40831 |
# File 'lib/pago/v2026_04/models.rb', line 40829 def meter_id @meter_id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
40809 40810 40811 |
# File 'lib/pago/v2026_04/models.rb', line 40809 def modified_at @modified_at end |
Class Method Details
.from_json(data) ⇒ SubscriptionMeter?
40857 40858 40859 40860 40861 40862 40863 40864 40865 40866 40867 40868 40869 40870 40871 40872 40873 40874 40875 |
# File 'lib/pago/v2026_04/models.rb', line 40857 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::Meter.from_json(data["meter"]) : ::Pago::UNSET) ), data ) end |