Class: HookSniff::EndpointCreatedEventData

Inherits:
Object
  • Object
show all
Defined in:
lib/hooksniff/webhook_event.rb,
lib/hooksniff/models/endpoint_created_event_data.rb

Overview

Sent when an endpoint is created, updated, or deleted

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EndpointCreatedEventData

Returns a new instance of EndpointCreatedEventData.



10
11
12
13
14
# File 'lib/hooksniff/webhook_event.rb', line 10

def initialize(app_id:, endpoint_id:, app_uid: nil)
  @app_id = app_id
  @endpoint_id = endpoint_id
  @app_uid = app_uid
end

Instance Attribute Details

#app_idObject

The Application’s ID.



9
10
11
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 9

def app_id
  @app_id
end

#app_uidObject

The Application’s UID.



11
12
13
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 11

def app_uid
  @app_uid
end

#endpoint_idObject

The Endpoint’s ID.



13
14
15
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 13

def endpoint_id
  @endpoint_id
end

#endpoint_uidObject

The Endpoint’s UID.



15
16
17
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 15

def endpoint_uid
  @endpoint_uid
end

Class Method Details

.deserialize(attributes = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 38

def self.deserialize(attributes = {})
  attributes = attributes.transform_keys(&:to_s)
  attrs = Hash.new
  attrs["app_id"] = attributes["appId"]
  attrs["app_uid"] = attributes["appUid"]
  attrs["endpoint_id"] = attributes["endpointId"]
  attrs["endpoint_uid"] = attributes["endpointUid"]
  new(attrs)
end

Instance Method Details

#serializeObject



48
49
50
51
52
53
54
55
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 48

def serialize
  out = Hash.new
  out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id
  out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid
  out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
  out["endpointUid"] = HookSniff::serialize_primitive(@endpoint_uid) if @endpoint_uid
  out
end

#to_jsonObject

Serializes the object to a json string

Returns:

  • String



59
60
61
# File 'lib/hooksniff/models/endpoint_created_event_data.rb', line 59

def to_json
  JSON.dump(serialize)
end