Class: WalmartApIs::ReservedQuantity
- Defined in:
- lib/walmart_ap_is/models/reserved_quantity.rb
Overview
Breakdown of reserved quantities
Instance Attribute Summary collapse
-
#pending_customer_order_quantity ⇒ Integer
TODO: Write general description for this method.
-
#pending_transshipment_quantity ⇒ Integer
TODO: Write general description for this method.
-
#total_reserved_quantity ⇒ Integer
TODO: Write general description for this method.
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(total_reserved_quantity: SKIP, pending_customer_order_quantity: SKIP, pending_transshipment_quantity: SKIP, additional_properties: nil) ⇒ ReservedQuantity
constructor
A new instance of ReservedQuantity.
-
#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(total_reserved_quantity: SKIP, pending_customer_order_quantity: SKIP, pending_transshipment_quantity: SKIP, additional_properties: nil) ⇒ ReservedQuantity
Returns a new instance of ReservedQuantity.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 49 def initialize(total_reserved_quantity: SKIP, pending_customer_order_quantity: SKIP, pending_transshipment_quantity: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @total_reserved_quantity = total_reserved_quantity unless total_reserved_quantity == SKIP unless pending_customer_order_quantity == SKIP @pending_customer_order_quantity = pending_customer_order_quantity end unless pending_transshipment_quantity == SKIP @pending_transshipment_quantity = pending_transshipment_quantity end @additional_properties = additional_properties end |
Instance Attribute Details
#pending_customer_order_quantity ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 18 def pending_customer_order_quantity @pending_customer_order_quantity end |
#pending_transshipment_quantity ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 22 def pending_transshipment_quantity @pending_transshipment_quantity end |
#total_reserved_quantity ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 14 def total_reserved_quantity @total_reserved_quantity end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. total_reserved_quantity = hash.key?('totalReservedQuantity') ? hash['totalReservedQuantity'] : SKIP pending_customer_order_quantity = hash.key?('pendingCustomerOrderQuantity') ? hash['pendingCustomerOrderQuantity'] : SKIP pending_transshipment_quantity = hash.key?('pendingTransshipmentQuantity') ? hash['pendingTransshipmentQuantity'] : SKIP # 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. ReservedQuantity.new(total_reserved_quantity: total_reserved_quantity, pending_customer_order_quantity: pending_customer_order_quantity, pending_transshipment_quantity: pending_transshipment_quantity, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 32 33 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['total_reserved_quantity'] = 'totalReservedQuantity' @_hash['pending_customer_order_quantity'] = 'pendingCustomerOrderQuantity' @_hash['pending_transshipment_quantity'] = 'pendingTransshipmentQuantity' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 39 40 41 42 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 36 def self.optionals %w[ total_reserved_quantity pending_customer_order_quantity pending_transshipment_quantity ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 110 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} total_reserved_quantity: #{@total_reserved_quantity.inspect},"\ " pending_customer_order_quantity: #{@pending_customer_order_quantity.inspect},"\ " pending_transshipment_quantity: #{@pending_transshipment_quantity.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 100 101 |
# File 'lib/walmart_ap_is/models/reserved_quantity.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} total_reserved_quantity: #{@total_reserved_quantity},"\ " pending_customer_order_quantity: #{@pending_customer_order_quantity},"\ " pending_transshipment_quantity: #{@pending_transshipment_quantity}, additional_properties:"\ " #{@additional_properties}>" end |