Class: NewStoreApi::ConfigModelResponse

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

Overview

ConfigModelResponse Model.

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(allow_adjustments_manual_quantity_editing = nil, allow_counts_manual_quantity_editing = nil, allow_full_counts_manual_quantity_editing = nil, allow_receiving_manual_quantity_editing = nil, allow_transfers_manual_quantity_editing = nil, enabled_adjustments_stores = nil, enabled_carton_receiving_stores = nil, enabled_counts_stores = nil, enabled_full_counts_stores = nil, enabled_receiving_stores = nil, enabled_receiving_without_asn_stores = nil, enabled_reservations_stores = nil, enabled_store_initiated_transfers_stores = nil, enabled_transfers_stores = nil, require_confirmation_on_scanning = nil, enabled = SKIP, store_config = SKIP) ⇒ ConfigModelResponse

Returns a new instance of ConfigModelResponse.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/new_store_api/models/config_model_response.rb', line 125

def initialize(allow_adjustments_manual_quantity_editing = nil,
               allow_counts_manual_quantity_editing = nil,
               allow_full_counts_manual_quantity_editing = nil,
               allow_receiving_manual_quantity_editing = nil,
               allow_transfers_manual_quantity_editing = nil,
               enabled_adjustments_stores = nil,
               enabled_carton_receiving_stores = nil,
               enabled_counts_stores = nil,
               enabled_full_counts_stores = nil,
               enabled_receiving_stores = nil,
               enabled_receiving_without_asn_stores = nil,
               enabled_reservations_stores = nil,
               enabled_store_initiated_transfers_stores = nil,
               enabled_transfers_stores = nil,
               require_confirmation_on_scanning = nil, enabled = SKIP,
               store_config = SKIP)
  @allow_adjustments_manual_quantity_editing = allow_adjustments_manual_quantity_editing
  @allow_counts_manual_quantity_editing = allow_counts_manual_quantity_editing
  @allow_full_counts_manual_quantity_editing = allow_full_counts_manual_quantity_editing
  @allow_receiving_manual_quantity_editing = allow_receiving_manual_quantity_editing
  @allow_transfers_manual_quantity_editing = allow_transfers_manual_quantity_editing
  @enabled = enabled unless enabled == SKIP
  @enabled_adjustments_stores = enabled_adjustments_stores
  @enabled_carton_receiving_stores = enabled_carton_receiving_stores
  @enabled_counts_stores = enabled_counts_stores
  @enabled_full_counts_stores = enabled_full_counts_stores
  @enabled_receiving_stores = enabled_receiving_stores
  @enabled_receiving_without_asn_stores = enabled_receiving_without_asn_stores
  @enabled_reservations_stores = enabled_reservations_stores
  @enabled_store_initiated_transfers_stores = enabled_store_initiated_transfers_stores
  @enabled_transfers_stores = enabled_transfers_stores
  @require_confirmation_on_scanning = require_confirmation_on_scanning
  @store_config = store_config unless store_config == SKIP
end

Instance Attribute Details

#allow_adjustments_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Adjustments

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/new_store_api/models/config_model_response.rb', line 14

def allow_adjustments_manual_quantity_editing
  @allow_adjustments_manual_quantity_editing
end

#allow_counts_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Count Tasks

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/new_store_api/models/config_model_response.rb', line 18

def allow_counts_manual_quantity_editing
  @allow_counts_manual_quantity_editing
end

#allow_full_counts_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning items on Full counts

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/new_store_api/models/config_model_response.rb', line 22

def allow_full_counts_manual_quantity_editing
  @allow_full_counts_manual_quantity_editing
end

#allow_receiving_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Receiving

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/new_store_api/models/config_model_response.rb', line 26

def allow_receiving_manual_quantity_editing
  @allow_receiving_manual_quantity_editing
end

#allow_transfers_manual_quantity_editingTrueClass | FalseClass

