From 8c30cebd1150d7ad2badddf760ed53cbced4b34c Mon Sep 17 00:00:00 2001 From: Alejandro de Arriba Date: Sun, 4 Feb 2024 11:50:06 +0100 Subject: [PATCH] Added IServiceFactory + Refactor DI Created IServiceFactory and updated all Factories to use this new interface. Refactor test cases for dependency injectio to validate all factories using the base generic interface. --- .../ServiceCollectionExtensionTests.cs | 36 +++++++-- .../ServiceCollectionExtensions.cs | 81 +++++-------------- .../Factories/AccessScopeServiceFactory.cs | 12 +-- .../ApplicationCreditServiceFactory.cs | 12 +-- .../Factories/ArticleServiceFactory.cs | 12 +-- ShopifySharp/Factories/AssetServiceFactory.cs | 12 +-- .../AssignedFulfillmentOrderServiceFactory.cs | 12 +-- ShopifySharp/Factories/BlogServiceFactory.cs | 12 +-- .../CancellationRequestServiceFactory.cs | 12 +-- .../Factories/CarrierServiceFactory.cs | 12 +-- .../Factories/ChargeServiceFactory.cs | 13 +-- .../CheckoutSalesChannelServiceFactory.cs | 12 +-- .../Factories/CheckoutServiceFactory.cs | 12 +-- .../Factories/CollectServiceFactory.cs | 12 +-- .../CollectionListingServiceFactory.cs | 13 +-- .../Factories/CollectionServiceFactory.cs | 12 +-- .../Factories/CountryServiceFactory.cs | 12 +-- .../CustomCollectionServiceFactory.cs | 12 +-- .../CustomerAddressServiceFactory.cs | 12 +-- .../CustomerSavedSearchServiceFactory.cs | 12 +-- .../Factories/CustomerServiceFactory.cs | 12 +-- .../Factories/DiscountCodeServiceFactory.cs | 12 +-- .../Factories/DraftOrderServiceFactory.cs | 12 +-- ShopifySharp/Factories/EventServiceFactory.cs | 12 +-- .../FulfillmentEventServiceFactory.cs | 12 +-- .../FulfillmentOrderServiceFactory.cs | 12 +-- .../FulfillmentRequestServiceFactory.cs | 12 +-- .../Factories/FulfillmentServiceFactory.cs | 12 +-- .../FulfillmentServiceServiceFactory.cs | 12 +-- .../GiftCardAdjustmentServiceFactory.cs | 12 +-- .../Factories/GiftCardServiceFactory.cs | 12 +-- ShopifySharp/Factories/GraphServiceFactory.cs | 12 +-- ShopifySharp/Factories/IServiceFactory.cs | 16 ++++ .../Factories/InventoryItemServiceFactory.cs | 12 +-- .../Factories/InventoryLevelServiceFactory.cs | 12 +-- .../Factories/LocationServiceFactory.cs | 12 +-- .../Factories/MetaFieldServiceFactory.cs | 12 +-- .../Factories/OrderRiskServiceFactory.cs | 12 +-- ShopifySharp/Factories/OrderServiceFactory.cs | 12 +-- ShopifySharp/Factories/PageServiceFactory.cs | 12 +-- .../Factories/PolicyServiceFactory.cs | 12 +-- .../Factories/PriceRuleServiceFactory.cs | 12 +-- .../Factories/ProductImageServiceFactory.cs | 12 +-- .../Factories/ProductListingServiceFactory.cs | 12 +-- .../Factories/ProductServiceFactory.cs | 12 +-- .../Factories/ProductVariantServiceFactory.cs | 12 +-- .../RecurringChargeServiceFactory.cs | 12 +-- .../Factories/RedirectServiceFactory.cs | 12 +-- .../Factories/RefundServiceFactory.cs | 12 +-- .../Factories/ScriptTagServiceFactory.cs | 12 +-- .../Factories/ShippingZoneServiceFactory.cs | 12 +-- .../Factories/ShopPlanServiceFactory.cs | 12 +-- ShopifySharp/Factories/ShopServiceFactory.cs | 12 +-- .../ShopifyPaymentsServiceFactory.cs | 12 +-- .../SmartCollectionServiceFactory.cs | 12 +-- .../StorefrontAccessTokenServiceFactory.cs | 12 +-- .../TenderTransactionServiceFactory.cs | 12 +-- ShopifySharp/Factories/ThemeServiceFactory.cs | 12 +-- .../Factories/TransactionServiceFactory.cs | 12 +-- .../Factories/UsageChargeServiceFactory.cs | 12 +-- ShopifySharp/Factories/UserServiceFactory.cs | 12 +-- .../Factories/WebhookServiceFactory.cs | 12 +-- .../Factories/factory-service-template.txt | 14 +--- 63 files changed, 131 insertions(+), 726 deletions(-) create mode 100644 ShopifySharp/Factories/IServiceFactory.cs diff --git a/ShopifySharp.Extensions.DependencyInjection.Tests/ServiceCollectionExtensionTests.cs b/ShopifySharp.Extensions.DependencyInjection.Tests/ServiceCollectionExtensionTests.cs index b22cfebf..3ddd798c 100644 --- a/ShopifySharp.Extensions.DependencyInjection.Tests/ServiceCollectionExtensionTests.cs +++ b/ShopifySharp.Extensions.DependencyInjection.Tests/ServiceCollectionExtensionTests.cs @@ -1,4 +1,5 @@ using ShopifySharp.Utilities; +using System.Reflection; namespace ShopifySharp.Extensions.DependencyInjection.Tests; @@ -140,12 +141,35 @@ public void AddShopifySharpServiceFactories_AddsServiceFactories() // Assert var serviceProvider = container.BuildServiceProvider(); - var orderServiceFactory = serviceProvider.GetService(); - - orderServiceFactory.Should() - .NotBeNull() - .And - .BeOfType(); + var assembly = Assembly.GetAssembly(typeof(IServiceFactory<>)); + + if (assembly == null) + { + throw new InvalidOperationException("No assembly found for IServiceFactory interface. Ensure you are scanning the correct assembly."); + } + + var serviceFactoryTypes = assembly + ?.GetTypes() + .Where(t => t.IsInterface + && t.IsPublic + && t.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IServiceFactory<>))) + .ToList(); + + if (serviceFactoryTypes == null || !serviceFactoryTypes.Any()) + { + throw new InvalidOperationException("No IServiceFactory interfaces found. Ensure you are scanning the correct assembly."); + } + + foreach (var serviceType in serviceFactoryTypes) + { + var resolvedService = serviceProvider.GetService(serviceType); + var concreteType = assembly.GetType($"ShopifySharp.Factories.{serviceType.Name.Substring(1)}"); + + resolvedService.Should() + .NotBeNull() + .And + .BeOfType(concreteType); + } } [Fact] diff --git a/ShopifySharp.Extensions.DependencyInjection/ServiceCollectionExtensions.cs b/ShopifySharp.Extensions.DependencyInjection/ServiceCollectionExtensions.cs index 49efe9f9..358c049e 100644 --- a/ShopifySharp.Extensions.DependencyInjection/ServiceCollectionExtensions.cs +++ b/ShopifySharp.Extensions.DependencyInjection/ServiceCollectionExtensions.cs @@ -3,6 +3,8 @@ using Microsoft.Extensions.DependencyInjection; using ShopifySharp.Factories; using ShopifySharp.Utilities; +using System.Reflection; +using System.Linq; // ReSharper disable MemberCanBePrivate.Global // ReSharper disable UnusedType.Global @@ -79,66 +81,27 @@ public static IServiceCollection AddShopifySharpUtilities(this IServiceCollectio public static IServiceCollection AddShopifySharpServiceFactories(this IServiceCollection services) { // TODO: add ServiceLifetime parameter - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); + var assembly = Assembly.GetAssembly(typeof(IServiceFactory<>)); + + var factoryTypes = assembly!.GetTypes() + .Where(t => !t.IsAbstract && !t.IsInterface) + .Where(t => t.GetInterfaces().Any(i => + i.IsGenericType && + i.GetGenericTypeDefinition() == typeof(IServiceFactory<>))); + + foreach (var type in factoryTypes) + { + var serviceType = type.GetInterfaces() + .Where(i => !i.IsGenericType) + .FirstOrDefault(); + + if(serviceType != null) + { + services.TryAddSingleton(serviceType, type); + } + } + services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); return services; } diff --git a/ShopifySharp/Factories/AccessScopeServiceFactory.cs b/ShopifySharp/Factories/AccessScopeServiceFactory.cs index d1f25afb..d839c44b 100644 --- a/ShopifySharp/Factories/AccessScopeServiceFactory.cs +++ b/ShopifySharp/Factories/AccessScopeServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IAccessScopeServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IAccessScopeService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IAccessScopeService Create(ShopifyApiCredentials credentials); -} +public interface IAccessScopeServiceFactory : IServiceFactory; public class AccessScopeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IAccessScopeServiceFactory { diff --git a/ShopifySharp/Factories/ApplicationCreditServiceFactory.cs b/ShopifySharp/Factories/ApplicationCreditServiceFactory.cs index b2202fb4..14a68abe 100644 --- a/ShopifySharp/Factories/ApplicationCreditServiceFactory.cs +++ b/ShopifySharp/Factories/ApplicationCreditServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IApplicationCreditServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IApplicationCreditService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IApplicationCreditService Create(ShopifyApiCredentials credentials); -} +public interface IApplicationCreditServiceFactory : IServiceFactory; public class ApplicationCreditServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IApplicationCreditServiceFactory { diff --git a/ShopifySharp/Factories/ArticleServiceFactory.cs b/ShopifySharp/Factories/ArticleServiceFactory.cs index 1f3c679b..f94f9406 100644 --- a/ShopifySharp/Factories/ArticleServiceFactory.cs +++ b/ShopifySharp/Factories/ArticleServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IArticleServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IArticleService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IArticleService Create(ShopifyApiCredentials credentials); -} +public interface IArticleServiceFactory : IServiceFactory; public class ArticleServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IArticleServiceFactory { diff --git a/ShopifySharp/Factories/AssetServiceFactory.cs b/ShopifySharp/Factories/AssetServiceFactory.cs index 878d2589..84326c28 100644 --- a/ShopifySharp/Factories/AssetServiceFactory.cs +++ b/ShopifySharp/Factories/AssetServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IAssetServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IAssetService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IAssetService Create(ShopifyApiCredentials credentials); -} +public interface IAssetServiceFactory : IServiceFactory; public class AssetServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IAssetServiceFactory { diff --git a/ShopifySharp/Factories/AssignedFulfillmentOrderServiceFactory.cs b/ShopifySharp/Factories/AssignedFulfillmentOrderServiceFactory.cs index f0fe3403..9d6ce4ef 100644 --- a/ShopifySharp/Factories/AssignedFulfillmentOrderServiceFactory.cs +++ b/ShopifySharp/Factories/AssignedFulfillmentOrderServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IAssignedFulfillmentOrderServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IAssignedFulfillmentOrderService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IAssignedFulfillmentOrderService Create(ShopifyApiCredentials credentials); -} +public interface IAssignedFulfillmentOrderServiceFactory : IServiceFactory; public class AssignedFulfillmentOrderServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IAssignedFulfillmentOrderServiceFactory { diff --git a/ShopifySharp/Factories/BlogServiceFactory.cs b/ShopifySharp/Factories/BlogServiceFactory.cs index 44e51cc7..b342931a 100644 --- a/ShopifySharp/Factories/BlogServiceFactory.cs +++ b/ShopifySharp/Factories/BlogServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IBlogServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IBlogService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IBlogService Create(ShopifyApiCredentials credentials); -} +public interface IBlogServiceFactory : IServiceFactory; public class BlogServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IBlogServiceFactory { diff --git a/ShopifySharp/Factories/CancellationRequestServiceFactory.cs b/ShopifySharp/Factories/CancellationRequestServiceFactory.cs index ca0ab736..96f561a7 100644 --- a/ShopifySharp/Factories/CancellationRequestServiceFactory.cs +++ b/ShopifySharp/Factories/CancellationRequestServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICancellationRequestServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICancellationRequestService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICancellationRequestService Create(ShopifyApiCredentials credentials); -} +public interface ICancellationRequestServiceFactory : IServiceFactory; public class CancellationRequestServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICancellationRequestServiceFactory { diff --git a/ShopifySharp/Factories/CarrierServiceFactory.cs b/ShopifySharp/Factories/CarrierServiceFactory.cs index 8e9f1d01..ffc28181 100644 --- a/ShopifySharp/Factories/CarrierServiceFactory.cs +++ b/ShopifySharp/Factories/CarrierServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICarrierServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICarrierService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICarrierService Create(ShopifyApiCredentials credentials); -} +public interface ICarrierServiceFactory : IServiceFactory; public class CarrierServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICarrierServiceFactory { diff --git a/ShopifySharp/Factories/ChargeServiceFactory.cs b/ShopifySharp/Factories/ChargeServiceFactory.cs index 1668dc19..54ad72e0 100644 --- a/ShopifySharp/Factories/ChargeServiceFactory.cs +++ b/ShopifySharp/Factories/ChargeServiceFactory.cs @@ -7,17 +7,8 @@ namespace ShopifySharp.Factories; -public interface IChargeServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IChargeService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IChargeService Create(ShopifyApiCredentials credentials); -} +public interface IChargeServiceFactory : IServiceFactory; + public class ChargeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IChargeServiceFactory { diff --git a/ShopifySharp/Factories/CheckoutSalesChannelServiceFactory.cs b/ShopifySharp/Factories/CheckoutSalesChannelServiceFactory.cs index 04a8302c..7bd32b88 100644 --- a/ShopifySharp/Factories/CheckoutSalesChannelServiceFactory.cs +++ b/ShopifySharp/Factories/CheckoutSalesChannelServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICheckoutSalesChannelServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICheckoutSalesChannelService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICheckoutSalesChannelService Create(ShopifyApiCredentials credentials); -} +public interface ICheckoutSalesChannelServiceFactory : IServiceFactory; public class CheckoutSalesChannelServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICheckoutSalesChannelServiceFactory { diff --git a/ShopifySharp/Factories/CheckoutServiceFactory.cs b/ShopifySharp/Factories/CheckoutServiceFactory.cs index 7bc712d6..01710f46 100644 --- a/ShopifySharp/Factories/CheckoutServiceFactory.cs +++ b/ShopifySharp/Factories/CheckoutServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICheckoutServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICheckoutService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICheckoutService Create(ShopifyApiCredentials credentials); -} +public interface ICheckoutServiceFactory : IServiceFactory; public class CheckoutServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICheckoutServiceFactory { diff --git a/ShopifySharp/Factories/CollectServiceFactory.cs b/ShopifySharp/Factories/CollectServiceFactory.cs index a827dab7..9b0ca65a 100644 --- a/ShopifySharp/Factories/CollectServiceFactory.cs +++ b/ShopifySharp/Factories/CollectServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICollectServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICollectService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICollectService Create(ShopifyApiCredentials credentials); -} +public interface ICollectServiceFactory : IServiceFactory; public class CollectServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICollectServiceFactory { diff --git a/ShopifySharp/Factories/CollectionListingServiceFactory.cs b/ShopifySharp/Factories/CollectionListingServiceFactory.cs index 0d894b69..3f0667b2 100644 --- a/ShopifySharp/Factories/CollectionListingServiceFactory.cs +++ b/ShopifySharp/Factories/CollectionListingServiceFactory.cs @@ -7,17 +7,8 @@ namespace ShopifySharp.Factories; -public interface ICollectionListingServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICollectionListingService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICollectionListingService Create(ShopifyApiCredentials credentials); -} +public interface ICollectionListingServiceFactory : IServiceFactory; + public class CollectionListingServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICollectionListingServiceFactory { diff --git a/ShopifySharp/Factories/CollectionServiceFactory.cs b/ShopifySharp/Factories/CollectionServiceFactory.cs index e569dfa0..7d277460 100644 --- a/ShopifySharp/Factories/CollectionServiceFactory.cs +++ b/ShopifySharp/Factories/CollectionServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICollectionServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICollectionService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICollectionService Create(ShopifyApiCredentials credentials); -} +public interface ICollectionServiceFactory : IServiceFactory; public class CollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICollectionServiceFactory { diff --git a/ShopifySharp/Factories/CountryServiceFactory.cs b/ShopifySharp/Factories/CountryServiceFactory.cs index 4418d0c0..796f1bac 100644 --- a/ShopifySharp/Factories/CountryServiceFactory.cs +++ b/ShopifySharp/Factories/CountryServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICountryServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICountryService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICountryService Create(ShopifyApiCredentials credentials); -} +public interface ICountryServiceFactory : IServiceFactory; public class CountryServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICountryServiceFactory { diff --git a/ShopifySharp/Factories/CustomCollectionServiceFactory.cs b/ShopifySharp/Factories/CustomCollectionServiceFactory.cs index 8e3b1fc9..c1c5249d 100644 --- a/ShopifySharp/Factories/CustomCollectionServiceFactory.cs +++ b/ShopifySharp/Factories/CustomCollectionServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICustomCollectionServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICustomCollectionService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICustomCollectionService Create(ShopifyApiCredentials credentials); -} +public interface ICustomCollectionServiceFactory : IServiceFactory; public class CustomCollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICustomCollectionServiceFactory { diff --git a/ShopifySharp/Factories/CustomerAddressServiceFactory.cs b/ShopifySharp/Factories/CustomerAddressServiceFactory.cs index 5a2ecf51..f49afe1d 100644 --- a/ShopifySharp/Factories/CustomerAddressServiceFactory.cs +++ b/ShopifySharp/Factories/CustomerAddressServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICustomerAddressServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICustomerAddressService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICustomerAddressService Create(ShopifyApiCredentials credentials); -} +public interface ICustomerAddressServiceFactory : IServiceFactory; public class CustomerAddressServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICustomerAddressServiceFactory { diff --git a/ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs b/ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs index 96354030..b5553554 100644 --- a/ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs +++ b/ShopifySharp/Factories/CustomerSavedSearchServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICustomerSavedSearchServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICustomerSavedSearchService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICustomerSavedSearchService Create(ShopifyApiCredentials credentials); -} +public interface ICustomerSavedSearchServiceFactory : IServiceFactory; public class CustomerSavedSearchServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICustomerSavedSearchServiceFactory { diff --git a/ShopifySharp/Factories/CustomerServiceFactory.cs b/ShopifySharp/Factories/CustomerServiceFactory.cs index 8c318841..7187dc96 100644 --- a/ShopifySharp/Factories/CustomerServiceFactory.cs +++ b/ShopifySharp/Factories/CustomerServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ICustomerServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ICustomerService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ICustomerService Create(ShopifyApiCredentials credentials); -} +public interface ICustomerServiceFactory : IServiceFactory; public class CustomerServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICustomerServiceFactory { diff --git a/ShopifySharp/Factories/DiscountCodeServiceFactory.cs b/ShopifySharp/Factories/DiscountCodeServiceFactory.cs index f2ac1708..83b9c74d 100644 --- a/ShopifySharp/Factories/DiscountCodeServiceFactory.cs +++ b/ShopifySharp/Factories/DiscountCodeServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IDiscountCodeServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IDiscountCodeService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IDiscountCodeService Create(ShopifyApiCredentials credentials); -} +public interface IDiscountCodeServiceFactory : IServiceFactory; public class DiscountCodeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IDiscountCodeServiceFactory { diff --git a/ShopifySharp/Factories/DraftOrderServiceFactory.cs b/ShopifySharp/Factories/DraftOrderServiceFactory.cs index 5a12304b..346dd486 100644 --- a/ShopifySharp/Factories/DraftOrderServiceFactory.cs +++ b/ShopifySharp/Factories/DraftOrderServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IDraftOrderServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IDraftOrderService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IDraftOrderService Create(ShopifyApiCredentials credentials); -} +public interface IDraftOrderServiceFactory : IServiceFactory; public class DraftOrderServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IDraftOrderServiceFactory { diff --git a/ShopifySharp/Factories/EventServiceFactory.cs b/ShopifySharp/Factories/EventServiceFactory.cs index d53ce94e..094532f6 100644 --- a/ShopifySharp/Factories/EventServiceFactory.cs +++ b/ShopifySharp/Factories/EventServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IEventServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IEventService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IEventService Create(ShopifyApiCredentials credentials); -} +public interface IEventServiceFactory : IServiceFactory; public class EventServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IEventServiceFactory { diff --git a/ShopifySharp/Factories/FulfillmentEventServiceFactory.cs b/ShopifySharp/Factories/FulfillmentEventServiceFactory.cs index 2230055f..c31a7c87 100644 --- a/ShopifySharp/Factories/FulfillmentEventServiceFactory.cs +++ b/ShopifySharp/Factories/FulfillmentEventServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IFulfillmentEventServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IFulfillmentEventService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IFulfillmentEventService Create(ShopifyApiCredentials credentials); -} +public interface IFulfillmentEventServiceFactory : IServiceFactory; public class FulfillmentEventServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IFulfillmentEventServiceFactory { diff --git a/ShopifySharp/Factories/FulfillmentOrderServiceFactory.cs b/ShopifySharp/Factories/FulfillmentOrderServiceFactory.cs index d6354a3f..6aaa953a 100644 --- a/ShopifySharp/Factories/FulfillmentOrderServiceFactory.cs +++ b/ShopifySharp/Factories/FulfillmentOrderServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IFulfillmentOrderServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IFulfillmentOrderService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IFulfillmentOrderService Create(ShopifyApiCredentials credentials); -} +public interface IFulfillmentOrderServiceFactory : IServiceFactory; public class FulfillmentOrderServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IFulfillmentOrderServiceFactory { diff --git a/ShopifySharp/Factories/FulfillmentRequestServiceFactory.cs b/ShopifySharp/Factories/FulfillmentRequestServiceFactory.cs index 1fb0d198..95309a12 100644 --- a/ShopifySharp/Factories/FulfillmentRequestServiceFactory.cs +++ b/ShopifySharp/Factories/FulfillmentRequestServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IFulfillmentRequestServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IFulfillmentRequestService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IFulfillmentRequestService Create(ShopifyApiCredentials credentials); -} +public interface IFulfillmentRequestServiceFactory : IServiceFactory; public class FulfillmentRequestServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IFulfillmentRequestServiceFactory { diff --git a/ShopifySharp/Factories/FulfillmentServiceFactory.cs b/ShopifySharp/Factories/FulfillmentServiceFactory.cs index b25ab914..4a81355a 100644 --- a/ShopifySharp/Factories/FulfillmentServiceFactory.cs +++ b/ShopifySharp/Factories/FulfillmentServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IFulfillmentServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IFulfillmentService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IFulfillmentService Create(ShopifyApiCredentials credentials); -} +public interface IFulfillmentServiceFactory : IServiceFactory; public class FulfillmentServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IFulfillmentServiceFactory { diff --git a/ShopifySharp/Factories/FulfillmentServiceServiceFactory.cs b/ShopifySharp/Factories/FulfillmentServiceServiceFactory.cs index 76436639..b549ce17 100644 --- a/ShopifySharp/Factories/FulfillmentServiceServiceFactory.cs +++ b/ShopifySharp/Factories/FulfillmentServiceServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IFulfillmentServiceServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IFulfillmentServiceService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IFulfillmentServiceService Create(ShopifyApiCredentials credentials); -} +public interface IFulfillmentServiceServiceFactory : IServiceFactory; public class FulfillmentServiceServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IFulfillmentServiceServiceFactory { diff --git a/ShopifySharp/Factories/GiftCardAdjustmentServiceFactory.cs b/ShopifySharp/Factories/GiftCardAdjustmentServiceFactory.cs index b5b635da..0bf5795c 100644 --- a/ShopifySharp/Factories/GiftCardAdjustmentServiceFactory.cs +++ b/ShopifySharp/Factories/GiftCardAdjustmentServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IGiftCardAdjustmentServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IGiftCardAdjustmentService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IGiftCardAdjustmentService Create(ShopifyApiCredentials credentials); -} +public interface IGiftCardAdjustmentServiceFactory : IServiceFactory; public class GiftCardAdjustmentServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IGiftCardAdjustmentServiceFactory { diff --git a/ShopifySharp/Factories/GiftCardServiceFactory.cs b/ShopifySharp/Factories/GiftCardServiceFactory.cs index 3b086ea6..aca06b72 100644 --- a/ShopifySharp/Factories/GiftCardServiceFactory.cs +++ b/ShopifySharp/Factories/GiftCardServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IGiftCardServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IGiftCardService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IGiftCardService Create(ShopifyApiCredentials credentials); -} +public interface IGiftCardServiceFactory : IServiceFactory; public class GiftCardServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IGiftCardServiceFactory { diff --git a/ShopifySharp/Factories/GraphServiceFactory.cs b/ShopifySharp/Factories/GraphServiceFactory.cs index 2da939d0..df1e7013 100644 --- a/ShopifySharp/Factories/GraphServiceFactory.cs +++ b/ShopifySharp/Factories/GraphServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IGraphServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IGraphService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IGraphService Create(ShopifyApiCredentials credentials); -} +public interface IGraphServiceFactory : IServiceFactory; public class GraphServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IGraphServiceFactory { diff --git a/ShopifySharp/Factories/IServiceFactory.cs b/ShopifySharp/Factories/IServiceFactory.cs new file mode 100644 index 00000000..949c2574 --- /dev/null +++ b/ShopifySharp/Factories/IServiceFactory.cs @@ -0,0 +1,16 @@ +using ShopifySharp.Credentials; + +namespace ShopifySharp.Factories; + +public interface IServiceFactory + where T: IShopifyService +{ + /// Creates a new instance of the with the given credentials. + /// The shop's *.myshopify.com URL. + /// An API access token for the shop. + T Create(string shopDomain, string accessToken); + + /// Creates a new instance of the with the given credentials. + /// Credentials for authenticating with the Shopify API. + T Create(ShopifyApiCredentials credentials); +} diff --git a/ShopifySharp/Factories/InventoryItemServiceFactory.cs b/ShopifySharp/Factories/InventoryItemServiceFactory.cs index d563aa6d..e810ac96 100644 --- a/ShopifySharp/Factories/InventoryItemServiceFactory.cs +++ b/ShopifySharp/Factories/InventoryItemServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IInventoryItemServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IInventoryItemService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IInventoryItemService Create(ShopifyApiCredentials credentials); -} +public interface IInventoryItemServiceFactory : IServiceFactory; public class InventoryItemServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IInventoryItemServiceFactory { diff --git a/ShopifySharp/Factories/InventoryLevelServiceFactory.cs b/ShopifySharp/Factories/InventoryLevelServiceFactory.cs index 09a863ba..5d18dcef 100644 --- a/ShopifySharp/Factories/InventoryLevelServiceFactory.cs +++ b/ShopifySharp/Factories/InventoryLevelServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IInventoryLevelServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IInventoryLevelService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IInventoryLevelService Create(ShopifyApiCredentials credentials); -} +public interface IInventoryLevelServiceFactory : IServiceFactory; public class InventoryLevelServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IInventoryLevelServiceFactory { diff --git a/ShopifySharp/Factories/LocationServiceFactory.cs b/ShopifySharp/Factories/LocationServiceFactory.cs index 3b5f3f10..60a9da78 100644 --- a/ShopifySharp/Factories/LocationServiceFactory.cs +++ b/ShopifySharp/Factories/LocationServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ILocationServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ILocationService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ILocationService Create(ShopifyApiCredentials credentials); -} +public interface ILocationServiceFactory : IServiceFactory; public class LocationServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ILocationServiceFactory { diff --git a/ShopifySharp/Factories/MetaFieldServiceFactory.cs b/ShopifySharp/Factories/MetaFieldServiceFactory.cs index 798bc618..6c1e8a0e 100644 --- a/ShopifySharp/Factories/MetaFieldServiceFactory.cs +++ b/ShopifySharp/Factories/MetaFieldServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IMetaFieldServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IMetaFieldService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IMetaFieldService Create(ShopifyApiCredentials credentials); -} +public interface IMetaFieldServiceFactory : IServiceFactory; public class MetaFieldServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IMetaFieldServiceFactory { diff --git a/ShopifySharp/Factories/OrderRiskServiceFactory.cs b/ShopifySharp/Factories/OrderRiskServiceFactory.cs index 5040bb3c..fe1ba93b 100644 --- a/ShopifySharp/Factories/OrderRiskServiceFactory.cs +++ b/ShopifySharp/Factories/OrderRiskServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IOrderRiskServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IOrderRiskService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IOrderRiskService Create(ShopifyApiCredentials credentials); -} +public interface IOrderRiskServiceFactory : IServiceFactory; public class OrderRiskServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IOrderRiskServiceFactory { diff --git a/ShopifySharp/Factories/OrderServiceFactory.cs b/ShopifySharp/Factories/OrderServiceFactory.cs index 86ac255e..e5707465 100644 --- a/ShopifySharp/Factories/OrderServiceFactory.cs +++ b/ShopifySharp/Factories/OrderServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IOrderServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IOrderService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IOrderService Create(ShopifyApiCredentials credentials); -} +public interface IOrderServiceFactory : IServiceFactory; public class OrderServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IOrderServiceFactory { diff --git a/ShopifySharp/Factories/PageServiceFactory.cs b/ShopifySharp/Factories/PageServiceFactory.cs index 79331ff9..7c3471e8 100644 --- a/ShopifySharp/Factories/PageServiceFactory.cs +++ b/ShopifySharp/Factories/PageServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IPageServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IPageService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IPageService Create(ShopifyApiCredentials credentials); -} +public interface IPageServiceFactory : IServiceFactory; public class PageServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IPageServiceFactory { diff --git a/ShopifySharp/Factories/PolicyServiceFactory.cs b/ShopifySharp/Factories/PolicyServiceFactory.cs index ba68060b..1fa60ed1 100644 --- a/ShopifySharp/Factories/PolicyServiceFactory.cs +++ b/ShopifySharp/Factories/PolicyServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IPolicyServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IPolicyService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IPolicyService Create(ShopifyApiCredentials credentials); -} +public interface IPolicyServiceFactory : IServiceFactory; public class PolicyServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IPolicyServiceFactory { diff --git a/ShopifySharp/Factories/PriceRuleServiceFactory.cs b/ShopifySharp/Factories/PriceRuleServiceFactory.cs index a010d874..075c2d40 100644 --- a/ShopifySharp/Factories/PriceRuleServiceFactory.cs +++ b/ShopifySharp/Factories/PriceRuleServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IPriceRuleServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IPriceRuleService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IPriceRuleService Create(ShopifyApiCredentials credentials); -} +public interface IPriceRuleServiceFactory : IServiceFactory; public class PriceRuleServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IPriceRuleServiceFactory { diff --git a/ShopifySharp/Factories/ProductImageServiceFactory.cs b/ShopifySharp/Factories/ProductImageServiceFactory.cs index 79d01b61..67332578 100644 --- a/ShopifySharp/Factories/ProductImageServiceFactory.cs +++ b/ShopifySharp/Factories/ProductImageServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IProductImageServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IProductImageService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IProductImageService Create(ShopifyApiCredentials credentials); -} +public interface IProductImageServiceFactory : IServiceFactory; public class ProductImageServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IProductImageServiceFactory { diff --git a/ShopifySharp/Factories/ProductListingServiceFactory.cs b/ShopifySharp/Factories/ProductListingServiceFactory.cs index aad68fd2..acdd88ea 100644 --- a/ShopifySharp/Factories/ProductListingServiceFactory.cs +++ b/ShopifySharp/Factories/ProductListingServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IProductListingServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IProductListingService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IProductListingService Create(ShopifyApiCredentials credentials); -} +public interface IProductListingServiceFactory : IServiceFactory; public class ProductListingServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IProductListingServiceFactory { diff --git a/ShopifySharp/Factories/ProductServiceFactory.cs b/ShopifySharp/Factories/ProductServiceFactory.cs index 9cad52df..5ccae943 100644 --- a/ShopifySharp/Factories/ProductServiceFactory.cs +++ b/ShopifySharp/Factories/ProductServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IProductServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IProductService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IProductService Create(ShopifyApiCredentials credentials); -} +public interface IProductServiceFactory : IServiceFactory; public class ProductServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IProductServiceFactory { diff --git a/ShopifySharp/Factories/ProductVariantServiceFactory.cs b/ShopifySharp/Factories/ProductVariantServiceFactory.cs index 998a8fa8..9537ea16 100644 --- a/ShopifySharp/Factories/ProductVariantServiceFactory.cs +++ b/ShopifySharp/Factories/ProductVariantServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IProductVariantServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IProductVariantService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IProductVariantService Create(ShopifyApiCredentials credentials); -} +public interface IProductVariantServiceFactory : IServiceFactory; public class ProductVariantServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IProductVariantServiceFactory { diff --git a/ShopifySharp/Factories/RecurringChargeServiceFactory.cs b/ShopifySharp/Factories/RecurringChargeServiceFactory.cs index 70bbcafe..171dfd59 100644 --- a/ShopifySharp/Factories/RecurringChargeServiceFactory.cs +++ b/ShopifySharp/Factories/RecurringChargeServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IRecurringChargeServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IRecurringChargeService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IRecurringChargeService Create(ShopifyApiCredentials credentials); -} +public interface IRecurringChargeServiceFactory : IServiceFactory; public class RecurringChargeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IRecurringChargeServiceFactory { diff --git a/ShopifySharp/Factories/RedirectServiceFactory.cs b/ShopifySharp/Factories/RedirectServiceFactory.cs index 6dfd475a..133d8099 100644 --- a/ShopifySharp/Factories/RedirectServiceFactory.cs +++ b/ShopifySharp/Factories/RedirectServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IRedirectServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IRedirectService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IRedirectService Create(ShopifyApiCredentials credentials); -} +public interface IRedirectServiceFactory : IServiceFactory; public class RedirectServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IRedirectServiceFactory { diff --git a/ShopifySharp/Factories/RefundServiceFactory.cs b/ShopifySharp/Factories/RefundServiceFactory.cs index 59b628fb..f4e98867 100644 --- a/ShopifySharp/Factories/RefundServiceFactory.cs +++ b/ShopifySharp/Factories/RefundServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IRefundServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IRefundService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IRefundService Create(ShopifyApiCredentials credentials); -} +public interface IRefundServiceFactory : IServiceFactory; public class RefundServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IRefundServiceFactory { diff --git a/ShopifySharp/Factories/ScriptTagServiceFactory.cs b/ShopifySharp/Factories/ScriptTagServiceFactory.cs index 084f9be8..4eafcb49 100644 --- a/ShopifySharp/Factories/ScriptTagServiceFactory.cs +++ b/ShopifySharp/Factories/ScriptTagServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IScriptTagServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IScriptTagService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IScriptTagService Create(ShopifyApiCredentials credentials); -} +public interface IScriptTagServiceFactory : IServiceFactory; public class ScriptTagServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IScriptTagServiceFactory { diff --git a/ShopifySharp/Factories/ShippingZoneServiceFactory.cs b/ShopifySharp/Factories/ShippingZoneServiceFactory.cs index e59a5855..eec40b96 100644 --- a/ShopifySharp/Factories/ShippingZoneServiceFactory.cs +++ b/ShopifySharp/Factories/ShippingZoneServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IShippingZoneServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IShippingZoneService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IShippingZoneService Create(ShopifyApiCredentials credentials); -} +public interface IShippingZoneServiceFactory : IServiceFactory; public class ShippingZoneServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IShippingZoneServiceFactory { diff --git a/ShopifySharp/Factories/ShopPlanServiceFactory.cs b/ShopifySharp/Factories/ShopPlanServiceFactory.cs index f7ae015a..7c575ff6 100644 --- a/ShopifySharp/Factories/ShopPlanServiceFactory.cs +++ b/ShopifySharp/Factories/ShopPlanServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IShopPlanServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IShopPlanService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IShopPlanService Create(ShopifyApiCredentials credentials); -} +public interface IShopPlanServiceFactory : IServiceFactory; public class ShopPlanServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IShopPlanServiceFactory { diff --git a/ShopifySharp/Factories/ShopServiceFactory.cs b/ShopifySharp/Factories/ShopServiceFactory.cs index 54b537c8..b51c1610 100644 --- a/ShopifySharp/Factories/ShopServiceFactory.cs +++ b/ShopifySharp/Factories/ShopServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IShopServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IShopService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IShopService Create(ShopifyApiCredentials credentials); -} +public interface IShopServiceFactory : IServiceFactory; public class ShopServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IShopServiceFactory { diff --git a/ShopifySharp/Factories/ShopifyPaymentsServiceFactory.cs b/ShopifySharp/Factories/ShopifyPaymentsServiceFactory.cs index b316afb2..c54ed05a 100644 --- a/ShopifySharp/Factories/ShopifyPaymentsServiceFactory.cs +++ b/ShopifySharp/Factories/ShopifyPaymentsServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IShopifyPaymentsServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IShopifyPaymentsService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IShopifyPaymentsService Create(ShopifyApiCredentials credentials); -} +public interface IShopifyPaymentsServiceFactory : IServiceFactory; public class ShopifyPaymentsServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IShopifyPaymentsServiceFactory { diff --git a/ShopifySharp/Factories/SmartCollectionServiceFactory.cs b/ShopifySharp/Factories/SmartCollectionServiceFactory.cs index 875dbbd6..0d5014c3 100644 --- a/ShopifySharp/Factories/SmartCollectionServiceFactory.cs +++ b/ShopifySharp/Factories/SmartCollectionServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ISmartCollectionServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ISmartCollectionService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ISmartCollectionService Create(ShopifyApiCredentials credentials); -} +public interface ISmartCollectionServiceFactory : IServiceFactory; public class SmartCollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ISmartCollectionServiceFactory { diff --git a/ShopifySharp/Factories/StorefrontAccessTokenServiceFactory.cs b/ShopifySharp/Factories/StorefrontAccessTokenServiceFactory.cs index cd38700f..a47ec762 100644 --- a/ShopifySharp/Factories/StorefrontAccessTokenServiceFactory.cs +++ b/ShopifySharp/Factories/StorefrontAccessTokenServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IStorefrontAccessTokenServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IStorefrontAccessTokenService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IStorefrontAccessTokenService Create(ShopifyApiCredentials credentials); -} +public interface IStorefrontAccessTokenServiceFactory : IServiceFactory; public class StorefrontAccessTokenServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IStorefrontAccessTokenServiceFactory { diff --git a/ShopifySharp/Factories/TenderTransactionServiceFactory.cs b/ShopifySharp/Factories/TenderTransactionServiceFactory.cs index b4a49133..ff5f6c21 100644 --- a/ShopifySharp/Factories/TenderTransactionServiceFactory.cs +++ b/ShopifySharp/Factories/TenderTransactionServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ITenderTransactionServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ITenderTransactionService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ITenderTransactionService Create(ShopifyApiCredentials credentials); -} +public interface ITenderTransactionServiceFactory : IServiceFactory; public class TenderTransactionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ITenderTransactionServiceFactory { diff --git a/ShopifySharp/Factories/ThemeServiceFactory.cs b/ShopifySharp/Factories/ThemeServiceFactory.cs index ca42f393..2a4da25f 100644 --- a/ShopifySharp/Factories/ThemeServiceFactory.cs +++ b/ShopifySharp/Factories/ThemeServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IThemeServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IThemeService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IThemeService Create(ShopifyApiCredentials credentials); -} +public interface IThemeServiceFactory : IServiceFactory; public class ThemeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IThemeServiceFactory { diff --git a/ShopifySharp/Factories/TransactionServiceFactory.cs b/ShopifySharp/Factories/TransactionServiceFactory.cs index b73b996e..6cc456f9 100644 --- a/ShopifySharp/Factories/TransactionServiceFactory.cs +++ b/ShopifySharp/Factories/TransactionServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface ITransactionServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - ITransactionService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - ITransactionService Create(ShopifyApiCredentials credentials); -} +public interface ITransactionServiceFactory : IServiceFactory; public class TransactionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ITransactionServiceFactory { diff --git a/ShopifySharp/Factories/UsageChargeServiceFactory.cs b/ShopifySharp/Factories/UsageChargeServiceFactory.cs index 5616b194..91d7e78e 100644 --- a/ShopifySharp/Factories/UsageChargeServiceFactory.cs +++ b/ShopifySharp/Factories/UsageChargeServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IUsageChargeServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IUsageChargeService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IUsageChargeService Create(ShopifyApiCredentials credentials); -} +public interface IUsageChargeServiceFactory : IServiceFactory; public class UsageChargeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IUsageChargeServiceFactory { diff --git a/ShopifySharp/Factories/UserServiceFactory.cs b/ShopifySharp/Factories/UserServiceFactory.cs index c8bf8ee0..c84b6ebf 100644 --- a/ShopifySharp/Factories/UserServiceFactory.cs +++ b/ShopifySharp/Factories/UserServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IUserServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IUserService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IUserService Create(ShopifyApiCredentials credentials); -} +public interface IUserServiceFactory : IServiceFactory; public class UserServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IUserServiceFactory { diff --git a/ShopifySharp/Factories/WebhookServiceFactory.cs b/ShopifySharp/Factories/WebhookServiceFactory.cs index 16c0a8b8..e5a1a5d2 100644 --- a/ShopifySharp/Factories/WebhookServiceFactory.cs +++ b/ShopifySharp/Factories/WebhookServiceFactory.cs @@ -7,17 +7,7 @@ namespace ShopifySharp.Factories; -public interface IWebhookServiceFactory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - IWebhookService Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - IWebhookService Create(ShopifyApiCredentials credentials); -} +public interface IWebhookServiceFactory : IServiceFactory; public class WebhookServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IWebhookServiceFactory { diff --git a/ShopifySharp/Factories/factory-service-template.txt b/ShopifySharp/Factories/factory-service-template.txt index 50b8c339..55dc0ac4 100644 --- a/ShopifySharp/Factories/factory-service-template.txt +++ b/ShopifySharp/Factories/factory-service-template.txt @@ -7,19 +7,9 @@ using ShopifySharp.Utilities; namespace ShopifySharp.Factories; -public interface I@@REPLACEME@@Factory -{ - /// Creates a new instance of the with the given credentials. - /// The shop's *.myshopify.com URL. - /// An API access token for the shop. - I@@REPLACEME@@ Create(string shopDomain, string accessToken); - - /// Creates a new instance of the with the given credentials. - /// Credentials for authenticating with the Shopify API. - I@@REPLACEME@@ Create(ShopifyApiCredentials credentials); -} +public interface I@@REPLACEME@@Factory : IServiceFactory; -public class @@REPLACEME@@Factory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : I@@REPLACEME@@Factory +public class @@REPLACEME@@Factory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IServiceFactory { /// public virtual I@@REPLACEME@@ Create(string shopDomain, string accessToken)