Class: Pago::V2026_04::Models::WebhookBenefitCreatedPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a new benefit 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 ⇒ Object readonly
- #timestamp ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, timestamp:, data:) ⇒ WebhookBenefitCreatedPayload
constructor
A new instance of WebhookBenefitCreatedPayload.
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:) ⇒ WebhookBenefitCreatedPayload
Returns a new instance of WebhookBenefitCreatedPayload.
44476 44477 44478 44479 44480 44481 44482 44483 44484 44485 |
# File 'lib/pago/v2026_04/models.rb', line 44476 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Object (readonly)
44474 44475 44476 |
# File 'lib/pago/v2026_04/models.rb', line 44474 def data @data end |
#timestamp ⇒ String (readonly)
44471 44472 44473 |
# File 'lib/pago/v2026_04/models.rb', line 44471 def @timestamp end |
#type ⇒ String (readonly)
44468 44469 44470 |
# File 'lib/pago/v2026_04/models.rb', line 44468 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookBenefitCreatedPayload?
44489 44490 44491 44492 44493 44494 44495 44496 44497 44498 44499 44500 44501 44502 |
# File 'lib/pago/v2026_04/models.rb', line 44489 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") ? Unions::Benefit.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |