/// <summary> /// default: 50 /// Gets a list of up to 250 custom collections for the corresponding productId /// </summary> /// <param name="filter">The <see cref="ShopifyCustomCollection"/>. used to filter results</param> /// <returns></returns> public async Task<IEnumerable<ShopifyCustomCollection>> ListAsync(ShopifyCustomCollectionFilter filter = null) { IRestRequest req = RequestEngine.CreateRequest("/custom_collections.json", Method.GET, "custom_collections"); //Add optional parameters to request if (filter != null) req.Parameters.AddRange(filter.ToParameters(ParameterType.GetOrPost)); return await RequestEngine.ExecuteRequestAsync<List<ShopifyCustomCollection>>(_RestClient, req); }
/// <summary> /// Gets a count of all of the custom collections /// </summary> /// <returns>The count of all collects for the shop.</returns> public async Task<int> CountAsync(ShopifyCustomCollectionFilter options = null) { IRestRequest req = RequestEngine.CreateRequest("custom_collections/count.json", Method.GET, "count"); if (options != null) req.Parameters.AddRange(options.ToParameters(ParameterType.GetOrPost)); JToken responseObject = await RequestEngine.ExecuteRequestAsync(_RestClient, req); return responseObject.Value<int>("count"); }