Skip to content

Commit

Permalink
Pass IShopifyDomainUtility to Shopify services via factory DI
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Dec 19, 2023
1 parent 1171ee6 commit a2ebc5c
Show file tree
Hide file tree
Showing 60 changed files with 180 additions and 120 deletions.
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/AccessScopeServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IAccessScopeServiceFactory
IAccessScopeService Create(ShopifyApiCredentials credentials);
}

public class AccessScopeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IAccessScopeServiceFactory
public class AccessScopeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IAccessScopeServiceFactory
{
/// <inheritDoc />
public virtual IAccessScopeService Create(string shopDomain, string accessToken)
{
var service = new AccessScopeService(shopDomain, accessToken);
IAccessScopeService service = shopifyDomainUtility is null ? new AccessScopeService(shopDomain, accessToken) : new AccessScopeService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/ApplicationCreditServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IApplicationCreditServiceFactory
IApplicationCreditService Create(ShopifyApiCredentials credentials);
}

public class ApplicationCreditServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IApplicationCreditServiceFactory
public class ApplicationCreditServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IApplicationCreditServiceFactory
{
/// <inheritDoc />
public virtual IApplicationCreditService Create(string shopDomain, string accessToken)
{
var service = new ApplicationCreditService(shopDomain, accessToken);
IApplicationCreditService service = shopifyDomainUtility is null ? new ApplicationCreditService(shopDomain, accessToken) : new ApplicationCreditService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/ArticleServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IArticleServiceFactory
IArticleService Create(ShopifyApiCredentials credentials);
}

public class ArticleServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IArticleServiceFactory
public class ArticleServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IArticleServiceFactory
{
/// <inheritDoc />
public virtual IArticleService Create(string shopDomain, string accessToken)
{
var service = new ArticleService(shopDomain, accessToken);
IArticleService service = shopifyDomainUtility is null ? new ArticleService(shopDomain, accessToken) : new ArticleService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/AssetServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IAssetServiceFactory
IAssetService Create(ShopifyApiCredentials credentials);
}

public class AssetServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IAssetServiceFactory
public class AssetServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IAssetServiceFactory
{
/// <inheritDoc />
public virtual IAssetService Create(string shopDomain, string accessToken)
{
var service = new AssetService(shopDomain, accessToken);
IAssetService service = shopifyDomainUtility is null ? new AssetService(shopDomain, accessToken) : new AssetService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IAssignedFulfillmentOrderServiceFactory
IAssignedFulfillmentOrderService Create(ShopifyApiCredentials credentials);
}

public class AssignedFulfillmentOrderServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IAssignedFulfillmentOrderServiceFactory
public class AssignedFulfillmentOrderServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IAssignedFulfillmentOrderServiceFactory
{
/// <inheritDoc />
public virtual IAssignedFulfillmentOrderService Create(string shopDomain, string accessToken)
{
var service = new AssignedFulfillmentOrderService(shopDomain, accessToken);
IAssignedFulfillmentOrderService service = shopifyDomainUtility is null ? new AssignedFulfillmentOrderService(shopDomain, accessToken) : new AssignedFulfillmentOrderService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/BlogServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IBlogServiceFactory
IBlogService Create(ShopifyApiCredentials credentials);
}

public class BlogServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IBlogServiceFactory
public class BlogServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IBlogServiceFactory
{
/// <inheritDoc />
public virtual IBlogService Create(string shopDomain, string accessToken)
{
var service = new BlogService(shopDomain, accessToken);
IBlogService service = shopifyDomainUtility is null ? new BlogService(shopDomain, accessToken) : new BlogService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CancellationRequestServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICancellationRequestServiceFactory
ICancellationRequestService Create(ShopifyApiCredentials credentials);
}

public class CancellationRequestServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICancellationRequestServiceFactory
public class CancellationRequestServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICancellationRequestServiceFactory
{
/// <inheritDoc />
public virtual ICancellationRequestService Create(string shopDomain, string accessToken)
{
var service = new CancellationRequestService(shopDomain, accessToken);
ICancellationRequestService service = shopifyDomainUtility is null ? new CancellationRequestService(shopDomain, accessToken) : new CancellationRequestService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CarrierServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICarrierServiceFactory
ICarrierService Create(ShopifyApiCredentials credentials);
}

public class CarrierServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICarrierServiceFactory
public class CarrierServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICarrierServiceFactory
{
/// <inheritDoc />
public virtual ICarrierService Create(string shopDomain, string accessToken)
{
var service = new CarrierService(shopDomain, accessToken);
ICarrierService service = shopifyDomainUtility is null ? new CarrierService(shopDomain, accessToken) : new CarrierService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/ChargeServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface IChargeServiceFactory
IChargeService Create(ShopifyApiCredentials credentials);
}

public class ChargeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : IChargeServiceFactory
public class ChargeServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IChargeServiceFactory
{
/// <inheritDoc />
public virtual IChargeService Create(string shopDomain, string accessToken)
{
var service = new ChargeService(shopDomain, accessToken);
IChargeService service = shopifyDomainUtility is null ? new ChargeService(shopDomain, accessToken) : new ChargeService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CheckoutSalesChannelServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICheckoutSalesChannelServiceFactory
ICheckoutSalesChannelService Create(ShopifyApiCredentials credentials);
}

public class CheckoutSalesChannelServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICheckoutSalesChannelServiceFactory
public class CheckoutSalesChannelServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICheckoutSalesChannelServiceFactory
{
/// <inheritDoc />
public virtual ICheckoutSalesChannelService Create(string shopDomain, string accessToken)
{
var service = new CheckoutSalesChannelService(shopDomain, accessToken);
ICheckoutSalesChannelService service = shopifyDomainUtility is null ? new CheckoutSalesChannelService(shopDomain, accessToken) : new CheckoutSalesChannelService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CheckoutServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICheckoutServiceFactory
ICheckoutService Create(ShopifyApiCredentials credentials);
}

public class CheckoutServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICheckoutServiceFactory
public class CheckoutServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICheckoutServiceFactory
{
/// <inheritDoc />
public virtual ICheckoutService Create(string shopDomain, string accessToken)
{
var service = new CheckoutService(shopDomain, accessToken);
ICheckoutService service = shopifyDomainUtility is null ? new CheckoutService(shopDomain, accessToken) : new CheckoutService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CollectServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICollectServiceFactory
ICollectService Create(ShopifyApiCredentials credentials);
}

public class CollectServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICollectServiceFactory
public class CollectServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICollectServiceFactory
{
/// <inheritDoc />
public virtual ICollectService Create(string shopDomain, string accessToken)
{
var service = new CollectService(shopDomain, accessToken);
ICollectService service = shopifyDomainUtility is null ? new CollectService(shopDomain, accessToken) : new CollectService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CollectionListingServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICollectionListingServiceFactory
ICollectionListingService Create(ShopifyApiCredentials credentials);
}

public class CollectionListingServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICollectionListingServiceFactory
public class CollectionListingServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICollectionListingServiceFactory
{
/// <inheritDoc />
public virtual ICollectionListingService Create(string shopDomain, string accessToken)
{
var service = new CollectionListingService(shopDomain, accessToken);
ICollectionListingService service = shopifyDomainUtility is null ? new CollectionListingService(shopDomain, accessToken) : new CollectionListingService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CollectionServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICollectionServiceFactory
ICollectionService Create(ShopifyApiCredentials credentials);
}

public class CollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICollectionServiceFactory
public class CollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICollectionServiceFactory
{
/// <inheritDoc />
public virtual ICollectionService Create(string shopDomain, string accessToken)
{
var service = new CollectionService(shopDomain, accessToken);
ICollectionService service = shopifyDomainUtility is null ? new CollectionService(shopDomain, accessToken) : new CollectionService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CountryServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICountryServiceFactory
ICountryService Create(ShopifyApiCredentials credentials);
}

public class CountryServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICountryServiceFactory
public class CountryServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICountryServiceFactory
{
/// <inheritDoc />
public virtual ICountryService Create(string shopDomain, string accessToken)
{
var service = new CountryService(shopDomain, accessToken);
ICountryService service = shopifyDomainUtility is null ? new CountryService(shopDomain, accessToken) : new CountryService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CustomCollectionServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICustomCollectionServiceFactory
ICustomCollectionService Create(ShopifyApiCredentials credentials);
}

public class CustomCollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICustomCollectionServiceFactory
public class CustomCollectionServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICustomCollectionServiceFactory
{
/// <inheritDoc />
public virtual ICustomCollectionService Create(string shopDomain, string accessToken)
{
var service = new CustomCollectionService(shopDomain, accessToken);
ICustomCollectionService service = shopifyDomainUtility is null ? new CustomCollectionService(shopDomain, accessToken) : new CustomCollectionService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
5 changes: 3 additions & 2 deletions ShopifySharp/Factories/CustomerAddressServiceFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This class is auto-generated from a template. Please do not edit it or change it directly.

using ShopifySharp.Credentials;
using ShopifySharp.Utilities;

namespace ShopifySharp.Factories;

Expand All @@ -18,12 +19,12 @@ public interface ICustomerAddressServiceFactory
ICustomerAddressService Create(ShopifyApiCredentials credentials);
}

public class CustomerAddressServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null) : ICustomerAddressServiceFactory
public class CustomerAddressServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : ICustomerAddressServiceFactory
{
/// <inheritDoc />
public virtual ICustomerAddressService Create(string shopDomain, string accessToken)
{
var service = new CustomerAddressService(shopDomain, accessToken);
ICustomerAddressService service = shopifyDomainUtility is null ? new CustomerAddressService(shopDomain, accessToken) : new CustomerAddressService(shopDomain, accessToken, shopifyDomainUtility);

if (requestExecutionPolicy is not null)
{
Expand Down
Loading

0 comments on commit a2ebc5c

Please sign in to comment.