class Io::Flow::V0::Models::OrderReplacement

The order replacement details.

Attributes

id[R]
parent_order[R]
replacement_order[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 53849
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :parent_order, :replacement_order], 'OrderReplacement')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @parent_order = (x = opts.delete(:parent_order); x.is_a?(::Io::Flow::V0::Models::Order) ? x : ::Io::Flow::V0::Models::Order.new(x))
  @replacement_order = (x = opts.delete(:replacement_order); x.is_a?(::Io::Flow::V0::Models::Order) ? x : ::Io::Flow::V0::Models::Order.new(x))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 53861
def copy(incoming={})
  OrderReplacement.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 53865
def to_hash
  {
    :id => id,
    :parent_order => parent_order.to_hash,
    :replacement_order => replacement_order.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 53857
def to_json
  JSON.dump(to_hash)
end