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