Class: Pago::V2026_04::Models::CustomerCustomerMeterMeter

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  name: "name"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "name"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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:, name:) ⇒ CustomerCustomerMeterMeter

Returns a new instance of CustomerCustomerMeterMeter.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • name: (String)


16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
# File 'lib/pago/v2026_04/models.rb', line 16519

def initialize(
  created_at:,
  modified_at:,
  id:,
  name:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:name, name)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


16505
16506
16507
# File 'lib/pago/v2026_04/models.rb', line 16505

def created_at
  @created_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


16513
16514
16515
# File 'lib/pago/v2026_04/models.rb', line 16513

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


16509
16510
16511
# File 'lib/pago/v2026_04/models.rb', line 16509

def modified_at
  @modified_at
end

#nameString (readonly)

The name of the meter. Will be shown on customer's invoices and usage.

Returns:

  • (String)


16517
16518
16519
# File 'lib/pago/v2026_04/models.rb', line 16517

def name
  @name
end

Class Method Details

.from_json(data) ⇒ CustomerCustomerMeterMeter?

Parameters:

  • data (Hash, String, nil)

Returns:



16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
# File 'lib/pago/v2026_04/models.rb', line 16534

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),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET)
    ),
    data
  )
end