# 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, ignore_instance_status=None, instance_id=None, ip_lists=None, modify_mode=None, project_name=None, security_group_bind_infos=None, security_group_ids=None, update_security_group=None, user_allow_lists=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 ignore_instance_status and not isinstance(ignore_instance_status, bool):
            raise TypeError("Expected argument 'ignore_instance_status' to be a bool")
        pulumi.set(__self__, "ignore_instance_status", ignore_instance_status)
        if instance_id and not isinstance(instance_id, str):
            raise TypeError("Expected argument 'instance_id' to be a str")
        pulumi.set(__self__, "instance_id", instance_id)
        if ip_lists and not isinstance(ip_lists, list):
            raise TypeError("Expected argument 'ip_lists' to be a list")
        pulumi.set(__self__, "ip_lists", ip_lists)
        if modify_mode and not isinstance(modify_mode, str):
            raise TypeError("Expected argument 'modify_mode' to be a str")
        pulumi.set(__self__, "modify_mode", modify_mode)
        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)
        if security_group_bind_infos and not isinstance(security_group_bind_infos, list):
            raise TypeError("Expected argument 'security_group_bind_infos' to be a list")
        pulumi.set(__self__, "security_group_bind_infos", security_group_bind_infos)
        if security_group_ids and not isinstance(security_group_ids, list):
            raise TypeError("Expected argument 'security_group_ids' to be a list")
        pulumi.set(__self__, "security_group_ids", security_group_ids)
        if update_security_group and not isinstance(update_security_group, bool):
            raise TypeError("Expected argument 'update_security_group' to be a bool")
        pulumi.set(__self__, "update_security_group", update_security_group)
        if user_allow_lists and not isinstance(user_allow_lists, list):
            raise TypeError("Expected argument 'user_allow_lists' to be a list")
        pulumi.set(__self__, "user_allow_lists", user_allow_lists)

    @property
    @pulumi.getter(name="allowListCategory")
    def allow_list_category(self) -> builtins.str:
        """
        白名单分类。取值：Ordinary：普通白名单。Default：默认白名单。说明该参数作为请求参数时，默认值为 Ordinary。
        """
        return pulumi.get(self, "allow_list_category")

    @property
    @pulumi.getter(name="allowListDesc")
    def allow_list_desc(self) -> builtins.str:
        """
        白名单的备注。
        """
        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:
        """
        白名单名称。
        """
        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 地址列表
        """
        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="ignoreInstanceStatus")
    def ignore_instance_status(self) -> builtins.bool:
        """
        是否忽略实例状态校验。取值：true：是。false：否。默认值。
        """
        return pulumi.get(self, "ignore_instance_status")

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> builtins.str:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @property
    @pulumi.getter(name="ipLists")
    def ip_lists(self) -> Sequence[builtins.str]:
        """
        白名单包含的 IP 地址和 IP 地址段的列表。在请求参数 WithIpList 取值为 true 时返回，在取值为 false 或不为其传值时返回为 null。
        """
        return pulumi.get(self, "ip_lists")

    @property
    @pulumi.getter(name="modifyMode")
    def modify_mode(self) -> builtins.str:
        """
        修改方式，取值范围如下：Cover（默认值）：使用 AllowList 参数中的值覆盖原白名单。Append：在原白名单中增加 AllowList 参数中输入的 IP 地址。Delete：在原白名单中删除 AllowList 参数中输入的 IP 地址。至少需要保留一个 IP 地址。
        """
        return pulumi.get(self, "modify_mode")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        所属的项目。说明如您调用接口使用的 AK/SK 属于某个子账号，且该子账号只拥有某个项目的权限，需要传入该请求参数。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="securityGroupBindInfos")
    def security_group_bind_infos(self) -> Sequence['outputs.GetAllowListSecurityGroupBindInfoResult']:
        """
        白名单关联的安全组的信息。说明该字段不能与 SecurityGroupIds 同时使用。
        """
        return pulumi.get(self, "security_group_bind_infos")

    @property
    @pulumi.getter(name="securityGroupIds")
    def security_group_ids(self) -> Sequence[builtins.str]:
        """
        需要关联的安全组 ID 列表。说明您可以调用 DescribeSecurityGroups 接口查询安全组信息，包括安全组 ID。单个白名单单次最多可选择添加 10 个安全组。该字段不能与 SecurityGroupBindInfos 同时使用。
        """
        return pulumi.get(self, "security_group_ids")

    @property
    @pulumi.getter(name="updateSecurityGroup")
    def update_security_group(self) -> builtins.bool:
        """
        是否更新白名单所绑定的安全组。true：更新。false：不更新。默认值。说明该字段仅在白名单已绑定了安全组时生效。可调用 DescribeAllowLists 接口查询白名单是否绑定了安全组。
        """
        return pulumi.get(self, "update_security_group")

    @property
    @pulumi.getter(name="userAllowLists")
    def user_allow_lists(self) -> Sequence[builtins.str]:
        """
        该名单中由用户输入的 IP 地址。AllowList 字段中的 IP 为 UserAllowList 和 SecurityGroupBindInfos 包含的 IP 的并集。
        """
        return pulumi.get(self, "user_allow_lists")


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,
            ignore_instance_status=self.ignore_instance_status,
            instance_id=self.instance_id,
            ip_lists=self.ip_lists,
            modify_mode=self.modify_mode,
            project_name=self.project_name,
            security_group_bind_infos=self.security_group_bind_infos,
            security_group_ids=self.security_group_ids,
            update_security_group=self.update_security_group,
            user_allow_lists=self.user_allow_lists)


def get_allow_list(id: Optional[builtins.str] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAllowListResult:
    """
    Data Source schema for Byteplus::RDSMySQL::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:rdsmysql/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'),
        ignore_instance_status=pulumi.get(__ret__, 'ignore_instance_status'),
        instance_id=pulumi.get(__ret__, 'instance_id'),
        ip_lists=pulumi.get(__ret__, 'ip_lists'),
        modify_mode=pulumi.get(__ret__, 'modify_mode'),
        project_name=pulumi.get(__ret__, 'project_name'),
        security_group_bind_infos=pulumi.get(__ret__, 'security_group_bind_infos'),
        security_group_ids=pulumi.get(__ret__, 'security_group_ids'),
        update_security_group=pulumi.get(__ret__, 'update_security_group'),
        user_allow_lists=pulumi.get(__ret__, 'user_allow_lists'))
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::RDSMySQL::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:rdsmysql/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'),
        ignore_instance_status=pulumi.get(__response__, 'ignore_instance_status'),
        instance_id=pulumi.get(__response__, 'instance_id'),
        ip_lists=pulumi.get(__response__, 'ip_lists'),
        modify_mode=pulumi.get(__response__, 'modify_mode'),
        project_name=pulumi.get(__response__, 'project_name'),
        security_group_bind_infos=pulumi.get(__response__, 'security_group_bind_infos'),
        security_group_ids=pulumi.get(__response__, 'security_group_ids'),
        update_security_group=pulumi.get(__response__, 'update_security_group'),
        user_allow_lists=pulumi.get(__response__, 'user_allow_lists')))
