Class: Svix::IngestEndpointDisabledEventData
- Inherits:
-
Object
- Object
- Svix::IngestEndpointDisabledEventData
- Defined in:
- lib/svix/models/ingest_endpoint_disabled_event_data.rb
Overview
Sent when an ingest endpoint has been automatically disabled after continuous failures, or manually via an API call.
Instance Attribute Summary collapse
-
#endpoint_id ⇒ Object
The Endpoint’s ID.
-
#endpoint_uid ⇒ Object
The Endpoint’s UID.
-
#fail_since ⇒ Object
Returns the value of attribute fail_since.
-
#source_id ⇒ Object
The Source’s ID.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ IngestEndpointDisabledEventData
constructor
A new instance of IngestEndpointDisabledEventData.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ IngestEndpointDisabledEventData
Returns a new instance of IngestEndpointDisabledEventData.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/svix/models/ingest_endpoint_disabled_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::IngestEndpointDisabledEventData` 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::IngestEndpointDisabledEventData") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#endpoint_id ⇒ Object
The Endpoint’s ID.
9 10 11 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 9 def endpoint_id @endpoint_id end |
#endpoint_uid ⇒ Object
The Endpoint’s UID.
11 12 13 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 11 def endpoint_uid @endpoint_uid end |
#fail_since ⇒ Object
Returns the value of attribute fail_since.
12 13 14 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 12 def fail_since @fail_since end |
#source_id ⇒ Object
The Source’s ID.
14 15 16 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 14 def source_id @source_id end |
#trigger ⇒ Object
Returns the value of attribute trigger.
15 16 17 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 15 def trigger @trigger end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 38 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["endpoint_id"] = attributes["endpointId"] attrs["endpoint_uid"] = attributes["endpointUid"] attrs["fail_since"] = DateTime.rfc3339(attributes["failSince"]).to_time if attributes["failSince"] attrs["source_id"] = attributes["sourceId"] attrs["trigger"] = Svix::EndpointDisabledTrigger.deserialize(attributes["trigger"]) if attributes["trigger"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 49 def serialize out = Hash.new out["endpointId"] = Svix::serialize_primitive(@endpoint_id) if @endpoint_id out["endpointUid"] = Svix::serialize_primitive(@endpoint_uid) if @endpoint_uid out["failSince"] = Svix::serialize_primitive(@fail_since) if @fail_since out["sourceId"] = Svix::serialize_primitive(@source_id) if @source_id out["trigger"] = Svix::serialize_schema_ref(@trigger) if @trigger out end |
#to_json ⇒ Object
Serializes the object to a json string
61 62 63 |
# File 'lib/svix/models/ingest_endpoint_disabled_event_data.rb', line 61 def to_json JSON.dump(serialize) end |