# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetProductsResult:
    """
    A collection of values returned by getProducts.
    """
    def __init__(__self__, category_id=None, id=None, ids=None, name_regex=None, output_file=None, product_type=None, products=None, search_term=None, sort=None, suggested_price=None, supplier_id=None, supplier_name_keyword=None):
        if category_id and not isinstance(category_id, str):
            raise TypeError("Expected argument 'category_id' to be a str")
        __self__.category_id = category_id
        """
        The category id of the product.
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
        if ids and not isinstance(ids, list):
            raise TypeError("Expected argument 'ids' to be a list")
        __self__.ids = ids
        """
        A list of product codes.
        """
        if name_regex and not isinstance(name_regex, str):
            raise TypeError("Expected argument 'name_regex' to be a str")
        __self__.name_regex = name_regex
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        __self__.output_file = output_file
        if product_type and not isinstance(product_type, str):
            raise TypeError("Expected argument 'product_type' to be a str")
        __self__.product_type = product_type
        if products and not isinstance(products, list):
            raise TypeError("Expected argument 'products' to be a list")
        __self__.products = products
        """
        A list of products. Each element contains the following attributes:
        """
        if search_term and not isinstance(search_term, str):
            raise TypeError("Expected argument 'search_term' to be a str")
        __self__.search_term = search_term
        if sort and not isinstance(sort, str):
            raise TypeError("Expected argument 'sort' to be a str")
        __self__.sort = sort
        if suggested_price and not isinstance(suggested_price, float):
            raise TypeError("Expected argument 'suggested_price' to be a float")
        __self__.suggested_price = suggested_price
        """
        The suggested price of the product.
        """
        if supplier_id and not isinstance(supplier_id, str):
            raise TypeError("Expected argument 'supplier_id' to be a str")
        __self__.supplier_id = supplier_id
        """
        The supplier id of the product.
        """
        if supplier_name_keyword and not isinstance(supplier_name_keyword, str):
            raise TypeError("Expected argument 'supplier_name_keyword' to be a str")
        __self__.supplier_name_keyword = supplier_name_keyword
class AwaitableGetProductsResult(GetProductsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetProductsResult(
            category_id=self.category_id,
            id=self.id,
            ids=self.ids,
            name_regex=self.name_regex,
            output_file=self.output_file,
            product_type=self.product_type,
            products=self.products,
            search_term=self.search_term,
            sort=self.sort,
            suggested_price=self.suggested_price,
            supplier_id=self.supplier_id,
            supplier_name_keyword=self.supplier_name_keyword)

def get_products(category_id=None,ids=None,name_regex=None,output_file=None,product_type=None,search_term=None,sort=None,suggested_price=None,supplier_id=None,supplier_name_keyword=None,opts=None):
    """
    This data source provides the Market product items of Alibaba Cloud.

    > **NOTE:** Available in 1.64.0+

    > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/d/market_products.html.markdown.


    :param str category_id: The Category ID of products. For more information, see [DescribeProducts](https://help.aliyun.com/document_detail/89834.htm). 
    :param list ids: A list of product code.
    :param str name_regex: A regex string to apply to the product name.
    :param str product_type: The type of products, Valid values: `APP`, `SERVICE`, `MIRROR`, `DOWNLOAD` and `API_SERVICE`.
    :param str search_term: Search term in this query.
    :param str sort: This field determines how to sort the filtered results, Valid values: `user_count-desc`, `created_on-desc`, `price-desc` and `score-desc`.
    :param float suggested_price: The suggested price of the product.
    :param str supplier_id: The supplier id of the product.
    :param str supplier_name_keyword: The supplier name keyword of the product.
    """
    __args__ = dict()


    __args__['categoryId'] = category_id
    __args__['ids'] = ids
    __args__['nameRegex'] = name_regex
    __args__['outputFile'] = output_file
    __args__['productType'] = product_type
    __args__['searchTerm'] = search_term
    __args__['sort'] = sort
    __args__['suggestedPrice'] = suggested_price
    __args__['supplierId'] = supplier_id
    __args__['supplierNameKeyword'] = supplier_name_keyword
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('alicloud:marketplace/getProducts:getProducts', __args__, opts=opts).value

    return AwaitableGetProductsResult(
        category_id=__ret__.get('categoryId'),
        id=__ret__.get('id'),
        ids=__ret__.get('ids'),
        name_regex=__ret__.get('nameRegex'),
        output_file=__ret__.get('outputFile'),
        product_type=__ret__.get('productType'),
        products=__ret__.get('products'),
        search_term=__ret__.get('searchTerm'),
        sort=__ret__.get('sort'),
        suggested_price=__ret__.get('suggestedPrice'),
        supplier_id=__ret__.get('supplierId'),
        supplier_name_keyword=__ret__.get('supplierNameKeyword'))
