Class: Pago::V2026_04::Models::WebhookBenefitGrantCreatedPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a new benefit grant 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:) ⇒ WebhookBenefitGrantCreatedPayload
constructor
A new instance of WebhookBenefitGrantCreatedPayload.
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:) ⇒ WebhookBenefitGrantCreatedPayload
Returns a new instance of WebhookBenefitGrantCreatedPayload.
44525 44526 44527 44528 44529 44530 44531 44532 44533 44534 |
# File 'lib/pago/v2026_04/models.rb', line 44525 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Object (readonly)
44523 44524 44525 |
# File 'lib/pago/v2026_04/models.rb', line 44523 def data @data end |
#timestamp ⇒ String (readonly)
44520 44521 44522 |
# File 'lib/pago/v2026_04/models.rb', line 44520 def @timestamp end |
#type ⇒ String (readonly)
44517 44518 44519 |
# File 'lib/pago/v2026_04/models.rb', line 44517 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookBenefitGrantCreatedPayload?
44538 44539 44540 44541 44542 44543 44544 44545 44546 44547 44548 44549 44550 44551 |
# File 'lib/pago/v2026_04/models.rb', line 44538 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::BenefitGrantWebhook.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |