Sha256: e5ce31689865a9096583e441265cf7a2fe4d161fea9898ad24e45987799c90c1

Contents?: true

Size: 680 Bytes

Versions: 25

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module WorkOS
  # The Webhook class provides a lightweight wrapper around
  # a WorkOS Webhook resource. This class is not meant to be instantiated
  # in user space, and is instantiated internally but exposed.
  class Webhook
    include HashProvider

    attr_accessor :id, :event, :data, :created_at

    def initialize(json)
      hash = JSON.parse(json, symbolize_names: true)

      @id = hash[:id]
      @event = hash[:event]
      @data = hash[:data]
      @created_at = hash[:created_at]
    end

    def to_json(*)
      {
        id: id,
        event: event,
        data: data,
        created_at: created_at,
      }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
workos-5.15.0 lib/workos/webhook.rb
workos-5.14.0 lib/workos/webhook.rb
workos-5.13.0 lib/workos/webhook.rb
workos-5.12.0 lib/workos/webhook.rb
workos-5.11.1 lib/workos/webhook.rb
workos-5.11.0 lib/workos/webhook.rb
workos-5.10.0 lib/workos/webhook.rb
workos-5.9.0 lib/workos/webhook.rb
workos-5.8.0 lib/workos/webhook.rb
workos-5.7.0 lib/workos/webhook.rb
workos-5.6.0 lib/workos/webhook.rb
workos-5.5.1 lib/workos/webhook.rb
workos-5.5.0 lib/workos/webhook.rb
workos-5.4.0 lib/workos/webhook.rb
workos-5.3.0 lib/workos/webhook.rb
workos-5.2.1 lib/workos/webhook.rb
workos-5.2.0 lib/workos/webhook.rb
workos-5.1.0 lib/workos/webhook.rb
workos-5.0.0 lib/workos/webhook.rb
workos-4.8.0 lib/workos/webhook.rb