Class: WalmartApIs::InboundPlan
- Defined in:
- lib/walmart_ap_is/models/inbound_plan.rb
Overview
Inbound plan containing details of the WFS inbound workflow.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
The time at which the inbound plan was created.
-
#inbound_plan_id ⇒ String
Identifier of an inbound plan.
-
#last_updated_at ⇒ DateTime
The time at which the inbound plan was last updated.
-
#marketplace_ids ⇒ Array[String]
A list of Walmart marketplace IDs.
-
#name ⇒ String
Human-readable name of the inbound plan.
-
#packing_options ⇒ Array[PackingOptionSummary]
Packing options for the inbound plan.
-
#placement_options ⇒ Array[PlacementOptionSummary]
Placement options for the inbound plan.
-
#shipments ⇒ Array[ShipmentSummary]
A list of shipment IDs for the inbound plan.
-
#source_address ⇒ Address
Specific details to identify a place.
-
#status ⇒ String
Current status of the inbound plan.
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(created_at:, inbound_plan_id:, last_updated_at:, marketplace_ids:, name:, source_address:, status:, packing_options: SKIP, placement_options: SKIP, shipments: SKIP, additional_properties: nil) ⇒ InboundPlan
constructor
A new instance of InboundPlan.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_last_updated_at ⇒ 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(created_at:, inbound_plan_id:, last_updated_at:, marketplace_ids:, name:, source_address:, status:, packing_options: SKIP, placement_options: SKIP, shipments: SKIP, additional_properties: nil) ⇒ InboundPlan
Returns a new instance of InboundPlan.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 89 def initialize(created_at:, inbound_plan_id:, last_updated_at:, marketplace_ids:, name:, source_address:, status:, packing_options: SKIP, placement_options: SKIP, shipments: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @created_at = created_at @inbound_plan_id = inbound_plan_id @last_updated_at = last_updated_at @marketplace_ids = marketplace_ids @name = name @packing_options = unless == SKIP @placement_options = unless == SKIP @shipments = shipments unless shipments == SKIP @source_address = source_address @status = status @additional_properties = additional_properties end |
Instance Attribute Details
#created_at ⇒ DateTime
The time at which the inbound plan was created. In ISO 8601 datetime
format with pattern yyyy-MM-ddTHH:mm:ssZ.
16 17 18 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 16 def created_at @created_at end |
#inbound_plan_id ⇒ String
Identifier of an inbound plan.
20 21 22 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 20 def inbound_plan_id @inbound_plan_id end |
#last_updated_at ⇒ DateTime
The time at which the inbound plan was last updated. In ISO 8601 datetime
format with pattern yyyy-MM-ddTHH:mm:ssZ.
25 26 27 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 25 def last_updated_at @last_updated_at end |
#marketplace_ids ⇒ Array[String]
A list of Walmart marketplace IDs.
29 30 31 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 29 def marketplace_ids @marketplace_ids end |
#name ⇒ String
Human-readable name of the inbound plan.
33 34 35 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 33 def name @name end |
#packing_options ⇒ Array[PackingOptionSummary]
Packing options for the inbound plan. Populated after generation via the corresponding operation.
38 39 40 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 38 def @packing_options end |
#placement_options ⇒ Array[PlacementOptionSummary]
Placement options for the inbound plan. Populated after generation via the corresponding operation.
43 44 45 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 43 def @placement_options end |
#shipments ⇒ Array[ShipmentSummary]
A list of shipment IDs for the inbound plan. Populated after
confirmPlacementOptions.
48 49 50 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 48 def shipments @shipments end |
#source_address ⇒ Address
Specific details to identify a place.
52 53 54 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 52 def source_address @source_address end |
#status ⇒ String
Current status of the inbound plan. Possible values: ACTIVE, VOIDED,
SHIPPED, ERRORED.
57 58 59 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 57 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 110 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. created_at = if hash.key?('createdAt') (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt']) end inbound_plan_id = hash.key?('inboundPlanId') ? hash['inboundPlanId'] : nil last_updated_at = if hash.key?('lastUpdatedAt') (DateTimeHelper.from_rfc3339(hash['lastUpdatedAt']) if hash['lastUpdatedAt']) end marketplace_ids = hash.key?('marketplaceIds') ? hash['marketplaceIds'] : nil name = hash.key?('name') ? hash['name'] : nil source_address = Address.from_hash(hash['sourceAddress']) if hash['sourceAddress'] status = hash.key?('status') ? hash['status'] : nil # Parameter is an array, so we need to iterate through it = nil unless hash['packingOptions'].nil? = [] hash['packingOptions'].each do |structure| << (PackingOptionSummary.from_hash(structure) if structure) end end = SKIP unless hash.key?('packingOptions') # Parameter is an array, so we need to iterate through it = nil unless hash['placementOptions'].nil? = [] hash['placementOptions'].each do |structure| << (PlacementOptionSummary.from_hash(structure) if structure) end end = SKIP unless hash.key?('placementOptions') # Parameter is an array, so we need to iterate through it shipments = nil unless hash['shipments'].nil? shipments = [] hash['shipments'].each do |structure| shipments << (ShipmentSummary.from_hash(structure) if structure) end end shipments = SKIP unless hash.key?('shipments') # 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. InboundPlan.new(created_at: created_at, inbound_plan_id: inbound_plan_id, last_updated_at: last_updated_at, marketplace_ids: marketplace_ids, name: name, source_address: source_address, status: status, packing_options: , placement_options: , shipments: shipments, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 60 def self.names @_hash = {} if @_hash.nil? @_hash['created_at'] = 'createdAt' @_hash['inbound_plan_id'] = 'inboundPlanId' @_hash['last_updated_at'] = 'lastUpdatedAt' @_hash['marketplace_ids'] = 'marketplaceIds' @_hash['name'] = 'name' @_hash['packing_options'] = 'packingOptions' @_hash['placement_options'] = 'placementOptions' @_hash['shipments'] = 'shipments' @_hash['source_address'] = 'sourceAddress' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
76 77 78 79 80 81 82 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 76 def self.optionals %w[ packing_options placement_options shipments ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
197 198 199 200 201 202 203 204 205 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 197 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at.inspect}, inbound_plan_id:"\ " #{@inbound_plan_id.inspect}, last_updated_at: #{@last_updated_at.inspect},"\ " marketplace_ids: #{@marketplace_ids.inspect}, name: #{@name.inspect}, packing_options:"\ " #{@packing_options.inspect}, placement_options: #{@placement_options.inspect}, shipments:"\ " #{@shipments.inspect}, source_address: #{@source_address.inspect}, status:"\ " #{@status.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_created_at ⇒ Object
178 179 180 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 178 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_last_updated_at ⇒ Object
182 183 184 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 182 def to_custom_last_updated_at DateTimeHelper.to_rfc3339(last_updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
187 188 189 190 191 192 193 194 |
# File 'lib/walmart_ap_is/models/inbound_plan.rb', line 187 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at}, inbound_plan_id: #{@inbound_plan_id},"\ " last_updated_at: #{@last_updated_at}, marketplace_ids: #{@marketplace_ids}, name:"\ " #{@name}, packing_options: #{@packing_options}, placement_options: #{@placement_options},"\ " shipments: #{@shipments}, source_address: #{@source_address}, status: #{@status},"\ " additional_properties: #{@additional_properties}>" end |