Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::Payload1

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

Overview

Payload1 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, sku = nil, condition = nil, wpid = nil, upc = nil, isbn = nil, ean = nil, gtin = nil, item_id = nil, product_name = nil, shelf = nil, product_type = nil, price = nil, brand = nil, num_reviews = nil, customer_rating = nil, manufacturer = nil, fulfillment_type = nil, published_status = nil, inventory_status = nil, lifecycle_status = nil, shop_ref = nil, shop_product_id = nil, shop_variant_id = nil, variant_group_id = nil, variant_group_info = nil) ⇒ Payload1

Returns a new instance of Payload1.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 159

def initialize(mart = nil, sku = nil, condition = nil, wpid = nil,
               upc = nil, isbn = nil, ean = nil, gtin = nil, item_id = nil,
               product_name = nil, shelf = nil, product_type = nil,
               price = nil, brand = nil, num_reviews = nil,
               customer_rating = nil, manufacturer = nil,
               fulfillment_type = nil, published_status = nil,
               inventory_status = nil, lifecycle_status = nil,
               shop_ref = nil, shop_product_id = nil, shop_variant_id = nil,
               variant_group_id = nil, variant_group_info = nil)
  @mart = mart
  @sku = sku
  @condition = condition
  @wpid = wpid
  @upc = upc
  @isbn = isbn
  @ean = ean
  @gtin = gtin
  @item_id = item_id
  @product_name = product_name
  @shelf = shelf
  @product_type = product_type
  @price = price
  @brand = brand
  @num_reviews = num_reviews
  @customer_rating = customer_rating
  @manufacturer = manufacturer
  @fulfillment_type = fulfillment_type
  @published_status = published_status
  @inventory_status = inventory_status
  @lifecycle_status = lifecycle_status
  @shop_ref = shop_ref
  @shop_product_id = shop_product_id
  @shop_variant_id = shop_variant_id
  @variant_group_id = variant_group_id
  @variant_group_info = variant_group_info
end

Instance Attribute Details

#brandString

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/payload1.rb', line 67

def brand
  @brand
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/payload1.rb', line 23

def condition
  @condition
end

#customer_ratingString

TODO: Write general description for this method

Returns:

  • (String)


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

def customer_rating
  @customer_rating
end

#eanString

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

def ean
  @ean
end

#fulfillment_typeString

TODO: Write general description for this method

Returns:

  • (String)


83
84
85
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 83

def fulfillment_type
  @fulfillment_type
end

#gtinString

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/payload1.rb', line 43

def gtin
  @gtin
end

#inventory_statusString

TODO: Write general description for this method

Returns:

  • (String)


91
92
93
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 91

def inventory_status
  @inventory_status
end

#isbnString

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

def isbn
  @isbn
end

#item_idString

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/payload1.rb', line 47

def item_id
  @item_id
end

#lifecycle_statusString

TODO: Write general description for this method

Returns:

  • (String)


95
96
97
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 95

def lifecycle_status
  @lifecycle_status
end

#manufacturerString

TODO: Write general description for this method

Returns:

  • (String)


79
80
81
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 79

def manufacturer
  @manufacturer
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/payload1.rb', line 15

def mart
  @mart
end

#num_reviewsString

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/payload1.rb', line 71

def num_reviews
  @num_reviews
end

#priceQuantity

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/payload1.rb', line 63

def price
  @price
end

#product_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def product_name
  @product_name
end

#product_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def product_type
  @product_type
end

#published_statusPublishedStatus

TODO: Write general description for this method

Returns:



87
88
89
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 87

def published_status
  @published_status
end

#shelfString

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/payload1.rb', line 55

def shelf
  @shelf
end

#shop_product_idString

TODO: Write general description for this method

Returns:

  • (String)


103
104
105
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 103

def shop_product_id
  @shop_product_id
end

#shop_refString

TODO: Write general description for this method

Returns:

  • (String)


99
100
101
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 99

def shop_ref
  @shop_ref
end

#shop_variant_idString

TODO: Write general description for this method

Returns:

  • (String)


107
108
109
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 107

def shop_variant_id
  @shop_variant_id
end

#skuString

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

def sku
  @sku
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/payload1.rb', line 31

def upc
  @upc
end

#variant_group_idString

TODO: Write general description for this method

Returns:

  • (String)


111
112
113
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 111

def variant_group_id
  @variant_group_id
end

#variant_group_infoVariantGroupInfo

TODO: Write general description for this method

Returns:



115
116
117
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 115

def variant_group_info
  @variant_group_info
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/payload1.rb', line 27