Allow setting the product quantity when scanning an item on Transfers

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/new_store_api/models/config_model_response.rb', line 30

def allow_transfers_manual_quantity_editing
  @allow_transfers_manual_quantity_editing
end

#enabledTrueClass | FalseClass

Returns true if inventory is enabled for the provided store.

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#enabled_adjustments_storesArray[String]

Stores that can create adjustments

Returns:

  • (Array[String])


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

def enabled_adjustments_stores
  @enabled_adjustments_stores
end

#enabled_carton_receiving_storesArray[String]

Stores which allow receiving using a carton identifier

Returns:

  • (Array[String])


42
43
44
# File 'lib/new_store_api/models/config_model_response.rb', line 42

def enabled_carton_receiving_stores
  @enabled_carton_receiving_stores
end

#enabled_counts_storesArray[String]

Stores that can do counts

Returns:

  • (Array[String])


46
47
48
# File 'lib/new_store_api/models/config_model_response.rb', line 46

def enabled_counts_stores
  @enabled_counts_stores
end

#enabled_full_counts_storesArray[String]

Stores that can do full counts

Returns:

  • (Array[String])


50
51
52
# File 'lib/new_store_api/models/config_model_response.rb', line 50

def enabled_full_counts_stores
  @enabled_full_counts_stores
end

#enabled_receiving_storesArray[String]

Stores that can receive

Returns:

  • (Array[String])


54
55
56
# File 'lib/new_store_api/models/config_model_response.rb', line 54

def enabled_receiving_stores
  @enabled_receiving_stores
end

#enabled_receiving_without_asn_storesArray[String]

Stores which can receive without an ASN (blind receiving)

Returns:

  • (Array[String])


58
59
60
# File 'lib/new_store_api/models/config_model_response.rb', line 58

def enabled_receiving_without_asn_stores
  @enabled_receiving_without_asn_stores
end

#enabled_reservations_storesArray[String]

Stores that can do customer reservations

Returns:

  • (Array[String])


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

def enabled_reservations_stores
  @enabled_reservations_stores
end

#enabled_store_initiated_transfers_storesArray[String]

Stores where a transfer can be initiated

Returns:

  • (Array[String])


66
67
68
# File 'lib/new_store_api/models/config_model_response.rb', line 66

def enabled_store_initiated_transfers_stores
  @enabled_store_initiated_transfers_stores
end

#enabled_transfers_storesArray[String]

Stores that allow transfers

Returns:

  • (Array[String])


70
71
72
# File 'lib/new_store_api/models/config_model_response.rb', line 70

def enabled_transfers_stores
  @enabled_transfers_stores
end

#require_confirmation_on_scanningTrueClass | FalseClass

Require confirmation when scanning an item

Returns:

  • (TrueClass | FalseClass)


74
75
76
# File 'lib/new_store_api/models/config_model_response.rb', line 74

def require_confirmation_on_scanning
  @require_confirmation_on_scanning
end

#store_configObject

Feature toggles for the provided store

Returns:

  • (Object)


78
79
80
# File 'lib/new_store_api/models/config_model_response.rb', line 78

