Class: Pago::V2026_04::Models::WebhookBenefitGrantRevokedPayload

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 revoked.

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

Returns a new instance of WebhookBenefitGrantRevokedPayload.

Parameters:

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


44624
44625
44626
44627
44628
44629
44630
44631
44632
44633
# File 'lib/pago/v2026_04/models.rb', line 44624

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

Instance Attribute Details

#dataObject (readonly)

Returns:

  • (Object)


44622
44623
44624
# File 'lib/pago/v2026_04/models.rb', line 44622

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


44619
44620
44621
# File 'lib/pago/v2026_04/models.rb', line 44619

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


44616
44617
44618
# File 'lib/pago/v2026_04/models.rb', line 44616

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookBenefitGrantRevokedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



44637
44638
44639
44640
44641
44642
44643
44644
44645
44646
44647
44648
44649
44650
# File 'lib/pago/v2026_04/models.rb', line 44637

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