class Beaver::ItemResp

ItemResp Model.

Attributes

api_version[RW]

TODO: Write general description for this method @return [String]

create_time[RW]

TODO: Write general description for this method @return [Integer]

currency[RW]

TODO: Write general description for this method @return [CurrencyNullableEnum]

description[RW]

TODO: Write general description for this method @return [String]

id[RW]

TODO: Write general description for this method @return [String]

owner[RW]

TODO: Write general description for this method @return [OwnerOfItems]

path[RW]

TODO: Write general description for this method @return [String]

photos[RW]

TODO: Write general description for this method @return [List of String]

price[RW]

TODO: Write general description for this method @return [Integer]

product_code[RW]

TODO: Write general description for this method @return [String]

product_details[RW]

TODO: Write general description for this method @return [Object]

product_name[RW]

TODO: Write general description for this method @return [String]

reference_number[RW]

TODO: Write general description for this method @return [String]

resource[RW]

TODO: Write general description for this method @return [String]

shipping_options[RW]

TODO: Write general description for this method @return [List of String]

state[RW]

TODO: Write general description for this method @return [StateEnum]

terms[RW]

TODO: Write general description for this method @return [TermsNullable]

uri[RW]

TODO: Write general description for this method @return [String]

weight[RW]

TODO: Write general description for this method @return [Weight]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/item_resp.rb, line 151
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  create_time = hash['create_time']
  id = hash['id']
  owner = OwnerOfItems.from_hash(hash['owner']) if hash['owner']
  path = hash['path']
  product_name = hash['product_name']
  resource = hash['resource']
  state = hash['state']
  currency = hash['currency']
  description = hash['description']
  photos = hash['photos']
  price = hash['price']
  product_code = hash['product_code']
  product_details = hash['product_details']
  reference_number = hash['reference_number']
  shipping_options = hash['shipping_options']
  terms = TermsNullable.from_hash(hash['terms']) if hash['terms']
  uri = hash['uri']
  weight = Weight.from_hash(hash['weight']) if hash['weight']
  api_version = hash['api_version']

  # Create object from extracted values.
  ItemResp.new(create_time,
               id,
               owner,
               path,
               product_name,
               resource,
               state,
               currency,
               description,
               photos,
               price,
               product_code,
               product_details,
               reference_number,
               shipping_options,
               terms,
               uri,
               weight,
               api_version)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/item_resp.rb, line 86
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['create_time'] = 'create_time'
  @_hash['currency'] = 'currency'
  @_hash['description'] = 'description'
  @_hash['id'] = 'id'
  @_hash['owner'] = 'owner'
  @_hash['path'] = 'path'
  @_hash['photos'] = 'photos'
  @_hash['price'] = 'price'
  @_hash['product_code'] = 'product_code'
  @_hash['product_details'] = 'product_details'
  @_hash['product_name'] = 'product_name'
  @_hash['reference_number'] = 'reference_number'
  @_hash['resource'] = 'resource'
  @_hash['shipping_options'] = 'shipping_options'
  @_hash['state'] = 'state'
  @_hash['terms'] = 'terms'
  @_hash['uri'] = 'uri'
  @_hash['weight'] = 'weight'
  @_hash['api_version'] = 'api_version'
  @_hash
end
new(create_time = nil, id = nil, owner = nil, path = nil, product_name = nil, resource = nil, state = nil, currency = nil, description = nil, photos = nil, price = nil, product_code = nil, product_details = nil, reference_number = nil, shipping_options = nil, terms = nil, uri = nil, weight = nil, api_version = nil) click to toggle source
# File lib/beaver/models/item_resp.rb, line 110
def initialize(create_time = nil,
               id = nil,
               owner = nil,
               path = nil,
               product_name = nil,
               resource = nil,
               state = nil,
               currency = nil,
               description = nil,
               photos = nil,
               price = nil,
               product_code = nil,
               product_details = nil,
               reference_number = nil,
               shipping_options = nil,
               terms = nil,
               uri = nil,
               weight = nil,
               api_version = nil)
  @create_time = create_time
  @currency = currency
  @description = description
  @id = id
  @owner = owner
  @path = path
  @photos = photos
  @price = price
  @product_code = product_code
  @product_details = product_details
  @product_name = product_name
  @reference_number = reference_number
  @resource = resource
  @shipping_options = shipping_options
  @state = state
  @terms = terms
  @uri = uri
  @weight = weight
  @api_version = api_version
end