Class: NewStoreApi::FulfillmentRequest1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::FulfillmentRequest1
- Defined in:
- lib/new_store_api/models/fulfillment_request1.rb
Overview
The fulfillment request.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Date and time when fulfillment request was created.
-
#fulfillment_node_id ⇒ String
Fulfillment node where fulfillment request was routed to.
-
#fulfillment_request_id ⇒ String
The identifier of the fulfillment request.
-
#items ⇒ Array[Item8]
The identifier of the fulfillment request.
-
#service_level ⇒ String
Service level fulfillment request was routed with.
-
#status ⇒ Status11Enum
Current status of fulfillment request: dispatched - fulfillment request was sent to sent to store/DC services, but wasn't acknowledged yet; acknowledged - fulfillment request was acknowledged by store/DC service and will be send to store/DC for fulfillment; partially_completed - some items of fulfillment request were already processed (cancelled, rejected, shipped) but not all of them; completed - all items of fulfillment request were processed (cancelled, rejected, shipped).
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 = nil, fulfillment_node_id = nil, fulfillment_request_id = nil, items = nil, service_level = nil, status = nil) ⇒ FulfillmentRequest1
constructor
A new instance of FulfillmentRequest1.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_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 = nil, fulfillment_node_id = nil, fulfillment_request_id = nil, items = nil, service_level = nil, status = nil) ⇒ FulfillmentRequest1
Returns a new instance of FulfillmentRequest1.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 65 def initialize(created_at = nil, fulfillment_node_id = nil, fulfillment_request_id = nil, items = nil, service_level = nil, status = nil) @created_at = created_at @fulfillment_node_id = fulfillment_node_id @fulfillment_request_id = fulfillment_request_id @items = items @service_level = service_level @status = status end |
Instance Attribute Details
#created_at ⇒ DateTime
Date and time when fulfillment request was created.
15 16 17 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 15 def created_at @created_at end |
#fulfillment_node_id ⇒ String
Fulfillment node where fulfillment request was routed to.
19 20 21 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 19 def fulfillment_node_id @fulfillment_node_id end |
#fulfillment_request_id ⇒ String
The identifier of the fulfillment request.
23 24 25 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 23 def fulfillment_request_id @fulfillment_request_id end |
#items ⇒ Array[Item8]
The identifier of the fulfillment request.
27 28 29 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 27 def items @items end |
#service_level ⇒ String
Service level fulfillment request was routed with.
31 32 33 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 31 def service_level @service_level end |
#status ⇒ Status11Enum
Current status of fulfillment request: dispatched - fulfillment request was sent to sent to store/DC services, but wasn't acknowledged yet; acknowledged - fulfillment request was acknowledged by store/DC service and will be send to store/DC for fulfillment; partially_completed - some items of fulfillment request were already processed (cancelled, rejected, shipped) but not all of them; completed - all items of fulfillment request were processed (cancelled, rejected, shipped).
41 42 43 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 41 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end fulfillment_node_id = hash.key?('fulfillment_node_id') ? hash['fulfillment_node_id'] : nil fulfillment_request_id = hash.key?('fulfillment_request_id') ? hash['fulfillment_request_id'] : nil # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (Item8.from_hash(structure) if structure) end end items = nil unless hash.key?('items') service_level = hash.key?('service_level') ? hash['service_level'] : nil status = hash.key?('status') ? hash['status'] : nil # Create object from extracted values. FulfillmentRequest1.new(created_at, fulfillment_node_id, fulfillment_request_id, items, service_level, status) end |
.names ⇒ Object
A mapping from model property names to API property names.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 44 def self.names @_hash = {} if @_hash.nil? @_hash['created_at'] = 'created_at' @_hash['fulfillment_node_id'] = 'fulfillment_node_id' @_hash['fulfillment_request_id'] = 'fulfillment_request_id' @_hash['items'] = 'items' @_hash['service_level'] = 'service_level' @_hash['status'] = 'status' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 56 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
123 124 125 126 127 128 129 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 123 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at.inspect}, fulfillment_node_id:"\ " #{@fulfillment_node_id.inspect}, fulfillment_request_id:"\ " #{@fulfillment_request_id.inspect}, items: #{@items.inspect}, service_level:"\ " #{@service_level.inspect}, status: #{@status.inspect}>" end |
#to_custom_created_at ⇒ Object
110 111 112 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 110 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
115 116 117 118 119 120 |
# File 'lib/new_store_api/models/fulfillment_request1.rb', line 115 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at}, fulfillment_node_id: #{@fulfillment_node_id},"\ " fulfillment_request_id: #{@fulfillment_request_id}, items: #{@items}, service_level:"\ " #{@service_level}, status: #{@status}>" end |