Class: WalmartApIs::UpdateShipmentStatusRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- WalmartApIs::UpdateShipmentStatusRequest
- Defined in:
- lib/walmart_ap_is/models/update_shipment_status_request.rb
Overview
UpdateShipmentStatusRequest Model.
Instance Attribute Summary collapse
-
#order_lines ⇒ Array[UpdateShipmentStatusLine]
ISO-8601 timestamp at which the seller observed the status change.
-
#shipment_status ⇒ ShipmentStatus1
Non-terminal shipment-lifecycle state.
-
#status_date ⇒ DateTime
ISO-8601 timestamp at which the seller observed the status change.
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(shipment_status:, order_lines:, status_date: SKIP, additional_properties: nil) ⇒ UpdateShipmentStatusRequest
constructor
A new instance of UpdateShipmentStatusRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_status_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(shipment_status:, order_lines:, status_date: SKIP, additional_properties: nil) ⇒ UpdateShipmentStatusRequest
Returns a new instance of UpdateShipmentStatusRequest.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 50 def initialize(shipment_status:, order_lines:, status_date: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @shipment_status = shipment_status @status_date = status_date unless status_date == SKIP @order_lines = order_lines @additional_properties = additional_properties end |
Instance Attribute Details
#order_lines ⇒ Array[UpdateShipmentStatusLine]
ISO-8601 timestamp at which the seller observed the status change. Optional — if omitted, FMS defaults to server time.
27 28 29 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 27 def order_lines @order_lines end |
#shipment_status ⇒ ShipmentStatus1
Non-terminal shipment-lifecycle state. Mirrors Amazon SP-API
Orders v0 shipmentStatus. For terminal Delivered use the
dedicated /deliver endpoint.
17 18 19 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 17 def shipment_status @shipment_status end |
#status_date ⇒ DateTime
ISO-8601 timestamp at which the seller observed the status change. Optional — if omitted, FMS defaults to server time.
22 23 24 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 22 def status_date @status_date end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. shipment_status = hash.key?('shipmentStatus') ? hash['shipmentStatus'] : nil # Parameter is an array, so we need to iterate through it order_lines = nil unless hash['orderLines'].nil? order_lines = [] hash['orderLines'].each do |structure| order_lines << (UpdateShipmentStatusLine.from_hash(structure) if structure) end end order_lines = nil unless hash.key?('orderLines') status_date = if hash.key?('statusDate') (DateTimeHelper.from_rfc3339(hash['statusDate']) if hash['statusDate']) else SKIP end # 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. UpdateShipmentStatusRequest.new(shipment_status: shipment_status, order_lines: order_lines, status_date: status_date, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['shipment_status'] = 'shipmentStatus' @_hash['status_date'] = 'statusDate' @_hash['order_lines'] = 'orderLines' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 39 def self.optionals %w[ status_date ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 115 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} shipment_status: #{@shipment_status.inspect}, status_date:"\ " #{@status_date.inspect}, order_lines: #{@order_lines.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_custom_status_date ⇒ Object
98 99 100 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 98 def to_custom_status_date DateTimeHelper.to_rfc3339(status_date) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 |
# File 'lib/walmart_ap_is/models/update_shipment_status_request.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} shipment_status: #{@shipment_status}, status_date: #{@status_date},"\ " order_lines: #{@order_lines}, additional_properties: #{@additional_properties}>" end |