Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::ResponseRecord

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

Overview

ResponseRecord 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(sku = nil, mart = nil, condition = nil, wpid = nil, upc = nil, gtin = nil, product_name = nil, shelf = nil, product_type = nil, price = nil, published_status = nil, additional_attributes = nil, unpublished_reasons = nil, lifecycle_status = nil, is_duplicate = nil, duplicate_itemdetails = nil) ⇒ ResponseRecord

Returns a new instance of ResponseRecord.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 109

def initialize(sku = nil, mart = nil, condition = nil, wpid = nil,
               upc = nil, gtin = nil, product_name = nil, shelf = nil,
               product_type = nil, price = nil, published_status = nil,
               additional_attributes = nil, unpublished_reasons = nil,
               lifecycle_status = nil, is_duplicate = nil,
               duplicate_itemdetails = nil)
  @sku = sku
  @mart = mart
  @condition = condition
  @wpid = wpid
  @upc = upc
  @gtin = gtin
  @product_name = product_name
  @shelf = shelf
  @product_type = product_type
  @price = price
  @published_status = published_status
  @additional_attributes = additional_attributes
  @unpublished_reasons = unpublished_reasons
  @lifecycle_status = lifecycle_status
  @is_duplicate = is_duplicate
  @duplicate_itemdetails = duplicate_itemdetails
end

Instance Attribute Details

#additional_attributesAdditionalAttributes

TODO: Write general description for this method



59
60
61
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 59

def additional_attributes
  @additional_attributes
end

#conditionString

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/response_record.rb', line 23

def condition
  @condition
end

#duplicate_itemdetailsDuplicateItemdetails

TODO: Write general description for this method



75
76
77
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 75

def duplicate_itemdetails
  @duplicate_itemdetails
end

#gtinString

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/response_record.rb', line 35

def gtin
  @gtin
end

#is_duplicateString

TODO: Write general description for this method

Returns:

  • (String)


71
72
73
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 71

def is_duplicate
  @is_duplicate
end

#lifecycle_statusString

TODO: Write general description for this method

Returns:

  • (String)


67
68
69
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 67

def lifecycle_status
  @lifecycle_status
end

#martString

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/response_record.rb', line 19

def mart
  @mart
end

#pricePrice1

TODO: Write general description for this method

Returns:



51
52
53
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 51

def price
  @price
end

#product_nameString

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/response_record.rb', line 39

def product_name
  @product_name
end

#product_typeString

TODO: Write general description for this method

Returns:

  • (String)


47
48
49
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 47

def product_type
  @product_type
end

#published_statusString

TODO: Write general description for this method

Returns:

  • (String)


55
56
57
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 55

def published_status
  @published_status
end

#shelfString

TODO: Write general description for this method

Returns:

  • (String)


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

def shelf
  @shelf
end

#skuString

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/response_record.rb', line 15

def sku
  @sku
end

#unpublished_reasonsUnpublishedReasons

TODO: Write general description for this method

Returns:



63
64
65
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 63

def unpublished_reasons
  @unpublished_reasons
end

#upcString

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/response_record.rb', line 31

def upc
  @upc
end

#wpidString

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/response_record.rb', line 27

def wpid
  @wpid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 134

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  sku = hash.key?('sku') ? hash['sku'] : nil
  mart = hash.key?('mart') ? hash['mart'] : nil
  condition = hash.key?('condition') ? hash['condition'] : nil
  wpid = hash.key?('wpid') ? hash['wpid'] : nil
  upc = hash.key?('upc') ? hash['upc'] : nil
  gtin = hash.key?('gtin') ? hash['gtin'] : nil
  product_name = hash.key?('productName') ? hash['productName'] : nil
  shelf = hash.key?('shelf') ? hash['shelf'] : nil
  product_type = hash.key?('productType') ? hash['productType'] : nil
  price = Price1.from_hash(hash['price']) if hash['price']
  published_status =
    hash.key?('publishedStatus') ? hash['publishedStatus'] : nil
  additional_attributes = AdditionalAttributes.from_hash(hash['additionalAttributes']) if
    hash['additionalAttributes']
  unpublished_reasons = UnpublishedReasons.from_hash(hash['unpublishedReasons']) if
    hash['unpublishedReasons']
  lifecycle_status =
    hash.key?('lifecycleStatus') ? hash['lifecycleStatus'] : nil
  is_duplicate = hash.key?('isDuplicate') ? hash['isDuplicate'] : nil
  duplicate_itemdetails = DuplicateItemdetails.from_hash(hash['duplicateItemdetails']) if
    hash['duplicateItemdetails']

  # Create object from extracted values.
  ResponseRecord.new(sku,
                     mart,
                     condition,
                     wpid,
                     upc,
                     gtin,
                     product_name,
                     shelf,
                     product_type,
                     price,
                     published_status,
                     additional_attributes,
                     unpublished_reasons,
                     lifecycle_status,
                     is_duplicate,
                     duplicate_itemdetails)
end

.namesObject

A mapping from model property names to API property names.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 78

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['sku'] = 'sku'
  @_hash['mart'] = 'mart'
  @_hash['condition'] = 'condition'
  @_hash['wpid'] = 'wpid'
  @_hash['upc'] = 'upc'
  @_hash['gtin'] = 'gtin'
  @_hash['product_name'] = 'productName'
  @_hash['shelf'] = 'shelf'
  @_hash['product_type'] = 'productType'
  @_hash['price'] = 'price'
  @_hash['published_status'] = 'publishedStatus'
  @_hash['additional_attributes'] = 'additionalAttributes'
  @_hash['unpublished_reasons'] = 'unpublishedReasons'
  @_hash['lifecycle_status'] = 'lifecycleStatus'
  @_hash['is_duplicate'] = 'isDuplicate'
  @_hash['duplicate_itemdetails'] = 'duplicateItemdetails'
  @_hash
end

.nullablesObject

An array for nullable fields



105
106
107
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 105

def self.nullables
  []
end

.optionalsObject

An array for optional fields



100
101
102
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 100

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



191
192
193
194
195
196
197
198
199
200
201
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 191

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} sku: #{@sku.inspect}, mart: #{@mart.inspect}, condition:"\
  " #{@condition.inspect}, wpid: #{@wpid.inspect}, upc: #{@upc.inspect}, gtin:"\
  " #{@gtin.inspect}, product_name: #{@product_name.inspect}, shelf: #{@shelf.inspect},"\
  " product_type: #{@product_type.inspect}, price: #{@price.inspect}, published_status:"\
  " #{@published_status.inspect}, additional_attributes: #{@additional_attributes.inspect},"\
  " unpublished_reasons: #{@unpublished_reasons.inspect}, lifecycle_status:"\
  " #{@lifecycle_status.inspect}, is_duplicate: #{@is_duplicate.inspect},"\
  " duplicate_itemdetails: #{@duplicate_itemdetails.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



180
181
182
183
184
185
186
187
188
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/response_record.rb', line 180

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} sku: #{@sku}, mart: #{@mart}, condition: #{@condition}, wpid: #{@wpid},"\
  " upc: #{@upc}, gtin: #{@gtin}, product_name: #{@product_name}, shelf: #{@shelf},"\
  " product_type: #{@product_type}, price: #{@price}, published_status: #{@published_status},"\
  " additional_attributes: #{@additional_attributes}, unpublished_reasons:"\
  " #{@unpublished_reasons}, lifecycle_status: #{@lifecycle_status}, is_duplicate:"\
  " #{@is_duplicate}, duplicate_itemdetails: #{@duplicate_itemdetails}>"
end