Class: Svix::EndpointHeadersOut

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/models/endpoint_headers_out.rb

Overview

The value of the headers is returned in the headers field.

Sensitive headers that have been redacted are returned in the sensitive field.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EndpointHeadersOut

Returns a new instance of EndpointHeadersOut.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/svix/models/endpoint_headers_out.rb', line 16

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::EndpointHeadersOut` 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::EndpointHeadersOut")
    end

    instance_variable_set("@#{k}", v)
    instance_variable_set("@__#{k}_is_defined", true)
  end
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



10
11
12
# File 'lib/svix/models/endpoint_headers_out.rb', line 10

def headers
  @headers
end

#sensitiveObject

Returns the value of attribute sensitive.



11
12
13
# File 'lib/svix/models/endpoint_headers_out.rb', line 11

def sensitive
  @sensitive
end

Class Method Details

.deserialize(attributes = {}) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/svix/models/endpoint_headers_out.rb', line 31

def self.deserialize(attributes = {})
  attributes = attributes.transform_keys(&:to_s)
  attrs = Hash.new
  attrs["headers"] = attributes["headers"]
  attrs["sensitive"] = attributes["sensitive"]
  new(attrs)
end

Instance Method Details

#serializeObject



39
40
41
42
43
44
# File 'lib/svix/models/endpoint_headers_out.rb', line 39

def serialize
  out = Hash.new
  out["headers"] = Svix::serialize_primitive(@headers) if @headers
  out["sensitive"] = Svix::serialize_primitive(@sensitive) if @sensitive
  out
end

#to_jsonObject

Serializes the object to a json string

Returns:

  • String



48
49
50
# File 'lib/svix/models/endpoint_headers_out.rb', line 48

def to_json
  JSON.dump(serialize)
end