Class: Pago::V2026_04::Models::WebhookEvent
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
A webhook event.
An event represent something that happened in the system that should be sent to the webhook endpoint.
It can be delivered multiple times until it's marked as succeeded, each one creating a new delivery.
Constant Summary collapse
- JSON_KEYS =
{ created_at: "created_at", modified_at: "modified_at", id: "id", last_http_code: "last_http_code", succeeded: "succeeded", skipped: "skipped", payload: "payload", type: "type", is_archived: "is_archived" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "skipped", "payload", "type", "is_archived"].freeze
Instance Attribute Summary collapse
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#id ⇒ String
readonly
The ID of the object.
-
#is_archived ⇒ Boolean
readonly
Whether this event is archived.
-
#last_http_code ⇒ Integer?
readonly
Last HTTP code returned by the URL.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#payload ⇒ String?
readonly
The payload of the webhook event.
-
#skipped ⇒ Boolean
readonly
Whether this event was skipped because the webhook endpoint was disabled.
-
#succeeded ⇒ Boolean?
readonly
Whether this event was successfully delivered.
- #type ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, last_http_code: ::Pago::UNSET, succeeded: ::Pago::UNSET, skipped:, payload:, type:, is_archived:) ⇒ WebhookEvent
constructor
A new instance of WebhookEvent.
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:, last_http_code: ::Pago::UNSET, succeeded: ::Pago::UNSET, skipped:, payload:, type:, is_archived:) ⇒ WebhookEvent
Returns a new instance of WebhookEvent.
44409 44410 44411 44412 44413 44414 44415 44416 44417 44418 44419 44420 44421 44422 44423 44424 44425 44426 44427 44428 44429 44430 |
# File 'lib/pago/v2026_04/models.rb', line 44409 def initialize( created_at:, modified_at:, id:, last_http_code: ::Pago::UNSET, succeeded: ::Pago::UNSET, skipped:, payload:, type:, is_archived: ) super() assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:last_http_code, last_http_code) assign(:succeeded, succeeded) assign(:skipped, skipped) assign(:payload, payload) assign(:type, type) assign(:is_archived, is_archived) end |
Instance Attribute Details
#created_at ⇒ String (readonly)
Creation timestamp of the object.
44376 44377 44378 |
# File 'lib/pago/v2026_04/models.rb', line 44376 def created_at @created_at end |
#id ⇒ String (readonly)
The ID of the object.
44384 44385 44386 |
# File 'lib/pago/v2026_04/models.rb', line 44384 def id @id end |
#is_archived ⇒ Boolean (readonly)
Whether this event is archived. Archived events can't be redelivered, and the payload is not accessible anymore.
44407 44408 44409 |
# File 'lib/pago/v2026_04/models.rb', line 44407 def is_archived @is_archived end |
#last_http_code ⇒ Integer? (readonly)
Last HTTP code returned by the URL. null if no delviery has been attempted or if the endpoint was unreachable.
44388 44389 44390 |
# File 'lib/pago/v2026_04/models.rb', line 44388 def last_http_code @last_http_code end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
44380 44381 44382 |
# File 'lib/pago/v2026_04/models.rb', line 44380 def modified_at @modified_at end |
#payload ⇒ String? (readonly)
The payload of the webhook event.
44400 44401 44402 |
# File 'lib/pago/v2026_04/models.rb', line 44400 def payload @payload end |
#skipped ⇒ Boolean (readonly)
Whether this event was skipped because the webhook endpoint was disabled.
44396 44397 44398 |
# File 'lib/pago/v2026_04/models.rb', line 44396 def skipped @skipped end |
#succeeded ⇒ Boolean? (readonly)
Whether this event was successfully delivered. null if no delivery has been attempted.
44392 44393 44394 |
# File 'lib/pago/v2026_04/models.rb', line 44392 def succeeded @succeeded end |
#type ⇒ String (readonly)
44403 44404 44405 |
# File 'lib/pago/v2026_04/models.rb', line 44403 def type @type end |
Class Method Details
.from_json(data) ⇒ WebhookEvent?
44434 44435 44436 44437 44438 44439 44440 44441 44442 44443 44444 44445 44446 44447 44448 44449 44450 44451 44452 44453 |
# File 'lib/pago/v2026_04/models.rb', line 44434 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), last_http_code: (data.key?("last_http_code") ? data["last_http_code"] : ::Pago::UNSET), succeeded: (data.key?("succeeded") ? data["succeeded"] : ::Pago::UNSET), skipped: (data.key?("skipped") ? data["skipped"] : ::Pago::UNSET), payload: (data.key?("payload") ? data["payload"] : ::Pago::UNSET), type: (data.key?("type") ? data["type"] : ::Pago::UNSET), is_archived: (data.key?("is_archived") ? data["is_archived"] : ::Pago::UNSET) ), data ) end |