Class: Io::Flow::V0::Models::LocalizedItemUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#local ⇒ Object
readonly
Returns the value of attribute local.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Attributes inherited from Event
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LocalizedItemUpserted
constructor
A new instance of LocalizedItemUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ LocalizedItemUpserted
Returns a new instance of LocalizedItemUpserted.
19402 19403 19404 19405 19406 19407 19408 19409 19410 19411 19412 19413 19414 19415 19416 19417 19418 19419 19420 19421 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19402 def initialize(incoming={}) super(:discriminator => Event::Types::LOCALIZED_ITEM_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :number, :catalog, :locale, :name, :currency, :price, :categories, :attributes, :dimensions, :images, :local], 'LocalizedItemUpserted') @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) @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @catalog = HttpClient::Preconditions.assert_class('catalog', opts.delete(:catalog), String) @locale = HttpClient::Preconditions.assert_class('locale', opts.delete(:locale), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @price = HttpClient::Preconditions.assert_class('price', opts.delete(:price), Numeric) @categories = HttpClient::Preconditions.assert_class('categories', opts.delete(:categories), Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) } @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h } @dimensions = HttpClient::Preconditions.assert_class('dimensions', HttpClient::Helper.to_object(opts.delete(:dimensions)), Hash) @images = HttpClient::Preconditions.assert_class('images', opts.delete(:images), Array).map { |v| HttpClient::Preconditions.assert_class('images', HttpClient::Helper.to_object(v), Hash) } @local = HttpClient::Preconditions.assert_class('local', HttpClient::Helper.to_object(opts.delete(:local)), Hash) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def attributes @attributes end |
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def catalog @catalog end |
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def categories @categories end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def description @description end |
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def dimensions @dimensions end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def event_id @event_id end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def images @images end |
#local ⇒ Object (readonly)
Returns the value of attribute local.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def local @local end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def locale @locale end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def number @number end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def organization @organization end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def price @price end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
19400 19401 19402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19400 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19427 19428 19429 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19427 def copy(incoming={}) LocalizedItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
19431 19432 19433 19434 19435 19436 19437 19438 19439 19440 19441 19442 19443 19444 19445 19446 19447 19448 19449 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19431 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :number => number, :catalog => catalog, :locale => locale, :name => name, :currency => currency, :price => price, :categories => categories, :description => description, :attributes => attributes, :dimensions => dimensions, :images => images, :local => local } end |
#to_json ⇒ Object
19423 19424 19425 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19423 def to_json JSON.dump(to_hash) end |