class Io::Flow::V0::Models::FulfillmentItemAllocationDetails

Details about how prices were allocated to a fulfillment; use for reporting the value or net value of a line

Attributes

item_number[R]
levies[R]
line_number[R]
total[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44116
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:item_number, :line_number, :levies, :total], 'FulfillmentItemAllocationDetails')
  @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String)
  @line_number = HttpClient::Preconditions.assert_class('line_number', opts.delete(:line_number), Integer)
  @levies = (x = opts.delete(:levies); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
  @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44129
def copy(incoming={})
  FulfillmentItemAllocationDetails.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44133
def to_hash
  {
    :item_number => item_number,
    :line_number => line_number,
    :levies => levies.to_hash,
    :total => total.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44125
def to_json
  JSON.dump(to_hash)
end