# 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

__all__ = ['UnitArgs', 'Unit']

@pulumi.input_type
class UnitArgs:
    def __init__(__self__, *,
                 name: pulumi.Input[builtins.str],
                 parent_id: pulumi.Input[builtins.str],
                 description: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a Unit resource.
        :param pulumi.Input[builtins.str] name: 组织单元名称。
        :param pulumi.Input[builtins.str] parent_id: 父单元Id。
        :param pulumi.Input[builtins.str] description: 描述。
        """
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "parent_id", parent_id)
        if description is not None:
            pulumi.set(__self__, "description", description)

    @property
    @pulumi.getter
    def name(self) -> pulumi.Input[builtins.str]:
        """
        组织单元名称。
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> pulumi.Input[builtins.str]:
        """
        父单元Id。
        """
        return pulumi.get(self, "parent_id")

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

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

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


@pulumi.input_type
class _UnitState:
    def __init__(__self__, *,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 delete_uk: Optional[pulumi.Input[builtins.str]] = None,
                 deleted_time: Optional[pulumi.Input[builtins.str]] = None,
                 depth: Optional[pulumi.Input[builtins.int]] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 org_id: Optional[pulumi.Input[builtins.str]] = None,
                 org_type: Optional[pulumi.Input[builtins.int]] = None,
                 org_unit_id: Optional[pulumi.Input[builtins.str]] = None,
                 owner: Optional[pulumi.Input[builtins.str]] = None,
                 parent_id: Optional[pulumi.Input[builtins.str]] = None,
                 updated_time: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering Unit resources.
        :param pulumi.Input[builtins.str] created_time: 创建时间。
        :param pulumi.Input[builtins.str] delete_uk: 删除标识。
        :param pulumi.Input[builtins.str] deleted_time: 删除时间。
        :param pulumi.Input[builtins.int] depth: 深度。
        :param pulumi.Input[builtins.str] description: 描述。
        :param pulumi.Input[builtins.str] name: 组织单元名称。
        :param pulumi.Input[builtins.str] org_id: 组织ID。
        :param pulumi.Input[builtins.int] org_type: 组织类型。企业组织： 1
        :param pulumi.Input[builtins.str] org_unit_id: 组织单元ID。
        :param pulumi.Input[builtins.str] owner: 管理员ID。
        :param pulumi.Input[builtins.str] parent_id: 父单元Id。
        :param pulumi.Input[builtins.str] updated_time: 更新时间。
        """
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if delete_uk is not None:
            pulumi.set(__self__, "delete_uk", delete_uk)
        if deleted_time is not None:
            pulumi.set(__self__, "deleted_time", deleted_time)
        if depth is not None:
            pulumi.set(__self__, "depth", depth)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if org_id is not None:
            pulumi.set(__self__, "org_id", org_id)
        if org_type is not None:
            pulumi.set(__self__, "org_type", org_type)
        if org_unit_id is not None:
            pulumi.set(__self__, "org_unit_id", org_unit_id)
        if owner is not None:
            pulumi.set(__self__, "owner", owner)
        if parent_id is not None:
            pulumi.set(__self__, "parent_id", parent_id)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)

    @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(name="deleteUk")
    def delete_uk(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        删除标识。
        """
        return pulumi.get(self, "delete_uk")

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

    @property
    @pulumi.getter(name="deletedTime")
    def deleted_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        删除时间。
        """
        return pulumi.get(self, "deleted_time")

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

    @property
    @pulumi.getter
    def depth(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        深度。
        """
        return pulumi.get(self, "depth")

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

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

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        组织单元名称。
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="orgId")
    def org_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        组织ID。
        """
        return pulumi.get(self, "org_id")

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

    @property
    @pulumi.getter(name="orgType")
    def org_type(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        组织类型。企业组织： 1
        """
        return pulumi.get(self, "org_type")

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

    @property
    @pulumi.getter(name="orgUnitId")
    def org_unit_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        组织单元ID。
        """
        return pulumi.get(self, "org_unit_id")

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

    @property
    @pulumi.getter
    def owner(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        管理员ID。
        """
        return pulumi.get(self, "owner")

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

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        父单元Id。
        """
        return pulumi.get(self, "parent_id")

    @parent_id.setter
    def parent_id(self, value: Optional[pulumi.Input[builtins.str]]):
        pulumi.set(self, "parent_id", 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)


@pulumi.type_token("bytepluscc:organization/unit:Unit")
class Unit(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 parent_id: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        企业组织的创建者管理员账号可以新建组织单元来搭建企业的组织结构，对账号进行分组织单元管理。组织单元可以分多个组织单元层级，管理员账号也可属于任意层级的任意组织单元节点。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        organization_unit_demo = bytepluscc.organization.Unit("OrganizationUnitDemo",
            parent_id="735281472xxxx3651635",
            name="OrganizationUnitDemo",
            description="OrganizationUnitDemo description")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:organization/unit:Unit example "org_unit_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] description: 描述。
        :param pulumi.Input[builtins.str] name: 组织单元名称。
        :param pulumi.Input[builtins.str] parent_id: 父单元Id。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: UnitArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        企业组织的创建者管理员账号可以新建组织单元来搭建企业的组织结构，对账号进行分组织单元管理。组织单元可以分多个组织单元层级，管理员账号也可属于任意层级的任意组织单元节点。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        organization_unit_demo = bytepluscc.organization.Unit("OrganizationUnitDemo",
            parent_id="735281472xxxx3651635",
            name="OrganizationUnitDemo",
            description="OrganizationUnitDemo description")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:organization/unit:Unit example "org_unit_id"
        ```

        :param str resource_name: The name of the resource.
        :param UnitArgs 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(UnitArgs, 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,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 parent_id: Optional[pulumi.Input[builtins.str]] = 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__ = UnitArgs.__new__(UnitArgs)

            __props__.__dict__["description"] = description
            if name is None and not opts.urn:
                raise TypeError("Missing required property 'name'")
            __props__.__dict__["name"] = name
            if parent_id is None and not opts.urn:
                raise TypeError("Missing required property 'parent_id'")
            __props__.__dict__["parent_id"] = parent_id
            __props__.__dict__["created_time"] = None
            __props__.__dict__["delete_uk"] = None
            __props__.__dict__["deleted_time"] = None
            __props__.__dict__["depth"] = None
            __props__.__dict__["org_id"] = None
            __props__.__dict__["org_type"] = None
            __props__.__dict__["org_unit_id"] = None
            __props__.__dict__["owner"] = None
            __props__.__dict__["updated_time"] = None
        super(Unit, __self__).__init__(
            'bytepluscc:organization/unit:Unit',
            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,
            delete_uk: Optional[pulumi.Input[builtins.str]] = None,
            deleted_time: Optional[pulumi.Input[builtins.str]] = None,
            depth: Optional[pulumi.Input[builtins.int]] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            name: Optional[pulumi.Input[builtins.str]] = None,
            org_id: Optional[pulumi.Input[builtins.str]] = None,
            org_type: Optional[pulumi.Input[builtins.int]] = None,
            org_unit_id: Optional[pulumi.Input[builtins.str]] = None,
            owner: Optional[pulumi.Input[builtins.str]] = None,
            parent_id: Optional[pulumi.Input[builtins.str]] = None,
            updated_time: Optional[pulumi.Input[builtins.str]] = None) -> 'Unit':
        """
        Get an existing Unit 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: 创建时间。
        :param pulumi.Input[builtins.str] delete_uk: 删除标识。
        :param pulumi.Input[builtins.str] deleted_time: 删除时间。
        :param pulumi.Input[builtins.int] depth: 深度。
        :param pulumi.Input[builtins.str] description: 描述。
        :param pulumi.Input[builtins.str] name: 组织单元名称。
        :param pulumi.Input[builtins.str] org_id: 组织ID。
        :param pulumi.Input[builtins.int] org_type: 组织类型。企业组织： 1
        :param pulumi.Input[builtins.str] org_unit_id: 组织单元ID。
        :param pulumi.Input[builtins.str] owner: 管理员ID。
        :param pulumi.Input[builtins.str] parent_id: 父单元Id。
        :param pulumi.Input[builtins.str] updated_time: 更新时间。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _UnitState.__new__(_UnitState)

        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["delete_uk"] = delete_uk
        __props__.__dict__["deleted_time"] = deleted_time
        __props__.__dict__["depth"] = depth
        __props__.__dict__["description"] = description
        __props__.__dict__["name"] = name
        __props__.__dict__["org_id"] = org_id
        __props__.__dict__["org_type"] = org_type
        __props__.__dict__["org_unit_id"] = org_unit_id
        __props__.__dict__["owner"] = owner
        __props__.__dict__["parent_id"] = parent_id
        __props__.__dict__["updated_time"] = updated_time
        return Unit(resource_name, opts=opts, __props__=__props__)

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

    @property
    @pulumi.getter(name="deleteUk")
    def delete_uk(self) -> pulumi.Output[builtins.str]:
        """
        删除标识。
        """
        return pulumi.get(self, "delete_uk")

    @property
    @pulumi.getter(name="deletedTime")
    def deleted_time(self) -> pulumi.Output[builtins.str]:
        """
        删除时间。
        """
        return pulumi.get(self, "deleted_time")

    @property
    @pulumi.getter
    def depth(self) -> pulumi.Output[builtins.int]:
        """
        深度。
        """
        return pulumi.get(self, "depth")

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

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[builtins.str]:
        """
        组织单元名称。
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="orgId")
    def org_id(self) -> pulumi.Output[builtins.str]:
        """
        组织ID。
        """
        return pulumi.get(self, "org_id")

    @property
    @pulumi.getter(name="orgType")
    def org_type(self) -> pulumi.Output[builtins.int]:
        """
        组织类型。企业组织： 1
        """
        return pulumi.get(self, "org_type")

    @property
    @pulumi.getter(name="orgUnitId")
    def org_unit_id(self) -> pulumi.Output[builtins.str]:
        """
        组织单元ID。
        """
        return pulumi.get(self, "org_unit_id")

    @property
    @pulumi.getter
    def owner(self) -> pulumi.Output[builtins.str]:
        """
        管理员ID。
        """
        return pulumi.get(self, "owner")

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> pulumi.Output[builtins.str]:
        """
        父单元Id。
        """
        return pulumi.get(self, "parent_id")

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