def store_config
  @store_config
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/new_store_api/models/config_model_response.rb', line 161

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  allow_adjustments_manual_quantity_editing =
    hash.key?('allow_adjustments_manual_quantity_editing') ? hash['allow_adjustments_manual_quantity_editing'] : nil
  allow_counts_manual_quantity_editing =
    hash.key?('allow_counts_manual_quantity_editing') ? hash['allow_counts_manual_quantity_editing'] : nil
  allow_full_counts_manual_quantity_editing =
    hash.key?('allow_full_counts_manual_quantity_editing') ? hash['allow_full_counts_manual_quantity_editing'] : nil
  allow_receiving_manual_quantity_editing =
    hash.key?('allow_receiving_manual_quantity_editing') ? hash['allow_receiving_manual_quantity_editing'] : nil
  allow_transfers_manual_quantity_editing =
    hash.key?('allow_transfers_manual_quantity_editing') ? hash['allow_transfers_manual_quantity_editing'] : nil
  enabled_adjustments_stores =
    hash.key?('enabled_adjustments_stores') ? hash['enabled_adjustments_stores'] : nil
  enabled_carton_receiving_stores =
    hash.key?('enabled_carton_receiving_stores') ? hash['enabled_carton_receiving_stores'] : nil
  enabled_counts_stores =
    hash.key?('enabled_counts_stores') ? hash['enabled_counts_stores'] : nil
  enabled_full_counts_stores =
    hash.key?('enabled_full_counts_stores') ? hash['enabled_full_counts_stores'] : nil
  enabled_receiving_stores =
    hash.key?('enabled_receiving_stores') ? hash['enabled_receiving_stores'] : nil
  enabled_receiving_without_asn_stores =
    hash.key?('enabled_receiving_without_asn_stores') ? hash['enabled_receiving_without_asn_stores'] : nil
  enabled_reservations_stores =
    hash.key?('enabled_reservations_stores') ? hash['enabled_reservations_stores'] : nil
  enabled_store_initiated_transfers_stores =
    hash.key?('enabled_store_initiated_transfers_stores') ? hash['enabled_store_initiated_transfers_stores'] : nil
  enabled_transfers_stores =
    hash.key?('enabled_transfers_stores') ? hash['enabled_transfers_stores'] : nil
  require_confirmation_on_scanning =
    hash.key?('require_confirmation_on_scanning') ? hash['require_confirmation_on_scanning'] : nil
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  store_config = hash.key?('store_config') ? hash['store_config'] : SKIP

  # Create object from extracted values.
  ConfigModelResponse.new(allow_adjustments_manual_quantity_editing,
                          allow_counts_manual_quantity_editing,
                          allow_full_counts_manual_quantity_editing,
                          allow_receiving_manual_quantity_editing,
                          allow_transfers_manual_quantity_editing,
                          enabled_adjustments_stores,
                          enabled_carton_receiving_stores,
                          enabled_counts_stores,
                          enabled_full_counts_stores,
                          enabled_receiving_stores,
                          enabled_receiving_without_asn_stores,
                          enabled_reservations_stores,
                          enabled_store_initiated_transfers_stores,
                          enabled_transfers_stores,
                          require_confirmation_on_scanning,
                          enabled,
                          store_config)
end

.namesObject

A mapping from model property names to API property names.



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
109
110
# File 'lib/new_store_api/models/config_model_response.rb', line 81

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['allow_adjustments_manual_quantity_editing'] =
    'allow_adjustments_manual_quantity_editing'
  @_hash['allow_counts_manual_quantity_editing'] =
    'allow_counts_manual_quantity_editing'
  @_hash['allow_full_counts_manual_quantity_editing'] =
    'allow_full_counts_manual_quantity_editing'
  @_hash['allow_receiving_manual_quantity_editing'] =
    'allow_receiving_manual_quantity_editing'
  @_hash['allow_transfers_manual_quantity_editing'] =
    'allow_transfers_manual_quantity_editing'
  @_hash['enabled'] = 'enabled'
  @_hash['enabled_adjustments_stores'] = 'enabled_adjustments_stores'
  @_hash['enabled_carton_receiving_stores'] =
    'enabled_carton_receiving_stores'
  @_hash['enabled_counts_stores'] = 'enabled_counts_stores'
  @_hash['enabled_full_counts_stores'] = 'enabled_full_counts_stores'
  @_hash['enabled_receiving_stores'] = 'enabled_receiving_stores'
  @_hash['enabled_receiving_without_asn_stores'] =
    'enabled_receiving_without_asn_stores'
  @_hash['enabled_reservations_stores'] = 'enabled_reservations_stores'
  @_hash['enabled_store_initiated_transfers_stores'] =
    'enabled_store_initiated_transfers_stores'
  @_hash['enabled_transfers_stores'] = 'enabled_transfers_stores'
  @_hash['require_confirmation_on_scanning'] =
    'require_confirmation_on_scanning'
  @_hash['store_config'] = 'store_config'
  @_hash
