| | 1 | | using Cysharp.Threading.Tasks; |
| | 2 | | using DCL; |
| | 3 | | using System.Threading; |
| | 4 | |
|
| | 5 | | namespace DCLServices.SubscriptionsAPIService |
| | 6 | | { |
| | 7 | | public interface ISubscriptionsAPIService : IService |
| | 8 | | { |
| | 9 | | UniTask<Subscription> CreateSubscription(string email, CancellationToken ct); |
| | 10 | | UniTask DeleteSubscription(string subscriptionId, CancellationToken ct); |
| | 11 | | UniTask<Subscription> GetSubscription(string subscriptionId, CancellationToken ct); |
| | 12 | | } |
| | 13 | |
|
| | 14 | | public class SubscriptionsAPIService : ISubscriptionsAPIService |
| | 15 | | { |
| | 16 | | private readonly ISubscriptionsAPIClient client; |
| | 17 | |
|
| 425 | 18 | | public SubscriptionsAPIService(ISubscriptionsAPIClient client) => |
| 425 | 19 | | this.client = client; |
| | 20 | |
|
| 425 | 21 | | public void Initialize() { } |
| | 22 | |
|
| 425 | 23 | | public void Dispose() { } |
| | 24 | |
|
| | 25 | | public async UniTask<Subscription> CreateSubscription(string email, CancellationToken ct) => |
| 0 | 26 | | await client.CreateSubscription(email, ct); |
| | 27 | |
|
| | 28 | | public async UniTask DeleteSubscription(string subscriptionId, CancellationToken ct) => |
| 0 | 29 | | await client.DeleteSubscription(subscriptionId, ct); |
| | 30 | |
|
| | 31 | | public async UniTask<Subscription> GetSubscription(string subscriptionId, CancellationToken ct) => |
| 0 | 32 | | await client.GetSubscription(subscriptionId, ct); |
| | 33 | | } |
| | 34 | | } |