Exemplo n.º 1
0
        /// <summary>
        /// Creates a new <see cref="ProductStockStatusModel"/> on the store.
        /// </summary>
        /// <param name="order">A new <see cref="ProductStockStatusCreateUpdateModel"/>. Id should be set to null.</param>
        /// <returns>The new <see cref="ProductStockStatusModel"/>.</returns>
        public virtual async Task <ProductStockStatusModel> CreateAsync(ProductStockStatusCreateUpdateModel order)
        {
            var req     = PrepareRequest("product-stock-statuses");
            var body    = order.ToDictionary();
            var content = new JsonContent(body);

            return(await ExecuteRequestAsync <ProductStockStatusModel>(req, HttpMethod.Post, content, ""));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the given <see cref="ProductStockStatusModel"/>.
        /// </summary>
        /// <param name="stockStatusId">Id of the object being updated.</param>
        /// <param name="order">The <see cref="ProductStockStatusCreateUpdateModel"/> to update.</param>
        /// <returns>The updated <see cref="ProductStockStatusModel"/>.</returns>
        public virtual async Task <ProductStockStatusModel> PatchAsync(int stockStatusId, ProductStockStatusCreateUpdateModel order)
        {
            var req     = PrepareRequest($"product-stock-statuses/{stockStatusId}");
            var body    = order.ToDictionary();
            var content = new JsonContent(body);

            return(await ExecuteRequestAsync <ProductStockStatusModel>(req, HttpMethod.Patch, content, "data"));
        }