Class: Io::Flow::V0::Models::ExperienceUpserted

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

Instance Attribute Summary collapse

Attributes inherited from Event

#discriminator

Instance Method Summary collapse

Methods inherited from Event

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ExperienceUpserted

Returns a new instance of ExperienceUpserted.



16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16368

def initialize(incoming={})
  super(:discriminator => Event::Types::EXPERIENCE_UPSERTED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :key, :name, :delivered_duty, :subcatalog_id, :region_id, :country, :currency, :language, :measurement_system, :position], 'ExperienceUpserted')
  @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)
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @delivered_duty = HttpClient::Preconditions.assert_class('delivered_duty', opts.delete(:delivered_duty), String)
  @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
  @region_id = HttpClient::Preconditions.assert_class('region_id', opts.delete(:region_id), String)
  @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
  @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
  @measurement_system = HttpClient::Preconditions.assert_class('measurement_system', opts.delete(:measurement_system), String)
  @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def currency
  @currency
end

#delivered_dutyObject (readonly)

Returns the value of attribute delivered_duty.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def delivered_duty
  @delivered_duty
end

#event_idObject (readonly)

Returns the value of attribute event_id.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def event_id
  @event_id
end

#keyObject (readonly)

Returns the value of attribute key.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def key
  @key
end

#languageObject (readonly)

Returns the value of attribute language.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def language
  @language
end

#measurement_systemObject (readonly)

Returns the value of attribute measurement_system.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def measurement_system
  @measurement_system
end

#nameObject (readonly)

Returns the value of attribute name.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def name
  @name
end

#organizationObject (readonly)

Returns the value of attribute organization.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def organization
  @organization
end

#positionObject (readonly)

Returns the value of attribute position.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def position
  @position
end

#region_idObject (readonly)

Returns the value of attribute region_id.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def region_id
  @region_id
end

#subcatalog_idObject (readonly)

Returns the value of attribute subcatalog_id.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def subcatalog_id
  @subcatalog_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



16366
16367
16368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16366

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16391
16392
16393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16391

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

#subtype_to_hashObject



16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16395

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :key => key,
    :name => name,
    :delivered_duty => delivered_duty,
    :subcatalog_id => subcatalog_id,
    :region_id => region_id,
    :country => country,
    :currency => currency,
    :language => language,
    :measurement_system => measurement_system,
    :position => position
  }
end

#to_jsonObject



16387
16388
16389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16387

def to_json
  JSON.dump(to_hash)
end