Class: Pago::V2026_04::Models::SeatsList

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])
{
  seats: "seats",
  available_seats: "available_seats",
  total_seats: "total_seats"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["seats", "available_seats", "total_seats"].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(seats:, available_seats:, total_seats:) ⇒ SeatsList

Returns a new instance of SeatsList.

Parameters:



39214
39215
39216
39217
39218
39219
39220
39221
39222
39223
# File 'lib/pago/v2026_04/models.rb', line 39214

def initialize(
  seats:,
  available_seats:,
  total_seats:
)
  super()
  assign(:seats, seats)
  assign(:available_seats, available_seats)
  assign(:total_seats, total_seats)
end

Instance Attribute Details

#available_seatsInteger (readonly)

Number of available seats

Returns:

  • (Integer)


39208
39209
39210
# File 'lib/pago/v2026_04/models.rb', line 39208

def available_seats
  @available_seats
end

#seatsArray<Models::CustomerSeat> (readonly)

List of seats

Returns:



39204
39205
39206
# File 'lib/pago/v2026_04/models.rb', line 39204

def seats
  @seats
end

#total_seatsInteger (readonly)

Total number of seats for the subscription

Returns:

  • (Integer)


39212
39213
39214
# File 'lib/pago/v2026_04/models.rb', line 39212

def total_seats
  @total_seats
end

Class Method Details

.from_json(data) ⇒ SeatsList?

Parameters:

  • data (Hash, String, nil)

Returns:



39227
39228
39229
39230
39231
39232
39233
39234
39235
39236
39237
39238
39239
39240
# File 'lib/pago/v2026_04/models.rb', line 39227

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(
      seats: (data.key?("seats") ? ::Pago::Serde.array(data["seats"]) { |item0| Models::CustomerSeat.from_json(item0) } : ::Pago::UNSET),
      available_seats: (data.key?("available_seats") ? data["available_seats"] : ::Pago::UNSET),
      total_seats: (data.key?("total_seats") ? data["total_seats"] : ::Pago::UNSET)
    ),
    data
  )
end