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

__all__ = [
    'GetAuthenticationFlowResult',
    'AwaitableGetAuthenticationFlowResult',
    'get_authentication_flow',
    'get_authentication_flow_output',
]

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

    @property
    @pulumi.getter
    def alias(self) -> str:
        return pulumi.get(self, "alias")

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

    @property
    @pulumi.getter(name="realmId")
    def realm_id(self) -> str:
        return pulumi.get(self, "realm_id")


class AwaitableGetAuthenticationFlowResult(GetAuthenticationFlowResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAuthenticationFlowResult(
            alias=self.alias,
            id=self.id,
            realm_id=self.realm_id)


def get_authentication_flow(alias: Optional[str] = None,
                            realm_id: Optional[str] = None,
                            opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAuthenticationFlowResult:
    """
    This data source can be used to fetch the ID of an authentication flow within Keycloak.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_keycloak as keycloak

    realm = keycloak.Realm("realm",
        realm="my-realm",
        enabled=True)
    browser_auth_cookie = keycloak.get_authentication_flow_output(realm_id=realm.id,
        alias="browser")
    ```


    :param str alias: The alias of the flow.
    :param str realm_id: The realm the authentication flow exists in.
    """
    __args__ = dict()
    __args__['alias'] = alias
    __args__['realmId'] = realm_id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('keycloak:index/getAuthenticationFlow:getAuthenticationFlow', __args__, opts=opts, typ=GetAuthenticationFlowResult).value

    return AwaitableGetAuthenticationFlowResult(
        alias=__ret__.alias,
        id=__ret__.id,
        realm_id=__ret__.realm_id)


@_utilities.lift_output_func(get_authentication_flow)
def get_authentication_flow_output(alias: Optional[pulumi.Input[str]] = None,
                                   realm_id: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAuthenticationFlowResult]:
    """
    This data source can be used to fetch the ID of an authentication flow within Keycloak.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_keycloak as keycloak

    realm = keycloak.Realm("realm",
        realm="my-realm",
        enabled=True)
    browser_auth_cookie = keycloak.get_authentication_flow_output(realm_id=realm.id,
        alias="browser")
    ```


    :param str alias: The alias of the flow.
    :param str realm_id: The realm the authentication flow exists in.
    """
    ...
