class Io::Flow::V0::Models::TrackingLabelSummary

Attributes

carrier[R]
id[R]
status[R]
tracking[R]
tracking_number[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71608
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :tracking, :status, :carrier, :tracking_number], 'TrackingLabelSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @tracking = (x = opts.delete(:tracking); x.is_a?(::Io::Flow::V0::Models::TrackingSummary) ? x : ::Io::Flow::V0::Models::TrackingSummary.new(x))
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))
  @carrier = HttpClient::Preconditions.assert_class('carrier', opts.delete(:carrier), String)
  @tracking_number = HttpClient::Preconditions.assert_class('tracking_number', opts.delete(:tracking_number), String)
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71622
def copy(incoming={})
  TrackingLabelSummary.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 71626
def to_hash
  {
    :id => id,
    :tracking => tracking.to_hash,
    :status => status.value,
    :carrier => carrier,
    :tracking_number => tracking_number
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71618
def to_json
  JSON.dump(to_hash)
end