# 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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetAllowListResult',
    'AwaitableGetAllowListResult',
    'get_allow_list',
    'get_allow_list_output',
]

@pulumi.output_type
class GetAllowListResult:
    """
    A collection of values returned by getAllowList.
    """
    def __init__(__self__, allow_list_category=None, allow_list_desc=None, allow_list_id=None, allow_list_ip_num=None, allow_list_name=None, allow_list_type=None, allow_lists=None, associated_instance_num=None, associated_instances=None, id=None, project_name=None):
        if allow_list_category and not isinstance(allow_list_category, str):
            raise TypeError("Expected argument 'allow_list_category' to be a str")
        pulumi.set(__self__, "allow_list_category", allow_list_category)
        if allow_list_desc and not isinstance(allow_list_desc, str):
            raise TypeError("Expected argument 'allow_list_desc' to be a str")
        pulumi.set(__self__, "allow_list_desc", allow_list_desc)
        if allow_list_id and not isinstance(allow_list_id, str):
            raise TypeError("Expected argument 'allow_list_id' to be a str")
        pulumi.set(__self__, "allow_list_id", allow_list_id)
        if allow_list_ip_num and not isinstance(allow_list_ip_num, int):
            raise TypeError("Expected argument 'allow_list_ip_num' to be a int")
        pulumi.set(__self__, "allow_list_ip_num", allow_list_ip_num)
        if allow_list_name and not isinstance(allow_list_name, str):
            raise TypeError("Expected argument 'allow_list_name' to be a str")
        pulumi.set(__self__, "allow_list_name", allow_list_name)
        if allow_list_type and not isinstance(allow_list_type, str):
            raise TypeError("Expected argument 'allow_list_type' to be a str")
        pulumi.set(__self__, "allow_list_type", allow_list_type)
        if allow_lists and not isinstance(allow_lists, list):
            raise TypeError("Expected argument 'allow_lists' to be a list")
        pulumi.set(__self__, "allow_lists", allow_lists)
        if associated_instance_num and not isinstance(associated_instance_num, int):
            raise TypeError("Expected argument 'associated_instance_num' to be a int")
        pulumi.set(__self__, "associated_instance_num", associated_instance_num)
        if associated_instances and not isinstance(associated_instances, list):
            raise TypeError("Expected argument 'associated_instances' to be a list")
        pulumi.set(__self__, "associated_instances", associated_instances)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)

    @property
    @pulumi.getter(name="allowListCategory")
    def allow_list_category(self) -> builtins.str:
        """
        白名单类型。取值范围如下：Ordinary：普通白名单；Default：默认白名单。
        """
        return pulumi.get(self, "allow_list_category")

    @property
    @pulumi.getter(name="allowListDesc")
    def allow_list_desc(self) -> builtins.str:
        """
        白名单的备注信息，长度不可超过 200 个字符。
        """
        return pulumi.get(self, "allow_list_desc")

    @property
    @pulumi.getter(name="allowListId")
    def allow_list_id(self) -> builtins.str:
        """
        白名单 ID。
        """
        return pulumi.get(self, "allow_list_id")

    @property
    @pulumi.getter(name="allowListIpNum")
    def allow_list_ip_num(self) -> builtins.int:
        """
        白名单内的 IP 地址（或地址段）总数。
        """
        return pulumi.get(self, "allow_list_ip_num")

    @property
    @pulumi.getter(name="allowListName")
    def allow_list_name(self) -> builtins.str:
        """
        白名单名称，名称需同时满足如下要求：不能以数字、中划线（-）开头。只能包含中文、字母、数字、下划线（_）和中划线（-）。长度需为 1~128 个字符。
        """
        return pulumi.get(self, "allow_list_name")

    @property
    @pulumi.getter(name="allowListType")
    def allow_list_type(self) -> builtins.str:
        """
        白名单内的 IP 地址类型。当前仅支持 IPv4 地址。
        """
        return pulumi.get(self, "allow_list_type")

    @property
    @pulumi.getter(name="allowLists")
    def allow_lists(self) -> Sequence[builtins.str]:
        """
        输入 IP 地址或 CIDR 格式的 IP 地址段。
        """
        return pulumi.get(self, "allow_lists")

    @property
    @pulumi.getter(name="associatedInstanceNum")
    def associated_instance_num(self) -> builtins.int:
        """
        已绑定当前白名单的实例总数。
        """
        return pulumi.get(self, "associated_instance_num")

    @property
    @pulumi.getter(name="associatedInstances")
    def associated_instances(self) -> Sequence['outputs.GetAllowListAssociatedInstanceResult']:
        """
        已绑定当前白名单的实例信息。
        """
        return pulumi.get(self, "associated_instances")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        当前白名单所属的项目。
        """
        return pulumi.get(self, "project_name")


class AwaitableGetAllowListResult(GetAllowListResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAllowListResult(
            allow_list_category=self.allow_list_category,
            allow_list_desc=self.allow_list_desc,
            allow_list_id=self.allow_list_id,
            allow_list_ip_num=self.allow_list_ip_num,
            allow_list_name=self.allow_list_name,
            allow_list_type=self.allow_list_type,
            allow_lists=self.allow_lists,
            associated_instance_num=self.associated_instance_num,
            associated_instances=self.associated_instances,
            id=self.id,
            project_name=self.project_name)


def get_allow_list(id: Optional[builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAllowListResult:
    """
    Data Source schema for Byteplus::MongoDB::AllowList


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:mongodb/getAllowList:getAllowList', __args__, opts=opts, typ=GetAllowListResult).value

    return AwaitableGetAllowListResult(
        allow_list_category=pulumi.get(__ret__, 'allow_list_category'),
        allow_list_desc=pulumi.get(__ret__, 'allow_list_desc'),
        allow_list_id=pulumi.get(__ret__, 'allow_list_id'),
        allow_list_ip_num=pulumi.get(__ret__, 'allow_list_ip_num'),
        allow_list_name=pulumi.get(__ret__, 'allow_list_name'),
        allow_list_type=pulumi.get(__ret__, 'allow_list_type'),
        allow_lists=pulumi.get(__ret__, 'allow_lists'),
        associated_instance_num=pulumi.get(__ret__, 'associated_instance_num'),
        associated_instances=pulumi.get(__ret__, 'associated_instances'),
        id=pulumi.get(__ret__, 'id'),
        project_name=pulumi.get(__ret__, 'project_name'))
def get_allow_list_output(id: Optional[pulumi.Input[builtins.str]] = None,
                          opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetAllowListResult]:
    """
    Data Source schema for Byteplus::MongoDB::AllowList


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:mongodb/getAllowList:getAllowList', __args__, opts=opts, typ=GetAllowListResult)
    return __ret__.apply(lambda __response__: GetAllowListResult(
        allow_list_category=pulumi.get(__response__, 'allow_list_category'),
        allow_list_desc=pulumi.get(__response__, 'allow_list_desc'),
        allow_list_id=pulumi.get(__response__, 'allow_list_id'),
        allow_list_ip_num=pulumi.get(__response__, 'allow_list_ip_num'),
        allow_list_name=pulumi.get(__response__, 'allow_list_name'),
        allow_list_type=pulumi.get(__response__, 'allow_list_type'),
        allow_lists=pulumi.get(__response__, 'allow_lists'),
        associated_instance_num=pulumi.get(__response__, 'associated_instance_num'),
        associated_instances=pulumi.get(__response__, 'associated_instances'),
        id=pulumi.get(__response__, 'id'),
        project_name=pulumi.get(__response__, 'project_name')))
