Class: NewStoreApi::RoutingOptionsResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::RoutingOptionsResponse
- Defined in:
- lib/new_store_api/models/routing_options_response.rb
Overview
Represents a list of possible routing options. Also, colloquially known as the result of 'soft routing'.
Instance Attribute Summary collapse
-
#routing_options ⇒ Array[FulfillmentNodeAssignment]
TODO: Write general description for this method.
-
#status ⇒ Status21Enum
TODO: Write general description for this method.
-
#unavailable_products ⇒ Array[String]
Contains the list of unavailable products.
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(routing_options = nil, status = nil, unavailable_products = SKIP) ⇒ RoutingOptionsResponse
constructor
A new instance of RoutingOptionsResponse.
-
#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(routing_options = nil, status = nil, unavailable_products = SKIP) ⇒ RoutingOptionsResponse
Returns a new instance of RoutingOptionsResponse.
46 47 48 49 50 51 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 46 def initialize( = nil, status = nil, unavailable_products = SKIP) @routing_options = @status = status @unavailable_products = unavailable_products unless unavailable_products == SKIP end |
Instance Attribute Details
#routing_options ⇒ Array[FulfillmentNodeAssignment]
TODO: Write general description for this method
15 16 17 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 15 def @routing_options end |
#status ⇒ Status21Enum
TODO: Write general description for this method
19 20 21 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 19 def status @status end |
#unavailable_products ⇒ Array[String]
Contains the list of unavailable products
23 24 25 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 23 def unavailable_products @unavailable_products end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 54 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it = nil unless hash['routing_options'].nil? = [] hash['routing_options'].each do |structure| << (FulfillmentNodeAssignment.from_hash(structure) if structure) end end = nil unless hash.key?('routing_options') status = hash.key?('status') ? hash['status'] : nil unavailable_products = hash.key?('unavailable_products') ? hash['unavailable_products'] : SKIP # Create object from extracted values. RoutingOptionsResponse.new(, status, unavailable_products) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['routing_options'] = 'routing_options' @_hash['status'] = 'status' @_hash['unavailable_products'] = 'unavailable_products' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 35 def self.optionals %w[ unavailable_products ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} routing_options: #{@routing_options.inspect}, status: #{@status.inspect},"\ " unavailable_products: #{@unavailable_products.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 83 |
# File 'lib/new_store_api/models/routing_options_response.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} routing_options: #{@routing_options}, status: #{@status},"\ " unavailable_products: #{@unavailable_products}>" end |