class Io::Flow::V0::Models::SinglePackageShippingNotificationForm
Simplified form for notifying Flow
of a Fulfillment
shipped entirely in a single tracked package.
Attributes
carrier_tracking_number[R]
fulfillment_key[R]
package_dimensions[R]
service[R]
shipment_recipient[R]
Public Class Methods
new(incoming={})
click to toggle source
Calls superclass method
Io::Flow::V0::Models::ShippingNotificationForm::new
# File lib/flow_commerce/flow_api_v0_client.rb, line 68523 def initialize(incoming={}) super(:discriminator => ShippingNotificationForm::Types::SINGLE_PACKAGE_SHIPPING_NOTIFICATION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:fulfillment_key, :carrier_tracking_number], 'SinglePackageShippingNotificationForm') @fulfillment_key = HttpClient::Preconditions.assert_class('fulfillment_key', opts.delete(:fulfillment_key), String) @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String) @package_dimensions = (x = opts.delete(:package_dimensions); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x))) @service = (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, String)) @shipment_recipient = (x = opts.delete(:shipment_recipient); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShipmentRecipient) ? x : ::Io::Flow::V0::Models::ShipmentRecipient.apply(x))) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68538 def copy(incoming={}) SinglePackageShippingNotificationForm.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 68542 def subtype_to_hash { :fulfillment_key => fulfillment_key, :carrier_tracking_number => carrier_tracking_number, :package_dimensions => package_dimensions.nil? ? nil : package_dimensions.to_hash, :service => service, :shipment_recipient => shipment_recipient.nil? ? nil : shipment_recipient.value } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68534 def to_json JSON.dump(to_hash) end