# 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
from ._inputs import *

__all__ = ['GroupArgs', 'Group']

@pulumi.input_type
class GroupArgs:
    def __init__(__self__, *,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 group_name: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 reset_info: Optional[pulumi.Input['GroupResetInfoArgs']] = None):
        """
        The set of arguments for constructing a Group resource.
        :param pulumi.Input[builtins.str] description: Consumer Group 描述。
        :param pulumi.Input[builtins.str] group_name: 自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        :param pulumi.Input[builtins.str] instance_id: 所属 BMQ 实例 ID。
        :param pulumi.Input['GroupResetInfoArgs'] reset_info: 重置消费位点信息。
        """
        if description is not None:
            pulumi.set(__self__, "description", description)
        if group_name is not None:
            pulumi.set(__self__, "group_name", group_name)
        if instance_id is not None:
            pulumi.set(__self__, "instance_id", instance_id)
        if reset_info is not None:
            pulumi.set(__self__, "reset_info", reset_info)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 描述。
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter(name="groupName")
    def group_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        """
        return pulumi.get(self, "group_name")

    @group_name.setter
    def group_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "group_name", value)

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        所属 BMQ 实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @instance_id.setter
    def instance_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "instance_id", value)

    @property
    @pulumi.getter(name="resetInfo")
    def reset_info(self) -> Optional[pulumi.Input['GroupResetInfoArgs']]:
        """
        重置消费位点信息。
        """
        return pulumi.get(self, "reset_info")

    @reset_info.setter
    def reset_info(self, value: Optional[pulumi.Input['GroupResetInfoArgs']]):
        pulumi.set(self, "reset_info", value)


@pulumi.input_type
class _GroupState:
    def __init__(__self__, *,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 group_id: Optional[pulumi.Input[builtins.str]] = None,
                 group_name: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 owner_id: Optional[pulumi.Input[builtins.str]] = None,
                 owner_name: Optional[pulumi.Input[builtins.str]] = None,
                 reset_info: Optional[pulumi.Input['GroupResetInfoArgs']] = None,
                 status: Optional[pulumi.Input[builtins.str]] = None,
                 topic_infos: Optional[pulumi.Input[Sequence[pulumi.Input['GroupTopicInfoArgs']]]] = None):
        """
        Input properties used for looking up and filtering Group resources.
        :param pulumi.Input[builtins.str] created_time: Consumer Group 创建时间。
        :param pulumi.Input[builtins.str] description: Consumer Group 描述。
        :param pulumi.Input[builtins.str] group_id: Consumer Group 的 ID。
        :param pulumi.Input[builtins.str] group_name: 自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        :param pulumi.Input[builtins.str] instance_id: 所属 BMQ 实例 ID。
        :param pulumi.Input[builtins.str] owner_id: Consumer Group 所属用户的 ID。
        :param pulumi.Input[builtins.str] owner_name: Consumer Group 所属用户的名称。
        :param pulumi.Input['GroupResetInfoArgs'] reset_info: 重置消费位点信息。
        :param pulumi.Input[builtins.str] status: Consumer Group 的状态。
        """
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if group_id is not None:
            pulumi.set(__self__, "group_id", group_id)
        if group_name is not None:
            pulumi.set(__self__, "group_name", group_name)
        if instance_id is not None:
            pulumi.set(__self__, "instance_id", instance_id)
        if owner_id is not None:
            pulumi.set(__self__, "owner_id", owner_id)
        if owner_name is not None:
            pulumi.set(__self__, "owner_name", owner_name)
        if reset_info is not None:
            pulumi.set(__self__, "reset_info", reset_info)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if topic_infos is not None:
            pulumi.set(__self__, "topic_infos", topic_infos)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 创建时间。
        """
        return pulumi.get(self, "created_time")

    @created_time.setter
    def created_time(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "created_time", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 描述。
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter(name="groupId")
    def group_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 的 ID。
        """
        return pulumi.get(self, "group_id")

    @group_id.setter
    def group_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "group_id", value)

    @property
    @pulumi.getter(name="groupName")
    def group_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        """
        return pulumi.get(self, "group_name")

    @group_name.setter
    def group_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "group_name", value)

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        所属 BMQ 实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @instance_id.setter
    def instance_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "instance_id", value)

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 所属用户的 ID。
        """
        return pulumi.get(self, "owner_id")

    @owner_id.setter
    def owner_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "owner_id", value)

    @property
    @pulumi.getter(name="ownerName")
    def owner_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 所属用户的名称。
        """
        return pulumi.get(self, "owner_name")

    @owner_name.setter
    def owner_name(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "owner_name", value)

    @property
    @pulumi.getter(name="resetInfo")
    def reset_info(self) -> Optional[pulumi.Input['GroupResetInfoArgs']]:
        """
        重置消费位点信息。
        """
        return pulumi.get(self, "reset_info")

    @reset_info.setter
    def reset_info(self, value: Optional[pulumi.Input['GroupResetInfoArgs']]):
        pulumi.set(self, "reset_info", value)

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Consumer Group 的状态。
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter(name="topicInfos")
    def topic_infos(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GroupTopicInfoArgs']]]]:
        return pulumi.get(self, "topic_infos")

    @topic_infos.setter
    def topic_infos(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['GroupTopicInfoArgs']]]]):
        pulumi.set(self, "topic_infos", value)


