Class: Io::Flow::V0::Models::SinglePackageShippingNotificationForm
- Inherits:
-
ShippingNotificationForm
- Object
- ShippingNotificationForm
- Io::Flow::V0::Models::SinglePackageShippingNotificationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Simplified form for notifying Flow of a Fulfillment shipped entirely in a single tracked package.
Instance Attribute Summary collapse
-
#carrier_tracking_number ⇒ Object
readonly
Returns the value of attribute carrier_tracking_number.
-
#fulfillment_key ⇒ Object
readonly
Returns the value of attribute fulfillment_key.
-
#package_dimensions ⇒ Object
readonly
Returns the value of attribute package_dimensions.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#shipment_recipient ⇒ Object
readonly
Returns the value of attribute shipment_recipient.
Attributes inherited from ShippingNotificationForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SinglePackageShippingNotificationForm
constructor
A new instance of SinglePackageShippingNotificationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ShippingNotificationForm
Constructor Details
#initialize(incoming = {}) ⇒ SinglePackageShippingNotificationForm
Returns a new instance of SinglePackageShippingNotificationForm.
63525 63526 63527 63528 63529 63530 63531 63532 63533 63534 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63525 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 |
Instance Attribute Details
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
63523 63524 63525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63523 def carrier_tracking_number @carrier_tracking_number end |
#fulfillment_key ⇒ Object (readonly)
Returns the value of attribute fulfillment_key.
63523 63524 63525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63523 def fulfillment_key @fulfillment_key end |
#package_dimensions ⇒ Object (readonly)
Returns the value of attribute package_dimensions.
63523 63524 63525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63523 def package_dimensions @package_dimensions end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
63523 63524 63525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63523 def service @service end |
#shipment_recipient ⇒ Object (readonly)
Returns the value of attribute shipment_recipient.
63523 63524 63525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63523 def shipment_recipient @shipment_recipient end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
63540 63541 63542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63540 def copy(incoming={}) SinglePackageShippingNotificationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
63544 63545 63546 63547 63548 63549 63550 63551 63552 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63544 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 ⇒ Object
63536 63537 63538 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63536 def to_json JSON.dump(to_hash) end |