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.
23761 23762 23763 23764 23765 23766 23767 23768 23769 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23761 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.
23759 23760 23761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23759 def event_id @event_id end |
#experience_inventory_item ⇒ Object (readonly)
Returns the value of attribute experience_inventory_item.
23759 23760 23761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23759 def experience_inventory_item @experience_inventory_item end |
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
23759 23760 23761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23759 def organization_id @organization_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
23759 23760 23761 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23759 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23775 23776 23777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23775 def copy(incoming={}) ExperienceInventoryItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
23779 23780 23781 23782 23783 23784 23785 23786 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23779 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
23771 23772 23773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23771 def to_json JSON.dump(to_hash) end |