class Io::Flow::V0::Models::PriceBookItemForm
Represents the form to create an item in a pricebook.
Attributes
amount[R]
item_attributes[R]
item_number[R]
price_book_key[R]
schedule[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 60085 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:price_book_key, :item_number, :amount], 'PriceBookItemForm') @price_book_key = HttpClient::Preconditions.assert_class('price_book_key', opts.delete(:price_book_key), String) @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @schedule = (x = opts.delete(:schedule); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PriceBookItemSchedule) ? x : ::Io::Flow::V0::Models::PriceBookItemSchedule.new(x))) @item_attributes = (x = opts.delete(:item_attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('item_attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('item_attributes', d[1], String); h }) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 60099 def copy(incoming={}) PriceBookItemForm.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 60103 def to_hash { :price_book_key => price_book_key, :item_number => item_number, :amount => amount.to_f.to_s, :schedule => schedule.nil? ? nil : schedule.to_hash, :item_attributes => item_attributes.nil? ? nil : item_attributes } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 60095 def to_json JSON.dump(to_hash) end