Class: Svix::SinkHttpConfig
- Inherits:
-
Object
- Object
- Svix::SinkHttpConfig
- Defined in:
- lib/svix/models/sink_http_config.rb
Direct Known Subclasses
Svix::StreamSinkInConfig::Http, Svix::StreamSinkOutConfig::Http
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#key ⇒ Object
Returns the value of attribute key.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ SinkHttpConfig
constructor
A new instance of SinkHttpConfig.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ SinkHttpConfig
Returns a new instance of SinkHttpConfig.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/svix/models/sink_http_config.rb', line 14 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::SinkHttpConfig` 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::SinkHttpConfig") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#headers ⇒ Object
Returns the value of attribute headers.
7 8 9 |
# File 'lib/svix/models/sink_http_config.rb', line 7 def headers @headers end |
#key ⇒ Object
Returns the value of attribute key.
8 9 10 |
# File 'lib/svix/models/sink_http_config.rb', line 8 def key @key end |
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/svix/models/sink_http_config.rb', line 9 def url @url end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/svix/models/sink_http_config.rb', line 29 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["headers"] = attributes["headers"] attrs["key"] = attributes["key"] attrs["url"] = attributes["url"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/svix/models/sink_http_config.rb', line 38 def serialize out = Hash.new out["headers"] = Svix::serialize_primitive(@headers) if @headers out["key"] = Svix::serialize_primitive(@key) if @key out["url"] = Svix::serialize_primitive(@url) if @url out end |
#to_json ⇒ Object
Serializes the object to a json string
48 49 50 |
# File 'lib/svix/models/sink_http_config.rb', line 48 def to_json JSON.dump(serialize) end |