public RetrieveProductsCommand(SkubanaConfig config, IEnumerable <string> skus) : base(config, SkubanaEndpoint.RetrieveProductsUrl) { Condition.Requires(skus, "skus").IsNotNull().IsNotEmpty(); this.RequestParameters = new Dictionary <string, string>() { { "sku", string.Join(",", skus.Select(s => $"\"{ s }\"")) } }; this.Throttler = new Throttling.Throttler(5, 1); }
protected SkubanaCommand(SkubanaConfig config, string relativeUrl, Dictionary <string, string> requestParameters, object payload, bool isApiCommand = true) { Condition.Requires(config, "config").IsNotNull(); Condition.Requires(relativeUrl, "relativeUrl").IsNotNullOrEmpty(); this.Config = config; this.RelativeUrl = relativeUrl; this.RequestParameters = requestParameters; this.Payload = payload; this._isApiCommand = isApiCommand; }
public GetProductStockCommand(SkubanaConfig config, string sku, long warehouseId) : base(config, SkubanaEndpoint.RetrieveProductStockUrl) { Condition.Requires(sku, "sku").IsNotNullOrEmpty(); Condition.Requires(warehouseId, "warehouseId").IsGreaterThan(0); this.RequestParameters = new Dictionary <string, string>() { { "sku", sku }, { "warehouseId", warehouseId.ToString() } }; }
public RetrieveProductsUpdatedAfterCommand(SkubanaConfig config, DateTime updatedAfterUtc, int page, int limit) : base(config, SkubanaEndpoint.RetrieveProductsUrl) { Condition.Requires(page, "page").IsGreaterOrEqual(1); Condition.Requires(limit, "limit").IsGreaterOrEqual(1); this.RequestParameters = new Dictionary <string, string>() { { "modifiedDateFrom", updatedAfterUtc.ConvertDateTimeToStr() }, { "page", page.ToString() }, { "limit", limit.ToString() } }; }
public GetAccessTokenCommand(SkubanaConfig config, string redirectUrl, string code) : base(config, SkubanaEndpoint.GetAccessTokenUrl, null, null, isApiCommand: false) { Condition.Requires(redirectUrl, "redirectUrl").IsNotNullOrEmpty(); Condition.Requires(code, "code").IsNotNullOrEmpty(); this.RequestParameters = new Dictionary <string, string>() { { "grant_type", "authorization_code" }, { "redirect_uri", redirectUrl }, { "code", code } }; }
public RetrieveProductsStocksTotalCommand(SkubanaConfig config, long warehouseId, int page, int limit) : base(config, SkubanaEndpoint.GetProductsStocksTotalUrl) { Condition.Requires(warehouseId, "warehouseId").IsGreaterThan(0); Condition.Requires(page, "page").IsGreaterOrEqual(1); Condition.Requires(limit, "limit").IsGreaterOrEqual(1); this.RequestParameters = new Dictionary <string, string>() { { "warehouseId", warehouseId.ToString() }, { "page", page.ToString() }, { "limit", limit.ToString() } }; }
public RetrieveOrdersCommand(SkubanaConfig config, DateTime startDateUtc, DateTime endDateUtc, long warehouseId, int page, int limit) : base(config, SkubanaEndpoint.RetrieveOrdersUrl) { Condition.Requires(endDateUtc, "endDateUtc").IsGreaterThan(startDateUtc); Condition.Requires(warehouseId, "warehouseId").IsNotEqualTo(0); Condition.Requires(page, "page").IsGreaterOrEqual(1); Condition.Requires(limit, "limit").IsGreaterOrEqual(1); this.RequestParameters = new Dictionary <string, string>() { { "modifiedDateFrom", startDateUtc.ConvertDateTimeToStr() }, { "modifiedDateTo", endDateUtc.ConvertDateTimeToStr() }, { "warehouseId", warehouseId.ToString() }, { "page", page.ToString() }, { "limit", limit.ToString() } }; }
public AdjustProductsStockCommand(SkubanaConfig config, IEnumerable <SkubanaProductStock> skusQuantities, long warehouseId) : base(config, SkubanaEndpoint.AdjustProductStockUrl) { Condition.Requires(skusQuantities, "skusQuantities").IsNotNull().IsNotEmpty(); Condition.Requires(warehouseId, "warehouseId").IsGreaterThan(0); var body = new List <AdjustProductStockRequestBodyItem>(); foreach (var skuQuantity in skusQuantities) { body.Add(new AdjustProductStockRequestBodyItem() { MasterSku = skuQuantity.ProductSku, OnHandQuantity = skuQuantity.OnHandQuantity > maxQuantity ? maxQuantity : skuQuantity.OnHandQuantity, WarehouseId = warehouseId, StockLocationName = skuQuantity.LocationName }); } this.Payload = body; }
public CreateProductsStockCommand(SkubanaConfig config, IEnumerable <SkubanaProductStock> productsStock, long warehouseId) : base(config, SkubanaEndpoint.CreateProductStockUrl) { Condition.Requires(productsStock, "productsStock").IsNotNull().IsNotEmpty(); Condition.Requires(warehouseId, "warehouseId").IsGreaterThan(0); var body = new List <CreateProductStockRequestBodyItem>(); foreach (var productStock in productsStock) { body.Add(new CreateProductStockRequestBodyItem() { ProductId = productStock.ProductId, Quantity = productStock.OnHandQuantity > maxQuantity ? maxQuantity : productStock.OnHandQuantity, WarehouseId = warehouseId, StockLocationName = productStock.LocationName, Pickable = true, Receivable = true }); } ; this.Payload = body; }
public OrdersService(SkubanaConfig config) : base(config) { }
public ListWarehousesCommand(SkubanaConfig config) : base(config, SkubanaEndpoint.ListWarehousesUrl) { this.Throttler = new Throttling.Throttler(5, 1); }
public IGlobalService CreateGlobalService(SkubanaConfig config) { return(new GlobalService(config)); }
public IInventoryService CreateInventoryService(SkubanaConfig config) { return(new InventoryService(config)); }
public IAuthenticationService CreateAuthenticationService(SkubanaConfig config, SkubanaAppCredentials appCredentials) { return(new AuthenticationService(config, appCredentials)); }
protected SkubanaCommand(SkubanaConfig config, string relativeUrl, object payload) : this(config, relativeUrl, null, payload) { }
public IProductsService CreateProductsService(SkubanaConfig config) { return(new ProductsService(config)); }
public ServiceBaseWithTokenAuth(SkubanaConfig config) : base(config) { }
public ServiceBaseWithBasicAuth(SkubanaConfig config, SkubanaAppCredentials appCredentials) : base(config) { Condition.Requires(appCredentials, "appCredentials").IsNotNull(); this.AppCredentials = appCredentials; }
public IOrdersService CreateOrdersService(SkubanaConfig config) { return(new OrdersService(config)); }
protected SkubanaCommand(SkubanaConfig config, string relativeUrl) : this(config, relativeUrl, null, null) { }
public ProductsService(SkubanaConfig config) : base(config) { }
public InventoryService(SkubanaConfig config) : base(config) { }
public GlobalService(SkubanaConfig config) : base(config) { }