Class: Pago::V2026_04::Models::WebhookCustomerCreatedPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a new customer is created.
A customer can be created:
- After a successful checkout.
- Programmatically via the API.
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:) ⇒ WebhookCustomerCreatedPayload
constructor
A new instance of WebhookCustomerCreatedPayload.
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:) ⇒ WebhookCustomerCreatedPayload
Returns a new instance of WebhookCustomerCreatedPayload.
44926 44927 44928 44929 44930 44931 44932 44933 44934 44935 |
# File 'lib/pago/v2026_04/models.rb', line 44926 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Object (readonly)
44924 44925 44926 |
# File 'lib/pago/v2026_04/models.rb', line 44924 def data @data end |
#timestamp ⇒ String (readonly)
44921 44922 44923 |
# File 'lib/pago/v2026_04/models.rb', line 44921 def @timestamp end |
#type ⇒ String (readonly)
44918 44919 44920 |
# File 'lib/pago/v2026_04/models.rb', line 44918 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookCustomerCreatedPayload?
44939 44940 44941 44942 44943 44944 44945 44946 44947 44948 44949 44950 44951 44952 |
# File 'lib/pago/v2026_04/models.rb', line 44939 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::Customer.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |