# 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 GetDomainsResult:
    """
    A collection of values returned by getDomains.
    """
    def __init__(__self__, ali_domain=None, domain_name_regex=None, domains=None, group_name_regex=None, id=None, ids=None, instance_id=None, names=None, output_file=None, resource_group_id=None, version_code=None):
        if ali_domain and not isinstance(ali_domain, bool):
            raise TypeError("Expected argument 'ali_domain' to be a bool")
        __self__.ali_domain = ali_domain
        """
        Indicates whether the domain is an Alibaba Cloud domain.
        """
        if domain_name_regex and not isinstance(domain_name_regex, str):
            raise TypeError("Expected argument 'domain_name_regex' to be a str")
        __self__.domain_name_regex = domain_name_regex
        if domains and not isinstance(domains, list):
            raise TypeError("Expected argument 'domains' to be a list")
        __self__.domains = domains
        """
        A list of domains. Each element contains the following attributes:
        """
        if group_name_regex and not isinstance(group_name_regex, str):
            raise TypeError("Expected argument 'group_name_regex' to be a str")
        __self__.group_name_regex = group_name_regex
        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 domain IDs.
        """
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        __self__.instance_id = instance_id
        """
        Cloud analysis product ID of the domain.
        """
        if names and not isinstance(names, list):
            raise TypeError("Expected argument 'names' to be a list")
        __self__.names = names
        """
        A list of domain names.
        """
        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 resource_group_id and not isinstance(resource_group_id, str):
            raise TypeError("Expected argument 'resource_group_id' to be a str")
        __self__.resource_group_id = resource_group_id
        """
        The Id of resource group which the dns belongs.
        """
        if version_code and not isinstance(version_code, str):
            raise TypeError("Expected argument 'version_code' to be a str")
        __self__.version_code = version_code
        """
        Cloud analysis version code of the domain.
        """
class AwaitableGetDomainsResult(GetDomainsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDomainsResult(
            ali_domain=self.ali_domain,
            domain_name_regex=self.domain_name_regex,
            domains=self.domains,
            group_name_regex=self.group_name_regex,
            id=self.id,
            ids=self.ids,
            instance_id=self.instance_id,
            names=self.names,
            output_file=self.output_file,
            resource_group_id=self.resource_group_id,
            version_code=self.version_code)

def get_domains(ali_domain=None,domain_name_regex=None,group_name_regex=None,ids=None,instance_id=None,output_file=None,resource_group_id=None,version_code=None,opts=None):
    """
    This data source provides a list of DNS Domains in an Alibaba Cloud account according to the specified filters.

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


    :param bool ali_domain: Specifies whether the domain is from Alibaba Cloud or not.
    :param str domain_name_regex: A regex string to filter results by the domain name. 
    :param str group_name_regex: A regex string to filter results by the group name.
    :param str instance_id: Cloud analysis product ID.
    :param str resource_group_id: The Id of resource group which the dns belongs.
    :param str version_code: Cloud analysis version code.
           * `ids` (Optional, Available in 1.53.0+) - A list of domain IDs.
    """
    __args__ = dict()


    __args__['aliDomain'] = ali_domain
    __args__['domainNameRegex'] = domain_name_regex
    __args__['groupNameRegex'] = group_name_regex
    __args__['ids'] = ids
    __args__['instanceId'] = instance_id
    __args__['outputFile'] = output_file
    __args__['resourceGroupId'] = resource_group_id
    __args__['versionCode'] = version_code
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('alicloud:dns/getDomains:getDomains', __args__, opts=opts).value

    return AwaitableGetDomainsResult(
        ali_domain=__ret__.get('aliDomain'),
        domain_name_regex=__ret__.get('domainNameRegex'),
        domains=__ret__.get('domains'),
        group_name_regex=__ret__.get('groupNameRegex'),
        id=__ret__.get('id'),
        ids=__ret__.get('ids'),
        instance_id=__ret__.get('instanceId'),
        names=__ret__.get('names'),
        output_file=__ret__.get('outputFile'),
        resource_group_id=__ret__.get('resourceGroupId'),
        version_code=__ret__.get('versionCode'))
