Class: Io::Flow::V0::Models::ChannelUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ChannelUpserted
constructor
A new instance of ChannelUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ChannelUpserted
Returns a new instance of ChannelUpserted.
35797 35798 35799 35800 35801 35802 35803 35804 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35797 def initialize(incoming={}) super(:discriminator => Event::Types::CHANNEL_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :channel], 'ChannelUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @channel = (x = opts.delete(:channel); x.is_a?(::Io::Flow::V0::Models::Channel) ? x : ::Io::Flow::V0::Models::Channel.new(x)) end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
35795 35796 35797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35795 def channel @channel end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
35795 35796 35797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35795 def event_id @event_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
35795 35796 35797 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35795 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
35810 35811 35812 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35810 def copy(incoming={}) ChannelUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
35814 35815 35816 35817 35818 35819 35820 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35814 def subtype_to_hash { :event_id => event_id, :timestamp => , :channel => channel.to_hash } end |
#to_json ⇒ Object
35806 35807 35808 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 35806 def to_json JSON.dump(to_hash) end |