Class: WalmartApIs::SetPrepDetailsRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::SetPrepDetailsRequest
- Defined in:
- lib/walmart_ap_is/models/set_prep_details_request.rb
Overview
The setPrepDetails request.
Instance Attribute Summary collapse
-
#marketplace_id ⇒ String
The Walmart Marketplace ID.
-
#msku_prep_details ⇒ Array[MskuPrepDetailInput]
A list of MSKUs and related prep details.
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(marketplace_id:, msku_prep_details:, additional_properties: nil) ⇒ SetPrepDetailsRequest
constructor
A new instance of SetPrepDetailsRequest.
-
#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(marketplace_id:, msku_prep_details:, additional_properties: nil) ⇒ SetPrepDetailsRequest
Returns a new instance of SetPrepDetailsRequest.
40 41 42 43 44 45 46 47 48 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 40 def initialize(marketplace_id:, msku_prep_details:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @marketplace_id = marketplace_id @msku_prep_details = msku_prep_details @additional_properties = additional_properties end |
Instance Attribute Details
#marketplace_id ⇒ String
The Walmart Marketplace ID. For a list of possible values, refer to Marketplace IDs.
16 17 18 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 16 def marketplace_id @marketplace_id end |
#msku_prep_details ⇒ Array[MskuPrepDetailInput]
A list of MSKUs and related prep details.
20 21 22 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 20 def msku_prep_details @msku_prep_details end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 51 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. marketplace_id = hash.key?('marketplaceId') ? hash['marketplaceId'] : nil # Parameter is an array, so we need to iterate through it msku_prep_details = nil unless hash['mskuPrepDetails'].nil? msku_prep_details = [] hash['mskuPrepDetails'].each do |structure| msku_prep_details << (MskuPrepDetailInput.from_hash(structure) if structure) end end msku_prep_details = nil unless hash.key?('mskuPrepDetails') # 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. SetPrepDetailsRequest.new(marketplace_id: marketplace_id, msku_prep_details: msku_prep_details, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
23 24 25 26 27 28 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 23 def self.names @_hash = {} if @_hash.nil? @_hash['marketplace_id'] = 'marketplaceId' @_hash['msku_prep_details'] = 'mskuPrepDetails' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
31 32 33 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 31 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} marketplace_id: #{@marketplace_id.inspect}, msku_prep_details:"\ " #{@msku_prep_details.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
81 82 83 84 85 |
# File 'lib/walmart_ap_is/models/set_prep_details_request.rb', line 81 def to_s class_name = self.class.name.split('::').last "<#{class_name} marketplace_id: #{@marketplace_id}, msku_prep_details:"\ " #{@msku_prep_details}, additional_properties: #{@additional_properties}>" end |