Class: NewStoreApi::OrderInjectionConfigurationBigSalesOrder

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/new_store_api/models/order_injection_configuration_big_sales_order.rb

Overview

The order item limits that determine if the order is routed or is considered a big order and placed on hold.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(hard_limit_for_big_orders = nil) ⇒ OrderInjectionConfigurationBigSalesOrder

Returns a new instance of OrderInjectionConfigurationBigSalesOrder.



38
39
40
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 38

def initialize(hard_limit_for_big_orders = nil)
  @hard_limit_for_big_orders = hard_limit_for_big_orders
end

Instance Attribute Details

#hard_limit_for_big_ordersFloat

The maximum number of items an injected or external order can contain for it to be placed on hold and not be canceled. For example, if this is 800 and soft_limit_for_big_orders is 300, external orders with items between 301 and 800 are placed on hold, and an external order with 801 items is canceled.

Returns:

  • (Float)


19
20
21
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 19

def hard_limit_for_big_orders
  @hard_limit_for_big_orders
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



43
44
45
46
47
48
49
50
51
52
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 43

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  hard_limit_for_big_orders =
    hash.key?('hard_limit_for_big_orders') ? hash['hard_limit_for_big_orders'] : nil

  # Create object from extracted values.
  OrderInjectionConfigurationBigSalesOrder.new(hard_limit_for_big_orders)
end

.namesObject

A mapping from model property names to API property names.



22
23
24
25
26
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 22

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['hard_limit_for_big_orders'] = 'hard_limit_for_big_orders'
  @_hash
end

.nullablesObject

An array for nullable fields



34
35
36
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 34

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 29

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



61
62
63
64
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 61

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} hard_limit_for_big_orders: #{@hard_limit_for_big_orders.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



55
56
57
58
# File 'lib/new_store_api/models/order_injection_configuration_big_sales_order.rb', line 55

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} hard_limit_for_big_orders: #{@hard_limit_for_big_orders}>"
end