Class: Io::Flow::V0::Models::ExperienceInventoryItemUpserted

Inherits:
Event
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

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_idObject (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_itemObject (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_idObject (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

#timestampObject (readonly)

Returns the value of attribute timestamp.



23759
23760
23761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23759

def timestamp
  @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_hashObject



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 => timestamp,
    :organization_id => organization_id,
    :experience_inventory_item => experience_inventory_item.to_hash
  }
end

#to_jsonObject



23771
23772
23773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23771

def to_json
  JSON.dump(to_hash)
end