Exemplo n.º 1
0
        public async Task <IReadOnlyList <Category> > GetAllGenresAsync(CategoryRequest request)
        {
            Requires.ArgumentNotNull(request, nameof(request));

            var root = await _halClient.GetRootAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Category>(root.GenresLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 2
0
        public async Task <IReadOnlyList <Shipment> > GetAllAsync(
            int saleId,
            ShipmentRequest request,
            CancellationToken cancellationToken)
        {
            var shipmentsLink = await _linkFactory.CreateLinkAsync($"sales/{saleId}/shipments").ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Shipment>(shipmentsLink, request, cancellationToken).ConfigureAwait(_halClient));
        }
Exemplo n.º 3
0
        public async Task <IReadOnlyList <Address> > GetAllAsync(AddressRequest request)
        {
            Requires.ArgumentNotNull(request, nameof(request));

            var user = await _userClient.GetAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Address>(
                       user.AddressesLink,
                       request).ConfigureAwait(_halClient));
        }
Exemplo n.º 4
0
        public async Task <IReadOnlyList <SellerListing> > GetAllAsync(SellerListingRequest request, CancellationToken cancellationToken)
        {
            var sellerListingsLink = await _linkFactory.CreateLinkAsync("sellerlistings").ConfigureAwait(_halClient);

            var listings = await _halClient.GetAllPagesAsync <SellerListing>(
                sellerListingsLink,
                request,
                cancellationToken).ConfigureAwait(_halClient);

            return(listings.GroupBy(l => l.Id).Select(l => l.OrderByDescending(o => o.UpdatedAt).First()).ToList());
        }
Exemplo n.º 5
0
        public async Task <IReadOnlyList <Event> > GetAllByCategoryAsync(int categoryId, EventRequest request)
        {
            Requires.ArgumentNotNull(request, nameof(request));

            var root = await _halClient.GetRootAsync().ConfigureAwait(_halClient);

            var eventsLink = new Link
            {
                HRef = $"{root.SelfLink.HRef}/categories/{categoryId}/events"
            };

            return(await _halClient.GetAllPagesAsync <Event>(eventsLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 6
0
        public async Task <IReadOnlyList <Listing> > GetAllByEventAsync(int eventId, ListingRequest request)
        {
            Requires.ArgumentNotNull(request, nameof(request));

            var root = await _halClient.GetRootAsync().ConfigureAwait(_halClient);

            var listingsLink = new Link
            {
                HRef = $"{root.SelfLink.HRef}/events/{eventId}/listings"
            };

            return(await _halClient.GetAllPagesAsync <Listing>(listingsLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 7
0
        public async Task <IReadOnlyList <PaymentMethod> > GetAllAsync(PaymentMethodRequest request)
        {
            var user = await _userClient.GetAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <PaymentMethod>(user.PaymentMethodsLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 8
0
        public async Task <IReadOnlyList <Webhook> > GetAllAsync(WebhookRequest request)
        {
            var user = await _userClient.GetAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Webhook>(user.WebhooksLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 9
0
        public async Task <IReadOnlyList <Venue> > GetAllAsync(VenueRequest request)
        {
            var root = await _halClient.GetRootAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Venue>(root.VenuesLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 10
0
        public async Task <IReadOnlyList <Currency> > GetAllAsync(CurrencyRequest request)
        {
            var root = await _halClient.GetRootAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Currency>(root.CurrenciesLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 11
0
        public async Task <IReadOnlyList <Purchase> > GetAllAsync(PurchaseRequest request)
        {
            var user = await _userClient.GetAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Purchase>(user.PurchasesLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 12
0
        public async Task <IReadOnlyList <Sale> > GetAllAsync(SaleRequest request, CancellationToken cancellationToken)
        {
            var salesLink = await _linkFactory.CreateLinkAsync($"sales").ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Sale>(salesLink, request, cancellationToken).ConfigureAwait(_halClient));
        }
Exemplo n.º 13
0
        public async Task <IReadOnlyList <Webhook> > GetAllAsync(WebhookRequest request)
        {
            var webhookLink = await _linkFactory.CreateLinkAsync($"webhooks").ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Webhook>(webhookLink, request).ConfigureAwait(_halClient));
        }
Exemplo n.º 14
0
        public async Task <IReadOnlyList <Sale> > GetAllAsync(SaleRequest request, CancellationToken cancellationToken)
        {
            var user = await _userClient.GetAsync().ConfigureAwait(_halClient);

            return(await _halClient.GetAllPagesAsync <Sale>(user.SalesLink, request, cancellationToken).ConfigureAwait(_halClient));
        }