Class: Io::Flow::V0::Models::ShippingLaneDeleted

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

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ShippingLaneDeleted

Returns a new instance of ShippingLaneDeleted.



59387
59388
59389
59390
59391
59392
59393
59394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59387

def initialize(incoming={})
  super(:discriminator => Event::Types::SHIPPING_LANE_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :shipping_lane], 'ShippingLaneDeleted')
  @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)
  @shipping_lane = (x = opts.delete(:shipping_lane); x.is_a?(::Io::Flow::V0::Models::ShippingLane) ? x : ::Io::Flow::V0::Models::ShippingLane.new(x))
end

Instance Attribute Details

#event_idObject (readonly)

Returns the value of attribute event_id.



59385
59386
59387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59385

def event_id
  @event_id
end

#shipping_laneObject (readonly)

Returns the value of attribute shipping_lane.



59385
59386
59387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59385

def shipping_lane
  @shipping_lane
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



59385
59386
59387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59385

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



59400
59401
59402
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59400

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

#subtype_to_hashObject



59404
59405
59406
59407
59408
59409
59410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59404

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :shipping_lane => shipping_lane.to_hash
  }
end

#to_jsonObject



59396
59397
59398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59396

def to_json
  JSON.dump(to_hash)
end