class Beaver::OrderResp
OrderResp
Model.
Attributes
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [OwnerLegalEntitiesNullable]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [CurrencyNullableEnum]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [DeliveryTypeEnum]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [List of LineItem]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [OwnerOfItems]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [ResourceEnum]
TODO: Write general description for this method @return [AddressNullable]
TODO: Write general description for this method @return [AddressNullable]
TODO: Write general description for this method @return [AddressNullable]
TODO: Write general description for this method @return [ShippingStatus]
TODO: Write general description for this method @return [String]
TODO: Write general description for this method @return [StateEnum]
TODO: Write general description for this method @return [Status4Enum]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [TermsNullable]
TODO: Write general description for this method @return [Type4Enum]
TODO: Write general description for this method @return [Integer]
TODO: Write general description for this method @return [Float]
Public Class Methods
Creates an instance of the object from a hash.
# File lib/beaver/models/order_resp.rb, line 242 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. alternate_tax_amount = hash['alternate_tax_amount'] alternate_tax_id = hash['alternate_tax_id'] buyer = OwnerLegalEntitiesNullable.from_hash(hash['buyer']) if hash['buyer'] create_time = hash['create_time'] currency = hash['currency'] customer_reference_number = hash['customer_reference_number'] delivery_type = hash['delivery_type'] discount_amount = hash['discount_amount'] duty_amount = hash['duty_amount'] freight_amount = hash['freight_amount'] grand_total_amount = hash['grand_total_amount'] id = hash['id'] # Parameter is an array, so we need to iterate through it line_items = nil unless hash['line_items'].nil? line_items = [] hash['line_items'].each do |structure| line_items << (LineItem.from_hash(structure) if structure) end end long_description = hash['long_description'] notes = hash['notes'] owner = OwnerOfItems.from_hash(hash['owner']) if hash['owner'] path = hash['path'] reference_number = hash['reference_number'] resource = hash['resource'] service_address = AddressNullable.from_hash(hash['service_address']) if hash['service_address'] if hash['ship_from_address'] ship_from_address = AddressNullable.from_hash(hash['ship_from_address']) end ship_to_address = AddressNullable.from_hash(hash['ship_to_address']) if hash['ship_to_address'] shipping_status = ShippingStatus.from_hash(hash['shipping_status']) if hash['shipping_status'] short_description = hash['short_description'] state = hash['state'] status = hash['status'] tax_amount = hash['tax_amount'] terms = TermsNullable.from_hash(hash['terms']) if hash['terms'] type = hash['type'] vat_amount = hash['vat_amount'] vat_rate = hash['vat_rate'] api_version = hash['api_version'] # Create object from extracted values. OrderResp.new(alternate_tax_amount, alternate_tax_id, buyer, create_time, currency, customer_reference_number, delivery_type, discount_amount, duty_amount, freight_amount, grand_total_amount, id, line_items, long_description, notes, owner, path, reference_number, resource, service_address, ship_from_address, ship_to_address, shipping_status, short_description, state, status, tax_amount, terms, type, vat_amount, vat_rate, api_version) end
A mapping from model property names to API property names.
# File lib/beaver/models/order_resp.rb, line 138 def self.names @_hash = {} if @_hash.nil? @_hash['alternate_tax_amount'] = 'alternate_tax_amount' @_hash['alternate_tax_id'] = 'alternate_tax_id' @_hash['buyer'] = 'buyer' @_hash['create_time'] = 'create_time' @_hash['currency'] = 'currency' @_hash['customer_reference_number'] = 'customer_reference_number' @_hash['delivery_type'] = 'delivery_type' @_hash['discount_amount'] = 'discount_amount' @_hash['duty_amount'] = 'duty_amount' @_hash['freight_amount'] = 'freight_amount' @_hash['grand_total_amount'] = 'grand_total_amount' @_hash['id'] = 'id' @_hash['line_items'] = 'line_items' @_hash['long_description'] = 'long_description' @_hash['notes'] = 'notes' @_hash['owner'] = 'owner' @_hash['path'] = 'path' @_hash['reference_number'] = 'reference_number' @_hash['resource'] = 'resource' @_hash['service_address'] = 'service_address' @_hash['ship_from_address'] = 'ship_from_address' @_hash['ship_to_address'] = 'ship_to_address' @_hash['shipping_status'] = 'shipping_status' @_hash['short_description'] = 'short_description' @_hash['state'] = 'state' @_hash['status'] = 'status' @_hash['tax_amount'] = 'tax_amount' @_hash['terms'] = 'terms' @_hash['type'] = 'type' @_hash['vat_amount'] = 'vat_amount' @_hash['vat_rate'] = 'vat_rate' @_hash['api_version'] = 'api_version' @_hash end
# File lib/beaver/models/order_resp.rb, line 175 def initialize(alternate_tax_amount = nil, alternate_tax_id = nil, buyer = nil, create_time = nil, currency = nil, customer_reference_number = nil, delivery_type = nil, discount_amount = nil, duty_amount = nil, freight_amount = nil, grand_total_amount = nil, id = nil, line_items = nil, long_description = nil, notes = nil, owner = nil, path = nil, reference_number = nil, resource = nil, service_address = nil, ship_from_address = nil, ship_to_address = nil, shipping_status = nil, short_description = nil, state = nil, status = nil, tax_amount = nil, terms = nil, type = nil, vat_amount = nil, vat_rate = nil, api_version = nil) @alternate_tax_amount = alternate_tax_amount @alternate_tax_id = alternate_tax_id @buyer = buyer @create_time = create_time @currency = currency @customer_reference_number = customer_reference_number @delivery_type = delivery_type @discount_amount = discount_amount @duty_amount = duty_amount @freight_amount = freight_amount @grand_total_amount = grand_total_amount @id = id @line_items = line_items @long_description = long_description @notes = notes @owner = owner @path = path @reference_number = reference_number @resource = resource @service_address = service_address @ship_from_address = ship_from_address @ship_to_address = ship_to_address @shipping_status = shipping_status @short_description = short_description @state = state @status = status @tax_amount = tax_amount @terms = terms @type = type @vat_amount = vat_amount @vat_rate = vat_rate @api_version = api_version end