Class: Io::Flow::V0::Models::SummaryShippingNotificationForm
- Inherits:
-
ShippingNotificationForm
- Object
- ShippingNotificationForm
- Io::Flow::V0::Models::SummaryShippingNotificationForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Form for minimal information needed for a client-facilitated shipment where the shipping label and fulfillment was not handled by Flow.
Instance Attribute Summary collapse
-
#carrier_tracking_number ⇒ Object
readonly
Returns the value of attribute carrier_tracking_number.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#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 = {}) ⇒ SummaryShippingNotificationForm
constructor
A new instance of SummaryShippingNotificationForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ShippingNotificationForm
Constructor Details
#initialize(incoming = {}) ⇒ SummaryShippingNotificationForm
Returns a new instance of SummaryShippingNotificationForm.
69383 69384 69385 69386 69387 69388 69389 69390 69391 69392 69393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69383 def initialize(incoming={}) super(:discriminator => ShippingNotificationForm::Types::SUMMARY_SHIPPING_NOTIFICATION_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:order_number, :items, :service, :carrier_tracking_number], 'SummaryShippingNotificationForm') @order_number = HttpClient::Preconditions.assert_class('order_number', opts.delete(:order_number), String) @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::LineItemForm) ? x : ::Io::Flow::V0::Models::LineItemForm.new(x)) } @service = HttpClient::Preconditions.assert_class('service', opts.delete(:service), String) @carrier_tracking_number = HttpClient::Preconditions.assert_class('carrier_tracking_number', opts.delete(:carrier_tracking_number), String) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', 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.
69381 69382 69383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69381 def carrier_tracking_number @carrier_tracking_number end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
69381 69382 69383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69381 def items @items end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
69381 69382 69383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69381 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
69381 69382 69383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69381 def order_number @order_number end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
69381 69382 69383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69381 def service @service end |
#shipment_recipient ⇒ Object (readonly)
Returns the value of attribute shipment_recipient.
69381 69382 69383 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69381 def shipment_recipient @shipment_recipient end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
69399 69400 69401 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69399 def copy(incoming={}) SummaryShippingNotificationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
69403 69404 69405 69406 69407 69408 69409 69410 69411 69412 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69403 def subtype_to_hash { :order_number => order_number, :items => items.map { |o| o.to_hash }, :service => service, :carrier_tracking_number => carrier_tracking_number, :key => key, :shipment_recipient => shipment_recipient.nil? ? nil : shipment_recipient.value } end |
#to_json ⇒ Object
69395 69396 69397 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69395 def to_json JSON.dump(to_hash) end |