class Io::Flow::V0::Models::ExperiencePriceBookMapping

Attributes

experience[R]
id[R]
position[R]
price_book[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 42185
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :experience, :price_book, :position], 'ExperiencePriceBookMapping')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.new(x))
  @price_book = (x = opts.delete(:price_book); x.is_a?(::Io::Flow::V0::Models::PriceBookReference) ? x : ::Io::Flow::V0::Models::PriceBookReference.new(x))
  @position = HttpClient::Preconditions.assert_class('position', opts.delete(:position), Integer)
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 42198
def copy(incoming={})
  ExperiencePriceBookMapping.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 42202
def to_hash
  {
    :id => id,
    :experience => experience.to_hash,
    :price_book => price_book.to_hash,
    :position => position
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 42194
def to_json
  JSON.dump(to_hash)
end