Class: ErpIntegration::Configuration
- Inherits:
-
Object
- Object
- ErpIntegration::Configuration
- Defined in:
- lib/erp_integration/configuration.rb
Overview
Use the ‘Configuration` class to configure the ERP Integration gem. Use an initializer in your project configure the ERP Integration gem.
Instance Attribute Summary collapse
-
#api_key_rotation_threshold ⇒ Object
The ‘api_key_rotation_threshold` is used by the `ApiKeysRotation` middleware it will rotate the API key when the remaining requests are less than the threshold.
- #bill_of_material_adapter ⇒ Object
- #bill_of_material_input_adapter ⇒ Object
- #bill_of_material_output_adapter ⇒ Object
- #channel_listing_adapter ⇒ Object
- #country_adapter ⇒ Object
- #customer_shipment_adapter ⇒ Object
- #customer_shipment_return_adapter ⇒ Object
-
#fulfil_api_keys ⇒ Array<String>
The ‘fulfil_api_keys` sets a single or a list of API keys to use in the `FulfilClient` to authorize the requests to the Fulfil API endpoints.
-
#fulfil_base_url ⇒ String
The ‘fulfil_base_url` is used by the `FulfilClient` to connect to the right Fulfil API endpoints.
- #gift_card_adapter ⇒ Object
- #internal_shipment_adapter ⇒ Object
- #location_adapter ⇒ Object
- #party_address_adapter ⇒ Object
- #product_adapter ⇒ Object
- #product_category_adapter ⇒ Object
- #product_option_adapter ⇒ Object
- #product_template_adapter ⇒ Object
- #production_order_adapter ⇒ Object
- #purchase_order_adapter ⇒ Object
- #purchase_order_line_adapter ⇒ Object
- #purchase_product_supplier_adapter ⇒ Object
- #purchase_request_adapter ⇒ Object
- #sales_line_option_adapter ⇒ Object
- #sales_order_adapter ⇒ Object
- #sales_order_line_adapter ⇒ Object
- #sales_return_reason_adapter ⇒ Object
- #stock_bin_transfer_adapter ⇒ Object
- #stock_move_adapter ⇒ Object
- #supplier_shipment_adapter ⇒ Object
- #task_adapter ⇒ Object
- #tracking_number_adapter ⇒ Object
Instance Method Summary collapse
- #box_type_adapter ⇒ Object
- #carrier_adapter ⇒ Object
- #carrier_service_adapter ⇒ Object
-
#initialize(**options) ⇒ Configuration
constructor
A new instance of Configuration.
- #inventory_by_location_report_adapter ⇒ Object
- #logger ⇒ Object
- #logger=(logger) ⇒ Object
-
#rate_limiters ⇒ Object
Rate limiters that will be used for HTTP operations on Client to manage the number of requests made to avoid rate limiting by the API provider.
-
#rate_limiters=(rate_limiters) ⇒ Object
Sets the rate limiters that will be used.
- #webhook_adapter ⇒ Object
Constructor Details
#initialize(**options) ⇒ Configuration
Returns a new instance of Configuration.
176 177 178 179 180 |
# File 'lib/erp_integration/configuration.rb', line 176 def initialize(**) .each_pair do |key, value| public_send("#{key}=", value) if respond_to?("#{key}=") end end |
Instance Attribute Details
#api_key_rotation_threshold ⇒ Object
The ‘api_key_rotation_threshold` is used by the `ApiKeysRotation` middleware it will rotate the API key when the remaining requests are less than the threshold.
Set the ‘api_key_rotation_threshold` to 0, it you don’t want to rotate by the remaining requests.
29 30 31 |
# File 'lib/erp_integration/configuration.rb', line 29 def api_key_rotation_threshold @api_key_rotation_threshold end |
#bill_of_material_adapter ⇒ Object
186 187 188 |
# File 'lib/erp_integration/configuration.rb', line 186 def bill_of_material_adapter @bill_of_material_adapter || :fulfil end |
#bill_of_material_input_adapter ⇒ Object
190 191 192 |
# File 'lib/erp_integration/configuration.rb', line 190 def bill_of_material_input_adapter @bill_of_material_input_adapter || :fulfil end |
#bill_of_material_output_adapter ⇒ Object
194 195 196 |
# File 'lib/erp_integration/configuration.rb', line 194 def bill_of_material_output_adapter @bill_of_material_output_adapter || :fulfil end |
#channel_listing_adapter ⇒ Object
210 211 212 |
# File 'lib/erp_integration/configuration.rb', line 210 def channel_listing_adapter @channel_listing_adapter || :fulfil end |
#country_adapter ⇒ Object
214 215 216 |
# File 'lib/erp_integration/configuration.rb', line 214 def country_adapter @country_adapter || :fulfil end |
#customer_shipment_adapter ⇒ Object
218 219 220 |
# File 'lib/erp_integration/configuration.rb', line 218 def customer_shipment_adapter @customer_shipment_adapter || :fulfil end |
#customer_shipment_return_adapter ⇒ Object
222 223 224 |
# File 'lib/erp_integration/configuration.rb', line 222 def customer_shipment_return_adapter @customer_shipment_return_adapter || :fulfil end |
#fulfil_api_keys ⇒ Array<String>
The ‘fulfil_api_keys` sets a single or a list of API keys to use in the `FulfilClient` to authorize the requests to the Fulfil API endpoints.
18 19 20 |
# File 'lib/erp_integration/configuration.rb', line 18 def fulfil_api_keys @fulfil_api_keys end |
#fulfil_base_url ⇒ String
The ‘fulfil_base_url` is used by the `FulfilClient` to connect to the right Fulfil API endpoints.
23 24 25 |
# File 'lib/erp_integration/configuration.rb', line 23 def fulfil_base_url @fulfil_base_url end |
#gift_card_adapter ⇒ Object
226 227 228 |
# File 'lib/erp_integration/configuration.rb', line 226 def gift_card_adapter @gift_card_adapter || :fulfil end |
#internal_shipment_adapter ⇒ Object
230 231 232 |
# File 'lib/erp_integration/configuration.rb', line 230 def internal_shipment_adapter @internal_shipment_adapter || :fulfil end |
#location_adapter ⇒ Object
238 239 240 |
# File 'lib/erp_integration/configuration.rb', line 238 def location_adapter @location_adapter || :fulfil end |
#party_address_adapter ⇒ Object
250 251 252 |
# File 'lib/erp_integration/configuration.rb', line 250 def party_address_adapter @party_address_adapter || :fulfil end |
#product_adapter ⇒ Object
254 255 256 |
# File 'lib/erp_integration/configuration.rb', line 254 def product_adapter @product_adapter || :fulfil end |
#product_category_adapter ⇒ Object
258 259 260 |
# File 'lib/erp_integration/configuration.rb', line 258 def product_category_adapter @product_category_adapter || :fulfil end |
#product_option_adapter ⇒ Object
262 263 264 |
# File 'lib/erp_integration/configuration.rb', line 262 def product_option_adapter @product_option_adapter || :fulfil end |
#product_template_adapter ⇒ Object
266 267 268 |
# File 'lib/erp_integration/configuration.rb', line 266 def product_template_adapter @product_template_adapter || :fulfil end |
#production_order_adapter ⇒ Object
270 271 272 |
# File 'lib/erp_integration/configuration.rb', line 270 def production_order_adapter @production_order_adapter || :fulfil end |
#purchase_order_adapter ⇒ Object
274 275 276 |
# File 'lib/erp_integration/configuration.rb', line 274 def purchase_order_adapter @purchase_order_adapter || :fulfil end |
#purchase_order_line_adapter ⇒ Object
278 279 280 |
# File 'lib/erp_integration/configuration.rb', line 278 def purchase_order_line_adapter @purchase_order_line_adapter || :fulfil end |
#purchase_product_supplier_adapter ⇒ Object
282 283 284 |
# File 'lib/erp_integration/configuration.rb', line 282 def purchase_product_supplier_adapter @purchase_product_supplier_adapter || :fulfil end |
#purchase_request_adapter ⇒ Object
286 287 288 |
# File 'lib/erp_integration/configuration.rb', line 286 def purchase_request_adapter @purchase_request_adapter || :fulfil end |
#sales_line_option_adapter ⇒ Object
302 303 304 |
# File 'lib/erp_integration/configuration.rb', line 302 def sales_line_option_adapter @sales_line_option_adapter || :fulfil end |
#sales_order_adapter ⇒ Object
306 307 308 |
# File 'lib/erp_integration/configuration.rb', line 306 def sales_order_adapter @sales_order_adapter || :fulfil end |
#sales_order_line_adapter ⇒ Object
310 311 312 |
# File 'lib/erp_integration/configuration.rb', line 310 def sales_order_line_adapter @sales_order_line_adapter || :fulfil end |
#sales_return_reason_adapter ⇒ Object
314 315 316 |
# File 'lib/erp_integration/configuration.rb', line 314 def sales_return_reason_adapter @sales_return_reason_adapter || :fulfil end |
#stock_bin_transfer_adapter ⇒ Object
318 319 320 |
# File 'lib/erp_integration/configuration.rb', line 318 def stock_bin_transfer_adapter @stock_bin_transfer_adapter || :fulfil end |
#stock_move_adapter ⇒ Object
322 323 324 |
# File 'lib/erp_integration/configuration.rb', line 322 def stock_move_adapter @stock_move_adapter || :fulfil end |
#supplier_shipment_adapter ⇒ Object
326 327 328 |
# File 'lib/erp_integration/configuration.rb', line 326 def supplier_shipment_adapter @supplier_shipment_adapter || :fulfil end |
#task_adapter ⇒ Object
330 331 332 |
# File 'lib/erp_integration/configuration.rb', line 330 def task_adapter @task_adapter || :fulfil end |
#tracking_number_adapter ⇒ Object
334 335 336 |
# File 'lib/erp_integration/configuration.rb', line 334 def tracking_number_adapter @tracking_number_adapter || :fulfil end |
Instance Method Details
#box_type_adapter ⇒ Object
198 199 200 |
# File 'lib/erp_integration/configuration.rb', line 198 def box_type_adapter @box_type_adapter || :fulfil end |
#carrier_adapter ⇒ Object
202 203 204 |
# File 'lib/erp_integration/configuration.rb', line 202 def carrier_adapter @carrier_adapter || :fulfil end |
#carrier_service_adapter ⇒ Object
206 207 208 |
# File 'lib/erp_integration/configuration.rb', line 206 def carrier_service_adapter @carrier_service_adapter || :fulfil end |
#inventory_by_location_report_adapter ⇒ Object
234 235 236 |
# File 'lib/erp_integration/configuration.rb', line 234 def inventory_by_location_report_adapter @inventory_by_location_report_adapter || :fulfil end |
#logger ⇒ Object
242 243 244 |
# File 'lib/erp_integration/configuration.rb', line 242 def logger @logger || Logger.new(nil) end |
#logger=(logger) ⇒ Object
246 247 248 |
# File 'lib/erp_integration/configuration.rb', line 246 def logger=(logger) @logger = Logger.new(logger) end |
#rate_limiters ⇒ Object
Rate limiters that will be used for HTTP operations on Client to manage the number of requests made to avoid rate limiting by the API provider.
292 293 294 |
# File 'lib/erp_integration/configuration.rb', line 292 def rate_limiters @rate_limiters ||= [] end |
#rate_limiters=(rate_limiters) ⇒ Object
Sets the rate limiters that will be used
298 299 300 |
# File 'lib/erp_integration/configuration.rb', line 298 def rate_limiters=(rate_limiters) @rate_limiters = (rate_limiters || []).each { |limiter| RateLimiter.validate!(limiter) } end |
#webhook_adapter ⇒ Object
338 339 340 |
# File 'lib/erp_integration/configuration.rb', line 338 def webhook_adapter @webhook_adapter || :fulfil end |