Class: WalmartApIs::PricingInsightsResponseList

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/walmart_ap_is/models/pricing_insights_response_list.rb

Overview

PricingInsightsResponseList 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(item_name:, sku:, current_price:, buy_box_base_price:, buy_box_total_price:, buy_box_win_rate:, competitor_price:, comparison_price:, fulfillment:, inventory_count:, repricer_strategy_type:, repricer_strategy_name:, repricer_status:, repricer_min_price:, repricer_max_price:, price_competitive_score:, promo_status:, potential_gmv_lift:, gmv30:, in_demand:, price_differential:, traffic:, price_competitive:, reduced_referral_status:, walmart_funded_status:, additional_properties: nil) ⇒ PricingInsightsResponseList

Returns a new instance of PricingInsightsResponseList.



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
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 165

def initialize(item_name:, sku:, current_price:, buy_box_base_price:,
               buy_box_total_price:, buy_box_win_rate:, competitor_price:,
               comparison_price:, fulfillment:, inventory_count:,
               repricer_strategy_type:, repricer_strategy_name:,
               repricer_status:, repricer_min_price:, repricer_max_price:,
               price_competitive_score:, promo_status:, potential_gmv_lift:,
               gmv30:, in_demand:, price_differential:, traffic:,
               price_competitive:, reduced_referral_status:,
               walmart_funded_status:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @item_name = item_name
  @sku = sku
  @current_price = current_price
  @buy_box_base_price = buy_box_base_price
  @buy_box_total_price = buy_box_total_price
  @buy_box_win_rate = buy_box_win_rate
  @competitor_price = competitor_price
  @comparison_price = comparison_price
  @fulfillment = fulfillment
  @inventory_count = inventory_count
  @repricer_strategy_type = repricer_strategy_type
  @repricer_strategy_name = repricer_strategy_name
  @repricer_status = repricer_status
  @repricer_min_price = repricer_min_price
  @repricer_max_price = repricer_max_price
  @price_competitive_score = price_competitive_score
  @promo_status = promo_status
  @potential_gmv_lift = potential_gmv_lift
  @gmv30 = gmv30
  @in_demand = in_demand
  @price_differential = price_differential
  @traffic = traffic
  @price_competitive = price_competitive
  @reduced_referral_status = reduced_referral_status
  @walmart_funded_status = walmart_funded_status
  @additional_properties = additional_properties
end

Instance Attribute Details

#buy_box_base_priceFloat

TODO: Write general description for this method

Returns:

  • (Float)


26
27
28
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 26

def buy_box_base_price
  @buy_box_base_price
end

#buy_box_total_priceFloat

TODO: Write general description for this method

Returns:

  • (Float)


30
31
32
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 30

def buy_box_total_price
  @buy_box_total_price
end

#buy_box_win_rateString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 34

def buy_box_win_rate
  @buy_box_win_rate
end

#comparison_priceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


42
43
44
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 42

def comparison_price
  @comparison_price
end

#competitor_priceFloat

TODO: Write general description for this method

Returns:

  • (Float)


38
39
40
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 38

def competitor_price
  @competitor_price
end

#current_priceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 22

def current_price
  @current_price
end

#fulfillmentString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 46

def fulfillment
  @fulfillment
end

#gmv30Integer

TODO: Write general description for this method

Returns:

  • (Integer)


86
87
88
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 86

def gmv30
  @gmv30
end

#in_demandTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


90
91
92
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 90

def in_demand
  @in_demand
end

#inventory_countString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 50

def inventory_count
  @inventory_count
end

#item_nameString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 14

def item_name
  @item_name
end

#potential_gmv_liftString

TODO: Write general description for this method

Returns:

  • (String)


82
83
84
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 82

def potential_gmv_lift
  @potential_gmv_lift
end

#price_competitiveTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


102
103
104
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 102

def price_competitive
  @price_competitive
end

#price_competitive_scoreInteger

TODO: Write general description for this method

Returns:

  • (Integer)


74
75
76
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 74

def price_competitive_score
  @price_competitive_score
end

#price_differentialString

TODO: Write general description for this method

Returns:

  • (String)


94
95
96
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 94

def price_differential
  @price_differential
end

#promo_statusString

TODO: Write general description for this method

Returns:

  • (String)


78
79
80
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 78

def promo_status
  @promo_status
end

#reduced_referral_statusString

TODO: Write general description for this method

Returns:

  • (String)


106
107
108
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 106

def reduced_referral_status
  @reduced_referral_status
end

#repricer_max_priceString

TODO: Write general description for this method

Returns:

  • (String)


70
71
72
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 70

def repricer_max_price
  @repricer_max_price
end

#repricer_min_priceString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 66

def repricer_min_price
  @repricer_min_price
end

#repricer_statusString

TODO: Write general description for this method

Returns:

  • (String)


62
63
64
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 62

def repricer_status
  @repricer_status
end

#repricer_strategy_nameString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 58

def repricer_strategy_name
  @repricer_strategy_name
end

#repricer_strategy_typeString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 54

def repricer_strategy_type
  @repricer_strategy_type
end

#skuString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 18

def sku
  @sku
end

#trafficString

TODO: Write general description for this method

Returns:

  • (String)


98
99
100
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 98

def traffic
  @traffic
end

#walmart_funded_statusString

TODO: Write general description for this method

Returns:

  • (String)


110
111
112
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 110

def walmart_funded_status
  @walmart_funded_status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 206

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  item_name = hash.key?('itemName') ? hash['itemName'] : nil
  sku = hash.key?('sku') ? hash['sku'] : nil
  current_price = hash.key?('currentPrice') ? hash['currentPrice'] : nil
  buy_box_base_price =
    hash.key?('buyBoxBasePrice') ? hash['buyBoxBasePrice'] : nil
  buy_box_total_price =
    hash.key?('buyBoxTotalPrice') ? hash['buyBoxTotalPrice'] : nil
  buy_box_win_rate =
    hash.key?('buyBoxWinRate') ? hash['buyBoxWinRate'] : nil
  competitor_price =
    hash.key?('competitorPrice') ? hash['competitorPrice'] : nil
  comparison_price =
    hash.key?('comparisonPrice') ? hash['comparisonPrice'] : nil
  fulfillment = hash.key?('fulfillment') ? hash['fulfillment'] : nil
  inventory_count =
    hash.key?('inventoryCount') ? hash['inventoryCount'] : nil
  repricer_strategy_type =
    hash.key?('repricerStrategyType') ? hash['repricerStrategyType'] : nil
  repricer_strategy_name =
    hash.key?('repricerStrategyName') ? hash['repricerStrategyName'] : nil
  repricer_status =
    hash.key?('repricerStatus') ? hash['repricerStatus'] : nil
  repricer_min_price =
    hash.key?('repricerMinPrice') ? hash['repricerMinPrice'] : nil
  repricer_max_price =
    hash.key?('repricerMaxPrice') ? hash['repricerMaxPrice'] : nil
  price_competitive_score =
    hash.key?('priceCompetitiveScore') ? hash['priceCompetitiveScore'] : nil
  promo_status = hash.key?('promoStatus') ? hash['promoStatus'] : nil
  potential_gmv_lift =
    hash.key?('potentialGmvLift') ? hash['potentialGmvLift'] : nil
  gmv30 = hash.key?('gmv30') ? hash['gmv30'] : nil
  in_demand = hash.key?('inDemand') ? hash['inDemand'] : nil
  price_differential =
    hash.key?('priceDifferential') ? hash['priceDifferential'] : nil
  traffic = hash.key?('traffic') ? hash['traffic'] : nil
  price_competitive =
    hash.key?('priceCompetitive') ? hash['priceCompetitive'] : nil
  reduced_referral_status =
    hash.key?('reducedReferralStatus') ? hash['reducedReferralStatus'] : nil
  walmart_funded_status =
    hash.key?('walmartFundedStatus') ? hash['walmartFundedStatus'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  PricingInsightsResponseList.new(item_name: item_name,
                                  sku: sku,
                                  current_price: current_price,
                                  buy_box_base_price: buy_box_base_price,
                                  buy_box_total_price: buy_box_total_price,
                                  buy_box_win_rate: buy_box_win_rate,
                                  competitor_price: competitor_price,
                                  comparison_price: comparison_price,
                                  fulfillment: fulfillment,
                                  inventory_count: inventory_count,
                                  repricer_strategy_type: repricer_strategy_type,
                                  repricer_strategy_name: repricer_strategy_name,
                                  repricer_status: repricer_status,
                                  repricer_min_price: repricer_min_price,
                                  repricer_max_price: repricer_max_price,
                                  price_competitive_score: price_competitive_score,
                                  promo_status: promo_status,
                                  potential_gmv_lift: potential_gmv_lift,
                                  gmv30: gmv30,
                                  in_demand: in_demand,
                                  price_differential: price_differential,
                                  traffic: traffic,
                                  price_competitive: price_competitive,
                                  reduced_referral_status: reduced_referral_status,
                                  walmart_funded_status: walmart_funded_status,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 113

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['item_name'] = 'itemName'
  @_hash['sku'] = 'sku'
  @_hash['current_price'] = 'currentPrice'
  @_hash['buy_box_base_price'] = 'buyBoxBasePrice'
  @_hash['buy_box_total_price'] = 'buyBoxTotalPrice'
  @_hash['buy_box_win_rate'] = 'buyBoxWinRate'
  @_hash['competitor_price'] = 'competitorPrice'
  @_hash['comparison_price'] = 'comparisonPrice'
  @_hash['fulfillment'] = 'fulfillment'
  @_hash['inventory_count'] = 'inventoryCount'
  @_hash['repricer_strategy_type'] = 'repricerStrategyType'
  @_hash['repricer_strategy_name'] = 'repricerStrategyName'
  @_hash['repricer_status'] = 'repricerStatus'
  @_hash['repricer_min_price'] = 'repricerMinPrice'
  @_hash['repricer_max_price'] = 'repricerMaxPrice'
  @_hash['price_competitive_score'] = 'priceCompetitiveScore'
  @_hash['promo_status'] = 'promoStatus'
  @_hash['potential_gmv_lift'] = 'potentialGmvLift'
  @_hash['gmv30'] = 'gmv30'
  @_hash['in_demand'] = 'inDemand'
  @_hash['price_differential'] = 'priceDifferential'
  @_hash['traffic'] = 'traffic'
  @_hash['price_competitive'] = 'priceCompetitive'
  @_hash['reduced_referral_status'] = 'reducedReferralStatus'
  @_hash['walmart_funded_status'] = 'walmartFundedStatus'
  @_hash
end

.nullablesObject

An array for nullable fields



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 149

def self.nullables
  %w[
    inventory_count
    repricer_strategy_type
    repricer_strategy_name
    repricer_status
    repricer_min_price
    repricer_max_price
    promo_status
    potential_gmv_lift
    price_differential
    traffic
    reduced_referral_status
  ]
end

.optionalsObject

An array for optional fields



144
145
146
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 144

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 308

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} item_name: #{@item_name.inspect}, sku: #{@sku.inspect}, current_price:"\
  " #{@current_price.inspect}, buy_box_base_price: #{@buy_box_base_price.inspect},"\
  " buy_box_total_price: #{@buy_box_total_price.inspect}, buy_box_win_rate:"\
  " #{@buy_box_win_rate.inspect}, competitor_price: #{@competitor_price.inspect},"\
  " comparison_price: #{@comparison_price.inspect}, fulfillment: #{@fulfillment.inspect},"\
  " inventory_count: #{@inventory_count.inspect}, repricer_strategy_type:"\
  " #{@repricer_strategy_type.inspect}, repricer_strategy_name:"\
  " #{@repricer_strategy_name.inspect}, repricer_status: #{@repricer_status.inspect},"\
  " repricer_min_price: #{@repricer_min_price.inspect}, repricer_max_price:"\
  " #{@repricer_max_price.inspect}, price_competitive_score:"\
  " #{@price_competitive_score.inspect}, promo_status: #{@promo_status.inspect},"\
  " potential_gmv_lift: #{@potential_gmv_lift.inspect}, gmv30: #{@gmv30.inspect}, in_demand:"\
  " #{@in_demand.inspect}, price_differential: #{@price_differential.inspect}, traffic:"\
  " #{@traffic.inspect}, price_competitive: #{@price_competitive.inspect},"\
  " reduced_referral_status: #{@reduced_referral_status.inspect}, walmart_funded_status:"\
  " #{@walmart_funded_status.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/walmart_ap_is/models/pricing_insights_response_list.rb', line 290

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} item_name: #{@item_name}, sku: #{@sku}, current_price: #{@current_price},"\
  " buy_box_base_price: #{@buy_box_base_price}, buy_box_total_price: #{@buy_box_total_price},"\
  " buy_box_win_rate: #{@buy_box_win_rate}, competitor_price: #{@competitor_price},"\
  " comparison_price: #{@comparison_price}, fulfillment: #{@fulfillment}, inventory_count:"\
  " #{@inventory_count}, repricer_strategy_type: #{@repricer_strategy_type},"\
  " repricer_strategy_name: #{@repricer_strategy_name}, repricer_status: #{@repricer_status},"\
  " repricer_min_price: #{@repricer_min_price}, repricer_max_price: #{@repricer_max_price},"\
  " price_competitive_score: #{@price_competitive_score}, promo_status: #{@promo_status},"\
  " potential_gmv_lift: #{@potential_gmv_lift}, gmv30: #{@gmv30}, in_demand: #{@in_demand},"\
  " price_differential: #{@price_differential}, traffic: #{@traffic}, price_competitive:"\
  " #{@price_competitive}, reduced_referral_status: #{@reduced_referral_status},"\
  " walmart_funded_status: #{@walmart_funded_status}, additional_properties:"\
  " #{@additional_properties}>"
end