# 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 pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = [
    'GetClickhouseUserResult',
    'AwaitableGetClickhouseUserResult',
    'get_clickhouse_user',
    'get_clickhouse_user_output',
]

@pulumi.output_type
class GetClickhouseUserResult:
    """
    A collection of values returned by getClickhouseUser.
    """
    def __init__(__self__, id=None, password=None, project=None, required=None, service_name=None, username=None, uuid=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if password and not isinstance(password, str):
            raise TypeError("Expected argument 'password' to be a str")
        pulumi.set(__self__, "password", password)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if required and not isinstance(required, bool):
            raise TypeError("Expected argument 'required' to be a bool")
        pulumi.set(__self__, "required", required)
        if service_name and not isinstance(service_name, str):
            raise TypeError("Expected argument 'service_name' to be a str")
        pulumi.set(__self__, "service_name", service_name)
        if username and not isinstance(username, str):
            raise TypeError("Expected argument 'username' to be a str")
        pulumi.set(__self__, "username", username)
        if uuid and not isinstance(uuid, str):
            raise TypeError("Expected argument 'uuid' to be a str")
        pulumi.set(__self__, "uuid", uuid)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def password(self) -> str:
        """
        The password of the clickhouse user.
        """
        return pulumi.get(self, "password")

    @property
    @pulumi.getter
    def project(self) -> str:
        """
        Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter
    def required(self) -> bool:
        """
        Indicates if a clickhouse user is required
        """
        return pulumi.get(self, "required")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> str:
        """
        Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def username(self) -> str:
        """
        The actual name of the Clickhouse user. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "username")

    @property
    @pulumi.getter
    def uuid(self) -> str:
        """
        UUID of the clickhouse user.
        """
        return pulumi.get(self, "uuid")


class AwaitableGetClickhouseUserResult(GetClickhouseUserResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetClickhouseUserResult(
            id=self.id,
            password=self.password,
            project=self.project,
            required=self.required,
            service_name=self.service_name,
            username=self.username,
            uuid=self.uuid)


def get_clickhouse_user(project: Optional[str] = None,
                        service_name: Optional[str] = None,
                        username: Optional[str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetClickhouseUserResult:
    """
    The Clickhouse User data source provides information about the existing Aiven Clickhouse User.

    ## Example Usage

    <!--Start PulumiCodeChooser -->
    ```python
    import pulumi
    import pulumi_aiven as aiven

    ch_user = aiven.get_clickhouse_user(project=aiven_project["myproject"]["project"],
        service_name=aiven_clickhouse["myservice"]["service_name"],
        username="<USERNAME>")
    ```
    <!--End PulumiCodeChooser -->


    :param str project: Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str service_name: Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str username: The actual name of the Clickhouse user. Changing this property forces recreation of the resource.
    """
    __args__ = dict()
    __args__['project'] = project
    __args__['serviceName'] = service_name
    __args__['username'] = username
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('aiven:index/getClickhouseUser:getClickhouseUser', __args__, opts=opts, typ=GetClickhouseUserResult).value

    return AwaitableGetClickhouseUserResult(
        id=pulumi.get(__ret__, 'id'),
        password=pulumi.get(__ret__, 'password'),
        project=pulumi.get(__ret__, 'project'),
        required=pulumi.get(__ret__, 'required'),
        service_name=pulumi.get(__ret__, 'service_name'),
        username=pulumi.get(__ret__, 'username'),
        uuid=pulumi.get(__ret__, 'uuid'))


@_utilities.lift_output_func(get_clickhouse_user)
def get_clickhouse_user_output(project: Optional[pulumi.Input[str]] = None,
                               service_name: Optional[pulumi.Input[str]] = None,
                               username: Optional[pulumi.Input[str]] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetClickhouseUserResult]:
    """
    The Clickhouse User data source provides information about the existing Aiven Clickhouse User.

    ## Example Usage

    <!--Start PulumiCodeChooser -->
    ```python
    import pulumi
    import pulumi_aiven as aiven

    ch_user = aiven.get_clickhouse_user(project=aiven_project["myproject"]["project"],
        service_name=aiven_clickhouse["myservice"]["service_name"],
        username="<USERNAME>")
    ```
    <!--End PulumiCodeChooser -->


    :param str project: Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str service_name: Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
    :param str username: The actual name of the Clickhouse user. Changing this property forces recreation of the resource.
    """
    ...
