Class: Io::Flow::V0::Models::SpotRateDeleted

Inherits:
Event
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ SpotRateDeleted

Returns a new instance of SpotRateDeleted.



16003
16004
16005
16006
16007
16008
16009
16010
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16003

def initialize(incoming={})
  super(:name => Event::Types::SPOT_RATE_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :spot_rate_id], 'SpotRateDeleted')
  @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)
  @spot_rate_id = HttpClient::Preconditions.assert_class('spot_rate_id', opts.delete(:spot_rate_id), String)
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



16001
16002
16003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16001

def event_id
  @event_id
end

#spot_rate_idObject (readonly)

Returns the value of attribute spot_rate_id.



16001
16002
16003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16001

def spot_rate_id
  @spot_rate_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



16001
16002
16003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16001

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16016
16017
16018
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16016

def copy(incoming={})
  SpotRateDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



16020
16021
16022
16023
16024
16025
16026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16020

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :spot_rate_id => spot_rate_id
  }
end

#to_jsonObject



16012
16013
16014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16012

def to_json
  JSON.dump(to_hash)
end