Class: NewStoreApi::InjectedOrderRoutingStrategy1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::InjectedOrderRoutingStrategy1
- Defined in:
- lib/new_store_api/models/injected_order_routing_strategy1.rb
Overview
InjectedOrderRoutingStrategy1 Model.
Instance Attribute Summary collapse
-
#fulfillment_node_id ⇒ String
The fulfillment node ID to which the order is going to be routed.
-
#strategy ⇒ String
readonly
The routing strategy used to specify the fulfillment location for the order, and prevent it from being routed based on the fulfillment config.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(fulfillment_node_id = nil) ⇒ InjectedOrderRoutingStrategy1
constructor
A new instance of InjectedOrderRoutingStrategy1.
-
#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) ⇒ InjectedOrderRoutingStrategy1
Returns a new instance of InjectedOrderRoutingStrategy1.
42 43 44 45 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 42 def initialize(fulfillment_node_id = nil) @fulfillment_node_id = fulfillment_node_id @strategy = 'prerouted' end |
Instance Attribute Details
#fulfillment_node_id ⇒ String
The fulfillment node ID to which the order is going to be routed. The location must have ATP for all items in the order. If there's no ATP for some items, the items are put on hold.
17 18 19 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 17 def fulfillment_node_id @fulfillment_node_id end |
#strategy ⇒ String (readonly)
The routing strategy used to specify the fulfillment location for the order, and prevent it from being routed based on the fulfillment config.
22 23 24 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 22 def strategy @strategy end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 48 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 # Create object from extracted values. InjectedOrderRoutingStrategy1.new(fulfillment_node_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['fulfillment_node_id'] = 'fulfillment_node_id' @_hash['strategy'] = 'strategy' @_hash end |
.nullables ⇒ Object
An array for nullable fields
38 39 40 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 38 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 33 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 61 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.fulfillment_node_id, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.strategy, ->(val) { val.instance_of? String }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['fulfillment_node_id'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['strategy'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
88 89 90 91 92 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 88 def inspect class_name = self.class.name.split('::').last "<#{class_name} fulfillment_node_id: #{@fulfillment_node_id.inspect}, strategy:"\ " #{@strategy.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
82 83 84 85 |
# File 'lib/new_store_api/models/injected_order_routing_strategy1.rb', line 82 def to_s class_name = self.class.name.split('::').last "<#{class_name} fulfillment_node_id: #{@fulfillment_node_id}, strategy: #{@strategy}>" end |