class Io::Flow::V0::Models::PhysicalDelivery
Represents a collection of items, the available delivery option tier for that collection of items, and metadata about those options
Attributes
center[R]
fulfillment_routing[R]
goods_supply[R]
id[R]
items[R]
key[R]
merchant_of_record_flow_entity[R]
options[R]
prices[R]
ship_from_country[R]
special_services[R]
total[R]
Public Class Methods
new(incoming={})
click to toggle source
Calls superclass method
Io::Flow::V0::Models::Delivery::new
# File lib/flow_commerce/flow_api_v0_client.rb, line 59735 def initialize(incoming={}) super(:discriminator => Delivery::Types::PHYSICAL_DELIVERY) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :items, :options], 'PhysicalDelivery') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @center = (x = opts.delete(:center); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CenterSummary) ? x : ::Io::Flow::V0::Models::CenterSummary.new(x))) @fulfillment_routing = (x = opts.delete(:fulfillment_routing); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::FulfillmentRouting) ? x : ::Io::Flow::V0::Models::FulfillmentRouting.apply(x))) @ship_from_country = (x = opts.delete(:ship_from_country); x.nil? ? nil : HttpClient::Preconditions.assert_class('ship_from_country', x, String)) @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryItem) ? x : ::Io::Flow::V0::Models::DeliveryItem.new(x)) } @options = HttpClient::Preconditions.assert_class('options', opts.delete(:options), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DeliveryOption) ? x : ::Io::Flow::V0::Models::DeliveryOption.new(x)) } @special_services = (x = opts.delete(:special_services); x.nil? ? nil : HttpClient::Preconditions.assert_class('special_services', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PhysicalDeliverySpecialSerivce) ? x : ::Io::Flow::V0::Models::PhysicalDeliverySpecialSerivce.apply(x)) }) @prices = (x = opts.delete(:prices); x.nil? ? nil : HttpClient::Preconditions.assert_class('prices', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderPriceDetail) ? x : ::Io::Flow::V0::Models::OrderPriceDetail.new(x)) }) @total = (x = opts.delete(:total); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LocalizedTotal) ? x : ::Io::Flow::V0::Models::LocalizedTotal.new(x))) @goods_supply = (x = opts.delete(:goods_supply); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::GoodsSupply) ? x : ::Io::Flow::V0::Models::GoodsSupply.apply(x))) @merchant_of_record_flow_entity = (x = opts.delete(:merchant_of_record_flow_entity); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::FlowEntity) ? x : ::Io::Flow::V0::Models::FlowEntity.apply(x))) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59757 def copy(incoming={}) PhysicalDelivery.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
subtype_to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59761 def subtype_to_hash { :id => id, :key => key, :center => center.nil? ? nil : center.to_hash, :fulfillment_routing => fulfillment_routing.nil? ? nil : fulfillment_routing.value, :ship_from_country => ship_from_country, :items => items.map { |o| o.to_hash }, :options => options.map { |o| o.to_hash }, :special_services => special_services.nil? ? nil : special_services.map { |o| o.value }, :prices => prices.nil? ? nil : prices.map { |o| o.to_hash }, :total => total.nil? ? nil : total.to_hash, :goods_supply => goods_supply.nil? ? nil : goods_supply.value, :merchant_of_record_flow_entity => merchant_of_record_flow_entity.nil? ? nil : merchant_of_record_flow_entity.value } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 59753 def to_json JSON.dump(to_hash) end