# 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 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__ = [
    'GetFolderResult',
    'AwaitableGetFolderResult',
    'get_folder',
    'get_folder_output',
]

@pulumi.output_type
class GetFolderResult:
    """
    A collection of values returned by getFolder.
    """
    def __init__(__self__, id=None, name=None, parent_id=None, path=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if parent_id and not isinstance(parent_id, str):
            raise TypeError("Expected argument 'parent_id' to be a str")
        pulumi.set(__self__, "parent_id", parent_id)
        if path and not isinstance(path, str):
            raise TypeError("Expected argument 'path' to be a str")
        pulumi.set(__self__, "path", path)

    @property
    @pulumi.getter
    def id(self) -> Optional[str]:
        """
        The id the folder.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Name of the folder.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="parentId")
    def parent_id(self) -> str:
        """
        The ID of the folders's parent folder. 'root' is used for a folder at the root level.
        """
        return pulumi.get(self, "parent_id")

    @property
    @pulumi.getter
    def path(self) -> Optional[str]:
        """
        An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
        """
        return pulumi.get(self, "path")


class AwaitableGetFolderResult(GetFolderResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetFolderResult(
            id=self.id,
            name=self.name,
            parent_id=self.parent_id,
            path=self.path)


def get_folder(id: Optional[str] = None,
               path: Optional[str] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetFolderResult:
    """
    A CockroachDB Cloud folder. Folders can contain clusters or other folders.  They can be used to group resources together for the purposes of access control, organization or fine grained invoicing.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_cockroach as cockroach

    config = pulumi.Config()
    prod_folder_id = config.require("prodFolderId")
    team1 = cockroach.get_folder(path="/prod/team1")
    prod = cockroach.get_folder(id=prod_folder_id)
    ```


    :param str id: The id the folder.
    :param str path: An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['path'] = path
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('cockroach:index/getFolder:getFolder', __args__, opts=opts, typ=GetFolderResult).value

    return AwaitableGetFolderResult(
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        parent_id=pulumi.get(__ret__, 'parent_id'),
        path=pulumi.get(__ret__, 'path'))
def get_folder_output(id: Optional[pulumi.Input[Optional[str]]] = None,
                      path: Optional[pulumi.Input[Optional[str]]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetFolderResult]:
    """
    A CockroachDB Cloud folder. Folders can contain clusters or other folders.  They can be used to group resources together for the purposes of access control, organization or fine grained invoicing.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_cockroach as cockroach

    config = pulumi.Config()
    prod_folder_id = config.require("prodFolderId")
    team1 = cockroach.get_folder(path="/prod/team1")
    prod = cockroach.get_folder(id=prod_folder_id)
    ```


    :param str id: The id the folder.
    :param str path: An absolute path to the folder. Trailing slashes are optional. (i.e. /folder1/folder2)
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['path'] = path
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('cockroach:index/getFolder:getFolder', __args__, opts=opts, typ=GetFolderResult)
    return __ret__.apply(lambda __response__: GetFolderResult(
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        parent_id=pulumi.get(__response__, 'parent_id'),
        path=pulumi.get(__response__, 'path')))
