Class: Pago::V2026_04::Models::WebhookSubscriptionPausedPayload

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Sent when a subscription is paused and the customer temporarily loses access.

No order is created while paused. The subscription resumes either on its scheduled resume date or when resumed manually, starting a new billing period.

Discord & Slack support: Full

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  type: "type",
  timestamp: "timestamp",
  data: "data"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["type", "timestamp", "data"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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:) ⇒ WebhookSubscriptionPausedPayload

Returns a new instance of WebhookSubscriptionPausedPayload.

Parameters:



46104
46105
46106
46107
46108
46109
46110
46111
46112
46113
# File 'lib/pago/v2026_04/models.rb', line 46104

def initialize(
  type:,
  timestamp:,
  data:
)
  super()
  assign(:type, type)
  assign(:timestamp, timestamp)
  assign(:data, data)
end

Instance Attribute Details

#dataModels::Subscription (readonly)



46102
46103
46104
# File 'lib/pago/v2026_04/models.rb', line 46102

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


46099
46100
46101
# File 'lib/pago/v2026_04/models.rb', line 46099

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


46096
46097
46098
# File 'lib/pago/v2026_04/models.rb', line 46096

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookSubscriptionPausedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



46117
46118
46119
46120
46121
46122
46123
46124
46125
46126
46127
46128
46129
46130
# File 'lib/pago/v2026_04/models.rb', line 46117

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