Class: Pago::V2026_04::Models::WebhookDelivery

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

Overview

A webhook delivery for a webhook event.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  succeeded: "succeeded",
  http_code: "http_code",
  response: "response",
  webhook_event: "webhook_event"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "succeeded", "http_code", "response", "webhook_event"].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(created_at:, modified_at:, id:, succeeded:, http_code:, response:, webhook_event:) ⇒ WebhookDelivery

Returns a new instance of WebhookDelivery.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • succeeded: (Boolean)
  • http_code: (Integer, nil)
  • response: (String, nil)
  • webhook_event: (Models::WebhookEvent)


44079
44080
44081
44082
44083
44084
44085
44086
44087
44088
44089
44090
44091
44092
44093
44094
44095
44096
# File 'lib/pago/v2026_04/models.rb', line 44079

def initialize(
  created_at:,
  modified_at:,
  id:,
  succeeded:,
  http_code:,
  response:,
  webhook_event:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:succeeded, succeeded)
  assign(:http_code, http_code)
  assign(:response, response)
  assign(:webhook_event, webhook_event)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


44054
44055
44056
# File 'lib/pago/v2026_04/models.rb', line 44054

def created_at
  @created_at
end

#http_codeInteger? (readonly)

The HTTP code returned by the URL. null if the endpoint was unreachable.

Returns:

  • (Integer, nil)


44070
44071
44072
# File 'lib/pago/v2026_04/models.rb', line 44070

def http_code
  @http_code
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


44062
44063
44064
# File 'lib/pago/v2026_04/models.rb', line 44062

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


44058
44059
44060
# File 'lib/pago/v2026_04/models.rb', line 44058

def modified_at
  @modified_at
end

#responseString? (readonly)

The response body returned by the URL, or the error message if the endpoint was unreachable.

Returns:

  • (String, nil)


44074
44075
44076
# File 'lib/pago/v2026_04/models.rb', line 44074

def response
  @response
end

#succeededBoolean (readonly)

Whether the delivery was successful.

Returns:

  • (Boolean)


44066
44067
44068
# File 'lib/pago/v2026_04/models.rb', line 44066

def succeeded
  @succeeded
end

#webhook_eventModels::WebhookEvent (readonly)



44077
44078
44079
# File 'lib/pago/v2026_04/models.rb', line 44077

def webhook_event
  @webhook_event
end

Class Method Details

.from_json(data) ⇒ WebhookDelivery?

Parameters:

  • data (Hash, String, nil)

Returns:



44100
44101
44102
44103
44104
44105
44106
44107
44108
44109
44110
44111
44112
44113
44114
44115
44116
44117
# File 'lib/pago/v2026_04/models.rb', line 44100

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(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      succeeded: (data.key?("succeeded") ? data["succeeded"] : ::Pago::UNSET),
      http_code: (data.key?("http_code") ? data["http_code"] : ::Pago::UNSET),
      response: (data.key?("response") ? data["response"] : ::Pago::UNSET),
      webhook_event: (data.key?("webhook_event") ? Models::WebhookEvent.from_json(data["webhook_event"]) : ::Pago::UNSET)
    ),
    data
  )
end