def wpid
  @wpid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 197

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mart = hash.key?('mart') ? hash['mart'] : nil
  sku = hash.key?('sku') ? hash['sku'] : nil
  condition = hash.key?('condition') ? hash['condition'] : nil
  wpid = hash.key?('wpid') ? hash['wpid'] : nil
  upc = hash.key?('upc') ? hash['upc'] : nil
  isbn = hash.key?('isbn') ? hash['isbn'] : nil
  ean = hash.key?('ean') ? hash['ean'] : nil
  gtin = hash.key?('gtin') ? hash['gtin'] : nil
  item_id = hash.key?('itemId') ? hash['itemId'] : 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 = Quantity.from_hash(hash['price']) if hash['price']
  brand = hash.key?('brand') ? hash['brand'] : nil
  num_reviews = hash.key?('num_reviews') ? hash['num_reviews'] : nil
  customer_rating =
    hash.key?('customerRating') ? hash['customerRating'] : nil
  manufacturer = hash.key?('manufacturer') ? hash['manufacturer'] : nil
  fulfillment_type =
    hash.key?('fulfillmentType') ? hash['fulfillmentType'] : nil
  published_status = PublishedStatus.from_hash(hash['publishedStatus']) if
    hash['publishedStatus']
  inventory_status =
    hash.key?('inventoryStatus') ? hash['inventoryStatus'] : nil
  lifecycle_status =
    hash.key?('lifecycleStatus') ? hash['lifecycleStatus'] : nil
  shop_ref = hash.key?('shop_ref') ? hash['shop_ref'] : nil
  shop_product_id =
    hash.key?('shop_product_id') ? hash['shop_product_id'] : nil
  shop_variant_id =
    hash.key?('shop_variant_id') ? hash['shop_variant_id'] : nil
  variant_group_id =
    hash.key?('variantGroupId') ? hash['variantGroupId'] : nil
  variant_group_info = VariantGroupInfo.from_hash(hash['variantGroupInfo']) if
    hash['variantGroupInfo']

  # Create object from extracted values.
  Payload1.new(mart,
               sku,
               condition,
               wpid,
               upc,
               isbn,
               ean,
               gtin,
               item_id,
               product_name,
               shelf,
               product_type,
               price,
               brand,
               num_reviews,
               customer_rating,
               manufacturer,
               fulfillment_type,
               published_status,
               inventory_status,
               lifecycle_status,
               shop_ref,
               shop_product_id,
               shop_variant_id,
               variant_group_id,
               variant_group_info)
end

.namesObject

A mapping from model property names to API property names.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 118

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['mart'] = 'mart'
  @_hash['sku'] = 'sku'
  @_hash['condition'] = 'condition'
  @_hash['wpid'] = 'wpid'
  @_hash['upc'] = 'upc'
  @_hash['isbn'] = 'isbn'
  @_hash['ean'] = 'ean'
  @_hash['gtin'] = 'gtin'
  @_hash['item_id'] = 'itemId'
  @_hash['product_name'] = 'productName'
  @_hash['shelf'] = 'shelf'
  @_hash['product_type'] = 'productType'
  @_hash['price'] = 'price'
  @_hash['brand'] = 'brand'
  @_hash['num_reviews'] = 'num_reviews'
  @_hash['customer_rating'] = 'customerRating'
  @_hash['manufacturer'] = 'manufacturer'
  @_hash['fulfillment_type'] = 'fulfillmentType'
  @_hash['published_status'] = 'publishedStatus'
  @_hash['inventory_status'] = 'inventoryStatus'
  @_hash['lifecycle_status'] = 'lifecycleStatus'
  @_hash['shop_ref'] = 'shop_ref'
  @_hash['shop_product_id'] = 'shop_product_id'
  @_hash['shop_variant_id'] = 'shop_variant_id'
  @_hash['variant_group_id'] = 'variantGroupId'
  @_hash['variant_group_info'] = 'variantGroupInfo'
  @_hash
end

.nullablesObject

An array for nullable fields



155
156
157
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 155

def self.nullables
  []
end

.optionalsObject

An array for optional fields



150
151
152
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 150

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 281

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} mart: #{@mart.inspect}, sku: #{@sku.inspect}, condition:"\
  " #{@condition.inspect}, wpid: #{@wpid.inspect}, upc: #{@upc.inspect}, isbn:"\
  " #{@isbn.inspect}, ean: #{@ean.inspect}, gtin: #{@gtin.inspect}, item_id:"\
  " #{@item_id.inspect}, product_name: #{@product_name.inspect}, shelf: #{@shelf.inspect},"\
  " product_type: #{@product_type.inspect}, price: #{@price.inspect}, brand:"\
  " #{@brand.inspect}, num_reviews: #{@num_reviews.inspect}, customer_rating:"\
  " #{@customer_rating.inspect}, manufacturer: #{@manufacturer.inspect}, fulfillment_type:"\
  " #{@fulfillment_type.inspect}, published_status: #{@published_status.inspect},"\
  " inventory_status: #{@inventory_status.inspect}, lifecycle_status:"\
  " #{@lifecycle_status.inspect}, shop_ref: #{@shop_ref.inspect}, shop_product_id:"\
  " #{@shop_product_id.inspect}, shop_variant_id: #{@shop_variant_id.inspect},"\
  " variant_group_id: #{@variant_group_id.inspect}, variant_group_info:"\
  " #{@variant_group_info.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/payload1.rb', line 267

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} mart: #{@mart}, sku: #{@sku}, condition: #{@condition}, wpid: #{@wpid},"\
  " upc: #{@upc}, isbn: #{@isbn}, ean: #{@ean}, gtin: #{@gtin}, item_id: #{@item_id},"\
  " product_name: #{@product_name}, shelf: #{@shelf}, product_type: #{@product_type}, price:"\
  " #{@price}, brand: #{@brand}, num_reviews: #{@num_reviews}, customer_rating:"\
  " #{@customer_rating}, manufacturer: #{@manufacturer}, fulfillment_type:"\
  " #{@fulfillment_type}, published_status: #{@published_status}, inventory_status:"\
  " #{@inventory_status}, lifecycle_status: #{@lifecycle_status}, shop_ref: #{@shop_ref},"\
  " shop_product_id: #{@shop_product_id}, shop_variant_id: #{@shop_variant_id},"\
  " variant_group_id: #{@variant_group_id}, variant_group_info: #{@variant_group_info}>"
end