class Io::Flow::V0::Models::TrackingForm

Top level tracking information which contains labels. In cases where shipments are re-labeled, you will see multiple labels for each tracking allowing simple access to see where a shipment is - with which carrier and with the local tracking number

Attributes

attributes[R]
order_number[R]
status[R]
window[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71442
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x)))
  @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String))
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
  @window = (x = opts.delete(:window); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71454
def copy(incoming={})
  TrackingForm.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 71458
def to_hash
  {
    :status => status.nil? ? nil : status.value,
    :order_number => order_number,
    :attributes => attributes.nil? ? nil : attributes,
    :window => window.nil? ? nil : window.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71450
def to_json
  JSON.dump(to_hash)
end