Class: Pago::V2026_04::Models::WebhookBenefitUpdatedPayload

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

Overview

Sent when a benefit is updated.

Discord & Slack support: Basic

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

Returns a new instance of WebhookBenefitUpdatedPayload.

Parameters:

  • type: (String)
  • timestamp: (String)
  • data: (Object)


44722
44723
44724
44725
44726
44727
44728
44729
44730
44731
# File 'lib/pago/v2026_04/models.rb', line 44722

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

Instance Attribute Details

#dataObject (readonly)

Returns:

  • (Object)


44720
44721
44722
# File 'lib/pago/v2026_04/models.rb', line 44720

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


44717
44718
44719
# File 'lib/pago/v2026_04/models.rb', line 44717

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


44714
44715
44716
# File 'lib/pago/v2026_04/models.rb', line 44714

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookBenefitUpdatedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



44735
44736
44737
44738
44739
44740
44741
44742
44743
44744
44745
44746
44747
44748
# File 'lib/pago/v2026_04/models.rb', line 44735

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::Benefit.from_json(data["data"]) : ::Pago::UNSET)
    ),
    data
  )
end