# 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__ = [
    'GetIndexResult',
    'AwaitableGetIndexResult',
    'get_index',
    'get_index_output',
]

@pulumi.output_type
class GetIndexResult:
    """
    A collection of values returned by getIndex.
    """
    def __init__(__self__, create_time=None, enable_auto_index=None, full_text=None, id=None, key_values=None, max_text_len=None, modify_time=None, topic_id=None, user_inner_key_values=None):
        if create_time and not isinstance(create_time, str):
            raise TypeError("Expected argument 'create_time' to be a str")
        pulumi.set(__self__, "create_time", create_time)
        if enable_auto_index and not isinstance(enable_auto_index, bool):
            raise TypeError("Expected argument 'enable_auto_index' to be a bool")
        pulumi.set(__self__, "enable_auto_index", enable_auto_index)
        if full_text and not isinstance(full_text, dict):
            raise TypeError("Expected argument 'full_text' to be a dict")
        pulumi.set(__self__, "full_text", full_text)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if key_values and not isinstance(key_values, list):
            raise TypeError("Expected argument 'key_values' to be a list")
        pulumi.set(__self__, "key_values", key_values)
        if max_text_len and not isinstance(max_text_len, int):
            raise TypeError("Expected argument 'max_text_len' to be a int")
        pulumi.set(__self__, "max_text_len", max_text_len)
        if modify_time and not isinstance(modify_time, str):
            raise TypeError("Expected argument 'modify_time' to be a str")
        pulumi.set(__self__, "modify_time", modify_time)
        if topic_id and not isinstance(topic_id, str):
            raise TypeError("Expected argument 'topic_id' to be a str")
        pulumi.set(__self__, "topic_id", topic_id)
        if user_inner_key_values and not isinstance(user_inner_key_values, list):
            raise TypeError("Expected argument 'user_inner_key_values' to be a list")
        pulumi.set(__self__, "user_inner_key_values", user_inner_key_values)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> builtins.str:
        """
        索引创建的时间。
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter(name="enableAutoIndex")
    def enable_auto_index(self) -> builtins.bool:
        """
        是否开启索引自动更新，开启后系统将根据新出现的字段自动添加到键值索引。true：开启自动更新。false：不开启自动更新。
        """
        return pulumi.get(self, "enable_auto_index")

    @property
    @pulumi.getter(name="fullText")
    def full_text(self) -> 'outputs.GetIndexFullTextResult':
        """
        全文索引配置。此字段为 null 或者未配置，表示不开启全文索引。全文索引配置和键值索引配置至少配置一项，即 FullText 和 KeyValue 之间应至少指定一个参数。
        """
        return pulumi.get(self, "full_text")

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

    @property
    @pulumi.getter(name="keyValues")
    def key_values(self) -> Sequence['outputs.GetIndexKeyValueResult']:
        """
        键值索引配置。此字段数组长度为 0 或者未配置，表示不开启键值索引。全文索引配置和键值索引配置至少配置一项，即 FullText 和 KeyValue 之间应至少指定一个参数。
        """
        return pulumi.get(self, "key_values")

    @property
    @pulumi.getter(name="maxTextLen")
    def max_text_len(self) -> builtins.int:
        """
        统计字段值的最大长度，默认为 2048，取值范围为 64~16384，单位为字节。说明单个字段值的长度超过您所指定的最大长度时，超出部分将被截断，不参与分析。字段最大长度更新后，只对增量数据有效。
        """
        return pulumi.get(self, "max_text_len")

    @property
    @pulumi.getter(name="modifyTime")
    def modify_time(self) -> builtins.str:
        """
        索引最近修改的时间。
        """
        return pulumi.get(self, "modify_time")

    @property
    @pulumi.getter(name="topicId")
    def topic_id(self) -> builtins.str:
        """
        日志主题ID。
        """
        return pulumi.get(self, "topic_id")

    @property
    @pulumi.getter(name="userInnerKeyValues")
    def user_inner_key_values(self) -> Sequence['outputs.GetIndexUserInnerKeyValueResult']:
        """
        预留字段索引配置。此字段数组长度为 0 或者未配置，表示不开启预留字段索引。不能同时开启全文索引和预留字段 **content** 的键值索引，即如果通过 UserInnerKeyValue 参数设置**content** 索引，则不能同时设置参数 FullText。预留字段中，目前仅支持为 **content** 手动开启索引。其他预留字段的索引设置请参考预留字段。
        """
        return pulumi.get(self, "user_inner_key_values")


class AwaitableGetIndexResult(GetIndexResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetIndexResult(
            create_time=self.create_time,
            enable_auto_index=self.enable_auto_index,
            full_text=self.full_text,
            id=self.id,
            key_values=self.key_values,
            max_text_len=self.max_text_len,
            modify_time=self.modify_time,
            topic_id=self.topic_id,
            user_inner_key_values=self.user_inner_key_values)


def get_index(id: Optional[builtins.str] = None,
              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetIndexResult:
    """
    Data Source schema for Byteplus::TLS::Index


    :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:tls/getIndex:getIndex', __args__, opts=opts, typ=GetIndexResult).value

    return AwaitableGetIndexResult(
        create_time=pulumi.get(__ret__, 'create_time'),
        enable_auto_index=pulumi.get(__ret__, 'enable_auto_index'),
        full_text=pulumi.get(__ret__, 'full_text'),
        id=pulumi.get(__ret__, 'id'),
        key_values=pulumi.get(__ret__, 'key_values'),
        max_text_len=pulumi.get(__ret__, 'max_text_len'),
        modify_time=pulumi.get(__ret__, 'modify_time'),
        topic_id=pulumi.get(__ret__, 'topic_id'),
        user_inner_key_values=pulumi.get(__ret__, 'user_inner_key_values'))
def get_index_output(id: Optional[pulumi.Input[builtins.str]] = None,
                     opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetIndexResult]:
    """
    Data Source schema for Byteplus::TLS::Index


    :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:tls/getIndex:getIndex', __args__, opts=opts, typ=GetIndexResult)
    return __ret__.apply(lambda __response__: GetIndexResult(
        create_time=pulumi.get(__response__, 'create_time'),
        enable_auto_index=pulumi.get(__response__, 'enable_auto_index'),
        full_text=pulumi.get(__response__, 'full_text'),
        id=pulumi.get(__response__, 'id'),
        key_values=pulumi.get(__response__, 'key_values'),
        max_text_len=pulumi.get(__response__, 'max_text_len'),
        modify_time=pulumi.get(__response__, 'modify_time'),
        topic_id=pulumi.get(__response__, 'topic_id'),
        user_inner_key_values=pulumi.get(__response__, 'user_inner_key_values')))
