Class: Pago::V2026_04::Models::ProductPriceFixed

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

Overview

A fixed 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",
  price_amount: "price_amount"
}.freeze
REQUIRED_KEYS =

Returns:

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

Returns a new instance of ProductPriceFixed.

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)
  • price_amount: (Integer)


37216
37217
37218
37219
37220
37221
37222
37223
37224
37225
37226
37227
37228
37229
37230
37231
37232
37233
37234
37235
37236
37237
37238
37239
# File 'lib/pago/v2026_04/models.rb', line 37216

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

Instance Attribute Details

#amount_typeString (readonly)

Returns:

  • (String)


37194
37195
37196
# File 'lib/pago/v2026_04/models.rb', line 37194

def amount_type
  @amount_type
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


37180
37181
37182
# File 'lib/pago/v2026_04/models.rb', line 37180

def created_at
  @created_at
end

#idString (readonly)

The ID of the price.

Returns:

  • (String)


37188
37189
37190
# File 'lib/pago/v2026_04/models.rb', line 37188

def id
  @id
end

#is_archivedBoolean (readonly)

Whether the price is archived and no longer available.

Returns:

  • (Boolean)


37206
37207
37208
# File 'lib/pago/v2026_04/models.rb', line 37206

def is_archived
  @is_archived
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


37184
37185
37186
# File 'lib/pago/v2026_04/models.rb', line 37184

def modified_at
  @modified_at
end

#price_amountInteger (readonly)

The price in cents.

Returns:

  • (Integer)


37214
37215
37216
# File 'lib/pago/v2026_04/models.rb', line 37214

def price_amount
  @price_amount
end

#price_currencyString (readonly)

The currency in which the customer will be charged.

Returns:

  • (String)


37198
37199
37200
# File 'lib/pago/v2026_04/models.rb', line 37198

def price_currency
  @price_currency
end

#product_idString (readonly)

The ID of the product owning the price.

Returns:

  • (String)


37210
37211
37212
# File 'lib/pago/v2026_04/models.rb', line 37210

def product_id
  @product_id
end

#sourceString (readonly)

Returns:

  • (String)


37191
37192
37193
# File 'lib/pago/v2026_04/models.rb', line 37191

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)


37202
37203
37204
# File 'lib/pago/v2026_04/models.rb', line 37202

def tax_behavior
  @tax_behavior
end

Class Method Details

.from_json(data) ⇒ ProductPriceFixed?

Parameters:

  • data (Hash, String, nil)

Returns:



37243
37244
37245
37246
37247
37248
37249
37250
37251
37252
37253
37254
37255
37256
37257
37258
37259
37260
37261
37262
37263
# File 'lib/pago/v2026_04/models.rb', line 37243

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