Class: Vortex::WebhookEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/vortex/webhook_types.rb

Overview

A Vortex webhook event representing a server-side state change

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ WebhookEvent

Returns a new instance of WebhookEvent.



65
66
67
68
69
70
71
72
73
74
# File 'lib/vortex/webhook_types.rb', line 65

def initialize(attrs)
  @id = attrs['id']
  @type = attrs['type']
  @timestamp = attrs['timestamp']
  @account_id = attrs['accountId']
  @environment_id = attrs['environmentId']
  @source_table = attrs['sourceTable']
  @operation = attrs['operation']
  @data = attrs['data'] || {}
end

Instance Attribute Details

#account_idString (readonly)

The account ID

Returns:

  • the current value of account_id



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def 
  @account_id
end

#dataHash (readonly)

Event-specific payload data

Returns:

  • the current value of data



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def data
  @data
end

#environment_idString? (readonly)

The environment ID

Returns:

  • the current value of environment_id



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def environment_id
  @environment_id
end

#idString (readonly)

Unique event ID

Returns:

  • the current value of id



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def id
  @id
end

#operationString (readonly)

The database operation

Returns:

  • the current value of operation



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def operation
  @operation
end

#source_tableString (readonly)

The source table

Returns:

  • the current value of source_table



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def source_table
  @source_table
end

#timestampString (readonly)

ISO-8601 timestamp

Returns:

  • the current value of timestamp



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def timestamp
  @timestamp
end

#typeString (readonly)

The semantic event type

Returns:

  • the current value of type



61
62
63
# File 'lib/vortex/webhook_types.rb', line 61

def type
  @type
end