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_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.
- #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.
171 172 173 174 175 |
# File 'lib/erp_integration/configuration.rb', line 171 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
189 190 191 |
# File 'lib/erp_integration/configuration.rb', line 189 def bill_of_material_adapter @bill_of_material_adapter || :fulfil end |
#bill_of_material_input_adapter ⇒ Object
193 194 195 |
# File 'lib/erp_integration/configuration.rb', line 193 def bill_of_material_input_adapter @bill_of_material_input_adapter || :fulfil end |
#bill_of_material_output_adapter ⇒ Object
197 198 199 |
# File 'lib/erp_integration/configuration.rb', line 197 def bill_of_material_output_adapter @bill_of_material_output_adapter || :fulfil end |
#channel_listing_adapter ⇒ Object
209 210 211 |
# File 'lib/erp_integration/configuration.rb', line 209 def channel_listing_adapter @channel_listing_adapter || :fulfil end |
#country_adapter ⇒ Object
205 206 207 |
# File 'lib/erp_integration/configuration.rb', line 205 def country_adapter @country_adapter || :fulfil end |
#customer_shipment_adapter ⇒ Object
213 214 215 |
# File 'lib/erp_integration/configuration.rb', line 213 def customer_shipment_adapter @customer_shipment_adapter || :fulfil end |
#customer_shipment_return_adapter ⇒ Object
217 218 219 |
# File 'lib/erp_integration/configuration.rb', line 217 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
293 294 295 |
# File 'lib/erp_integration/configuration.rb', line 293 def gift_card_adapter @gift_card_adapter || :fulfil end |
#internal_shipment_adapter ⇒ Object
221 222 223 |
# File 'lib/erp_integration/configuration.rb', line 221 def internal_shipment_adapter @internal_shipment_adapter || :fulfil end |
#location_adapter ⇒ Object
225 226 227 |
# File 'lib/erp_integration/configuration.rb', line 225 def location_adapter @location_adapter || :fulfil end |
#party_address_adapter ⇒ Object
301 302 303 |
# File 'lib/erp_integration/configuration.rb', line 301 def party_address_adapter @party_address_adapter || :fulfil end |
#product_adapter ⇒ Object
229 230 231 |
# File 'lib/erp_integration/configuration.rb', line 229 def product_adapter @product_adapter || :fulfil end |
#product_category_adapter ⇒ Object
233 234 235 |
# File 'lib/erp_integration/configuration.rb', line 233 def product_category_adapter @product_category_adapter || :fulfil end |
#product_option_adapter ⇒ Object
305 306 307 |
# File 'lib/erp_integration/configuration.rb', line 305 def product_option_adapter @product_option_adapter || :fulfil end |
#product_template_adapter ⇒ Object
237 238 239 |
# File 'lib/erp_integration/configuration.rb', line 237 def product_template_adapter @product_template_adapter || :fulfil end |
#production_order_adapter ⇒ Object
241 242 243 |
# File 'lib/erp_integration/configuration.rb', line 241 def production_order_adapter @production_order_adapter || :fulfil end |
#purchase_order_adapter ⇒ Object
245 246 247 |
# File 'lib/erp_integration/configuration.rb', line 245 def purchase_order_adapter @purchase_order_adapter || :fulfil end |
#purchase_order_line_adapter ⇒ Object
249 250 251 |
# File 'lib/erp_integration/configuration.rb', line 249 def purchase_order_line_adapter @purchase_order_line_adapter || :fulfil end |
#purchase_request_adapter ⇒ Object
253 254 255 |
# File 'lib/erp_integration/configuration.rb', line 253 def purchase_request_adapter @purchase_request_adapter || :fulfil end |
#sales_line_option_adapter ⇒ Object
297 298 299 |
# File 'lib/erp_integration/configuration.rb', line 297 def sales_line_option_adapter @sales_line_option_adapter || :fulfil end |
#sales_order_adapter ⇒ Object
261 262 263 |
# File 'lib/erp_integration/configuration.rb', line 261 def sales_order_adapter @sales_order_adapter || :fulfil end |
#sales_order_line_adapter ⇒ Object
257 258 259 |
# File 'lib/erp_integration/configuration.rb', line 257 def sales_order_line_adapter @sales_order_line_adapter || :fulfil end |
#sales_return_reason_adapter ⇒ Object
265 266 267 |
# File 'lib/erp_integration/configuration.rb', line 265 def sales_return_reason_adapter @sales_return_reason_adapter || :fulfil end |
#stock_bin_transfer_adapter ⇒ Object
273 274 275 |
# File 'lib/erp_integration/configuration.rb', line 273 def stock_bin_transfer_adapter @stock_bin_transfer_adapter || :fulfil end |
#stock_move_adapter ⇒ Object
277 278 279 |
# File 'lib/erp_integration/configuration.rb', line 277 def stock_move_adapter @stock_move_adapter || :fulfil end |
#supplier_shipment_adapter ⇒ Object
269 270 271 |
# File 'lib/erp_integration/configuration.rb', line 269 def supplier_shipment_adapter @supplier_shipment_adapter || :fulfil end |
#task_adapter ⇒ Object
281 282 283 |
# File 'lib/erp_integration/configuration.rb', line 281 def task_adapter @task_adapter || :fulfil end |
#tracking_number_adapter ⇒ Object
285 286 287 |
# File 'lib/erp_integration/configuration.rb', line 285 def tracking_number_adapter @tracking_number_adapter || :fulfil end |
Instance Method Details
#box_type_adapter ⇒ Object
201 202 203 |
# File 'lib/erp_integration/configuration.rb', line 201 def box_type_adapter @box_type_adapter || :fulfil end |
#carrier_adapter ⇒ Object
181 182 183 |
# File 'lib/erp_integration/configuration.rb', line 181 def carrier_adapter @carrier_adapter || :fulfil end |
#carrier_service_adapter ⇒ Object
185 186 187 |
# File 'lib/erp_integration/configuration.rb', line 185 def carrier_service_adapter @carrier_service_adapter || :fulfil end |
#logger ⇒ Object
321 322 323 |
# File 'lib/erp_integration/configuration.rb', line 321 def logger @logger || Logger.new(nil) end |
#logger=(logger) ⇒ Object
325 326 327 |
# File 'lib/erp_integration/configuration.rb', line 325 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.
311 312 313 |
# File 'lib/erp_integration/configuration.rb', line 311 def rate_limiters @rate_limiters ||= [] end |
#rate_limiters=(rate_limiters) ⇒ Object
Sets the rate limiters that will be used
317 318 319 |
# File 'lib/erp_integration/configuration.rb', line 317 def rate_limiters=(rate_limiters) @rate_limiters = (rate_limiters || []).each { |limiter| RateLimiter.validate!(limiter) } end |
#webhook_adapter ⇒ Object
289 290 291 |
# File 'lib/erp_integration/configuration.rb', line 289 def webhook_adapter @webhook_adapter || :fulfil end |