Class: Pago::V2026_04::Models::ProductPriceMeteredUnit
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
A metered, usage-based, price for a product, with a fixed unit price.
Constant Summary collapse
- JSON_KEYS =
{ 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", unit_amount: "unit_amount", cap_amount: "cap_amount", meter_id: "meter_id", meter: "meter" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "source", "amount_type", "price_currency", "tax_behavior", "is_archived", "product_id", "unit_amount", "cap_amount", "meter_id", "meter"].freeze
Instance Attribute Summary collapse
- #amount_type ⇒ String readonly
-
#cap_amount ⇒ Integer?
readonly
The maximum amount in cents that can be charged, regardless of the number of units consumed.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#id ⇒ String
readonly
The ID of the price.
-
#is_archived ⇒ Boolean
readonly
Whether the price is archived and no longer available.
- #meter ⇒ Models::ProductPriceMeter readonly
-
#meter_id ⇒ String
readonly
The ID of the meter associated to the price.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#price_currency ⇒ String
readonly
The currency in which the customer will be charged.
-
#product_id ⇒ String
readonly
The ID of the product owning the price.
- #source ⇒ String readonly
-
#tax_behavior ⇒ String?
readonly
The tax behavior of the price.
-
#unit_amount ⇒ String
readonly
The price per unit in cents.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, source:, amount_type:, price_currency:, tax_behavior:, is_archived:, product_id:, unit_amount:, cap_amount:, meter_id:, meter:) ⇒ ProductPriceMeteredUnit
constructor
A new instance of ProductPriceMeteredUnit.
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:, unit_amount:, cap_amount:, meter_id:, meter:) ⇒ ProductPriceMeteredUnit
Returns a new instance of ProductPriceMeteredUnit.
37583 37584 37585 37586 37587 37588 37589 37590 37591 37592 37593 37594 37595 37596 37597 37598 37599 37600 37601 37602 37603 37604 37605 37606 37607 37608 37609 37610 37611 37612 |
# File 'lib/pago/v2026_04/models.rb', line 37583 def initialize( created_at:, modified_at:, id:, source:, amount_type:, price_currency:, tax_behavior:, is_archived:, product_id:, unit_amount:, cap_amount:, meter_id:, meter: ) 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(:unit_amount, unit_amount) assign(:cap_amount, cap_amount) assign(:meter_id, meter_id) assign(:meter, meter) end |
Instance Attribute Details
#amount_type ⇒ String (readonly)
37550 37551 37552 |
# File 'lib/pago/v2026_04/models.rb', line 37550 def amount_type @amount_type end |
#cap_amount ⇒ Integer? (readonly)
The maximum amount in cents that can be charged, regardless of the number of units consumed.
37574 37575 37576 |
# File 'lib/pago/v2026_04/models.rb', line 37574 def cap_amount @cap_amount end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
37536 37537 37538 |
# File 'lib/pago/v2026_04/models.rb', line 37536 def created_at @created_at end |
#id ⇒ String (readonly)
The ID of the price.
37544 37545 37546 |
# File 'lib/pago/v2026_04/models.rb', line 37544 def id @id end |
#is_archived ⇒ Boolean (readonly)
Whether the price is archived and no longer available.
37562 37563 37564 |
# File 'lib/pago/v2026_04/models.rb', line 37562 def is_archived @is_archived end |
#meter ⇒ Models::ProductPriceMeter (readonly)
37581 37582 37583 |
# File 'lib/pago/v2026_04/models.rb', line 37581 def meter @meter end |
#meter_id ⇒ String (readonly)
The ID of the meter associated to the price.
37578 37579 37580 |
# File 'lib/pago/v2026_04/models.rb', line 37578 def meter_id @meter_id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
37540 37541 37542 |
# File 'lib/pago/v2026_04/models.rb', line 37540 def modified_at @modified_at end |
#price_currency ⇒ String (readonly)
The currency in which the customer will be charged.
37554 37555 37556 |
# File 'lib/pago/v2026_04/models.rb', line 37554 def price_currency @price_currency end |
#product_id ⇒ String (readonly)
The ID of the product owning the price.
37566 37567 37568 |
# File 'lib/pago/v2026_04/models.rb', line 37566 def product_id @product_id end |
#source ⇒ String (readonly)
37547 37548 37549 |
# File 'lib/pago/v2026_04/models.rb', line 37547 def source @source end |
#tax_behavior ⇒ String? (readonly)
The tax behavior of the price. If null, it defaults to the organization's default tax behavior.
37558 37559 37560 |
# File 'lib/pago/v2026_04/models.rb', line 37558 def tax_behavior @tax_behavior end |
#unit_amount ⇒ String (readonly)
The price per unit in cents.
37570 37571 37572 |
# File 'lib/pago/v2026_04/models.rb', line 37570 def unit_amount @unit_amount end |
Class Method Details
.from_json(data) ⇒ ProductPriceMeteredUnit?
37616 37617 37618 37619 37620 37621 37622 37623 37624 37625 37626 37627 37628 37629 37630 37631 37632 37633 37634 37635 37636 37637 37638 37639 |
# File 'lib/pago/v2026_04/models.rb', line 37616 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), unit_amount: (data.key?("unit_amount") ? data["unit_amount"] : ::Pago::UNSET), cap_amount: (data.key?("cap_amount") ? data["cap_amount"] : ::Pago::UNSET), meter_id: (data.key?("meter_id") ? data["meter_id"] : ::Pago::UNSET), meter: (data.key?("meter") ? Models::ProductPriceMeter.from_json(data["meter"]) : ::Pago::UNSET) ), data ) end |