Class: NewStoreApi::FulfillmentNodeAssignment
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::FulfillmentNodeAssignment
- Defined in:
- lib/new_store_api/models/fulfillment_node_assignment.rb
Overview
A fulfillment node assigned to fulfill products in an order at a certain service level. And products which can be routed with this service level
Instance Attribute Summary collapse
-
#fulfillment_node_id ⇒ String
TODO: Write general description for this method.
-
#line_items ⇒ Array[LineItem3]
Line items in this fulfillment node assignment.
-
#service_level_identifier ⇒ String
Line items in this fulfillment node assignment.
-
#type ⇒ Type2Enum
Shows if this FF node assignment available right now (regular), or can be fulfilled in the future (pre-order).
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(fulfillment_node_id = nil, line_items = nil, service_level_identifier = nil, type = SKIP) ⇒ FulfillmentNodeAssignment
constructor
A new instance of FulfillmentNodeAssignment.
-
#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(fulfillment_node_id = nil, line_items = nil, service_level_identifier = nil, type = SKIP) ⇒ FulfillmentNodeAssignment
Returns a new instance of FulfillmentNodeAssignment.
52 53 54 55 56 57 58 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 52 def initialize(fulfillment_node_id = nil, line_items = nil, service_level_identifier = nil, type = SKIP) @fulfillment_node_id = fulfillment_node_id @line_items = line_items @service_level_identifier = service_level_identifier @type = type unless type == SKIP end |
Instance Attribute Details
#fulfillment_node_id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 15 def fulfillment_node_id @fulfillment_node_id end |
#line_items ⇒ Array[LineItem3]
Line items in this fulfillment node assignment
19 20 21 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 19 def line_items @line_items end |
#service_level_identifier ⇒ String
Line items in this fulfillment node assignment
23 24 25 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 23 def service_level_identifier @service_level_identifier end |
#type ⇒ Type2Enum
Shows if this FF node assignment available right now (regular), or can be fulfilled in the future (pre-order)
28 29 30 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 28 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
61 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 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 61 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. fulfillment_node_id = hash.key?('fulfillment_node_id') ? hash['fulfillment_node_id'] : nil # Parameter is an array, so we need to iterate through it line_items = nil unless hash['line_items'].nil? line_items = [] hash['line_items'].each do |structure| line_items << (LineItem3.from_hash(structure) if structure) end end line_items = nil unless hash.key?('line_items') service_level_identifier = hash.key?('service_level_identifier') ? hash['service_level_identifier'] : nil type = hash.key?('type') ? hash['type'] : SKIP # Create object from extracted values. FulfillmentNodeAssignment.new(fulfillment_node_id, line_items, service_level_identifier, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['fulfillment_node_id'] = 'fulfillment_node_id' @_hash['line_items'] = 'line_items' @_hash['service_level_identifier'] = 'service_level_identifier' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 41 def self.optionals %w[ type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
96 97 98 99 100 101 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 96 def inspect class_name = self.class.name.split('::').last "<#{class_name} fulfillment_node_id: #{@fulfillment_node_id.inspect}, line_items:"\ " #{@line_items.inspect}, service_level_identifier: #{@service_level_identifier.inspect},"\ " type: #{@type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
89 90 91 92 93 |
# File 'lib/new_store_api/models/fulfillment_node_assignment.rb', line 89 def to_s class_name = self.class.name.split('::').last "<#{class_name} fulfillment_node_id: #{@fulfillment_node_id}, line_items: #{@line_items},"\ " service_level_identifier: #{@service_level_identifier}, type: #{@type}>" end |