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