Class: Pago::V2026_04::Models::ProductPriceSeatBased

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

Overview

A seat-based price for a product.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  source: "source",
  amount_type: "amount_type",
  price_currency: "price_currency",
  tax_behavior: "tax_behavior",
  is_archived: "is_archived",
  product_id: "product_id",
  seat_tiers: "seat_tiers"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "source", "amount_type", "price_currency", "tax_behavior", "is_archived", "product_id", "seat_tiers"].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:, source:, amount_type:, price_currency:, tax_behavior:, is_archived:, product_id:, seat_tiers:) ⇒ ProductPriceSeatBased

Returns a new instance of ProductPriceSeatBased.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • source: (String)
  • amount_type: (String)
  • price_currency: (String)
  • tax_behavior: (String, nil)
  • is_archived: (Boolean)
  • product_id: (String)
  • seat_tiers: (Models::ProductPriceSeatTiersOutput)


37767
37768
37769
37770
37771
37772
37773
37774
37775
37776
37777
37778
37779
37780
37781
37782
37783
37784
37785
37786
37787
37788
37789
37790
# File 'lib/pago/v2026_04/models.rb', line 37767

def initialize(
  created_at:,
  modified_at:,
  id:,
  source:,
  amount_type:,
  price_currency:,
  tax_behavior:,
  is_archived:,
  product_id:,
  seat_tiers:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:source, source)
  assign(:amount_type, amount_type)
  assign(:price_currency, price_currency)
  assign(:tax_behavior, tax_behavior)
  assign(:is_archived, is_archived)
  assign(:product_id, product_id)
  assign(:seat_tiers, seat_tiers)
end

Instance Attribute Details

#amount_typeString (readonly)

Returns:

  • (String)


37746
37747
37748
# File 'lib/pago/v2026_04/models.rb', line 37746

def amount_type
  @amount_type
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


37732
37733
37734
# File 'lib/pago/v2026_04/models.rb', line 37732

def created_at
  @created_at
end

#idString (readonly)

The ID of the price.

Returns:

  • (String)


37740
37741
37742
# File 'lib/pago/v2026_04/models.rb', line 37740

def id
  @id
end

#is_archivedBoolean (readonly)

Whether the price is archived and no longer available.

Returns:

  • (Boolean)


37758
37759
37760
# File 'lib/pago/v2026_04/models.rb', line 37758

def is_archived
  @is_archived
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


37736
37737
37738
# File 'lib/pago/v2026_04/models.rb', line 37736

def modified_at
  @modified_at
end

#price_currencyString (readonly)

The currency in which the customer will be charged.

Returns:

  • (String)


37750
37751
37752
# File 'lib/pago/v2026_04/models.rb', line 37750

def price_currency
  @price_currency
end

#product_idString (readonly)

The ID of the product owning the price.

Returns:

  • (String)


37762
37763
37764
# File 'lib/pago/v2026_04/models.rb', line 37762

def product_id
  @product_id
end

#seat_tiersModels::ProductPriceSeatTiersOutput (readonly)



37765
37766
37767
# File 'lib/pago/v2026_04/models.rb', line 37765

def seat_tiers
  @seat_tiers
end

#sourceString (readonly)

Returns:

  • (String)


37743
37744
37745
# File 'lib/pago/v2026_04/models.rb', line 37743

def source
  @source
end

#tax_behaviorString? (readonly)

The tax behavior of the price. If null, it defaults to the organization's default tax behavior.

Returns:

  • (String, nil)


37754
37755
37756
# File 'lib/pago/v2026_04/models.rb', line 37754

def tax_behavior
  @tax_behavior
end

Class Method Details

.from_json(data) ⇒ ProductPriceSeatBased?

Parameters:

  • data (Hash, String, nil)

Returns:



37794
37795
37796
37797
37798
37799
37800
37801
37802
37803
37804
37805
37806
37807
37808
37809
37810
37811
37812
37813
37814
# File 'lib/pago/v2026_04/models.rb', line 37794

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),
      source: (data.key?("source") ? data["source"] : ::Pago::UNSET),
      amount_type: (data.key?("amount_type") ? data["amount_type"] : ::Pago::UNSET),
      price_currency: (data.key?("price_currency") ? data["price_currency"] : ::Pago::UNSET),
      tax_behavior: (data.key?("tax_behavior") ? data["tax_behavior"] : ::Pago::UNSET),
      is_archived: (data.key?("is_archived") ? data["is_archived"] : ::Pago::UNSET),
      product_id: (data.key?("product_id") ? data["product_id"] : ::Pago::UNSET),
      seat_tiers: (data.key?("seat_tiers") ? Models::ProductPriceSeatTiersOutput.from_json(data["seat_tiers"]) : ::Pago::UNSET)
    ),
    data
  )
end