44using System ;
55using System . Globalization ;
66using System . Threading ;
7+ using Microsoft . Extensions . Logging ;
78
89namespace FikaAmazonAPI
910{
1011 public class AmazonConnection
1112 {
13+ private readonly ILoggerFactory _loggerFactory ;
1214 private AmazonCredential Credentials { get ; set ; }
1315
1416 private IRateLimitingHandler RateLimitingHandler { get ; }
@@ -93,12 +95,9 @@ public class AmazonConnection
9395 private UnauthorizedAccessException _NoCredentials = new UnauthorizedAccessException ( $ "Error, you cannot make calls to Amazon without credentials!") ;
9496
9597 public string RefNumber { get ; set ; }
96- public AmazonConnection (
97- AmazonCredential Credentials ,
98- IRateLimitingHandler rateLimitingHandler = null ,
99- string RefNumber = null ,
100- CultureInfo ? cultureInfo = null )
98+ public AmazonConnection ( AmazonCredential Credentials , IRateLimitingHandler rateLimitingHandler = null , string RefNumber = null , CultureInfo ? cultureInfo = null , ILoggerFactory ? loggerFactory = null )
10199 {
100+ _loggerFactory = loggerFactory ;
102101 this . Authenticate ( Credentials ) ;
103102 this . RefNumber = RefNumber ;
104103 this . RateLimitingHandler = rateLimitingHandler ?? new RateLimitingHandler ( ) ;
@@ -119,44 +118,44 @@ private void Init(AmazonCredential Credentials)
119118
120119 this . Credentials = Credentials ;
121120
122- this . _Authorization = new AuthorizationService ( this . Credentials , this . RateLimitingHandler ) ;
123- this . _AppIntegrationsServiceV20240401 = new AppIntegrationsServiceV20240401 ( this . Credentials , this . RateLimitingHandler ) ;
124- this . _Orders = new OrderService ( this . Credentials , this . RateLimitingHandler ) ;
125- this . _Reports = new ReportService ( this . Credentials , this . RateLimitingHandler ) ;
126- this . _Solicitations = new SolicitationService ( this . Credentials , this . RateLimitingHandler ) ;
127- this . _Financials = new FinancialService ( this . Credentials , this . RateLimitingHandler ) ;
128- this . _CatalogItems = new CatalogItemService ( this . Credentials , this . RateLimitingHandler ) ;
129- this . _ProductPricing = new ProductPricingService ( this . Credentials , this . RateLimitingHandler ) ;
121+ this . _Authorization = new AuthorizationService ( this . Credentials , _loggerFactory ) ;
122+ this . _AppIntegrationsServiceV20240401 = new AppIntegrationsServiceV20240401 ( this . Credentials , _loggerFactory ) ;
123+ this . _Orders = new OrderService ( this . Credentials , _loggerFactory ) ;
124+ this . _Reports = new ReportService ( this . Credentials , _loggerFactory ) ;
125+ this . _Solicitations = new SolicitationService ( this . Credentials , _loggerFactory ) ;
126+ this . _Financials = new FinancialService ( this . Credentials , _loggerFactory ) ;
127+ this . _CatalogItems = new CatalogItemService ( this . Credentials , _loggerFactory ) ;
128+ this . _ProductPricing = new ProductPricingService ( this . Credentials , _loggerFactory ) ;
130129
131- this . _FbaInbound = new FbaInboundService ( this . Credentials , this . RateLimitingHandler ) ;
132- this . _FbaInventory = new FbaInventoryService ( this . Credentials , this . RateLimitingHandler ) ;
133- this . _FbaOutbound = new FbaOutboundService ( this . Credentials , this . RateLimitingHandler ) ;
134- this . _FbaSmallandLight = new FbaSmallandLightService ( this . Credentials , this . RateLimitingHandler ) ;
135- this . _FbaInboundEligibility = new FbaInboundEligibilityService ( this . Credentials , this . RateLimitingHandler ) ;
136- this . _EasyShip20220323 = new EasyShip20220323Service ( this . Credentials , this . RateLimitingHandler ) ;
137- this . _AplusContent = new AplusContentService ( this . Credentials , this . RateLimitingHandler ) ;
138- this . _Feed = new FeedService ( this . Credentials , this . RateLimitingHandler ) ;
139- this . _ListingsItem = new ListingsItemService ( this . Credentials , this . RateLimitingHandler ) ;
140- this . _Restrictions = new RestrictionService ( this . Credentials , this . RateLimitingHandler ) ;
141- this . _MerchantFulfillment = new MerchantFulfillmentService ( this . Credentials , this . RateLimitingHandler ) ;
142- this . _Messaging = new MessagingService ( this . Credentials , this . RateLimitingHandler ) ;
143- this . _Notification = new NotificationService ( this . Credentials , this . RateLimitingHandler ) ;
144- this . _ProductFee = new ProductFeeService ( this . Credentials , this . RateLimitingHandler ) ;
145- this . _ProductType = new ProductTypeService ( this . Credentials , this . RateLimitingHandler ) ;
146- this . _Sales = new SalesService ( this . Credentials , this . RateLimitingHandler ) ;
147- this . _Seller = new SellerService ( this . Credentials , this . RateLimitingHandler ) ;
148- this . _Services = new ServicesService ( this . Credentials , this . RateLimitingHandler ) ;
149- this . _ShipmentInvoicing = new ShipmentInvoicingService ( this . Credentials , this . RateLimitingHandler ) ;
150- this . _Shipping = new ShippingService ( this . Credentials , this . RateLimitingHandler ) ;
151- this . _ShippingV2 = new ShippingServiceV2 ( this . Credentials , this . RateLimitingHandler ) ;
152- this . _Upload = new UploadService ( this . Credentials , this . RateLimitingHandler ) ;
153- this . _Tokens = new TokenService ( this . Credentials , this . RateLimitingHandler ) ;
154- this . _FulFillmentInbound = new FulFillmentInboundService ( this . Credentials , this . RateLimitingHandler ) ;
155- this . _FulFillmentInboundv20240320 = new FulFillmentInboundServicev20240320 ( this . Credentials , this . RateLimitingHandler ) ;
156- this . _FulFillmentOutbound = new FulFillmentOutboundService ( this . Credentials , this . RateLimitingHandler ) ;
157- this . _VendorDirectFulfillmentOrders = new VendorDirectFulfillmentOrderService ( this . Credentials , this . RateLimitingHandler ) ;
158- this . _VendorOrders = new VendorOrderService ( this . Credentials , this . RateLimitingHandler ) ;
159- this . _VendorTransactionStatus = new VendorTransactionStatusService ( this . Credentials , this . RateLimitingHandler ) ;
130+ this . _FbaInbound = new FbaInboundService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
131+ this . _FbaInventory = new FbaInventoryService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
132+ this . _FbaOutbound = new FbaOutboundService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
133+ this . _FbaSmallandLight = new FbaSmallandLightService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
134+ this . _FbaInboundEligibility = new FbaInboundEligibilityService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
135+ this . _EasyShip20220323 = new EasyShip20220323Service ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
136+ this . _AplusContent = new AplusContentService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
137+ this . _Feed = new FeedService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
138+ this . _ListingsItem = new ListingsItemService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
139+ this . _Restrictions = new RestrictionService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
140+ this . _MerchantFulfillment = new MerchantFulfillmentService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
141+ this . _Messaging = new MessagingService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
142+ this . _Notification = new NotificationService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
143+ this . _ProductFee = new ProductFeeService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
144+ this . _ProductType = new ProductTypeService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
145+ this . _Sales = new SalesService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
146+ this . _Seller = new SellerService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
147+ this . _Services = new ServicesService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
148+ this . _ShipmentInvoicing = new ShipmentInvoicingService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
149+ this . _Shipping = new ShippingService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
150+ this . _ShippingV2 = new ShippingServiceV2 ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
151+ this . _Upload = new UploadService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
152+ this . _Tokens = new TokenService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
153+ this . _FulFillmentInbound = new FulFillmentInboundService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
154+ this . _FulFillmentInboundv20240320 = new FulFillmentInboundServicev20240320 ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
155+ this . _FulFillmentOutbound = new FulFillmentOutboundService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
156+ this . _VendorDirectFulfillmentOrders = new VendorDirectFulfillmentOrderService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
157+ this . _VendorOrders = new VendorOrderService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
158+ this . _VendorTransactionStatus = new VendorTransactionStatusService ( this . Credentials , _loggerFactory , this . RateLimitingHandler ) ;
160159
161160 AmazonCredential . DebugMode = this . Credentials . IsDebugMode ;
162161 }
0 commit comments