Class: Pago::V2026_04::Models::LegacyRecurringProductPriceFixed

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

Overview

A recurring price for a product, i.e. a subscription.

Deprecated: The recurring interval should be set on the product itself.

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",
  type: "type",
  recurring_interval: "recurring_interval",
  price_amount: "price_amount",
  legacy: "legacy"
}.freeze
REQUIRED_KEYS =

Returns:

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

Returns a new instance of LegacyRecurringProductPriceFixed.

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)
  • type: (String)
  • recurring_interval: (String)
  • price_amount: (Integer)
  • legacy: (Boolean)


26478
26479
26480
26481
26482
26483
26484
26485
26486
26487
26488
26489
26490
26491
26492
26493
26494
26495
26496
26497
26498
26499
26500
26501
26502
26503
26504
26505
26506
26507
# File 'lib/pago/v2026_04/models.rb', line 26478

def initialize(
  created_at:,
  modified_at:,
  id:,
  source:,
  amount_type:,
  price_currency:,
  tax_behavior:,
  is_archived:,
  product_id:,
  type:,
  recurring_interval:,
  price_amount:,
  legacy:
)
  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(:type, type)
  assign(:recurring_interval, recurring_interval)
  assign(:price_amount, price_amount)
  assign(:legacy, legacy)
end

Instance Attribute Details

#amount_typeString (readonly)

Returns:

  • (String)


26446
26447
26448
# File 'lib/pago/v2026_04/models.rb', line 26446

def amount_type
  @amount_type
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


26432
26433
26434
# File 'lib/pago/v2026_04/models.rb', line 26432

def created_at
  @created_at
end

#idString (readonly)

The ID of the price.

Returns:

  • (String)


26440
26441
26442
# File 'lib/pago/v2026_04/models.rb', line 26440

def id
  @id
end

#is_archivedBoolean (readonly)

Whether the price is archived and no longer available.

Returns:

  • (Boolean)


26458
26459
26460
# File 'lib/pago/v2026_04/models.rb', line 26458

def is_archived
  @is_archived
end

#legacyBoolean (readonly)

Returns:

  • (Boolean)


26476
26477
26478
# File 'lib/pago/v2026_04/models.rb', line 26476

def legacy
  @legacy
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


26436
26437
26438
# File 'lib/pago/v2026_04/models.rb', line 26436

def modified_at
  @modified_at
end

#price_amountInteger (readonly)

The price in cents.

Returns:

  • (Integer)


26473
26474
26475
# File 'lib/pago/v2026_04/models.rb', line 26473

def price_amount
  @price_amount
end

#price_currencyString (readonly)

The currency in which the customer will be charged.

Returns:

  • (String)


26450
26451
26452
# File 'lib/pago/v2026_04/models.rb', line 26450

def price_currency
  @price_currency
end

#product_idString (readonly)

The ID of the product owning the price.

Returns:

  • (String)


26462
26463
26464
# File 'lib/pago/v2026_04/models.rb', line 26462

def product_id
  @product_id
end

#recurring_intervalString (readonly)

Returns:

  • (String)


26469
26470
26471
# File 'lib/pago/v2026_04/models.rb', line 26469

def recurring_interval
  @recurring_interval
end

#sourceString (readonly)

Returns:

  • (String)


26443
26444
26445
# File 'lib/pago/v2026_04/models.rb', line 26443

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)


26454
26455
26456
# File 'lib/pago/v2026_04/models.rb', line 26454

def tax_behavior
  @tax_behavior
end

#typeString (readonly)

The type of the price.

Returns:

  • (String)


26466
26467
26468
# File 'lib/pago/v2026_04/models.rb', line 26466

def type
  @type
end

Class Method Details

.from_json(data) ⇒ LegacyRecurringProductPriceFixed?

Parameters:

  • data (Hash, String, nil)

Returns:



26511
26512
26513
26514
26515
26516
26517
26518
26519
26520
26521
26522
26523
26524
26525
26526
26527
26528
26529
26530
26531
26532
26533
26534
# File 'lib/pago/v2026_04/models.rb', line 26511

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