# 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__, *,
                 user_group_name: pulumi.Input[builtins.str],
                 attached_policies: Optional[pulumi.Input[Sequence[pulumi.Input['GroupAttachedPolicyArgs']]]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 display_name: Optional[pulumi.Input[builtins.str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input['GroupUserArgs']]]] = None):
        """
        The set of arguments for constructing a Group resource.
        :param pulumi.Input[builtins.str] user_group_name: 用户组名称。长度1~64，支持英文、数字和.-_符号。
        :param pulumi.Input[builtins.str] description: 用户组描述信息。长度不超过128。
        :param pulumi.Input[builtins.str] display_name: 用户组显示名称。长度不超过64。
        """
        pulumi.set(__self__, "user_group_name", user_group_name)
        if attached_policies is not None:
            pulumi.set(__self__, "attached_policies", attached_policies)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if display_name is not None:
            pulumi.set(__self__, "display_name", display_name)
        if users is not None:
            pulumi.set(__self__, "users", users)

    @property
    @pulumi.getter(name="userGroupName")
    def user_group_name(self) -> pulumi.Input[builtins.str]:
        """
        用户组名称。长度1~64，支持英文、数字和.-_符号。
        """
        return pulumi.get(self, "user_group_name")

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

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

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组描述信息。长度不超过128。
        """
        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="displayName")
    def display_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组显示名称。长度不超过64。
        """
        return pulumi.get(self, "display_name")

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

    @property
    @pulumi.getter
    def users(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GroupUserArgs']]]]:
        return pulumi.get(self, "users")

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


@pulumi.input_type
class _GroupState:
    def __init__(__self__, *,
                 account_id: Optional[pulumi.Input[builtins.int]] = None,
                 attached_policies: Optional[pulumi.Input[Sequence[pulumi.Input['GroupAttachedPolicyArgs']]]] = None,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 display_name: Optional[pulumi.Input[builtins.str]] = None,
                 updated_time: Optional[pulumi.Input[builtins.str]] = None,
                 user_group_id: Optional[pulumi.Input[builtins.int]] = None,
                 user_group_name: Optional[pulumi.Input[builtins.str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input['GroupUserArgs']]]] = None):
        """
        Input properties used for looking up and filtering Group resources.
        :param pulumi.Input[builtins.int] account_id: 用户组所属主账号的ID。
        :param pulumi.Input[builtins.str] created_time: 用户组的创建时间。
        :param pulumi.Input[builtins.str] description: 用户组描述信息。长度不超过128。
        :param pulumi.Input[builtins.str] display_name: 用户组显示名称。长度不超过64。
        :param pulumi.Input[builtins.str] updated_time: 用户组的更新时间。
        :param pulumi.Input[builtins.int] user_group_id: 用户组ID。
        :param pulumi.Input[builtins.str] user_group_name: 用户组名称。长度1~64，支持英文、数字和.-_符号。
        """
        if account_id is not None:
            pulumi.set(__self__, "account_id", account_id)
        if attached_policies is not None:
            pulumi.set(__self__, "attached_policies", attached_policies)
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if display_name is not None:
            pulumi.set(__self__, "display_name", display_name)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)
        if user_group_id is not None:
            pulumi.set(__self__, "user_group_id", user_group_id)
        if user_group_name is not None:
            pulumi.set(__self__, "user_group_name", user_group_name)
        if users is not None:
            pulumi.set(__self__, "users", users)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        用户组所属主账号的ID。
        """
        return pulumi.get(self, "account_id")

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

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

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

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组的创建时间。
        """
        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]]:
        """
        用户组描述信息。长度不超过128。
        """
        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="displayName")
    def display_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组显示名称。长度不超过64。
        """
        return pulumi.get(self, "display_name")

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

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组的更新时间。
        """
        return pulumi.get(self, "updated_time")

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

    @property
    @pulumi.getter(name="userGroupId")
    def user_group_id(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        用户组ID。
        """
        return pulumi.get(self, "user_group_id")

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

    @property
    @pulumi.getter(name="userGroupName")
    def user_group_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        用户组名称。长度1~64，支持英文、数字和.-_符号。
        """
        return pulumi.get(self, "user_group_name")

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

    @property
    @pulumi.getter
    def users(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['GroupUserArgs']]]]:
        return pulumi.get(self, "users")

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


