Class: WalmartApIs::MskuPrepDetailInput
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::MskuPrepDetailInput
- Defined in:
- lib/walmart_ap_is/models/msku_prep_detail_input.rb
Overview
An MSKU and its related prep details (input).
Instance Attribute Summary collapse
-
#msku ⇒ String
The merchant SKU, a merchant-supplied identifier for a specific SKU.
-
#prep_category ⇒ PrepCategory
The preparation category for shipping an item to Walmart's fulfillment network.
-
#prep_types ⇒ Array[PrepType]
A list of preparation types associated with a preparation category.
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(msku:, prep_category:, prep_types:, additional_properties: nil) ⇒ MskuPrepDetailInput
constructor
A new instance of MskuPrepDetailInput.
-
#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(msku:, prep_category:, prep_types:, additional_properties: nil) ⇒ MskuPrepDetailInput
Returns a new instance of MskuPrepDetailInput.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 44 def initialize(msku:, prep_category:, prep_types:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @msku = msku @prep_category = prep_category @prep_types = prep_types @additional_properties = additional_properties end |
Instance Attribute Details
#msku ⇒ String
The merchant SKU, a merchant-supplied identifier for a specific SKU.
14 15 16 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 14 def msku @msku end |
#prep_category ⇒ PrepCategory
The preparation category for shipping an item to Walmart's fulfillment network.
19 20 21 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 19 def prep_category @prep_category end |
#prep_types ⇒ Array[PrepType]
A list of preparation types associated with a preparation category.
23 24 25 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 23 def prep_types @prep_types end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. msku = hash.key?('msku') ? hash['msku'] : nil prep_category = hash.key?('prepCategory') ? hash['prepCategory'] : nil prep_types = hash.key?('prepTypes') ? hash['prepTypes'] : 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. MskuPrepDetailInput.new(msku: msku, prep_category: prep_category, prep_types: prep_types, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['msku'] = 'msku' @_hash['prep_category'] = 'prepCategory' @_hash['prep_types'] = 'prepTypes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
40 41 42 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 40 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 35 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} msku: #{@msku.inspect}, prep_category: #{@prep_category.inspect},"\ " prep_types: #{@prep_types.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 83 |
# File 'lib/walmart_ap_is/models/msku_prep_detail_input.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} msku: #{@msku}, prep_category: #{@prep_category}, prep_types:"\ " #{@prep_types}, additional_properties: #{@additional_properties}>" end |