Class: Io::Flow::V0::Models::TargetingItemUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Indiciates that a given item has been targeted by the query q producing an outcome. The item number is unique within its targeting_id.
Instance Attribute Summary collapse
-
#catalog_id ⇒ Object
readonly
Returns the value of attribute catalog_id.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#outcome_id ⇒ Object
readonly
Returns the value of attribute outcome_id.
-
#q ⇒ Object
readonly
Returns the value of attribute q.
-
#subcatalog_id ⇒ Object
readonly
Returns the value of attribute subcatalog_id.
-
#targeting_id ⇒ Object
readonly
Returns the value of attribute targeting_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TargetingItemUpserted
constructor
A new instance of TargetingItemUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ TargetingItemUpserted
Returns a new instance of TargetingItemUpserted.
25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25395 def initialize(incoming={}) super(:discriminator => Event::Types::TARGETING_ITEM_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :targeting_id, :item_number, :q, :outcome_id, :catalog_id, :key], 'TargetingItemUpserted') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @targeting_id = HttpClient::Preconditions.assert_class('targeting_id', opts.delete(:targeting_id), String) @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @q = HttpClient::Preconditions.assert_class('q', opts.delete(:q), String) @outcome_id = HttpClient::Preconditions.assert_class('outcome_id', opts.delete(:outcome_id), String) @catalog_id = HttpClient::Preconditions.assert_class('catalog_id', opts.delete(:catalog_id), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @subcatalog_id = (x = opts.delete(:subcatalog_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('subcatalog_id', x, String)) end |
Instance Attribute Details
#catalog_id ⇒ Object (readonly)
Returns the value of attribute catalog_id.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def catalog_id @catalog_id end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def id @id end |
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def item_number @item_number end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def key @key end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def organization @organization end |
#outcome_id ⇒ Object (readonly)
Returns the value of attribute outcome_id.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def outcome_id @outcome_id end |
#q ⇒ Object (readonly)
Returns the value of attribute q.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def q @q end |
#subcatalog_id ⇒ Object (readonly)
Returns the value of attribute subcatalog_id.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def subcatalog_id @subcatalog_id end |
#targeting_id ⇒ Object (readonly)
Returns the value of attribute targeting_id.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def targeting_id @targeting_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
25393 25394 25395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25393 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25416 25417 25418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25416 def copy(incoming={}) TargetingItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
25420 25421 25422 25423 25424 25425 25426 25427 25428 25429 25430 25431 25432 25433 25434 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25420 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :id => id, :targeting_id => targeting_id, :item_number => item_number, :q => q, :outcome_id => outcome_id, :catalog_id => catalog_id, :key => key, :subcatalog_id => subcatalog_id } end |
#to_json ⇒ Object
25412 25413 25414 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25412 def to_json JSON.dump(to_hash) end |