class Io::Flow::V0::Models::Manifest
Represents closeout of a group of labels that have been transferred to the carrier for shipping
Attributes
id[R]
pdf[R]
service[R]
shipping_labels[R]
timestamp[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 49468 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :timestamp, :shipping_labels], 'Manifest') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @shipping_labels = HttpClient::Preconditions.assert_class('shipping_labels', opts.delete(:shipping_labels), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShippingLabelSummary) ? x : ::Io::Flow::V0::Models::ShippingLabelSummary.new(x)) } @pdf = (x = opts.delete(:pdf); x.nil? ? nil : HttpClient::Preconditions.assert_class('pdf', x, String)) @service = (x = opts.delete(:service); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ServiceSummary) ? x : ::Io::Flow::V0::Models::ServiceSummary.new(x))) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 49482 def copy(incoming={}) Manifest.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 49486 def to_hash { :id => id, :timestamp => timestamp, :shipping_labels => shipping_labels.map { |o| o.to_hash }, :pdf => pdf, :service => service.nil? ? nil : service.to_hash } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 49478 def to_json JSON.dump(to_hash) end