Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::DestinationItem

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb

Overview

DestinationItem Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(mart = nil, wpid = nil, gtin = nil, upc = nil, item_id = nil, product_name = nil, product_type = nil, additional_attributes = nil) ⇒ DestinationItem

Returns a new instance of DestinationItem.



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 69

def initialize(mart = nil, wpid = nil, gtin = nil, upc = nil, item_id = nil,
               product_name = nil, product_type = nil,
               additional_attributes = nil)
  @mart = mart
  @wpid = wpid
  @gtin = gtin
  @upc = upc
  @item_id = item_id
  @product_name = product_name
  @product_type = product_type
  @additional_attributes = additional_attributes
end

Instance Attribute Details

#additional_attributesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


43
44
45
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 43

def additional_attributes
  @additional_attributes
end

#gtinString

TODO: Write general description for this method

Returns:

  • (String)


23
24
25
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 23

def gtin
  @gtin
end

#item_idString

TODO: Write general description for this method

Returns:

  • (String)


31
32
33
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 31

def item_id
  @item_id
end

#martString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 15

def mart
  @mart
end

#product_nameString

TODO: Write general description for this method

Returns:

  • (String)


35
36
37
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 35

def product_name
  @product_name
end

#product_typeString

TODO: Write general description for this method

Returns:

  • (String)


39
40
41
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 39

def product_type
  @product_type
end

#upcString

TODO: Write general description for this method

Returns:

  • (String)


27
28
29
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 27

def upc
  @upc
end

#wpidString

TODO: Write general description for this method

Returns:

  • (String)


19
20
21
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 19

def wpid
  @wpid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 83

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mart = hash.key?('mart') ? hash['mart'] : nil
  wpid = hash.key?('wpid') ? hash['wpid'] : nil
  gtin = hash.key?('gtin') ? hash['gtin'] : nil
  upc = hash.key?('upc') ? hash['upc'] : nil
  item_id = hash.key?('itemId') ? hash['itemId'] : nil
  product_name = hash.key?('productName') ? hash['productName'] : nil
  product_type = hash.key?('productType') ? hash['productType'] : nil
  additional_attributes =
    hash.key?('additionalAttributes') ? hash['additionalAttributes'] : nil

  # Create object from extracted values.
  DestinationItem.new(mart,
                      wpid,
                      gtin,
                      upc,
                      item_id,
                      product_name,
                      product_type,
                      additional_attributes)
end

.namesObject

A mapping from model property names to API property names.



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 46

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mart'] = 'mart'
  @_hash['wpid'] = 'wpid'
  @_hash['gtin'] = 'gtin'
  @_hash['upc'] = 'upc'
  @_hash['item_id'] = 'itemId'
  @_hash['product_name'] = 'productName'
  @_hash['product_type'] = 'productType'
  @_hash['additional_attributes'] = 'additionalAttributes'
  @_hash
end

.nullablesObject

An array for nullable fields



65
66
67
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 65

def self.nullables
  []
end

.optionalsObject

An array for optional fields



60
61
62
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 60

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



117
118
119
120
121
122
123
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 117

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mart: #{@mart.inspect}, wpid: #{@wpid.inspect}, gtin: #{@gtin.inspect},"\
  " upc: #{@upc.inspect}, item_id: #{@item_id.inspect}, product_name:"\
  " #{@product_name.inspect}, product_type: #{@product_type.inspect}, additional_attributes:"\
  " #{@additional_attributes.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



109
110
111
112
113
114
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/destination_item.rb', line 109

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mart: #{@mart}, wpid: #{@wpid}, gtin: #{@gtin}, upc: #{@upc}, item_id:"\
  " #{@item_id}, product_name: #{@product_name}, product_type: #{@product_type},"\
  " additional_attributes: #{@additional_attributes}>"
end