Class: Pago::V2026_04::Models::WebhookCustomerStateChangedPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a customer state has changed.
It's triggered when:
- Customer is created, updated or deleted.
- A subscription is created or updated.
- A benefit is granted or revoked.
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:) ⇒ WebhookCustomerStateChangedPayload
constructor
A new instance of WebhookCustomerStateChangedPayload.
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:) ⇒ WebhookCustomerStateChangedPayload
Returns a new instance of WebhookCustomerStateChangedPayload.
45178 45179 45180 45181 45182 45183 45184 45185 45186 45187 |
# File 'lib/pago/v2026_04/models.rb', line 45178 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Object (readonly)
45176 45177 45178 |
# File 'lib/pago/v2026_04/models.rb', line 45176 def data @data end |
#timestamp ⇒ String (readonly)
45173 45174 45175 |
# File 'lib/pago/v2026_04/models.rb', line 45173 def @timestamp end |
#type ⇒ String (readonly)
45170 45171 45172 |
# File 'lib/pago/v2026_04/models.rb', line 45170 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookCustomerStateChangedPayload?
45191 45192 45193 45194 45195 45196 45197 45198 45199 45200 45201 45202 45203 45204 |
# File 'lib/pago/v2026_04/models.rb', line 45191 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::CustomerState.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |