Class: Io::Flow::V0::Models::LocalizedItemSnapshot

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

#to_hash

Constructor Details

#initialize(incoming = {}) ⇒ LocalizedItemSnapshot

Returns a new instance of LocalizedItemSnapshot.



15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15834

def initialize(incoming={})
  super(:discriminator => Event::Types::LOCALIZED_ITEM_SNAPSHOT)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :subcatalog_id, :url], 'LocalizedItemSnapshot')
  @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)
  @subcatalog_id = HttpClient::Preconditions.assert_class('subcatalog_id', opts.delete(:subcatalog_id), String)
  @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
end

Instance Attribute Details

#event_id ⇒ Object (readonly)

Returns the value of attribute event_id.



15832
15833
15834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15832

def event_id
  @event_id
end

#organization ⇒ Object (readonly)

Returns the value of attribute organization.



15832
15833
15834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15832

def organization
  @organization
end

#subcatalog_id ⇒ Object (readonly)

Returns the value of attribute subcatalog_id.



15832
15833
15834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15832

def subcatalog_id
  @subcatalog_id
end

#timestamp ⇒ Object (readonly)

Returns the value of attribute timestamp.



15832
15833
15834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15832

def timestamp
  @timestamp
end

#url ⇒ Object (readonly)

Returns the value of attribute url.



15832
15833
15834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15832

def url
  @url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



15849
15850
15851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15849

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

#subtype_to_hash ⇒ Object



15853
15854
15855
15856
15857
15858
15859
15860
15861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15853

def subtype_to_hash
  {
    :event_id => event_id,
    :timestamp => timestamp,
    :organization => organization,
    :subcatalog_id => subcatalog_id,
    :url => url
  }
end

#to_json ⇒ Object



15845
15846
15847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15845

def to_json
  JSON.dump(to_hash)
end