Class: Pago::V2026_04::Models::ProductPriceSeatTier

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

Overview

A pricing tier for seat-based pricing.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  min_seats: "min_seats",
  max_seats: "max_seats",
  price_per_seat: "price_per_seat"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["min_seats", "price_per_seat"].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(min_seats:, max_seats: ::Pago::UNSET, price_per_seat:) ⇒ ProductPriceSeatTier

Returns a new instance of ProductPriceSeatTier.

Parameters:

  • min_seats: (Integer)
  • max_seats: (Integer, nil) (defaults to: ::Pago::UNSET)
  • price_per_seat: (Integer)


37893
37894
37895
37896
37897
37898
37899
37900
37901
37902
# File 'lib/pago/v2026_04/models.rb', line 37893

def initialize(
  min_seats:,
  max_seats: ::Pago::UNSET,
  price_per_seat:
)
  super()
  assign(:min_seats, min_seats)
  assign(:max_seats, max_seats)
  assign(:price_per_seat, price_per_seat)
end

Instance Attribute Details

#max_seatsInteger? (readonly)

Maximum number of seats (inclusive). None for unlimited.

Returns:

  • (Integer, nil)


37887
37888
37889
# File 'lib/pago/v2026_04/models.rb', line 37887

def max_seats
  @max_seats
end

#min_seatsInteger (readonly)

Minimum number of seats (inclusive)

Returns:

  • (Integer)


37883
37884
37885
# File 'lib/pago/v2026_04/models.rb', line 37883

def min_seats
  @min_seats
end

#price_per_seatInteger (readonly)

Price per seat in cents for this tier

Returns:

  • (Integer)


37891
37892
37893
# File 'lib/pago/v2026_04/models.rb', line 37891

def price_per_seat
  @price_per_seat
end

Class Method Details

.from_json(data) ⇒ ProductPriceSeatTier?

Parameters:

  • data (Hash, String, nil)

Returns:



37906
37907
37908
37909
37910
37911
37912
37913
37914
37915
37916
37917
37918
37919
# File 'lib/pago/v2026_04/models.rb', line 37906

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