Class: Pago::V2026_04::Models::ProductPriceFixed
- 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 =
{ 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 =
["created_at", "modified_at", "id", "source", "amount_type", "price_currency", "tax_behavior", "is_archived", "product_id", "price_amount"].freeze
Instance Attribute Summary collapse
- #amount_type ⇒ String readonly
-
#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.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#price_amount ⇒ Integer
readonly
The price in cents.
-
#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.
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:, price_amount:) ⇒ ProductPriceFixed
constructor
A new instance of ProductPriceFixed.
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.
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_type ⇒ String (readonly)
37194 37195 37196 |
# File 'lib/pago/v2026_04/models.rb', line 37194 def amount_type @amount_type end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
37180 37181 37182 |
# File 'lib/pago/v2026_04/models.rb', line 37180 def created_at @created_at end |
#id ⇒ String (readonly)
The ID of the price.
37188 37189 37190 |
# File 'lib/pago/v2026_04/models.rb', line 37188 def id @id end |
#is_archived ⇒ Boolean (readonly)
Whether the price is archived and no longer available.
37206 37207 37208 |
# File 'lib/pago/v2026_04/models.rb', line 37206 def is_archived @is_archived end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
37184 37185 37186 |
# File 'lib/pago/v2026_04/models.rb', line 37184 def modified_at @modified_at end |
#price_amount ⇒ Integer (readonly)
The price in cents.
37214 37215 37216 |
# File 'lib/pago/v2026_04/models.rb', line 37214 def price_amount @price_amount end |
#price_currency ⇒ String (readonly)
The currency in which the customer will be charged.
37198 37199 37200 |
# File 'lib/pago/v2026_04/models.rb', line 37198 def price_currency @price_currency end |
#product_id ⇒ String (readonly)
The ID of the product owning the price.
37210 37211 37212 |
# File 'lib/pago/v2026_04/models.rb', line 37210 def product_id @product_id end |
#source ⇒ String (readonly)
37191 37192 37193 |
# File 'lib/pago/v2026_04/models.rb', line 37191 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.
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?
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 |