Class: Io::Flow::V0::Models::LocalizedItemUpsertedV2
- 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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LocalizedItemUpsertedV2
constructor
A new instance of LocalizedItemUpsertedV2.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ LocalizedItemUpsertedV2
Returns a new instance of LocalizedItemUpsertedV2.
19770 19771 19772 19773 19774 19775 19776 19777 19778 19779 19780 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19770 def initialize(incoming={}) super(:discriminator => Event::Types::LOCALIZED_ITEM_UPSERTED_V2) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :id, :item, :catalog], 'LocalizedItemUpsertedV2') @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) @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::Item) ? x : ::Io::Flow::V0::Models::Item.new(x)) @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String) end |
Instance Attribute Details
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
19768 19769 19770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19768 def catalog @catalog end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
19768 19769 19770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19768 def event_id @event_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
19768 19769 19770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19768 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
19768 19769 19770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19768 def item @item end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
19768 19769 19770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19768 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
19768 19769 19770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19768 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19786 19787 19788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19786 def copy(incoming={}) LocalizedItemUpsertedV2.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
19790 19791 19792 19793 19794 19795 19796 19797 19798 19799 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19790 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :id => id, :item => item.to_hash, :catalog => catalog } end |
#to_json ⇒ Object
19782 19783 19784 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19782 def to_json JSON.dump(to_hash) end |