Class: Io::Flow::V0::Models::ChannelCurrencyUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#channel_currency ⇒ Object
readonly
Returns the value of attribute channel_currency.
-
#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 = {}) ⇒ ChannelCurrencyUpserted
constructor
A new instance of ChannelCurrencyUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ChannelCurrencyUpserted
Returns a new instance of ChannelCurrencyUpserted.
30540 30541 30542 30543 30544 30545 30546 30547 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30540 def initialize(incoming={}) super(:discriminator => Event::Types::CHANNEL_CURRENCY_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :channel_currency], 'ChannelCurrencyUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @channel_currency = (x = opts.delete(:channel_currency); x.is_a?(::Io::Flow::Channel::Internal::V0::Models::ChannelCurrency) ? x : ::Io::Flow::Channel::Internal::V0::Models::ChannelCurrency.new(x)) end |
Instance Attribute Details
#channel_currency ⇒ Object (readonly)
Returns the value of attribute channel_currency.
30538 30539 30540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30538 def channel_currency @channel_currency end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
30538 30539 30540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30538 def event_id @event_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
30538 30539 30540 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30538 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30553 30554 30555 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30553 def copy(incoming={}) ChannelCurrencyUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
30557 30558 30559 30560 30561 30562 30563 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30557 def subtype_to_hash { :event_id => event_id, :timestamp => , :channel_currency => channel_currency.to_hash } end |
#to_json ⇒ Object
30549 30550 30551 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30549 def to_json JSON.dump(to_hash) end |