public ViagogoClient( ProductHeaderValue product, IGogoKitConfiguration configuration, IOAuth2TokenStore tokenStore, IJsonSerializer serializer, IHttpConnection oauthConnection, IHttpConnection apiConnection) { Requires.ArgumentNotNull(product, nameof(product)); Requires.ArgumentNotNull(configuration, nameof(configuration)); Requires.ArgumentNotNull(tokenStore, nameof(tokenStore)); Requires.ArgumentNotNull(serializer, nameof(serializer)); Requires.ArgumentNotNull(oauthConnection, nameof(oauthConnection)); Requires.ArgumentNotNull(apiConnection, nameof(apiConnection)); var halKitConfiguration = new HalKitConfiguration(configuration.ViagogoApiRootEndpoint) { CaptureSynchronizationContext = configuration.CaptureSynchronizationContext }; Configuration = configuration; TokenStore = tokenStore; Hypermedia = new HalClient(halKitConfiguration, apiConnection); var linkFactory = new LinkFactory(configuration); OAuth2 = new OAuth2Client(oauthConnection, configuration); User = new UserClient(Hypermedia); Search = new SearchClient(Hypermedia); Addresses = new AddressesClient(User, Hypermedia, linkFactory); Purchases = new PurchasesClient(User, Hypermedia, linkFactory); Sales = new SalesClient(Hypermedia, linkFactory); Shipments = new ShipmentsClient(Hypermedia, linkFactory); PaymentMethods = new PaymentMethodsClient(User, Hypermedia, linkFactory); Countries = new CountriesClient(Hypermedia, linkFactory); Currencies = new CurrenciesClient(Hypermedia, linkFactory); Categories = new CategoriesClient(Hypermedia, linkFactory); Events = new EventsClient(Hypermedia); Listings = new ListingsClient(Hypermedia); Venues = new VenuesClient(Hypermedia); SellerListings = new SellerListingsClient(Hypermedia, linkFactory); Webhooks = new WebhooksClient(Hypermedia, linkFactory); BatchClient = new BatchClient(apiConnection, new ApiResponseFactory(serializer, halKitConfiguration), serializer, new LinkResolver()); }
public static void Main(string[] args) { using (var client = new SalesClient()) { Guid orderId = Guid.NewGuid(); client.OrderDrink(new OrderDrink { OrderId = orderId, Drink = Drinks.Cappucino }); Thread.Sleep(5000); client.Pay(new Pay { OrderId = orderId, Amount = 12.95m }); } }