Class: Io::Flow::V0::Models::ExperienceInventoryItemUpserted
- 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.
-
#experience_inventory_item ⇒ Object
readonly
Returns the value of attribute experience_inventory_item.
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperienceInventoryItemUpserted
constructor
A new instance of ExperienceInventoryItemUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceInventoryItemUpserted
Returns a new instance of ExperienceInventoryItemUpserted.
24232 24233 24234 24235 24236 24237 24238 24239 24240 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24232 def initialize(incoming={}) super(:discriminator => Event::Types::EXPERIENCE_INVENTORY_ITEM_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization_id, :experience_inventory_item], 'ExperienceInventoryItemUpserted') @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_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String) @experience_inventory_item = (x = opts.delete(:experience_inventory_item); x.is_a?(::Io::Flow::V0::Models::ExperienceInventoryItem) ? x : ::Io::Flow::V0::Models::ExperienceInventoryItem.new(x)) end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
24230 24231 24232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24230 def event_id @event_id end |
#experience_inventory_item ⇒ Object (readonly)
Returns the value of attribute experience_inventory_item.
24230 24231 24232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24230 def experience_inventory_item @experience_inventory_item end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
24230 24231 24232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24230 def organization_id @organization_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
24230 24231 24232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24230 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24246 24247 24248 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24246 def copy(incoming={}) ExperienceInventoryItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
24250 24251 24252 24253 24254 24255 24256 24257 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24250 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization_id => organization_id, :experience_inventory_item => experience_inventory_item.to_hash } end |
#to_json ⇒ Object
24242 24243 24244 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24242 def to_json JSON.dump(to_hash) end |