Class: Svix::EndpointUpsertIn
- Inherits:
-
Object
- Object
- Svix::EndpointUpsertIn
- Defined in:
- lib/svix/models/endpoint_upsert_in.rb
Instance Attribute Summary collapse
-
#channels ⇒ Object
List of message channels this endpoint listens to (omit for all).
-
#description ⇒ Object
Returns the value of attribute description.
-
#disabled ⇒ Object
Returns the value of attribute disabled.
-
#event_types ⇒ Object
Returns the value of attribute event_types.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#throttle_rate ⇒ Object
Maximum messages per second to send to this endpoint.
-
#uid ⇒ Object
Optional unique identifier for the endpoint.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ EndpointUpsertIn
constructor
A new instance of EndpointUpsertIn.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ EndpointUpsertIn
Returns a new instance of EndpointUpsertIn.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 24 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointUpsertIn` 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::EndpointUpsertIn") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#channels ⇒ Object
List of message channels this endpoint listens to (omit for all).
18 19 20 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 18 def channels @channels end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 8 def description @description end |
#disabled ⇒ Object
Returns the value of attribute disabled.
15 16 17 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 15 def disabled @disabled end |
#event_types ⇒ Object
Returns the value of attribute event_types.
16 17 18 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 16 def event_types @event_types end |
#metadata ⇒ Object
Returns the value of attribute metadata.
19 20 21 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 19 def @metadata end |
#throttle_rate ⇒ Object
Maximum messages per second to send to this endpoint.
Outgoing messages will be throttled to this rate.
12 13 14 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 12 def throttle_rate @throttle_rate end |
#uid ⇒ Object
Optional unique identifier for the endpoint.
14 15 16 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 14 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 7 def url @url end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 39 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["url"] = attributes["url"] attrs["description"] = attributes["description"] attrs["throttle_rate"] = attributes["throttleRate"] attrs["uid"] = attributes["uid"] attrs["disabled"] = attributes["disabled"] attrs["event_types"] = attributes["eventTypes"] attrs["channels"] = attributes["channels"] attrs["metadata"] = attributes["metadata"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 53 def serialize out = Hash.new out["url"] = Svix::serialize_primitive(@url) if @url out["description"] = Svix::serialize_primitive(@description) if @description out["throttleRate"] = Svix::serialize_primitive(@throttle_rate) if @throttle_rate out["uid"] = Svix::serialize_primitive(@uid) if @uid out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled out["eventTypes"] = Svix::serialize_primitive(@event_types) if @event_types out["channels"] = Svix::serialize_primitive(@channels) if @channels out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata out end |
#to_json ⇒ Object
Serializes the object to a json string
68 69 70 |
# File 'lib/svix/models/endpoint_upsert_in.rb', line 68 def to_json JSON.dump(serialize) end |