Class: Pago::V2026_04::Models::WebhookProductCreatedPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a new product is created.
Discord & Slack support: Basic
Constant Summary collapse
- JSON_KEYS =
{ type: "type", timestamp: "timestamp", data: "data" }.freeze
- REQUIRED_KEYS =
["type", "timestamp", "data"].freeze
Instance Attribute Summary collapse
- #data ⇒ Models::Product readonly
- #timestamp ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, timestamp:, data:) ⇒ WebhookProductCreatedPayload
constructor
A new instance of WebhookProductCreatedPayload.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(type:, timestamp:, data:) ⇒ WebhookProductCreatedPayload
Returns a new instance of WebhookProductCreatedPayload.
45700 45701 45702 45703 45704 45705 45706 45707 45708 45709 |
# File 'lib/pago/v2026_04/models.rb', line 45700 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Models::Product (readonly)
45698 45699 45700 |
# File 'lib/pago/v2026_04/models.rb', line 45698 def data @data end |
#timestamp ⇒ String (readonly)
45695 45696 45697 |
# File 'lib/pago/v2026_04/models.rb', line 45695 def @timestamp end |
#type ⇒ String (readonly)
45692 45693 45694 |
# File 'lib/pago/v2026_04/models.rb', line 45692 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookProductCreatedPayload?
45713 45714 45715 45716 45717 45718 45719 45720 45721 45722 45723 45724 45725 45726 |
# File 'lib/pago/v2026_04/models.rb', line 45713 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( type: (data.key?("type") ? data["type"] : ::Pago::UNSET), timestamp: (data.key?("timestamp") ? data["timestamp"] : ::Pago::UNSET), data: (data.key?("data") ? Models::Product.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |