Class: Io::Flow::V0::Models::ReturnForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReturnForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#carrier_tracking_number ⇒ Object
readonly
Returns the value of attribute carrier_tracking_number.
-
#center_key ⇒ Object
readonly
Returns the value of attribute center_key.
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#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.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#tier_id ⇒ Object
readonly
Returns the value of attribute tier_id.
-
#tracking_status ⇒ Object
readonly
Returns the value of attribute tracking_status.
-
#tracking_status_timestamp ⇒ Object
readonly
Returns the value of attribute tracking_status_timestamp.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReturnForm
constructor
A new instance of ReturnForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReturnForm
Returns a new instance of ReturnForm.
64014 64015 64016 64017 64018 64019 64020 64021 64022 64023 64024 64025 64026 64027 64028 64029 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64014 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:items], 'ReturnForm') @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ReturnLineItem) ? x : ::Io::Flow::V0::Models::ReturnLineItem.new(x)) } @tier_id = (x = opts.delete(:tier_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('tier_id', x, String)) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @service = (x = opts.delete(:service); x.nil? ? nil : HttpClient::Preconditions.assert_class('service', x, String)) @destination = (x = opts.delete(:destination); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))) @key = (x = opts.delete(:key); x.nil? ? nil : HttpClient::Preconditions.assert_class('key', x, String)) @origin = (x = opts.delete(:origin); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ShippingAddress) ? x : ::Io::Flow::V0::Models::ShippingAddress.new(x))) @center_key = (x = opts.delete(:center_key); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_key', x, String)) @source = (x = opts.delete(:source); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ReturnSource) ? x : ::Io::Flow::V0::Models::ReturnSource.from_json(x))) @tracking_status = (x = opts.delete(:tracking_status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::ReturnTrackingStatus) ? x : ::Io::Flow::V0::Models::ReturnTrackingStatus.apply(x))) @tracking_status_timestamp = (x = opts.delete(:tracking_status_timestamp); x.nil? ? nil : HttpClient::Preconditions.assert_class('tracking_status_timestamp', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) @carrier_tracking_number = (x = opts.delete(:carrier_tracking_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('carrier_tracking_number', x, String)) end |
Instance Attribute Details
#carrier_tracking_number ⇒ Object (readonly)
Returns the value of attribute carrier_tracking_number.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def carrier_tracking_number @carrier_tracking_number end |
#center_key ⇒ Object (readonly)
Returns the value of attribute center_key.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def center_key @center_key end |
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def destination @destination end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def items @items end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def key @key end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def order_number @order_number end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def origin @origin end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def service @service end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def source @source end |
#tier_id ⇒ Object (readonly)
Returns the value of attribute tier_id.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def tier_id @tier_id end |
#tracking_status ⇒ Object (readonly)
Returns the value of attribute tracking_status.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def tracking_status @tracking_status end |
#tracking_status_timestamp ⇒ Object (readonly)
Returns the value of attribute tracking_status_timestamp.
64012 64013 64014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64012 def @tracking_status_timestamp end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
64035 64036 64037 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64035 def copy(incoming={}) ReturnForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
64039 64040 64041 64042 64043 64044 64045 64046 64047 64048 64049 64050 64051 64052 64053 64054 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64039 def to_hash { :items => items.map { |o| o.to_hash }, :tier_id => tier_id, :order_number => order_number, :service => service, :destination => destination.nil? ? nil : destination.to_hash, :key => key, :origin => origin.nil? ? nil : origin.to_hash, :center_key => center_key, :source => source.nil? ? nil : source.to_hash, :tracking_status => tracking_status.nil? ? nil : tracking_status.value, :tracking_status_timestamp => , :carrier_tracking_number => carrier_tracking_number } end |
#to_json ⇒ Object
64031 64032 64033 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64031 def to_json JSON.dump(to_hash) end |