Class: Pago::V2026_04::Models::WebhookSubscriptionActivePayload
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
Sent when a subscription becomes active, whether because it's a new paid subscription or because payment was recovered.
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:) ⇒ WebhookSubscriptionActivePayload
constructor
A new instance of WebhookSubscriptionActivePayload.
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:) ⇒ WebhookSubscriptionActivePayload
Returns a new instance of WebhookSubscriptionActivePayload.
45897 45898 45899 45900 45901 45902 45903 45904 45905 45906 |
# File 'lib/pago/v2026_04/models.rb', line 45897 def initialize( type:, timestamp:, data: ) super() assign(:type, type) assign(:timestamp, ) assign(:data, data) end |
Instance Attribute Details
#data ⇒ Models::Subscription (readonly)
45895 45896 45897 |
# File 'lib/pago/v2026_04/models.rb', line 45895 def data @data end |
#timestamp ⇒ String (readonly)
45892 45893 45894 |
# File 'lib/pago/v2026_04/models.rb', line 45892 def @timestamp end |
#type ⇒ String (readonly)
45889 45890 45891 |
# File 'lib/pago/v2026_04/models.rb', line 45889 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookSubscriptionActivePayload?
45910 45911 45912 45913 45914 45915 45916 45917 45918 45919 45920 45921 45922 45923 |
# File 'lib/pago/v2026_04/models.rb', line 45910 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 |