@pulumi.type_token("bytepluscc:bmq/group:Group")
class Group(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 group_name: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 reset_info: Optional[pulumi.Input[Union['GroupResetInfoArgs', 'GroupResetInfoArgsDict']]] = None,
                 __props__=None):
        """
        一组具有相同 Group ID 的消费端。当一个 Topic 被同一个 Group 的多个 Consumer 消费时，每一条消息都只会被投递到一个 Consumer，实现消费的负载均衡。通过 Group，您可以确保一个 Topic 的消息被并行消费。

        ## Import

        ```sh
        $ pulumi import bytepluscc:bmq/group:Group example "group_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] description: Consumer Group 描述。
        :param pulumi.Input[builtins.str] group_name: 自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        :param pulumi.Input[builtins.str] instance_id: 所属 BMQ 实例 ID。
        :param pulumi.Input[Union['GroupResetInfoArgs', 'GroupResetInfoArgsDict']] reset_info: 重置消费位点信息。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[GroupArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        一组具有相同 Group ID 的消费端。当一个 Topic 被同一个 Group 的多个 Consumer 消费时，每一条消息都只会被投递到一个 Consumer，实现消费的负载均衡。通过 Group，您可以确保一个 Topic 的消息被并行消费。

        ## Import

        ```sh
        $ pulumi import bytepluscc:bmq/group:Group example "group_id"
        ```

        :param str resource_name: The name of the resource.
        :param GroupArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(GroupArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 group_name: Optional[pulumi.Input[builtins.str]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 reset_info: Optional[pulumi.Input[Union['GroupResetInfoArgs', 'GroupResetInfoArgsDict']]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = GroupArgs.__new__(GroupArgs)

            __props__.__dict__["description"] = description
            __props__.__dict__["group_name"] = group_name
            __props__.__dict__["instance_id"] = instance_id
            __props__.__dict__["reset_info"] = reset_info
            __props__.__dict__["created_time"] = None
            __props__.__dict__["group_id"] = None
            __props__.__dict__["owner_id"] = None
            __props__.__dict__["owner_name"] = None
            __props__.__dict__["status"] = None
            __props__.__dict__["topic_infos"] = None
        super(Group, __self__).__init__(
            'bytepluscc:bmq/group:Group',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            group_id: Optional[pulumi.Input[builtins.str]] = None,
            group_name: Optional[pulumi.Input[builtins.str]] = None,
            instance_id: Optional[pulumi.Input[builtins.str]] = None,
            owner_id: Optional[pulumi.Input[builtins.str]] = None,
            owner_name: Optional[pulumi.Input[builtins.str]] = None,
            reset_info: Optional[pulumi.Input[Union['GroupResetInfoArgs', 'GroupResetInfoArgsDict']]] = None,
            status: Optional[pulumi.Input[builtins.str]] = None,
            topic_infos: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupTopicInfoArgs', 'GroupTopicInfoArgsDict']]]]] = None) -> 'Group':
        """
        Get an existing Group resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] created_time: Consumer Group 创建时间。
        :param pulumi.Input[builtins.str] description: Consumer Group 描述。
        :param pulumi.Input[builtins.str] group_id: Consumer Group 的 ID。
        :param pulumi.Input[builtins.str] group_name: 自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        :param pulumi.Input[builtins.str] instance_id: 所属 BMQ 实例 ID。
        :param pulumi.Input[builtins.str] owner_id: Consumer Group 所属用户的 ID。
        :param pulumi.Input[builtins.str] owner_name: Consumer Group 所属用户的名称。
        :param pulumi.Input[Union['GroupResetInfoArgs', 'GroupResetInfoArgsDict']] reset_info: 重置消费位点信息。
        :param pulumi.Input[builtins.str] status: Consumer Group 的状态。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GroupState.__new__(_GroupState)

        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["description"] = description
        __props__.__dict__["group_id"] = group_id
        __props__.__dict__["group_name"] = group_name
        __props__.__dict__["instance_id"] = instance_id
        __props__.__dict__["owner_id"] = owner_id
        __props__.__dict__["owner_name"] = owner_name
        __props__.__dict__["reset_info"] = reset_info
        __props__.__dict__["status"] = status
        __props__.__dict__["topic_infos"] = topic_infos
        return Group(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.str]:
        """
        Consumer Group 创建时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        Consumer Group 描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="groupId")
    def group_id(self) -> pulumi.Output[builtins.str]:
        """
        Consumer Group 的 ID。
        """
        return pulumi.get(self, "group_id")

    @property
    @pulumi.getter(name="groupName")
    def group_name(self) -> pulumi.Output[builtins.str]:
        """
        自定义设置Consumer Group 的名称，约束限制如下：只能由小写英文字符、数字、下划线和中划线（-）组成。长度为 3~64 字符。
        """
        return pulumi.get(self, "group_name")

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

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> pulumi.Output[builtins.str]:
        """
        Consumer Group 所属用户的 ID。
        """
        return pulumi.get(self, "owner_id")

    @property
    @pulumi.getter(name="ownerName")
    def owner_name(self) -> pulumi.Output[builtins.str]:
        """
        Consumer Group 所属用户的名称。
        """
        return pulumi.get(self, "owner_name")

    @property
    @pulumi.getter(name="resetInfo")
    def reset_info(self) -> pulumi.Output['outputs.GroupResetInfo']:
        """
        重置消费位点信息。
        """
        return pulumi.get(self, "reset_info")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[builtins.str]:
        """
        Consumer Group 的状态。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter(name="topicInfos")
    def topic_infos(self) -> pulumi.Output[Sequence['outputs.GroupTopicInfo']]:
        return pulumi.get(self, "topic_infos")

