Exemplo n.º 1
0
        /// <summary>
        /// Gets a list of up to 250 of the shop's collects.
        /// </summary>
        /// <returns></returns>
        public async Task<IEnumerable<ShopifyCollect>> ListAsync(ShopifyCollectFilter options = null)
        {
            IRestRequest req = RequestEngine.CreateRequest("collects.json", Method.GET, "collects");

            if (options != null) req.Parameters.AddRange(options.ToParameters(ParameterType.GetOrPost));

            return await RequestEngine.ExecuteRequestAsync<List<ShopifyCollect>>(_RestClient, req);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets a count of all of the collects (product-collection mappings).
        /// </summary>
        /// <returns>The count of all collects for the shop.</returns>
        public async Task<int> CountAsync(ShopifyCollectFilter filter = null)
        {
            IRestRequest req = RequestEngine.CreateRequest("collects/count.json", Method.GET, "count");

            if (filter != null) req.Parameters.AddRange(filter.ToParameters(ParameterType.GetOrPost));

            JToken responseObject = await RequestEngine.ExecuteRequestAsync(_RestClient, req);

            return responseObject.Value<int>("count");
        }