Class: Io::Flow::V0::Models::ShopifyLocalizedOrder
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyLocalizedOrder
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#allocation_details ⇒ Object
readonly
Returns the value of attribute allocation_details.
-
#flow_order_id ⇒ Object
readonly
Returns the value of attribute flow_order_id.
-
#geo ⇒ Object
readonly
Returns the value of attribute geo.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#incoterm ⇒ Object
readonly
Returns the value of attribute incoterm.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#merchant_of_record ⇒ Object
readonly
Returns the value of attribute merchant_of_record.
-
#merchant_of_record_entity ⇒ Object
readonly
Returns the value of attribute merchant_of_record_entity.
-
#prices ⇒ Object
readonly
Returns the value of attribute prices.
-
#tax_registration ⇒ Object
readonly
Returns the value of attribute tax_registration.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyLocalizedOrder
constructor
A new instance of ShopifyLocalizedOrder.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyLocalizedOrder
Returns a new instance of ShopifyLocalizedOrder.
67702 67703 67704 67705 67706 67707 67708 67709 67710 67711 67712 67713 67714 67715 67716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67702 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :lines, :prices, :total, :allocation_details], 'ShopifyLocalizedOrder') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), Integer) @lines = HttpClient::Preconditions.assert_class('lines', opts.delete(:lines), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShopifyLine) ? x : ::Io::Flow::V0::Models::ShopifyLine.new(x)) } @prices = HttpClient::Preconditions.assert_class('prices', opts.delete(:prices), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShopifyPrice) ? x : ::Io::Flow::V0::Models::ShopifyPrice.new(x)) } @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::ShopifyPrice) ? x : ::Io::Flow::V0::Models::ShopifyPrice.new(x)) @allocation_details = HttpClient::Preconditions.assert_class('allocation_details', opts.delete(:allocation_details), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::AllocationDetail) ? x : ::Io::Flow::V0::Models::AllocationDetail.from_json(x)) } @merchant_of_record = (x = opts.delete(:merchant_of_record); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderMerchantOfRecord) ? x : ::Io::Flow::V0::Models::OrderMerchantOfRecord.apply(x))) @merchant_of_record_entity = (x = opts.delete(:merchant_of_record_entity); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantOfRecordEntity) ? x : ::Io::Flow::V0::Models::MerchantOfRecordEntity.new(x))) @incoterm = (x = opts.delete(:incoterm); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Incoterm) ? x : ::Io::Flow::V0::Models::Incoterm.apply(x))) @flow_order_id = (x = opts.delete(:flow_order_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('flow_order_id', x, String)) @tax_registration = (x = opts.delete(:tax_registration); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TaxRegistration) ? x : ::Io::Flow::V0::Models::TaxRegistration.new(x))) @geo = (x = opts.delete(:geo); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderGeo) ? x : ::Io::Flow::V0::Models::OrderGeo.new(x))) end |
Instance Attribute Details
#allocation_details ⇒ Object (readonly)
Returns the value of attribute allocation_details.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def allocation_details @allocation_details end |
#flow_order_id ⇒ Object (readonly)
Returns the value of attribute flow_order_id.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def flow_order_id @flow_order_id end |
#geo ⇒ Object (readonly)
Returns the value of attribute geo.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def geo @geo end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def id @id end |
#incoterm ⇒ Object (readonly)
Returns the value of attribute incoterm.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def incoterm @incoterm end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def lines @lines end |
#merchant_of_record ⇒ Object (readonly)
Returns the value of attribute merchant_of_record.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def merchant_of_record @merchant_of_record end |
#merchant_of_record_entity ⇒ Object (readonly)
Returns the value of attribute merchant_of_record_entity.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def merchant_of_record_entity @merchant_of_record_entity end |
#prices ⇒ Object (readonly)
Returns the value of attribute prices.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def prices @prices end |
#tax_registration ⇒ Object (readonly)
Returns the value of attribute tax_registration.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def tax_registration @tax_registration end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
67700 67701 67702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67700 def total @total end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
67722 67723 67724 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67722 def copy(incoming={}) ShopifyLocalizedOrder.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
67726 67727 67728 67729 67730 67731 67732 67733 67734 67735 67736 67737 67738 67739 67740 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67726 def to_hash { :id => id, :lines => lines.map { |o| o.to_hash }, :prices => prices.map { |o| o.to_hash }, :total => total.to_hash, :allocation_details => allocation_details.map { |o| o.to_hash }, :merchant_of_record => merchant_of_record.nil? ? nil : merchant_of_record.value, :merchant_of_record_entity => merchant_of_record_entity.nil? ? nil : merchant_of_record_entity.to_hash, :incoterm => incoterm.nil? ? nil : incoterm.value, :flow_order_id => flow_order_id, :tax_registration => tax_registration.nil? ? nil : tax_registration.to_hash, :geo => geo.nil? ? nil : geo.to_hash } end |
#to_json ⇒ Object
67718 67719 67720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67718 def to_json JSON.dump(to_hash) end |