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