Class: Svix::EndpointIn
- Inherits:
-
Object
- Object
- Svix::EndpointIn
- Defined in:
- lib/svix/models/endpoint_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.
-
#filter_types ⇒ Object
Returns the value of attribute filter_types.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
-
#secret ⇒ Object
The endpoint’s verification secret.
-
#uid ⇒ Object
Optional unique identifier for the endpoint.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ EndpointIn
constructor
A new instance of EndpointIn.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ EndpointIn
Returns a new instance of EndpointIn.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/svix/models/endpoint_in.rb', line 40 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointIn` 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::EndpointIn") 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).
8 9 10 |
# File 'lib/svix/models/endpoint_in.rb', line 8 def channels @channels end |
#description ⇒ Object
Returns the value of attribute description.
9 10 11 |
# File 'lib/svix/models/endpoint_in.rb', line 9 def description @description end |
#disabled ⇒ Object
Returns the value of attribute disabled.
10 11 12 |
# File 'lib/svix/models/endpoint_in.rb', line 10 def disabled @disabled end |
#filter_types ⇒ Object
Returns the value of attribute filter_types.
11 12 13 |
# File 'lib/svix/models/endpoint_in.rb', line 11 def filter_types @filter_types end |
#headers ⇒ Object
Returns the value of attribute headers.
12 13 14 |
# File 'lib/svix/models/endpoint_in.rb', line 12 def headers @headers end |
#metadata ⇒ Object
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/svix/models/endpoint_in.rb', line 13 def @metadata end |
#rate_limit ⇒ Object
Returns the value of attribute rate_limit.
14 15 16 |
# File 'lib/svix/models/endpoint_in.rb', line 14 def rate_limit @rate_limit end |
#secret ⇒ Object
The endpoint’s verification secret.
Format: ‘base64` encoded random bytes optionally prefixed with `whsec_`. It is recommended to not set this and let the server generate the secret.
19 20 21 |
# File 'lib/svix/models/endpoint_in.rb', line 19 def secret @secret end |
#uid ⇒ Object
Optional unique identifier for the endpoint.
21 22 23 |
# File 'lib/svix/models/endpoint_in.rb', line 21 def uid @uid end |
#url ⇒ Object
Returns the value of attribute url.
22 23 24 |
# File 'lib/svix/models/endpoint_in.rb', line 22 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
23 24 25 |
# File 'lib/svix/models/endpoint_in.rb', line 23 def version @version end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/svix/models/endpoint_in.rb', line 55 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["channels"] = attributes["channels"] attrs["description"] = attributes["description"] attrs["disabled"] = attributes["disabled"] attrs["filter_types"] = attributes["filterTypes"] attrs["headers"] = attributes["headers"] attrs["metadata"] = attributes["metadata"] attrs["rate_limit"] = attributes["rateLimit"] attrs["secret"] = attributes["secret"] attrs["uid"] = attributes["uid"] attrs["url"] = attributes["url"] attrs["version"] = attributes["version"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/svix/models/endpoint_in.rb', line 72 def serialize out = Hash.new out["channels"] = Svix::serialize_primitive(@channels) if @channels out["description"] = Svix::serialize_primitive(@description) if @description out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled out["filterTypes"] = Svix::serialize_primitive(@filter_types) if @filter_types out["headers"] = Svix::serialize_primitive(@headers) if @headers out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata out["rateLimit"] = Svix::serialize_primitive(@rate_limit) if @rate_limit out["secret"] = Svix::serialize_primitive(@secret) if @secret out["uid"] = Svix::serialize_primitive(@uid) if @uid out["url"] = Svix::serialize_primitive(@url) if @url out["version"] = Svix::serialize_primitive(@version) if @version out end |
#to_json ⇒ Object
Serializes the object to a json string
90 91 92 |
# File 'lib/svix/models/endpoint_in.rb', line 90 def to_json JSON.dump(serialize) end |