# 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__ = [
    'GetKafkaTriggerResult',
    'AwaitableGetKafkaTriggerResult',
    'get_kafka_trigger',
    'get_kafka_trigger_output',
]

@pulumi.output_type
class GetKafkaTriggerResult:
    """
    A collection of values returned by getKafkaTrigger.
    """
    def __init__(__self__, batch_flush_duration_milliseconds=None, batch_size=None, consumer_group=None, created_time=None, description=None, enabled=None, function_id=None, id=None, kafka_credentials=None, kafka_trigger_id=None, maximum_retry_attempts=None, mq_instance_id=None, name=None, starting_position=None, status=None, topic_name=None, updated_time=None):
        if batch_flush_duration_milliseconds and not isinstance(batch_flush_duration_milliseconds, int):
            raise TypeError("Expected argument 'batch_flush_duration_milliseconds' to be a int")
        pulumi.set(__self__, "batch_flush_duration_milliseconds", batch_flush_duration_milliseconds)
        if batch_size and not isinstance(batch_size, int):
            raise TypeError("Expected argument 'batch_size' to be a int")
        pulumi.set(__self__, "batch_size", batch_size)
        if consumer_group and not isinstance(consumer_group, str):
            raise TypeError("Expected argument 'consumer_group' to be a str")
        pulumi.set(__self__, "consumer_group", consumer_group)
        if created_time and not isinstance(created_time, str):
            raise TypeError("Expected argument 'created_time' to be a str")
        pulumi.set(__self__, "created_time", created_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if enabled and not isinstance(enabled, bool):
            raise TypeError("Expected argument 'enabled' to be a bool")
        pulumi.set(__self__, "enabled", enabled)
        if function_id and not isinstance(function_id, str):
            raise TypeError("Expected argument 'function_id' to be a str")
        pulumi.set(__self__, "function_id", function_id)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if kafka_credentials and not isinstance(kafka_credentials, dict):
            raise TypeError("Expected argument 'kafka_credentials' to be a dict")
        pulumi.set(__self__, "kafka_credentials", kafka_credentials)
        if kafka_trigger_id and not isinstance(kafka_trigger_id, str):
            raise TypeError("Expected argument 'kafka_trigger_id' to be a str")
        pulumi.set(__self__, "kafka_trigger_id", kafka_trigger_id)
        if maximum_retry_attempts and not isinstance(maximum_retry_attempts, int):
            raise TypeError("Expected argument 'maximum_retry_attempts' to be a int")
        pulumi.set(__self__, "maximum_retry_attempts", maximum_retry_attempts)
        if mq_instance_id and not isinstance(mq_instance_id, str):
            raise TypeError("Expected argument 'mq_instance_id' to be a str")
        pulumi.set(__self__, "mq_instance_id", mq_instance_id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if starting_position and not isinstance(starting_position, str):
            raise TypeError("Expected argument 'starting_position' to be a str")
        pulumi.set(__self__, "starting_position", starting_position)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if topic_name and not isinstance(topic_name, str):
            raise TypeError("Expected argument 'topic_name' to be a str")
        pulumi.set(__self__, "topic_name", topic_name)
        if updated_time and not isinstance(updated_time, str):
            raise TypeError("Expected argument 'updated_time' to be a str")
        pulumi.set(__self__, "updated_time", updated_time)

    @property
    @pulumi.getter(name="batchFlushDurationMilliseconds")
    def batch_flush_duration_milliseconds(self) -> builtins.int:
        """
        触发器批量消费的最长等待时间。单位为毫秒（ms），取值范围为 1000 ~ 60000 ms，默认值为 1000 ms。
        """
        return pulumi.get(self, "batch_flush_duration_milliseconds")

    @property
    @pulumi.getter(name="batchSize")
    def batch_size(self) -> builtins.int:
        """
        触发器批量消费的每批次消息数。
        """
        return pulumi.get(self, "batch_size")

    @property
    @pulumi.getter(name="consumerGroup")
    def consumer_group(self) -> builtins.str:
        """
        消息队列 Kafka 实例的消费组名字。
        """
        return pulumi.get(self, "consumer_group")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> builtins.str:
        """
        Kafka 触发器创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        Kafka 触发器描述。长度限制为 200 个字符以内。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def enabled(self) -> builtins.bool:
        """
        是否在创建触发器的同时启用触发器。取值：true：启用。false：关闭。
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter(name="functionId")
    def function_id(self) -> builtins.str:
        """
        函数 ID。
        """
        return pulumi.get(self, "function_id")

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

    @property
    @pulumi.getter(name="kafkaCredentials")
    def kafka_credentials(self) -> 'outputs.GetKafkaTriggerKafkaCredentialsResult':
        """
        Kafka 身份认证。函数服务将通过 Kafka ACL 权限策略，对 PLAIN 和 SCRAM-SHA-256 两种类型的 SASL 用户进行消息消费鉴权。
        """
        return pulumi.get(self, "kafka_credentials")

    @property
    @pulumi.getter(name="kafkaTriggerId")
    def kafka_trigger_id(self) -> builtins.str:
        """
        Kafka 触发器 ID。
        """
        return pulumi.get(self, "kafka_trigger_id")

    @property
    @pulumi.getter(name="maximumRetryAttempts")
    def maximum_retry_attempts(self) -> builtins.int:
        """
        函数发生运行错误（包括用户代码错误和 Runtime 错误）时的最大重试次数。取值范围为 0～100 的正整数。
        """
        return pulumi.get(self, "maximum_retry_attempts")

    @property
    @pulumi.getter(name="mqInstanceId")
    def mq_instance_id(self) -> builtins.str:
        """
        消息队列 Kafka 实例 ID。
        """
        return pulumi.get(self, "mq_instance_id")

    @property
    @pulumi.getter
    def name(self) -> builtins.str:
        """
        Kafka 触发器名字。同一函数下，触发器名称不可重复。只能包含大小写字母、数字、下划线，并且以字母开头，长度限制为 4~63 个字符。
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="startingPosition")
    def starting_position(self) -> builtins.str:
        """
        指定开始消费 Topic 中消息的位置。取值：Latest：只消费订阅 Topic 后产生的消息。Earliest：从 Topic 中生产的第一条消息开始消费。
        """
        return pulumi.get(self, "starting_position")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        Kafka 触发器状态。参数值说明：ready：运行，failed：失败，pending：启动中
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="topicName")
    def topic_name(self) -> builtins.str:
        """
        消息队列 Kafka 实例的 Topic 名称。
        """
        return pulumi.get(self, "topic_name")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> builtins.str:
        """
        Kafka 触发器最近一次更新时间。
        """
        return pulumi.get(self, "updated_time")


class AwaitableGetKafkaTriggerResult(GetKafkaTriggerResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetKafkaTriggerResult(
            batch_flush_duration_milliseconds=self.batch_flush_duration_milliseconds,
            batch_size=self.batch_size,
            consumer_group=self.consumer_group,
            created_time=self.created_time,
            description=self.description,
            enabled=self.enabled,
            function_id=self.function_id,
            id=self.id,
            kafka_credentials=self.kafka_credentials,
            kafka_trigger_id=self.kafka_trigger_id,
            maximum_retry_attempts=self.maximum_retry_attempts,
            mq_instance_id=self.mq_instance_id,
            name=self.name,
            starting_position=self.starting_position,
            status=self.status,
            topic_name=self.topic_name,
            updated_time=self.updated_time)


def get_kafka_trigger(id: Optional[builtins.str] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetKafkaTriggerResult:
    """
    Data Source schema for Byteplus::VEFAAS::KafkaTrigger


    :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:vefaas/getKafkaTrigger:getKafkaTrigger', __args__, opts=opts, typ=GetKafkaTriggerResult).value

    return AwaitableGetKafkaTriggerResult(
        batch_flush_duration_milliseconds=pulumi.get(__ret__, 'batch_flush_duration_milliseconds'),
        batch_size=pulumi.get(__ret__, 'batch_size'),
        consumer_group=pulumi.get(__ret__, 'consumer_group'),
        created_time=pulumi.get(__ret__, 'created_time'),
        description=pulumi.get(__ret__, 'description'),
        enabled=pulumi.get(__ret__, 'enabled'),
        function_id=pulumi.get(__ret__, 'function_id'),
        id=pulumi.get(__ret__, 'id'),
        kafka_credentials=pulumi.get(__ret__, 'kafka_credentials'),
        kafka_trigger_id=pulumi.get(__ret__, 'kafka_trigger_id'),
        maximum_retry_attempts=pulumi.get(__ret__, 'maximum_retry_attempts'),
        mq_instance_id=pulumi.get(__ret__, 'mq_instance_id'),
        name=pulumi.get(__ret__, 'name'),
        starting_position=pulumi.get(__ret__, 'starting_position'),
        status=pulumi.get(__ret__, 'status'),
        topic_name=pulumi.get(__ret__, 'topic_name'),
        updated_time=pulumi.get(__ret__, 'updated_time'))
def get_kafka_trigger_output(id: Optional[pulumi.Input[builtins.str]] = None,
                             opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetKafkaTriggerResult]:
    """
    Data Source schema for Byteplus::VEFAAS::KafkaTrigger


    :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:vefaas/getKafkaTrigger:getKafkaTrigger', __args__, opts=opts, typ=GetKafkaTriggerResult)
    return __ret__.apply(lambda __response__: GetKafkaTriggerResult(
        batch_flush_duration_milliseconds=pulumi.get(__response__, 'batch_flush_duration_milliseconds'),
        batch_size=pulumi.get(__response__, 'batch_size'),
        consumer_group=pulumi.get(__response__, 'consumer_group'),
        created_time=pulumi.get(__response__, 'created_time'),
        description=pulumi.get(__response__, 'description'),
        enabled=pulumi.get(__response__, 'enabled'),
        function_id=pulumi.get(__response__, 'function_id'),
        id=pulumi.get(__response__, 'id'),
        kafka_credentials=pulumi.get(__response__, 'kafka_credentials'),
        kafka_trigger_id=pulumi.get(__response__, 'kafka_trigger_id'),
        maximum_retry_attempts=pulumi.get(__response__, 'maximum_retry_attempts'),
        mq_instance_id=pulumi.get(__response__, 'mq_instance_id'),
        name=pulumi.get(__response__, 'name'),
        starting_position=pulumi.get(__response__, 'starting_position'),
        status=pulumi.get(__response__, 'status'),
        topic_name=pulumi.get(__response__, 'topic_name'),
        updated_time=pulumi.get(__response__, 'updated_time')))
