Class: Io::Flow::V0::Models::OrderReplacementUpserted
- 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.
-
#order_replacement ⇒ Object
readonly
Returns the value of attribute order_replacement.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderReplacementUpserted
constructor
A new instance of OrderReplacementUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ OrderReplacementUpserted
Returns a new instance of OrderReplacementUpserted.
53938 53939 53940 53941 53942 53943 53944 53945 53946 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53938 def initialize(incoming={}) super(:discriminator => Event::Types::ORDER_REPLACEMENT_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :order_replacement], 'OrderReplacementUpserted') @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) @order_replacement = (x = opts.delete(:order_replacement); x.is_a?(::Io::Flow::V0::Models::OrderReplacement) ? x : ::Io::Flow::V0::Models::OrderReplacement.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
53936 53937 53938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53936 def event_id @event_id end |
#order_replacement ⇒ Object (readonly)
Returns the value of attribute order_replacement.
53936 53937 53938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53936 def order_replacement @order_replacement end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
53936 53937 53938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53936 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
53936 53937 53938 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53936 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
53952 53953 53954 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53952 def copy(incoming={}) OrderReplacementUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
53956 53957 53958 53959 53960 53961 53962 53963 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53956 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :order_replacement => order_replacement.to_hash } end |
#to_json ⇒ Object
53948 53949 53950 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53948 def to_json JSON.dump(to_hash) end |