Class: Io::Flow::V0::Models::AllocationUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#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 = {}) ⇒ AllocationUpserted
constructor
A new instance of AllocationUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ AllocationUpserted
Returns a new instance of AllocationUpserted.
10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10205 def initialize(incoming={}) super(:discriminator => Event::Types::ALLOCATION_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :id, :organization, :order_id, :order_number, :details], 'AllocationUpserted') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String) @order_id = HttpClient::Preconditions.assert_class('order_id', opts.delete(:order_id), String) @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String) @details = HttpClient::Preconditions.assert_class('details', opts.delete(:details), Array).map { |v| HttpClient::Preconditions.assert_class('details', HttpClient::Helper.to_object(v), Hash) } end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def details @details end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def id @id end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def order_id @order_id end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def order_number @order_number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
10203 10204 10205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10203 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
10222 10223 10224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10222 def copy(incoming={}) AllocationUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10226 def subtype_to_hash { :event_id => event_id, :timestamp => , :id => id, :organization => organization, :order_id => order_id, :order_number => order_number, :details => details } end |
#to_json ⇒ Object
10218 10219 10220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10218 def to_json JSON.dump(to_hash) end |