Class: Svix::BulkReplayIn
- Inherits:
-
Object
- Object
- Svix::BulkReplayIn
- Defined in:
- lib/svix/models/bulk_replay_in.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#event_types ⇒ Object
Returns the value of attribute event_types.
-
#since ⇒ Object
Returns the value of attribute since.
-
#status ⇒ Object
Returns the value of attribute status.
-
#status_code_class ⇒ Object
Returns the value of attribute status_code_class.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#until ⇒ Object
Returns the value of attribute until.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ BulkReplayIn
constructor
A new instance of BulkReplayIn.
- #serialize ⇒ Object
-
#to_json ⇒ Object
Serializes the object to a json string.
Constructor Details
#initialize(attributes = {}) ⇒ BulkReplayIn
Returns a new instance of BulkReplayIn.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/svix/models/bulk_replay_in.rb', line 18 def initialize(attributes = {}) unless attributes.is_a?(Hash) fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::BulkReplayIn` 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::BulkReplayIn") end instance_variable_set("@#{k}", v) instance_variable_set("@__#{k}_is_defined", true) end end |
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
7 8 9 |
# File 'lib/svix/models/bulk_replay_in.rb', line 7 def channel @channel end |
#event_types ⇒ Object
Returns the value of attribute event_types.
8 9 10 |
# File 'lib/svix/models/bulk_replay_in.rb', line 8 def event_types @event_types end |
#since ⇒ Object
Returns the value of attribute since.
9 10 11 |
# File 'lib/svix/models/bulk_replay_in.rb', line 9 def since @since end |
#status ⇒ Object
Returns the value of attribute status.
10 11 12 |
# File 'lib/svix/models/bulk_replay_in.rb', line 10 def status @status end |
#status_code_class ⇒ Object
Returns the value of attribute status_code_class.
11 12 13 |
# File 'lib/svix/models/bulk_replay_in.rb', line 11 def status_code_class @status_code_class end |
#tag ⇒ Object
Returns the value of attribute tag.
12 13 14 |
# File 'lib/svix/models/bulk_replay_in.rb', line 12 def tag @tag end |
#until ⇒ Object
Returns the value of attribute until.
13 14 15 |
# File 'lib/svix/models/bulk_replay_in.rb', line 13 def until @until end |
Class Method Details
.deserialize(attributes = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/svix/models/bulk_replay_in.rb', line 33 def self.deserialize(attributes = {}) attributes = attributes.transform_keys(&:to_s) attrs = Hash.new attrs["channel"] = attributes["channel"] attrs["event_types"] = attributes["eventTypes"] attrs["since"] = DateTime.rfc3339(attributes["since"]).to_time attrs["status"] = Svix::MessageStatus.deserialize(attributes["status"]) if attributes["status"] if attributes["statusCodeClass"] attrs["status_code_class"] = Svix::StatusCodeClass.deserialize(attributes["statusCodeClass"]) end attrs["tag"] = attributes["tag"] attrs["until"] = DateTime.rfc3339(attributes["until"]).to_time if attributes["until"] new(attrs) end |
Instance Method Details
#serialize ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/svix/models/bulk_replay_in.rb', line 49 def serialize out = Hash.new out["channel"] = Svix::serialize_primitive(@channel) if @channel out["eventTypes"] = Svix::serialize_primitive(@event_types) if @event_types out["since"] = Svix::serialize_primitive(@since) if @since out["status"] = Svix::serialize_schema_ref(@status) if @status out["statusCodeClass"] = Svix::serialize_schema_ref(@status_code_class) if @status_code_class out["tag"] = Svix::serialize_primitive(@tag) if @tag out["until"] = Svix::serialize_primitive(@until) if @until out end |
#to_json ⇒ Object
Serializes the object to a json string
63 64 65 |
# File 'lib/svix/models/bulk_replay_in.rb', line 63 def to_json JSON.dump(serialize) end |