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.



28143
28144
28145
28146
28147
28148
28149
28150
28151
28152
28153
28154
28155
28156
28157
28158
28159
28160
28161
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28143

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)
  @status = (x = opts.delete(:status); x.nil? ? nil : HttpClient::Preconditions.assert_class('status', x, String))
end

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def country
  @country
end

#currencyObject (readonly)

Returns the value of attribute currency.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def currency
  @currency
end

#delivered_dutyObject (readonly)

Returns the value of attribute delivered_duty.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def delivered_duty
  @delivered_duty
end

#event_idObject (readonly)

Returns the value of attribute event_id.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def event_id
  @event_id
end

#keyObject (readonly)

Returns the value of attribute key.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def key
  @key
end

#languageObject (readonly)

Returns the value of attribute language.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def language
  @language
end

#measurement_systemObject (readonly)

Returns the value of attribute measurement_system.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def measurement_system
  @measurement_system
end

#nameObject (readonly)

Returns the value of attribute name.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def name
  @name
end

#organizationObject (readonly)

Returns the value of attribute organization.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def organization
  @organization
end

#positionObject (readonly)

Returns the value of attribute position.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def position
  @position
end

#region_idObject (readonly)

Returns the value of attribute region_id.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def region_id
  @region_id
end

#statusObject (readonly)

Returns the value of attribute status.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def status
  @status
end

#subcatalog_idObject (readonly)

Returns the value of attribute subcatalog_id.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def subcatalog_id
  @subcatalog_id
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



28141
28142
28143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28141

def timestamp
  @timestamp
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28167
28168
28169
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28167

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

#subtype_to_hashObject



28171
28172
28173
28174
28175
28176
28177
28178
28179
28180
28181
28182
28183
28184
28185
28186
28187
28188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28171

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,
    :status => status
  }
end

#to_jsonObject



28163
28164
28165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28163

def to_json
  JSON.dump(to_hash)
end