Class: Io::Flow::V0::Models::FullyHarmonizedItemUpserted
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Event indicating insertion or changes to the details of a fully harmonized item. Will be triggered upon any change to the item being harmonized, its duties or taxes. If two changes occur within minutes of each other, it is possible only one upserted event will be produced, aggregating both changes.
Instance Attribute Summary collapse
-
#customs_description ⇒ Object
readonly
Returns the value of attribute customs_description.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#hs6_code ⇒ Object
readonly
Returns the value of attribute hs6_code.
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#landed_costs ⇒ Object
readonly
Returns the value of attribute landed_costs.
-
#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 = {}) ⇒ FullyHarmonizedItemUpserted
constructor
A new instance of FullyHarmonizedItemUpserted.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Event
Constructor Details
#initialize(incoming = {}) ⇒ FullyHarmonizedItemUpserted
Returns a new instance of FullyHarmonizedItemUpserted.
31344 31345 31346 31347 31348 31349 31350 31351 31352 31353 31354 31355 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31344 def initialize(incoming={}) super(:discriminator => Event::Types::FULLY_HARMONIZED_ITEM_UPSERTED) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:event_id, :timestamp, :organization, :item_number, :customs_description, :hs6_code, :landed_costs], 'FullyHarmonizedItemUpserted') @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) @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @customs_description = HttpClient::Preconditions.assert_class('customs_description', opts.delete(:customs_description), String) @hs6_code = HttpClient::Preconditions.assert_class('hs6_code', opts.delete(:hs6_code), String) @landed_costs = HttpClient::Preconditions.assert_class('landed_costs', opts.delete(:landed_costs), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LaneLandedCost) ? x : ::Io::Flow::V0::Models::LaneLandedCost.new(x)) } end |
Instance Attribute Details
#customs_description ⇒ Object (readonly)
Returns the value of attribute customs_description.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def customs_description @customs_description end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def event_id @event_id end |
#hs6_code ⇒ Object (readonly)
Returns the value of attribute hs6_code.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def hs6_code @hs6_code end |
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def item_number @item_number end |
#landed_costs ⇒ Object (readonly)
Returns the value of attribute landed_costs.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def landed_costs @landed_costs end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def organization @organization end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
31342 31343 31344 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31342 def @timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31361 31362 31363 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31361 def copy(incoming={}) FullyHarmonizedItemUpserted.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
31365 31366 31367 31368 31369 31370 31371 31372 31373 31374 31375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31365 def subtype_to_hash { :event_id => event_id, :timestamp => , :organization => organization, :item_number => item_number, :customs_description => customs_description, :hs6_code => hs6_code, :landed_costs => landed_costs.map { |o| o.to_hash } } end |
#to_json ⇒ Object
31357 31358 31359 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31357 def to_json JSON.dump(to_hash) end |