Class: Pago::V2026_04::Models::WebhookBenefitGrantUpdatedPayload

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

Overview

Sent when a benefit grant 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:) ⇒ WebhookBenefitGrantUpdatedPayload

Returns a new instance of WebhookBenefitGrantUpdatedPayload.

Parameters:

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


44673
44674
44675
44676
44677
44678
44679
44680
44681
44682
# File 'lib/pago/v2026_04/models.rb', line 44673

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

Instance Attribute Details

#dataObject (readonly)

Returns:

  • (Object)


44671
44672
44673
# File 'lib/pago/v2026_04/models.rb', line 44671

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


44668
44669
44670
# File 'lib/pago/v2026_04/models.rb', line 44668

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


44665
44666
44667
# File 'lib/pago/v2026_04/models.rb', line 44665

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookBenefitGrantUpdatedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



44686
44687
44688
44689
44690
44691
44692
44693
44694
44695
44696
44697
44698
44699
# File 'lib/pago/v2026_04/models.rb', line 44686

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