Class: WalmartApIs::FeaturedOfferExpectedPriceResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::FeaturedOfferExpectedPriceResult
- Defined in:
- lib/walmart_ap_is/models/featured_offer_expected_price_result.rb
Overview
The featured offer expected price result for a specific offer.
Instance Attribute Summary collapse
-
#competing_featured_offer ⇒ FeaturedOffer
A featured offer.
-
#current_featured_offer ⇒ FeaturedOffer
A featured offer.
-
#featured_offer_expected_price ⇒ FeaturedOfferExpectedPrice
The featured offer expected price for a given SKU.
-
#result_status ⇒ String
The status of the FOEP request.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(featured_offer_expected_price: SKIP, result_status: SKIP, competing_featured_offer: SKIP, current_featured_offer: SKIP, additional_properties: nil) ⇒ FeaturedOfferExpectedPriceResult
constructor
A new instance of FeaturedOfferExpectedPriceResult.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(featured_offer_expected_price: SKIP, result_status: SKIP, competing_featured_offer: SKIP, current_featured_offer: SKIP, additional_properties: nil) ⇒ FeaturedOfferExpectedPriceResult
Returns a new instance of FeaturedOfferExpectedPriceResult.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 53 def initialize(featured_offer_expected_price: SKIP, result_status: SKIP, competing_featured_offer: SKIP, current_featured_offer: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? unless featured_offer_expected_price == SKIP @featured_offer_expected_price = featured_offer_expected_price end @result_status = result_status unless result_status == SKIP @competing_featured_offer = competing_featured_offer unless competing_featured_offer == SKIP @current_featured_offer = current_featured_offer unless current_featured_offer == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#competing_featured_offer ⇒ FeaturedOffer
A featured offer.
22 23 24 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 22 def competing_featured_offer @competing_featured_offer end |
#current_featured_offer ⇒ FeaturedOffer
A featured offer.
26 27 28 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 26 def current_featured_offer @current_featured_offer end |
#featured_offer_expected_price ⇒ FeaturedOfferExpectedPrice
The featured offer expected price for a given SKU.
14 15 16 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 14 def featured_offer_expected_price @featured_offer_expected_price end |
#result_status ⇒ String
The status of the FOEP request.
18 19 20 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 18 def result_status @result_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. if hash['featuredOfferExpectedPrice'] featured_offer_expected_price = FeaturedOfferExpectedPrice.from_hash(hash['featuredOfferExpectedPrice']) end result_status = hash.key?('resultStatus') ? hash['resultStatus'] : SKIP competing_featured_offer = FeaturedOffer.from_hash(hash['competingFeaturedOffer']) if hash['competingFeaturedOffer'] current_featured_offer = FeaturedOffer.from_hash(hash['currentFeaturedOffer']) if hash['currentFeaturedOffer'] # 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. FeaturedOfferExpectedPriceResult.new(featured_offer_expected_price: featured_offer_expected_price, result_status: result_status, competing_featured_offer: competing_featured_offer, current_featured_offer: current_featured_offer, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['featured_offer_expected_price'] = 'featuredOfferExpectedPrice' @_hash['result_status'] = 'resultStatus' @_hash['competing_featured_offer'] = 'competingFeaturedOffer' @_hash['current_featured_offer'] = 'currentFeaturedOffer' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 39 def self.optionals %w[ featured_offer_expected_price result_status competing_featured_offer current_featured_offer ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 114 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} featured_offer_expected_price: #{@featured_offer_expected_price.inspect},"\ " result_status: #{@result_status.inspect}, competing_featured_offer:"\ " #{@competing_featured_offer.inspect}, current_featured_offer:"\ " #{@current_featured_offer.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
99 100 101 102 103 104 105 |
# File 'lib/walmart_ap_is/models/featured_offer_expected_price_result.rb', line 99 def to_s class_name = self.class.name.split('::').last "<#{class_name} featured_offer_expected_price: #{@featured_offer_expected_price},"\ " result_status: #{@result_status}, competing_featured_offer: #{@competing_featured_offer},"\ " current_featured_offer: #{@current_featured_offer}, additional_properties:"\ " #{@additional_properties}>" end |