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.



15201
15202
15203
15204
15205
15206
15207
15208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15201

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.



15199
15200
15201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199

def event_id
  @event_id
end

#spot_rate_idObject (readonly)

Returns the value of attribute spot_rate_id.



15199
15200
15201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199

def spot_rate_id
  @spot_rate_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



15199
15200
15201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15199

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



15214
15215
15216
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15214

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

#subtype_to_hashObject



15218
15219
15220
15221
15222
15223
15224
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15218

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

#to_jsonObject



15210
15211
15212
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15210

def to_json
  JSON.dump(to_hash)
end