Class: Pago::V2026_04::Models::OrderItemSchema
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
An order line item.
Constant Summary collapse
- JSON_KEYS =
{ created_at: "created_at", modified_at: "modified_at", id: "id", label: "label", amount: "amount", tax_amount: "tax_amount", proration: "proration", product_price_id: "product_price_id" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "label", "amount", "tax_amount", "proration", "product_price_id"].freeze
Instance Attribute Summary collapse
-
#amount ⇒ Integer
readonly
Amount in cents, before discounts and taxes.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#id ⇒ String
readonly
The ID of the object.
-
#label ⇒ String
readonly
Description of the line item charge.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#product_price_id ⇒ String?
readonly
Associated price ID, if any.
-
#proration ⇒ Boolean
readonly
Whether this charge is due to a proration.
-
#tax_amount ⇒ Integer
readonly
Sales tax amount in cents.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, label:, amount:, tax_amount:, proration:, product_price_id:) ⇒ OrderItemSchema
constructor
A new instance of OrderItemSchema.
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:, label:, amount:, tax_amount:, proration:, product_price_id:) ⇒ OrderItemSchema
Returns a new instance of OrderItemSchema.
32547 32548 32549 32550 32551 32552 32553 32554 32555 32556 32557 32558 32559 32560 32561 32562 32563 32564 32565 32566 |
# File 'lib/pago/v2026_04/models.rb', line 32547 def initialize( created_at:, modified_at:, id:, label:, amount:, tax_amount:, proration:, product_price_id: ) super() assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:label, label) assign(:amount, amount) assign(:tax_amount, tax_amount) assign(:proration, proration) assign(:product_price_id, product_price_id) end |
Instance Attribute Details
#amount ⇒ Integer (readonly)
Amount in cents, before discounts and taxes.
32533 32534 32535 |
# File 'lib/pago/v2026_04/models.rb', line 32533 def amount @amount end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
32517 32518 32519 |
# File 'lib/pago/v2026_04/models.rb', line 32517 def created_at @created_at end |
#id ⇒ String (readonly)
The ID of the object.
32525 32526 32527 |
# File 'lib/pago/v2026_04/models.rb', line 32525 def id @id end |
#label ⇒ String (readonly)
Description of the line item charge.
32529 32530 32531 |
# File 'lib/pago/v2026_04/models.rb', line 32529 def label @label end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
32521 32522 32523 |
# File 'lib/pago/v2026_04/models.rb', line 32521 def modified_at @modified_at end |
#product_price_id ⇒ String? (readonly)
Associated price ID, if any.
32545 32546 32547 |
# File 'lib/pago/v2026_04/models.rb', line 32545 def product_price_id @product_price_id end |
#proration ⇒ Boolean (readonly)
Whether this charge is due to a proration.
32541 32542 32543 |
# File 'lib/pago/v2026_04/models.rb', line 32541 def proration @proration end |
#tax_amount ⇒ Integer (readonly)
Sales tax amount in cents.
32537 32538 32539 |
# File 'lib/pago/v2026_04/models.rb', line 32537 def tax_amount @tax_amount end |
Class Method Details
.from_json(data) ⇒ OrderItemSchema?
32570 32571 32572 32573 32574 32575 32576 32577 32578 32579 32580 32581 32582 32583 32584 32585 32586 32587 32588 |
# File 'lib/pago/v2026_04/models.rb', line 32570 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), label: (data.key?("label") ? data["label"] : ::Pago::UNSET), amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET), tax_amount: (data.key?("tax_amount") ? data["tax_amount"] : ::Pago::UNSET), proration: (data.key?("proration") ? data["proration"] : ::Pago::UNSET), product_price_id: (data.key?("product_price_id") ? data["product_price_id"] : ::Pago::UNSET) ), data ) end |