Class: Io::Flow::V0::Models::SnapshotUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#available ⇒ Object
readonly
Returns the value of attribute available.
-
#center_key ⇒ Object
readonly
Returns the value of attribute center_key.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#snapshot_id ⇒ Object
readonly
Returns the value of attribute snapshot_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SnapshotUpserted
constructor
A new instance of SnapshotUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ SnapshotUpserted
Returns a new instance of SnapshotUpserted.
46398 46399 46400 46401 46402 46403 46404 46405 46406 46407 46408 46409 46410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46398 def initialize(incoming={}) super(:discriminator => Event::Types::SNAPSHOT_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :snapshot_id, :available, :center_key, :item_number, :quantity], 'SnapshotUpserted') @event_id = HttpClient::Preconditions.assert_class('event_id', opts.delete(:event_id), String) = 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) @snapshot_id = HttpClient::Preconditions.assert_class('snapshot_id', opts.delete(:snapshot_id), String) @available = HttpClient::Preconditions.assert_class('available', opts.delete(:available), Integer) @center_key = HttpClient::Preconditions.assert_class('center_key', opts.delete(:center_key), String) @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) end |
Instance Attribute Details
#available ⇒ Object (readonly)
Returns the value of attribute available.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def available @available end |
#center_key ⇒ Object (readonly)
Returns the value of attribute center_key.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def center_key @center_key end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def event_id @event_id end |
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def item_number @item_number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def organization @organization end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def quantity @quantity end |
#snapshot_id ⇒ Object (readonly)
Returns the value of attribute snapshot_id.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def snapshot_id @snapshot_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
46396 46397 46398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46396 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
46416 46417 46418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46416 def copy(incoming={}) SnapshotUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
46420 46421 46422 46423 46424 46425 46426 46427 46428 46429 46430 46431 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46420 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :snapshot_id => snapshot_id, :available => available, :center_key => center_key, :item_number => item_number, :quantity => quantity } end |
#to_json ⇒ Object
46412 46413 46414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46412 def to_json JSON.dump(to_hash) end |