Class: Svix::EndpointEnabledEventData

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/models/endpoint_enabled_event_data.rb

Overview

Sent when an endpoint has been enabled.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EndpointEnabledEventData

Returns a new instance of EndpointEnabledEventData.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/svix/models/endpoint_enabled_event_data.rb', line 20

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    fail(
      ArgumentError,
      "The input argument (attributes) must be a hash in `Svix::EndpointEnabledEventData` new method"
    )
  end

  attributes.each do |k, v|
    unless ALL_FIELD.include?(k.to_s)
      fail(ArgumentError, "The field #{k} is not part of Svix::EndpointEnabledEventData")
    end

    instance_variable_set("@#{k}", v)
    instance_variable_set("@__#{k}_is_defined", true)
  end
end

Instance Attribute Details

#app_idObject

The Application’s ID.



9
10
11
# File 'lib/svix/models/endpoint_enabled_event_data.rb', line 9

def app_id
  @app_id
end

#app_uidObject

The Application’s UID.



11
12
13
# File 'lib/svix/models/endpoint_enabled_event_data.rb', line 11

def app_uid
  @app_uid
end

#endpoint_idObject

The Endpoint’s ID.



13
14
15
# File 'lib/svix/models/endpoint_enabled_event_data.rb', line 13

def endpoint_id
  @endpoint_id
end

#endpoint_uidObject

The Endpoint’s UID.



15
16
17
# File 'lib/svix/models/endpoint_enabled_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/svix/models/endpoint_enabled_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/svix/models/endpoint_enabled_event_data.rb', line 48

def serialize
  out = Hash.new
  out["appId"] = Svix::serialize_primitive(@app_id) if @app_id
  out["appUid"] = Svix::serialize_primitive(@app_uid) if @app_uid
  out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id
  out["endpointUid"] = Svix::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/svix/models/endpoint_enabled_event_data.rb', line 59

def to_json
  JSON.dump(serialize)
end