Class: InventoryManagementAndItemManagementAndOrderManagementAndPriceManagement::ItemResponse

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

Overview

ItemResponse 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, availability = 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, variant_group_id = nil, variant_group_info = nil, is_duplicate = nil, duplicate_item_info = nil) ⇒ ItemResponse

Returns a new instance of ItemResponse.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item_response.rb', line 124

def initialize(sku = nil, mart = nil, condition = nil, availability = 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,
               variant_group_id = nil, variant_group_info = nil,
               is_duplicate = nil, duplicate_item_info = nil)
  @sku = sku
  @mart = mart
  @condition = condition
  @availability = availability
  @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
  @variant_group_id = variant_group_id
  @variant_group_info = variant_group_info
  @is_duplicate = is_duplicate
  @duplicate_item_info = duplicate_item_info
end

Instance Attribute Details

#additional_attributesAdditionalAttributes

TODO: Write general description for this method



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

def additional_attributes
  @additional_attributes
end

#availabilityString

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

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

def condition
  @condition
end

#duplicate_item_infoDuplicateItemInfo

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/item_response.rb', line 87

def duplicate_item_info
  @duplicate_item_info
end

#gtinString

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

def gtin
  @gtin
end

#is_duplicateString

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/item_response.rb', line 83

def is_duplicate
  @is_duplicate
end

#lifecycle_statusString

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

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

def mart
  @mart
end

#pricePrice1

TODO: Write general description for this method

Returns:



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

def price
  @price
end

#product_nameString

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

def product_name
  @product_name
end

#product_typeString

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/item_response.rb', line 51

def product_type
  @product_type
end

#published_statusString

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/item_response.rb', line 59

def published_status
  @published_status
end

#shelfString

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

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

def sku
  @sku
end

#unpublished_reasonsUnpublishedReasons

TODO: Write general description for this method

Returns:



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

def unpublished_reasons
  @unpublished_reasons
end

#upcString

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

def upc
  @upc
end

#variant_group_idString

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/item_response.rb', line 75

def variant_group_id
  @variant_group_id
end

#variant_group_infoVariantGroupInfo

TODO: Write general description for this method

Returns:



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

def variant_group_info
  @variant_group_info
end

#wpidString

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

def wpid
  @wpid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item_response.rb', line 153

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
  availability = hash.key?('availability') ? hash['availability'] : 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
  variant_group_id =
    hash.key?('variantGroupId') ? hash['variantGroupId'] : nil
  variant_group_info = VariantGroupInfo.from_hash(hash['variantGroupInfo']) if
    hash['variantGroupInfo']
  is_duplicate = hash.key?('isDuplicate') ? hash['isDuplicate'] : nil
  duplicate_item_info = DuplicateItemInfo.from_hash(hash['duplicateItemInfo']) if
    hash['duplicateItemInfo']

  # Create object from extracted values.
  ItemResponse.new(sku,
                   mart,
                   condition,
                   availability,
                   wpid,
                   upc,
                   gtin,
                   product_name,
                   shelf,
                   product_type,
                   price,
                   published_status,
                   additional_attributes,
                   unpublished_reasons,
                   lifecycle_status,
                   variant_group_id,
                   variant_group_info,
                   is_duplicate,
                   duplicate_item_info)
end

.namesObject

A mapping from model property names to API property names.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item_response.rb', line 90

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['sku'] = 'sku'
  @_hash['mart'] = 'mart'
  @_hash['condition'] = 'condition'
  @_hash['availability'] = 'availability'
  @_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['variant_group_id'] = 'variantGroupId'
  @_hash['variant_group_info'] = 'variantGroupInfo'
  @_hash['is_duplicate'] = 'isDuplicate'
  @_hash['duplicate_item_info'] = 'duplicateItemInfo'
  @_hash
end

.nullablesObject

An array for nullable fields



120
121
122
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item_response.rb', line 120

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item_response.rb', line 219

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} sku: #{@sku.inspect}, mart: #{@mart.inspect}, condition:"\
  " #{@condition.inspect}, availability: #{@availability.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}, variant_group_id:"\
  " #{@variant_group_id.inspect}, variant_group_info: #{@variant_group_info.inspect},"\
  " is_duplicate: #{@is_duplicate.inspect}, duplicate_item_info:"\
  " #{@duplicate_item_info.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



207
208
209
210
211
212
213
214
215
216
# File 'lib/inventory_management_and_item_management_and_order_management_and_price_management/models/item_response.rb', line 207

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} sku: #{@sku}, mart: #{@mart}, condition: #{@condition}, availability:"\
  " #{@availability}, 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},"\
  " variant_group_id: #{@variant_group_id}, variant_group_info: #{@variant_group_info},"\
  " is_duplicate: #{@is_duplicate}, duplicate_item_info: #{@duplicate_item_info}>"
end