Пример #1
0
        /// \deprecated Use `QueryRoot.products` instead.
        /// <summary>
        /// List of the shop’s products.
        /// </summary>
        /// <param name="first">
        /// Returns up to the first `n` elements from the list.
        /// </param>
        /// <param name="after">
        /// Returns the elements that come after the specified cursor.
        /// </param>
        /// <param name="last">
        /// Returns up to the last `n` elements from the list.
        /// </param>
        /// <param name="before">
        /// Returns the elements that come before the specified cursor.
        /// </param>
        /// <param name="reverse">
        /// Reverse the order of the underlying list.
        /// </param>
        /// <param name="sortKey">
        /// Sort the underlying list by the given key.
        /// </param>
        /// <param name="query">
        /// Supported filter parameters:
        /// - `available_for_sale`
        /// - `created_at`
        /// - `product_type`
        /// - `tag`
        /// - `title`
        /// - `updated_at`
        /// - `variants.price`
        /// - `vendor`
        ///
        /// See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax).
        /// </param>
        public ShopQuery products(ProductConnectionDelegate buildQuery, long?first = null, string after = null, long?last = null, string before = null, bool?reverse = null, ProductSortKeys?sortKey = null, string queryValue = null, string alias = null)
        {
            Log.DeprecatedQueryField("Shop", "products", "Use `QueryRoot.products` instead.");

            if (alias != null)
            {
                ValidationUtils.ValidateAlias(alias);

                Query.Append("products___");
                Query.Append(alias);
                Query.Append(":");
            }

            Query.Append("products ");

            Arguments args = new Arguments();

            if (first != null)
            {
                args.Add("first", first);
            }

            if (after != null)
            {
                args.Add("after", after);
            }

            if (last != null)
            {
                args.Add("last", last);
            }

            if (before != null)
            {
                args.Add("before", before);
            }

            if (reverse != null)
            {
                args.Add("reverse", reverse);
            }

            if (sortKey != null)
            {
                args.Add("sortKey", sortKey);
            }

            if (queryValue != null)
            {
                args.Add("query", queryValue);
            }

            Query.Append(args.ToString());

            Query.Append("{");
            buildQuery(new ProductConnectionQuery(Query));
            Query.Append("}");

            return(this);
        }
Пример #2
0
        /// <summary>
        /// List of products in the collection.
        /// </summary>
        /// <param name="first">
        /// Returns up to the first `n` elements from the list.
        /// </param>
        /// <param name="after">
        /// Returns the elements that come after the specified cursor.
        /// </param>
        /// <param name="last">
        /// Returns up to the last `n` elements from the list.
        /// </param>
        /// <param name="before">
        /// Returns the elements that come before the specified cursor.
        /// </param>
        /// <param name="reverse">
        /// Reverse the order of the underlying list.
        /// </param>
        /// <param name="sortKey">
        /// Sort the underlying list by the given key.
        /// </param>
        public CollectionQuery products(ProductConnectionDelegate buildQuery, long?first = null, string after = null, long?last = null, string before = null, bool?reverse = null, ProductCollectionSortKeys?sortKey = null, string alias = null)
        {
            if (alias != null)
            {
                ValidationUtils.ValidateAlias(alias);

                Query.Append("products___");
                Query.Append(alias);
                Query.Append(":");
            }

            Query.Append("products ");

            Arguments args = new Arguments();

            if (first != null)
            {
                args.Add("first", first);
            }

            if (after != null)
            {
                args.Add("after", after);
            }

            if (last != null)
            {
                args.Add("last", last);
            }

            if (before != null)
            {
                args.Add("before", before);
            }

            if (reverse != null)
            {
                args.Add("reverse", reverse);
            }

            if (sortKey != null)
            {
                args.Add("sortKey", sortKey);
            }

            Query.Append(args.ToString());

            Query.Append("{");
            buildQuery(new ProductConnectionQuery(Query));
            Query.Append("}");

            return(this);
        }
        /// <summary>
        /// List of the shop’s products.
        /// </summary>
        /// <param name="first">
        /// Returns up to the first `n` elements from the list.
        /// </param>
        /// <param name="after">
        /// Returns the elements that come after the specified cursor.
        /// </param>
        /// <param name="last">
        /// Returns up to the last `n` elements from the list.
        /// </param>
        /// <param name="before">
        /// Returns the elements that come before the specified cursor.
        /// </param>
        /// <param name="reverse">
        /// Reverse the order of the underlying list.
        /// </param>
        /// <param name="sortKey">
        /// Sort the underlying list by the given key.
        /// </param>
        /// <param name="query">
        /// Supported filter parameters:
        /// - `available_for_sale`
        /// - `created_at`
        /// - `product_type`
        /// - `tag`
        /// - `title`
        /// - `updated_at`
        /// - `variants.price`
        /// - `vendor`
        ///
        /// See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax).
        /// </param>
        public QueryRootQuery products(ProductConnectionDelegate buildQuery, long?first = null, string after = null, long?last = null, string before = null, bool?reverse = null, ProductSortKeys?sortKey = null, string queryValue = null, string alias = null)
        {
            if (alias != null)
            {
                ValidationUtils.ValidateAlias(alias);

                Query.Append("products___");
                Query.Append(alias);
                Query.Append(":");
            }

            Query.Append("products ");

            Arguments args = new Arguments();

            if (first != null)
            {
                args.Add("first", first);

                if (Tags.useTag)
                {
                    args.Add("query", Tags.tag);
                }


                Debug.Log("tags");
                //args.Add("query", "tag:'made_in:USA'");
            }

            if (after != null)
            {
                args.Add("after", after);
            }

            if (last != null)
            {
                args.Add("last", last);
            }

            if (before != null)
            {
                args.Add("before", before);
            }

            if (reverse != null)
            {
                args.Add("reverse", reverse);
            }

            if (sortKey != null)
            {
                args.Add("sortKey", sortKey);
            }

            if (queryValue != null)
            {
                args.Add("query", queryValue);
            }

            Query.Append(args.ToString());

            Query.Append("{");
            buildQuery(new ProductConnectionQuery(Query));
            Query.Append("}");

            return(this);
        }