Class: Svix::EndpointPatch

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EndpointPatch

Returns a new instance of EndpointPatch.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/svix/models/endpoint_patch.rb', line 23

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

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

Instance Attribute Details

#channelsObject

Returns the value of attribute channels.



17
18
19
# File 'lib/svix/models/endpoint_patch.rb', line 17

def channels
  @channels
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/svix/models/endpoint_patch.rb', line 7

def description
  @description
end

#disabledObject

Returns the value of attribute disabled.



15
16
17
# File 'lib/svix/models/endpoint_patch.rb', line 15

def disabled
  @disabled
end

#event_typesObject

Returns the value of attribute event_types.



16
17
18
# File 'lib/svix/models/endpoint_patch.rb', line 16

def event_types
  @event_types
end

#metadataObject

Returns the value of attribute metadata.



18
19
20
# File 'lib/svix/models/endpoint_patch.rb', line 18

def 
  @metadata
end

#throttle_rateObject

Maximum messages per second to send to this endpoint.

Outgoing messages will be throttled to this rate.



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

def throttle_rate
  @throttle_rate
end

#uidObject

The Endpoint's UID.



13
14
15
# File 'lib/svix/models/endpoint_patch.rb', line 13

def uid
  @uid
end

#urlObject

Returns the value of attribute url.



14
15
16
# File 'lib/svix/models/endpoint_patch.rb', line 14

def url
  @url
end

Class Method Details

.deserialize(attributes = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/svix/models/endpoint_patch.rb', line 38

def self.deserialize(attributes = {})
  attributes = attributes.transform_keys(&:to_s)
  attrs = Hash.new
  attrs["description"] = attributes["description"]
  attrs["throttle_rate"] = attributes["throttleRate"]
  attrs["uid"] = attributes["uid"]
  attrs["url"] = attributes["url"]
  attrs["disabled"] = attributes["disabled"]
  attrs["event_types"] = attributes["eventTypes"]
  attrs["channels"] = attributes["channels"]
  attrs["metadata"] = attributes["metadata"]
  new(attrs)
end

Instance Method Details

#serializeObject



52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/svix/models/endpoint_patch.rb', line 52

def serialize
  out = Hash.new
  out["description"] = Svix::serialize_primitive(@description) if @description
  out["throttleRate"] = Svix::serialize_primitive(@throttle_rate) if @__throttle_rate_is_defined
  out["uid"] = Svix::serialize_primitive(@uid) if @__uid_is_defined
  out["url"] = Svix::serialize_primitive(@url) if @url
  out["disabled"] = Svix::serialize_primitive(@disabled) if @disabled
  out["eventTypes"] = Svix::serialize_primitive(@event_types) if @__event_types_is_defined
  out["channels"] = Svix::serialize_primitive(@channels) if @__channels_is_defined
  out["metadata"] = Svix::serialize_primitive(@metadata) if @metadata
  out
end

#to_jsonObject

Serializes the object to a json string

Returns:

  • String



67
68
69
# File 'lib/svix/models/endpoint_patch.rb', line 67

def to_json
  JSON.dump(serialize)
end