Class: Io::Flow::V0::Models::TargetingItemUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
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.
16775 16776 16777 16778 16779 16780 16781 16782 16783 16784 16785 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16775 def initialize(incoming={}) super(:name => Event::Types::TARGETING_ITEM_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :catalog, :number, :key], 'TargetingItemUpserted') @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
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
16773 16774 16775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16773 def catalog @catalog end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
16773 16774 16775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16773 def event_id @event_id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
16773 16774 16775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16773 def key @key end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
16773 16774 16775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16773 def number @number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
16773 16774 16775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16773 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
16773 16774 16775 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16773 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
16791 16792 16793 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16791 def copy(incoming={}) TargetingItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
16795 16796 16797 16798 16799 16800 16801 16802 16803 16804 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16795 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :catalog => catalog, :number => number, :key => key } end |
#to_json ⇒ Object
16787 16788 16789 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16787 def to_json JSON.dump(to_hash) end |