forked from nozzlegear/ShopifySharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebhookServiceFactory.cs
30 lines (23 loc) · 1.07 KB
/
WebhookServiceFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#nullable enable
// Notice:
// 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;
public interface IWebhookServiceFactory : IServiceFactory<IWebhookService>;
public class WebhookServiceFactory(IRequestExecutionPolicy? requestExecutionPolicy = null, IShopifyDomainUtility? shopifyDomainUtility = null) : IWebhookServiceFactory
{
/// <inheritDoc />
public virtual IWebhookService Create(string shopDomain, string accessToken)
{
IWebhookService service = shopifyDomainUtility is null ? new WebhookService(shopDomain, accessToken) : new WebhookService(shopDomain, accessToken, shopifyDomainUtility);
if (requestExecutionPolicy is not null)
{
service.SetExecutionPolicy(requestExecutionPolicy);
}
return service;
}
/// <inheritDoc />
public virtual IWebhookService Create(ShopifyApiCredentials credentials) =>
Create(credentials.ShopDomain, credentials.AccessToken);
}