end

.nullablesObject

An array for nullable fields



121
122
123
# File 'lib/new_store_api/models/config_model_response.rb', line 121

def self.nullables
  []
end

.optionalsObject

An array for optional fields



113
114
115
116
117
118
# File 'lib/new_store_api/models/config_model_response.rb', line 113

def self.optionals
  %w[
    enabled
    store_config
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/new_store_api/models/config_model_response.rb', line 239

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} allow_adjustments_manual_quantity_editing:"\
  " #{@allow_adjustments_manual_quantity_editing.inspect},"\
  " allow_counts_manual_quantity_editing: #{@allow_counts_manual_quantity_editing.inspect},"\
  ' allow_full_counts_manual_quantity_editing:'\
  " #{@allow_full_counts_manual_quantity_editing.inspect},"\
  ' allow_receiving_manual_quantity_editing:'\
  " #{@allow_receiving_manual_quantity_editing.inspect},"\
  ' allow_transfers_manual_quantity_editing:'\
  " #{@allow_transfers_manual_quantity_editing.inspect}, enabled: #{@enabled.inspect},"\
  " enabled_adjustments_stores: #{@enabled_adjustments_stores.inspect},"\
  " enabled_carton_receiving_stores: #{@enabled_carton_receiving_stores.inspect},"\
  " enabled_counts_stores: #{@enabled_counts_stores.inspect}, enabled_full_counts_stores:"\
  " #{@enabled_full_counts_stores.inspect}, enabled_receiving_stores:"\
  " #{@enabled_receiving_stores.inspect}, enabled_receiving_without_asn_stores:"\
  " #{@enabled_receiving_without_asn_stores.inspect}, enabled_reservations_stores:"\
  " #{@enabled_reservations_stores.inspect}, enabled_store_initiated_transfers_stores:"\
  " #{@enabled_store_initiated_transfers_stores.inspect}, enabled_transfers_stores:"\
  " #{@enabled_transfers_stores.inspect}, require_confirmation_on_scanning:"\
  " #{@require_confirmation_on_scanning.inspect}, store_config: #{@store_config.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/new_store_api/models/config_model_response.rb', line 219

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} allow_adjustments_manual_quantity_editing:"\
  " #{@allow_adjustments_manual_quantity_editing}, allow_counts_manual_quantity_editing:"\
  " #{@allow_counts_manual_quantity_editing}, allow_full_counts_manual_quantity_editing:"\
  " #{@allow_full_counts_manual_quantity_editing}, allow_receiving_manual_quantity_editing:"\
  " #{@allow_receiving_manual_quantity_editing}, allow_transfers_manual_quantity_editing:"\
  " #{@allow_transfers_manual_quantity_editing}, enabled: #{@enabled},"\
  " enabled_adjustments_stores: #{@enabled_adjustments_stores},"\
  " enabled_carton_receiving_stores: #{@enabled_carton_receiving_stores},"\
  " enabled_counts_stores: #{@enabled_counts_stores}, enabled_full_counts_stores:"\
  " #{@enabled_full_counts_stores}, enabled_receiving_stores: #{@enabled_receiving_stores},"\
  " enabled_receiving_without_asn_stores: #{@enabled_receiving_without_asn_stores},"\
  " enabled_reservations_stores: #{@enabled_reservations_stores},"\
  " enabled_store_initiated_transfers_stores: #{@enabled_store_initiated_transfers_stores},"\
  " enabled_transfers_stores: #{@enabled_transfers_stores}, require_confirmation_on_scanning:"\
  " #{@require_confirmation_on_scanning}, store_config: #{@store_config}>"
end