Class: WalmartApIs::DetailedShippingTimeType
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::DetailedShippingTimeType
- Defined in:
- lib/walmart_ap_is/models/detailed_shipping_time_type.rb
Overview
The time range in which an item will likely be shipped once an order has been placed.
Instance Attribute Summary collapse
-
#availability_type ⇒ AvailabilityType
Indicates whether the item is available for shipping now, or on a known or an unknown date in the future.
-
#available_date ⇒ String
The date when the item will be available for shipping.
-
#maximum_hours ⇒ Integer
The maximum time, in hours, that the item will likely be shipped after the order has been placed.
-
#minimum_hours ⇒ Integer
The minimum time, in hours, that the item will likely be shipped after the order has been placed.
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(minimum_hours: SKIP, maximum_hours: SKIP, available_date: SKIP, availability_type: SKIP, additional_properties: nil) ⇒ DetailedShippingTimeType
constructor
A new instance of DetailedShippingTimeType.
-
#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(minimum_hours: SKIP, maximum_hours: SKIP, available_date: SKIP, availability_type: SKIP, additional_properties: nil) ⇒ DetailedShippingTimeType
Returns a new instance of DetailedShippingTimeType.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 57 def initialize(minimum_hours: SKIP, maximum_hours: SKIP, available_date: SKIP, availability_type: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @minimum_hours = minimum_hours unless minimum_hours == SKIP @maximum_hours = maximum_hours unless maximum_hours == SKIP @available_date = available_date unless available_date == SKIP @availability_type = availability_type unless availability_type == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#availability_type ⇒ AvailabilityType
Indicates whether the item is available for shipping now, or on a known or an unknown date in the future.
30 31 32 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 30 def availability_type @availability_type end |
#available_date ⇒ String
The date when the item will be available for shipping.
25 26 27 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 25 def available_date @available_date end |
#maximum_hours ⇒ Integer
The maximum time, in hours, that the item will likely be shipped after the order has been placed.
21 22 23 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 21 def maximum_hours @maximum_hours end |
#minimum_hours ⇒ Integer
The minimum time, in hours, that the item will likely be shipped after the order has been placed.
16 17 18 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 16 def minimum_hours @minimum_hours end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. minimum_hours = hash.key?('minimumHours') ? hash['minimumHours'] : SKIP maximum_hours = hash.key?('maximumHours') ? hash['maximumHours'] : SKIP available_date = hash.key?('availableDate') ? hash['availableDate'] : SKIP availability_type = hash.key?('availabilityType') ? hash['availabilityType'] : 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. DetailedShippingTimeType.new(minimum_hours: minimum_hours, maximum_hours: maximum_hours, available_date: available_date, availability_type: availability_type, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['minimum_hours'] = 'minimumHours' @_hash['maximum_hours'] = 'maximumHours' @_hash['available_date'] = 'availableDate' @_hash['availability_type'] = 'availabilityType' @_hash end |
.nullables ⇒ Object
An array for nullable fields
53 54 55 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 53 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 48 49 50 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 43 def self.optionals %w[ minimum_hours maximum_hours available_date availability_type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
105 106 107 108 109 110 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 105 def inspect class_name = self.class.name.split('::').last "<#{class_name} minimum_hours: #{@minimum_hours.inspect}, maximum_hours:"\ " #{@maximum_hours.inspect}, available_date: #{@available_date.inspect}, availability_type:"\ " #{@availability_type.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 102 |
# File 'lib/walmart_ap_is/models/detailed_shipping_time_type.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} minimum_hours: #{@minimum_hours}, maximum_hours: #{@maximum_hours},"\ " available_date: #{@available_date}, availability_type: #{@availability_type},"\ " additional_properties: #{@additional_properties}>" end |