@pulumi.type_token("bytepluscc:iam/group:Group")
class Group(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 attached_policies: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupAttachedPolicyArgs', 'GroupAttachedPolicyArgsDict']]]]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 display_name: Optional[pulumi.Input[builtins.str]] = None,
                 user_group_name: Optional[pulumi.Input[builtins.str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupUserArgs', 'GroupUserArgsDict']]]]] = None,
                 __props__=None):
        """
        用户组是用户的集合。当用户组被关联上策略后，同一用户组里的所有用户会拥有对应的策略权限，同一个用户可存在于多个用户组中，可同时拥有多个用户组的权限。

        ## Import

        ```sh
        $ pulumi import bytepluscc:iam/group:Group example "user_group_name"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] description: 用户组描述信息。长度不超过128。
        :param pulumi.Input[builtins.str] display_name: 用户组显示名称。长度不超过64。
        :param pulumi.Input[builtins.str] user_group_name: 用户组名称。长度1~64，支持英文、数字和.-_符号。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GroupArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        用户组是用户的集合。当用户组被关联上策略后，同一用户组里的所有用户会拥有对应的策略权限，同一个用户可存在于多个用户组中，可同时拥有多个用户组的权限。

        ## Import

        ```sh
        $ pulumi import bytepluscc:iam/group:Group example "user_group_name"
        ```

        :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,
                 attached_policies: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupAttachedPolicyArgs', 'GroupAttachedPolicyArgsDict']]]]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 display_name: Optional[pulumi.Input[builtins.str]] = None,
                 user_group_name: Optional[pulumi.Input[builtins.str]] = None,
                 users: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupUserArgs', 'GroupUserArgsDict']]]]] = 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__["attached_policies"] = attached_policies
            __props__.__dict__["description"] = description
            __props__.__dict__["display_name"] = display_name
            if user_group_name is None and not opts.urn:
                raise TypeError("Missing required property 'user_group_name'")
            __props__.__dict__["user_group_name"] = user_group_name
            __props__.__dict__["users"] = users
            __props__.__dict__["account_id"] = None
            __props__.__dict__["created_time"] = None
            __props__.__dict__["updated_time"] = None
            __props__.__dict__["user_group_id"] = None
        super(Group, __self__).__init__(
            'bytepluscc:iam/group:Group',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            account_id: Optional[pulumi.Input[builtins.int]] = None,
            attached_policies: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupAttachedPolicyArgs', 'GroupAttachedPolicyArgsDict']]]]] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            display_name: Optional[pulumi.Input[builtins.str]] = None,
            updated_time: Optional[pulumi.Input[builtins.str]] = None,
            user_group_id: Optional[pulumi.Input[builtins.int]] = None,
            user_group_name: Optional[pulumi.Input[builtins.str]] = None,
            users: Optional[pulumi.Input[Sequence[pulumi.Input[Union['GroupUserArgs', 'GroupUserArgsDict']]]]] = 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.int] account_id: 用户组所属主账号的ID。
        :param pulumi.Input[builtins.str] created_time: 用户组的创建时间。
        :param pulumi.Input[builtins.str] description: 用户组描述信息。长度不超过128。
        :param pulumi.Input[builtins.str] display_name: 用户组显示名称。长度不超过64。
        :param pulumi.Input[builtins.str] updated_time: 用户组的更新时间。
        :param pulumi.Input[builtins.int] user_group_id: 用户组ID。
        :param pulumi.Input[builtins.str] user_group_name: 用户组名称。长度1~64，支持英文、数字和.-_符号。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GroupState.__new__(_GroupState)

        __props__.__dict__["account_id"] = account_id
        __props__.__dict__["attached_policies"] = attached_policies
        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["description"] = description
        __props__.__dict__["display_name"] = display_name
        __props__.__dict__["updated_time"] = updated_time
        __props__.__dict__["user_group_id"] = user_group_id
        __props__.__dict__["user_group_name"] = user_group_name
        __props__.__dict__["users"] = users
        return Group(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="accountId")
    def account_id(self) -> pulumi.Output[builtins.int]:
        """
        用户组所属主账号的ID。
        """
        return pulumi.get(self, "account_id")

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

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

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        用户组描述信息。长度不超过128。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="displayName")
    def display_name(self) -> pulumi.Output[builtins.str]:
        """
        用户组显示名称。长度不超过64。
        """
        return pulumi.get(self, "display_name")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> pulumi.Output[builtins.str]:
        """
        用户组的更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="userGroupId")
    def user_group_id(self) -> pulumi.Output[builtins.int]:
        """
        用户组ID。
        """
        return pulumi.get(self, "user_group_id")

    @property
    @pulumi.getter(name="userGroupName")
    def user_group_name(self) -> pulumi.Output[builtins.str]:
        """
        用户组名称。长度1~64，支持英文、数字和.-_符号。
        """
        return pulumi.get(self, "user_group_name")

    @property
    @pulumi.getter
    def users(self) -> pulumi.Output[Sequence['outputs.GroupUser']]:
        return pulumi.get(self, "users")

