# 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__ = [
    'GetShareConfigResult',
    'AwaitableGetShareConfigResult',
    'get_share_config',
    'get_share_config_output',
]

@pulumi.output_type
class GetShareConfigResult:
    """
    A collection of values returned by getShareConfig.
    """
    def __init__(__self__, allow_ip_access_rule=None, allow_referer_access_rule=None, common_matchs=None, config_name=None, config_type=None, deny_ip_access_rule=None, deny_referer_access_rule=None, domain_count=None, id=None, project=None, rule_content=None, updated_time=None):
        if allow_ip_access_rule and not isinstance(allow_ip_access_rule, dict):
            raise TypeError("Expected argument 'allow_ip_access_rule' to be a dict")
        pulumi.set(__self__, "allow_ip_access_rule", allow_ip_access_rule)
        if allow_referer_access_rule and not isinstance(allow_referer_access_rule, dict):
            raise TypeError("Expected argument 'allow_referer_access_rule' to be a dict")
        pulumi.set(__self__, "allow_referer_access_rule", allow_referer_access_rule)
        if common_matchs and not isinstance(common_matchs, dict):
            raise TypeError("Expected argument 'common_matchs' to be a dict")
        pulumi.set(__self__, "common_matchs", common_matchs)
        if config_name and not isinstance(config_name, str):
            raise TypeError("Expected argument 'config_name' to be a str")
        pulumi.set(__self__, "config_name", config_name)
        if config_type and not isinstance(config_type, str):
            raise TypeError("Expected argument 'config_type' to be a str")
        pulumi.set(__self__, "config_type", config_type)
        if deny_ip_access_rule and not isinstance(deny_ip_access_rule, dict):
            raise TypeError("Expected argument 'deny_ip_access_rule' to be a dict")
        pulumi.set(__self__, "deny_ip_access_rule", deny_ip_access_rule)
        if deny_referer_access_rule and not isinstance(deny_referer_access_rule, dict):
            raise TypeError("Expected argument 'deny_referer_access_rule' to be a dict")
        pulumi.set(__self__, "deny_referer_access_rule", deny_referer_access_rule)
        if domain_count and not isinstance(domain_count, int):
            raise TypeError("Expected argument 'domain_count' to be a int")
        pulumi.set(__self__, "domain_count", domain_count)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if rule_content and not isinstance(rule_content, str):
            raise TypeError("Expected argument 'rule_content' to be a str")
        pulumi.set(__self__, "rule_content", rule_content)
        if updated_time and not isinstance(updated_time, int):
            raise TypeError("Expected argument 'updated_time' to be a int")
        pulumi.set(__self__, "updated_time", updated_time)

    @property
    @pulumi.getter(name="allowIpAccessRule")
    def allow_ip_access_rule(self) -> 'outputs.GetShareConfigAllowIpAccessRuleResult':
        """
        表示一个 IP 白名单的配置，对应 ConfigType 是 allow*ip*access*rule。
        """
        return pulumi.get(self, "allow_ip_access_rule")

    @property
    @pulumi.getter(name="allowRefererAccessRule")
    def allow_referer_access_rule(self) -> 'outputs.GetShareConfigAllowRefererAccessRuleResult':
        """
        表示一个 Referer 白名单的配置，对应 ConfigType 是 allow*referer*access*rule。
        """
        return pulumi.get(self, "allow_referer_access_rule")

    @property
    @pulumi.getter(name="commonMatchs")
    def common_matchs(self) -> 'outputs.GetShareConfigCommonMatchsResult':
        """
        表示一个通用列表的配置，对应 ConfigType 是 common*match*list。
        """
        return pulumi.get(self, "common_matchs")

    @property
    @pulumi.getter(name="configName")
    def config_name(self) -> builtins.str:
        """
        表示全局配置的名称。名称有以下要求：名称可以包含汉字、字母、数字、下划线（_），长度在 3-45 个字符之间。一个汉字占 3 个字符。名称不能与主账号下某个已有的全局配置的名称相同。
        """
        return pulumi.get(self, "config_name")

    @property
    @pulumi.getter(name="configType")
    def config_type(self) -> builtins.str:
        """
        表示该全局配置的类型。该参数有以下取值：deny*ip*access*rule：表示 IP 黑名单。allow*ip*access*rule：表示 IP 白名单。deny*referer*access*rule：表示 Referer 黑名单。allow*referer*access*rule：表示 Referer 白名单。common*match*list：表示通用列表。
        """
        return pulumi.get(self, "config_type")

    @property
    @pulumi.getter(name="denyIpAccessRule")
    def deny_ip_access_rule(self) -> 'outputs.GetShareConfigDenyIpAccessRuleResult':
        """
        表示一个 IP 黑名单的配置，对应 ConfigType 是 deny*ip*access*rule。
        """
        return pulumi.get(self, "deny_ip_access_rule")

    @property
    @pulumi.getter(name="denyRefererAccessRule")
    def deny_referer_access_rule(self) -> 'outputs.GetShareConfigDenyRefererAccessRuleResult':
        """
        表示一个 Referer 黑名单的配置，对应 ConfigType 是 deny*referer*access*rule。
        """
        return pulumi.get(self, "deny_referer_access_rule")

    @property
    @pulumi.getter(name="domainCount")
    def domain_count(self) -> builtins.int:
        """
        表示与该全局配置关联的加速域名的数量。
        """
        return pulumi.get(self, "domain_count")

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

    @property
    @pulumi.getter
    def project(self) -> builtins.str:
        """
        表示该全局配置所归属的项目名称。
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter(name="ruleContent")
    def rule_content(self) -> builtins.str:
        """
        表示该自定义错误页面的 HTML 代码。
        """
        return pulumi.get(self, "rule_content")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.int:
        """
        表示该全局配置的最近修改时间，单位是 Unix 时间戳。
        """
        return pulumi.get(self, "updated_time")


class AwaitableGetShareConfigResult(GetShareConfigResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetShareConfigResult(
            allow_ip_access_rule=self.allow_ip_access_rule,
            allow_referer_access_rule=self.allow_referer_access_rule,
            common_matchs=self.common_matchs,
            config_name=self.config_name,
            config_type=self.config_type,
            deny_ip_access_rule=self.deny_ip_access_rule,
            deny_referer_access_rule=self.deny_referer_access_rule,
            domain_count=self.domain_count,
            id=self.id,
            project=self.project,
            rule_content=self.rule_content,
            updated_time=self.updated_time)


def get_share_config(id: Optional[builtins.str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetShareConfigResult:
    """
    Data Source schema for Byteplus::CDN::ShareConfig


    :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:cdn/getShareConfig:getShareConfig', __args__, opts=opts, typ=GetShareConfigResult).value

    return AwaitableGetShareConfigResult(
        allow_ip_access_rule=pulumi.get(__ret__, 'allow_ip_access_rule'),
        allow_referer_access_rule=pulumi.get(__ret__, 'allow_referer_access_rule'),
        common_matchs=pulumi.get(__ret__, 'common_matchs'),
        config_name=pulumi.get(__ret__, 'config_name'),
        config_type=pulumi.get(__ret__, 'config_type'),
        deny_ip_access_rule=pulumi.get(__ret__, 'deny_ip_access_rule'),
        deny_referer_access_rule=pulumi.get(__ret__, 'deny_referer_access_rule'),
        domain_count=pulumi.get(__ret__, 'domain_count'),
        id=pulumi.get(__ret__, 'id'),
        project=pulumi.get(__ret__, 'project'),
        rule_content=pulumi.get(__ret__, 'rule_content'),
        updated_time=pulumi.get(__ret__, 'updated_time'))
def get_share_config_output(id: Optional[pulumi.Input[builtins.str]] = None,
                            opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetShareConfigResult]:
    """
    Data Source schema for Byteplus::CDN::ShareConfig


    :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:cdn/getShareConfig:getShareConfig', __args__, opts=opts, typ=GetShareConfigResult)
    return __ret__.apply(lambda __response__: GetShareConfigResult(
        allow_ip_access_rule=pulumi.get(__response__, 'allow_ip_access_rule'),
        allow_referer_access_rule=pulumi.get(__response__, 'allow_referer_access_rule'),
        common_matchs=pulumi.get(__response__, 'common_matchs'),
        config_name=pulumi.get(__response__, 'config_name'),
        config_type=pulumi.get(__response__, 'config_type'),
        deny_ip_access_rule=pulumi.get(__response__, 'deny_ip_access_rule'),
        deny_referer_access_rule=pulumi.get(__response__, 'deny_referer_access_rule'),
        domain_count=pulumi.get(__response__, 'domain_count'),
        id=pulumi.get(__response__, 'id'),
        project=pulumi.get(__response__, 'project'),
        rule_content=pulumi.get(__response__, 'rule_content'),
        updated_time=pulumi.get(__response__, 'updated_time')))
