class Io::Flow::V0::Models::DeliveryWindow
Flow’s estimate of when a shipment for this delivery will actually arrive at the final destination, taking into account a shipment estimate, center schedules, and carrier transit windows.
Attributes
from[R]
label[R]
max_days[R]
min_days[R]
timezone[R]
to[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39265 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:from, :to], 'DeliveryWindow') @from = HttpClient::Preconditions.assert_class('from', HttpClient::Helper.to_date_time_iso8601(opts.delete(:from)), DateTime) @to = HttpClient::Preconditions.assert_class('to', HttpClient::Helper.to_date_time_iso8601(opts.delete(:to)), DateTime) @timezone = (x = opts.delete(:timezone); x.nil? ? nil : HttpClient::Preconditions.assert_class('timezone', x, String)) @label = (x = opts.delete(:label); x.nil? ? nil : HttpClient::Preconditions.assert_class('label', x, String)) @min_days = (x = opts.delete(:min_days); x.nil? ? nil : HttpClient::Preconditions.assert_class('min_days', x, Integer)) @max_days = (x = opts.delete(:max_days); x.nil? ? nil : HttpClient::Preconditions.assert_class('max_days', x, Integer)) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39280 def copy(incoming={}) DeliveryWindow.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 39284 def to_hash { :from => from, :to => to, :timezone => timezone, :label => label, :min_days => min_days, :max_days => max_days } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39276 def to_json JSON.dump(to_hash) end