Class: Io::Flow::V0::Models::TargetingItemDeleted

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ TargetingItemDeleted

Returns a new instance of TargetingItemDeleted.



16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16738

def initialize(incoming={})
  super(:name => Event::Types::TARGETING_ITEM_DELETED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :catalog, :number, :key], 'TargetingItemDeleted')
  @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 = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
  @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String)
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
end

Instance Attribute Details

#catalogObject (readonly)

Returns the value of attribute catalog.



16736
16737
16738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16736

def catalog
  @catalog
end

#event_idObject (readonly)

Returns the value of attribute event_id.



16736
16737
16738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16736

def event_id
  @event_id
end

#keyObject (readonly)

Returns the value of attribute key.



16736
16737
16738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16736

def key
  @key
end

#numberObject (readonly)

Returns the value of attribute number.



16736
16737
16738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16736

def number
  @number
end

#organizationObject (readonly)

Returns the value of attribute organization.



16736
16737
16738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16736

def organization
  @organization
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



16736
16737
16738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16736

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16754
16755
16756
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16754

def copy(incoming={})
  TargetingItemDeleted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16758

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :catalog => catalog,
    :number => number,
    :key => key
  }
end

#to_jsonObject



16750
16751
16752
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16750

def to_json
  JSON.dump(to_hash)
end