Class: Pago::V2026_04::Models::WebhookSubscriptionCanceledPayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a subscription is canceled. Customers might still have access until the end of the current period.
Discord & Slack support: Full
Constant Summary collapse
- JSON_KEYS =
{ type: "type", timestamp: "timestamp", data: "data" }.freeze
- REQUIRED_KEYS =
["type", "timestamp", "data"].freeze
Instance Attribute Summary collapse
- #data ⇒ Models::Subscription readonly
- #timestamp ⇒ String readonly
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, timestamp:, data:) ⇒ WebhookSubscriptionCanceledPayload
constructor
A new instance of WebhookSubscriptionCanceledPayload.
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:) ⇒ WebhookSubscriptionCanceledPayload
Returns a new instance of WebhookSubscriptionCanceledPayload.
45947 45948 45949 45950 45951 45952 45953 45954 45955 45956 |
# File 'lib/pago/v2026_04/models.rb', line 45947 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Models::Subscription (readonly)
45945 45946 45947 |
# File 'lib/pago/v2026_04/models.rb', line 45945 def data @data end |
#timestamp ⇒ String (readonly)
45942 45943 45944 |
# File 'lib/pago/v2026_04/models.rb', line 45942 def @timestamp end |
#type ⇒ String (readonly)
45939 45940 45941 |
# File 'lib/pago/v2026_04/models.rb', line 45939 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookSubscriptionCanceledPayload?
45960 45961 45962 45963 45964 45965 45966 45967 45968 45969 45970 45971 45972 45973 |
# File 'lib/pago/v2026_04/models.rb', line 45960 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::Subscription.from_json(data["data"]) : ::Pago::UNSET) ), data ) end |