Class: Io::Flow::V0::Models::ShippingLaneUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#shipping_lane ⇒ Object
readonly
Returns the value of attribute shipping_lane.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingLaneUpserted
constructor
A new instance of ShippingLaneUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ShippingLaneUpserted
Returns a new instance of ShippingLaneUpserted.
66897 66898 66899 66900 66901 66902 66903 66904 66905 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66897 def initialize(incoming={}) super(:discriminator => Event::Types::SHIPPING_LANE_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :shipping_lane], 'ShippingLaneUpserted') @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) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @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_id ⇒ Object (readonly)
Returns the value of attribute event_id.
66895 66896 66897 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66895 def event_id @event_id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
66895 66896 66897 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66895 def organization @organization end |
#shipping_lane ⇒ Object (readonly)
Returns the value of attribute shipping_lane.
66895 66896 66897 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66895 def shipping_lane @shipping_lane end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
66895 66896 66897 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66895 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
66911 66912 66913 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66911 def copy(incoming={}) ShippingLaneUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
66915 66916 66917 66918 66919 66920 66921 66922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66915 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :shipping_lane => shipping_lane.to_hash } end |
#to_json ⇒ Object
66907 66908 66909 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 66907 def to_json JSON.dump(to_hash) end |