Example #1
0
        /// <summary>
        /// Updates the given <see cref="ShopifyProductImage"/>. Id must not be null.
        /// </summary>
        /// <param name="productId">The id of the product that counted images belong to.</param>
        /// <param name="image">The <see cref="ShopifyProductImage"/> to update.</param>
        /// <returns>The updated <see cref="ShopifyProductImage"/>.</returns>
        public virtual async Task <ShopifyProductImage> UpdateAsync(long productId, ShopifyProductImage image)
        {
            var req = RequestEngine.CreateRequest($"products/{productId}/images/{image.Id.Value}.json", Method.PUT, "image");

            req.AddJsonBody(new { image });

            return(await RequestEngine.ExecuteRequestAsync <ShopifyProductImage>(_RestClient, req));
        }
        /// <summary>
        /// Updates the given <see cref="ShopifyProductImage"/>. Id must not be null.
        /// </summary>
        /// <param name="productId">The id of the product that counted images belong to.</param>
        /// <param name="image">The <see cref="ShopifyProductImage"/> to update.</param>
        /// <returns>The updated <see cref="ShopifyProductImage"/>.</returns>
        public async Task<ShopifyProductImage> UpdateAsync(long productId, ShopifyProductImage image)
        {
            var req = RequestEngine.CreateRequest($"products/{productId}/images/{image.Id.Value}.json", Method.PUT, "image");

            req.AddJsonBody(new { image });

            return await RequestEngine.ExecuteRequestAsync<ShopifyProductImage>(_RestClient, req);
        }