コード例 #1
0
ファイル: ShipmentsClient.cs プロジェクト: joaope/gogokit.net
        public async Task <Shipment> CreateAsync(int saleId, ShipmentRequest request, CancellationToken cancellationToken)
        {
            var createShipmentLink = await _linkFactory.CreateLinkAsync($"sales/{saleId}/shipments").ConfigureAwait(_halClient);

            var shipment = await _halClient.PutAsync <Shipment>(createShipmentLink, null, request, cancellationToken)
                           .ConfigureAwait(_halClient);

            // Work-around an issue in the API where the first request's shipment
            // isn't populated with links and embedded addresses
            return(await _halClient.PutAsync <Shipment>(createShipmentLink, null, request, cancellationToken)
                   .ConfigureAwait(_halClient));
        }
コード例 #2
0
 private Task <PaymentMethod> PutPaymentMethodAsync(
     int paymentMethodId,
     NewPaymentMethod paymentMethod,
     Func <PaymentMethod, Link> getLinkFunc)
 {
     return(GetPaymentMethodAndFollowLinkAsync(
                paymentMethodId,
                getLinkFunc,
                putLink => _halClient.PutAsync <PaymentMethod>(putLink, paymentMethod)));
 }
コード例 #3
0
        public async Task <ListingConstraints> GetConstraintsForEventAsync(NewRequestedEvent @event, ListingConstraintsRequest request)
        {
            var constraintsLink = await _linkFactory.CreateLinkAsync($"listingconstraints").ConfigureAwait(_halClient);

            return(await _halClient.PutAsync <ListingConstraints>(constraintsLink, @event, request).ConfigureAwait(_halClient));
        }