Class: WalmartApIs::FulfillmentPreviewShipment
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::FulfillmentPreviewShipment
- Defined in:
- lib/walmart_ap_is/models/fulfillment_preview_shipment.rb
Overview
FulfillmentPreviewShipment Model.
Instance Attribute Summary collapse
-
#earliest_arrival_date ⇒ DateTime
TODO: Write general description for this method.
-
#earliest_ship_date ⇒ DateTime
TODO: Write general description for this method.
-
#latest_arrival_date ⇒ DateTime
TODO: Write general description for this method.
-
#latest_ship_date ⇒ DateTime
TODO: Write general description for this method.
-
#shipping_notes ⇒ Array[String]
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(earliest_ship_date: SKIP, latest_ship_date: SKIP, earliest_arrival_date: SKIP, latest_arrival_date: SKIP, shipping_notes: SKIP, additional_properties: nil) ⇒ FulfillmentPreviewShipment
constructor
A new instance of FulfillmentPreviewShipment.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_earliest_arrival_date ⇒ Object
- #to_custom_earliest_ship_date ⇒ Object
- #to_custom_latest_arrival_date ⇒ Object
- #to_custom_latest_ship_date ⇒ Object
-
#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(earliest_ship_date: SKIP, latest_ship_date: SKIP, earliest_arrival_date: SKIP, latest_arrival_date: SKIP, shipping_notes: SKIP, additional_properties: nil) ⇒ FulfillmentPreviewShipment
Returns a new instance of FulfillmentPreviewShipment.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 60 def initialize(earliest_ship_date: SKIP, latest_ship_date: SKIP, earliest_arrival_date: SKIP, latest_arrival_date: SKIP, shipping_notes: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @earliest_ship_date = earliest_ship_date unless earliest_ship_date == SKIP @latest_ship_date = latest_ship_date unless latest_ship_date == SKIP @earliest_arrival_date = earliest_arrival_date unless earliest_arrival_date == SKIP @latest_arrival_date = latest_arrival_date unless latest_arrival_date == SKIP @shipping_notes = shipping_notes unless shipping_notes == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#earliest_arrival_date ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 23 def earliest_arrival_date @earliest_arrival_date end |
#earliest_ship_date ⇒ DateTime
TODO: Write general description for this method
15 16 17 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 15 def earliest_ship_date @earliest_ship_date end |
#latest_arrival_date ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 27 def latest_arrival_date @latest_arrival_date end |
#latest_ship_date ⇒ DateTime
TODO: Write general description for this method
19 20 21 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 19 def latest_ship_date @latest_ship_date end |
#shipping_notes ⇒ Array[String]
TODO: Write general description for this method
31 32 33 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 31 def shipping_notes @shipping_notes end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. earliest_ship_date = if hash.key?('earliestShipDate') (DateTimeHelper.from_rfc3339(hash['earliestShipDate']) if hash['earliestShipDate']) else SKIP end latest_ship_date = if hash.key?('latestShipDate') (DateTimeHelper.from_rfc3339(hash['latestShipDate']) if hash['latestShipDate']) else SKIP end earliest_arrival_date = if hash.key?('earliestArrivalDate') (DateTimeHelper.from_rfc3339(hash['earliestArrivalDate']) if hash['earliestArrivalDate']) else SKIP end latest_arrival_date = if hash.key?('latestArrivalDate') (DateTimeHelper.from_rfc3339(hash['latestArrivalDate']) if hash['latestArrivalDate']) else SKIP end shipping_notes = hash.key?('shippingNotes') ? hash['shippingNotes'] : 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. FulfillmentPreviewShipment.new(earliest_ship_date: earliest_ship_date, latest_ship_date: latest_ship_date, earliest_arrival_date: earliest_arrival_date, latest_arrival_date: latest_arrival_date, shipping_notes: shipping_notes, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['earliest_ship_date'] = 'earliestShipDate' @_hash['latest_ship_date'] = 'latestShipDate' @_hash['earliest_arrival_date'] = 'earliestArrivalDate' @_hash['latest_arrival_date'] = 'latestArrivalDate' @_hash['shipping_notes'] = 'shippingNotes' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 45 def self.optionals %w[ earliest_ship_date latest_ship_date earliest_arrival_date latest_arrival_date shipping_notes ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
143 144 145 146 147 148 149 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 143 def inspect class_name = self.class.name.split('::').last "<#{class_name} earliest_ship_date: #{@earliest_ship_date.inspect}, latest_ship_date:"\ " #{@latest_ship_date.inspect}, earliest_arrival_date: #{@earliest_arrival_date.inspect},"\ " latest_arrival_date: #{@latest_arrival_date.inspect}, shipping_notes:"\ " #{@shipping_notes.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_earliest_arrival_date ⇒ Object
125 126 127 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 125 def to_custom_earliest_arrival_date DateTimeHelper.to_rfc3339(earliest_arrival_date) end |
#to_custom_earliest_ship_date ⇒ Object
117 118 119 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 117 def to_custom_earliest_ship_date DateTimeHelper.to_rfc3339(earliest_ship_date) end |
#to_custom_latest_arrival_date ⇒ Object
129 130 131 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 129 def to_custom_latest_arrival_date DateTimeHelper.to_rfc3339(latest_arrival_date) end |
#to_custom_latest_ship_date ⇒ Object
121 122 123 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 121 def to_custom_latest_ship_date DateTimeHelper.to_rfc3339(latest_ship_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
134 135 136 137 138 139 140 |
# File 'lib/walmart_ap_is/models/fulfillment_preview_shipment.rb', line 134 def to_s class_name = self.class.name.split('::').last "<#{class_name} earliest_ship_date: #{@earliest_ship_date}, latest_ship_date:"\ " #{@latest_ship_date}, earliest_arrival_date: #{@earliest_arrival_date},"\ " latest_arrival_date: #{@latest_arrival_date}, shipping_notes: #{@shipping_notes},"\ " additional_properties: #{@additional_properties}>" end |