# 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 Union
from . import utilities, tables

class GetRealmResult:
    """
    A collection of values returned by getRealm.
    """
    def __init__(__self__, access_code_lifespan=None, access_code_lifespan_login=None, access_code_lifespan_user_action=None, access_token_lifespan=None, access_token_lifespan_for_implicit_flow=None, account_theme=None, action_token_generated_by_admin_lifespan=None, action_token_generated_by_user_lifespan=None, admin_theme=None, attributes=None, browser_flow=None, client_authentication_flow=None, direct_grant_flow=None, display_name=None, display_name_html=None, docker_authentication_flow=None, duplicate_emails_allowed=None, edit_username_allowed=None, email_theme=None, enabled=None, id=None, internal_id=None, internationalizations=None, login_theme=None, login_with_email_allowed=None, offline_session_idle_timeout=None, offline_session_max_lifespan=None, password_policy=None, realm=None, refresh_token_max_reuse=None, registration_allowed=None, registration_email_as_username=None, registration_flow=None, remember_me=None, reset_credentials_flow=None, reset_password_allowed=None, security_defenses=None, smtp_servers=None, ssl_required=None, sso_session_idle_timeout=None, sso_session_max_lifespan=None, user_managed_access=None, verify_email=None):
        if access_code_lifespan and not isinstance(access_code_lifespan, str):
            raise TypeError("Expected argument 'access_code_lifespan' to be a str")
        __self__.access_code_lifespan = access_code_lifespan
        if access_code_lifespan_login and not isinstance(access_code_lifespan_login, str):
            raise TypeError("Expected argument 'access_code_lifespan_login' to be a str")
        __self__.access_code_lifespan_login = access_code_lifespan_login
        if access_code_lifespan_user_action and not isinstance(access_code_lifespan_user_action, str):
            raise TypeError("Expected argument 'access_code_lifespan_user_action' to be a str")
        __self__.access_code_lifespan_user_action = access_code_lifespan_user_action
        if access_token_lifespan and not isinstance(access_token_lifespan, str):
            raise TypeError("Expected argument 'access_token_lifespan' to be a str")
        __self__.access_token_lifespan = access_token_lifespan
        if access_token_lifespan_for_implicit_flow and not isinstance(access_token_lifespan_for_implicit_flow, str):
            raise TypeError("Expected argument 'access_token_lifespan_for_implicit_flow' to be a str")
        __self__.access_token_lifespan_for_implicit_flow = access_token_lifespan_for_implicit_flow
        if account_theme and not isinstance(account_theme, str):
            raise TypeError("Expected argument 'account_theme' to be a str")
        __self__.account_theme = account_theme
        if action_token_generated_by_admin_lifespan and not isinstance(action_token_generated_by_admin_lifespan, str):
            raise TypeError("Expected argument 'action_token_generated_by_admin_lifespan' to be a str")
        __self__.action_token_generated_by_admin_lifespan = action_token_generated_by_admin_lifespan
        if action_token_generated_by_user_lifespan and not isinstance(action_token_generated_by_user_lifespan, str):
            raise TypeError("Expected argument 'action_token_generated_by_user_lifespan' to be a str")
        __self__.action_token_generated_by_user_lifespan = action_token_generated_by_user_lifespan
        if admin_theme and not isinstance(admin_theme, str):
            raise TypeError("Expected argument 'admin_theme' to be a str")
        __self__.admin_theme = admin_theme
        if attributes and not isinstance(attributes, dict):
            raise TypeError("Expected argument 'attributes' to be a dict")
        __self__.attributes = attributes
        if browser_flow and not isinstance(browser_flow, str):
            raise TypeError("Expected argument 'browser_flow' to be a str")
        __self__.browser_flow = browser_flow
        if client_authentication_flow and not isinstance(client_authentication_flow, str):
            raise TypeError("Expected argument 'client_authentication_flow' to be a str")
        __self__.client_authentication_flow = client_authentication_flow
        if direct_grant_flow and not isinstance(direct_grant_flow, str):
            raise TypeError("Expected argument 'direct_grant_flow' to be a str")
        __self__.direct_grant_flow = direct_grant_flow
        if display_name and not isinstance(display_name, str):
            raise TypeError("Expected argument 'display_name' to be a str")
        __self__.display_name = display_name
        if display_name_html and not isinstance(display_name_html, str):
            raise TypeError("Expected argument 'display_name_html' to be a str")
        __self__.display_name_html = display_name_html
        if docker_authentication_flow and not isinstance(docker_authentication_flow, str):
            raise TypeError("Expected argument 'docker_authentication_flow' to be a str")
        __self__.docker_authentication_flow = docker_authentication_flow
        if duplicate_emails_allowed and not isinstance(duplicate_emails_allowed, bool):
            raise TypeError("Expected argument 'duplicate_emails_allowed' to be a bool")
        __self__.duplicate_emails_allowed = duplicate_emails_allowed
        if edit_username_allowed and not isinstance(edit_username_allowed, bool):
            raise TypeError("Expected argument 'edit_username_allowed' to be a bool")
        __self__.edit_username_allowed = edit_username_allowed
        if email_theme and not isinstance(email_theme, str):
            raise TypeError("Expected argument 'email_theme' to be a str")
        __self__.email_theme = email_theme
        if enabled and not isinstance(enabled, bool):
            raise TypeError("Expected argument 'enabled' to be a bool")
        __self__.enabled = enabled
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        The provider-assigned unique ID for this managed resource.
        """
        if internal_id and not isinstance(internal_id, str):
            raise TypeError("Expected argument 'internal_id' to be a str")
        __self__.internal_id = internal_id
        if internationalizations and not isinstance(internationalizations, list):
            raise TypeError("Expected argument 'internationalizations' to be a list")
        __self__.internationalizations = internationalizations
        if login_theme and not isinstance(login_theme, str):
            raise TypeError("Expected argument 'login_theme' to be a str")
        __self__.login_theme = login_theme
        if login_with_email_allowed and not isinstance(login_with_email_allowed, bool):
            raise TypeError("Expected argument 'login_with_email_allowed' to be a bool")
        __self__.login_with_email_allowed = login_with_email_allowed
        if offline_session_idle_timeout and not isinstance(offline_session_idle_timeout, str):
            raise TypeError("Expected argument 'offline_session_idle_timeout' to be a str")
        __self__.offline_session_idle_timeout = offline_session_idle_timeout
        if offline_session_max_lifespan and not isinstance(offline_session_max_lifespan, str):
            raise TypeError("Expected argument 'offline_session_max_lifespan' to be a str")
        __self__.offline_session_max_lifespan = offline_session_max_lifespan
        if password_policy and not isinstance(password_policy, str):
            raise TypeError("Expected argument 'password_policy' to be a str")
        __self__.password_policy = password_policy
        if realm and not isinstance(realm, str):
            raise TypeError("Expected argument 'realm' to be a str")
        __self__.realm = realm
        if refresh_token_max_reuse and not isinstance(refresh_token_max_reuse, float):
            raise TypeError("Expected argument 'refresh_token_max_reuse' to be a float")
        __self__.refresh_token_max_reuse = refresh_token_max_reuse
        if registration_allowed and not isinstance(registration_allowed, bool):
            raise TypeError("Expected argument 'registration_allowed' to be a bool")
        __self__.registration_allowed = registration_allowed
        if registration_email_as_username and not isinstance(registration_email_as_username, bool):
            raise TypeError("Expected argument 'registration_email_as_username' to be a bool")
        __self__.registration_email_as_username = registration_email_as_username
        if registration_flow and not isinstance(registration_flow, str):
            raise TypeError("Expected argument 'registration_flow' to be a str")
        __self__.registration_flow = registration_flow
        if remember_me and not isinstance(remember_me, bool):
            raise TypeError("Expected argument 'remember_me' to be a bool")
        __self__.remember_me = remember_me
        if reset_credentials_flow and not isinstance(reset_credentials_flow, str):
            raise TypeError("Expected argument 'reset_credentials_flow' to be a str")
        __self__.reset_credentials_flow = reset_credentials_flow
        if reset_password_allowed and not isinstance(reset_password_allowed, bool):
            raise TypeError("Expected argument 'reset_password_allowed' to be a bool")
        __self__.reset_password_allowed = reset_password_allowed
        if security_defenses and not isinstance(security_defenses, list):
            raise TypeError("Expected argument 'security_defenses' to be a list")
        __self__.security_defenses = security_defenses
        if smtp_servers and not isinstance(smtp_servers, list):
            raise TypeError("Expected argument 'smtp_servers' to be a list")
        __self__.smtp_servers = smtp_servers
        if ssl_required and not isinstance(ssl_required, str):
            raise TypeError("Expected argument 'ssl_required' to be a str")
        __self__.ssl_required = ssl_required
        if sso_session_idle_timeout and not isinstance(sso_session_idle_timeout, str):
            raise TypeError("Expected argument 'sso_session_idle_timeout' to be a str")
        __self__.sso_session_idle_timeout = sso_session_idle_timeout
        if sso_session_max_lifespan and not isinstance(sso_session_max_lifespan, str):
            raise TypeError("Expected argument 'sso_session_max_lifespan' to be a str")
        __self__.sso_session_max_lifespan = sso_session_max_lifespan
        if user_managed_access and not isinstance(user_managed_access, bool):
            raise TypeError("Expected argument 'user_managed_access' to be a bool")
        __self__.user_managed_access = user_managed_access
        if verify_email and not isinstance(verify_email, bool):
            raise TypeError("Expected argument 'verify_email' to be a bool")
        __self__.verify_email = verify_email
class AwaitableGetRealmResult(GetRealmResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRealmResult(
            access_code_lifespan=self.access_code_lifespan,
            access_code_lifespan_login=self.access_code_lifespan_login,
            access_code_lifespan_user_action=self.access_code_lifespan_user_action,
            access_token_lifespan=self.access_token_lifespan,
            access_token_lifespan_for_implicit_flow=self.access_token_lifespan_for_implicit_flow,
            account_theme=self.account_theme,
            action_token_generated_by_admin_lifespan=self.action_token_generated_by_admin_lifespan,
            action_token_generated_by_user_lifespan=self.action_token_generated_by_user_lifespan,
            admin_theme=self.admin_theme,
            attributes=self.attributes,
            browser_flow=self.browser_flow,
            client_authentication_flow=self.client_authentication_flow,
            direct_grant_flow=self.direct_grant_flow,
            display_name=self.display_name,
            display_name_html=self.display_name_html,
            docker_authentication_flow=self.docker_authentication_flow,
            duplicate_emails_allowed=self.duplicate_emails_allowed,
            edit_username_allowed=self.edit_username_allowed,
            email_theme=self.email_theme,
            enabled=self.enabled,
            id=self.id,
            internal_id=self.internal_id,
            internationalizations=self.internationalizations,
            login_theme=self.login_theme,
            login_with_email_allowed=self.login_with_email_allowed,
            offline_session_idle_timeout=self.offline_session_idle_timeout,
            offline_session_max_lifespan=self.offline_session_max_lifespan,
            password_policy=self.password_policy,
            realm=self.realm,
            refresh_token_max_reuse=self.refresh_token_max_reuse,
            registration_allowed=self.registration_allowed,
            registration_email_as_username=self.registration_email_as_username,
            registration_flow=self.registration_flow,
            remember_me=self.remember_me,
            reset_credentials_flow=self.reset_credentials_flow,
            reset_password_allowed=self.reset_password_allowed,
            security_defenses=self.security_defenses,
            smtp_servers=self.smtp_servers,
            ssl_required=self.ssl_required,
            sso_session_idle_timeout=self.sso_session_idle_timeout,
            sso_session_max_lifespan=self.sso_session_max_lifespan,
            user_managed_access=self.user_managed_access,
            verify_email=self.verify_email)

def get_realm(attributes=None,display_name_html=None,internationalizations=None,realm=None,security_defenses=None,smtp_servers=None,opts=None):
    """
    ## # Realm data source

    This data source can be used to fetch properties of a Keycloak realm for
    usage with other resources.

    ### Example Usage

    ```python
    import pulumi
    import pulumi_keycloak as keycloak

    realm = keycloak.get_realm(realm="my-realm")
    group = keycloak.Role("group", realm_id=data["keycloak_realm"]["id"])
    ```

    ### Argument Reference

    The following arguments are supported:

    - `realm` - (Required) The realm name.

    ### Attributes Reference

    See the docs for the `Realm` resource for details on the exported attributes.



    The **internationalizations** object supports the following:

      * `defaultLocale` (`str`)
      * `supportedLocales` (`list`)

    The **security_defenses** object supports the following:

      * `bruteForceDetections` (`list`)
        * `failureResetTimeSeconds` (`float`)
        * `maxFailureWaitSeconds` (`float`)
        * `maxLoginFailures` (`float`)
        * `minimumQuickLoginWaitSeconds` (`float`)
        * `permanentLockout` (`bool`)
        * `quickLoginCheckMilliSeconds` (`float`)
        * `waitIncrementSeconds` (`float`)

      * `headers` (`list`)
        * `contentSecurityPolicy` (`str`)
        * `contentSecurityPolicyReportOnly` (`str`)
        * `strictTransportSecurity` (`str`)
        * `xContentTypeOptions` (`str`)
        * `xFrameOptions` (`str`)
        * `xRobotsTag` (`str`)
        * `xXssProtection` (`str`)

    The **smtp_servers** object supports the following:

      * `auths` (`list`)
        * `password` (`str`)
        * `username` (`str`)

      * `envelopeFrom` (`str`)
      * `from` (`str`)
      * `fromDisplayName` (`str`)
      * `host` (`str`)
      * `port` (`str`)
      * `replyTo` (`str`)
      * `replyToDisplayName` (`str`)
      * `ssl` (`bool`)
      * `starttls` (`bool`)
    """
    __args__ = dict()


    __args__['attributes'] = attributes
    __args__['displayNameHtml'] = display_name_html
    __args__['internationalizations'] = internationalizations
    __args__['realm'] = realm
    __args__['securityDefenses'] = security_defenses
    __args__['smtpServers'] = smtp_servers
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('keycloak:index/getRealm:getRealm', __args__, opts=opts).value

    return AwaitableGetRealmResult(
        access_code_lifespan=__ret__.get('accessCodeLifespan'),
        access_code_lifespan_login=__ret__.get('accessCodeLifespanLogin'),
        access_code_lifespan_user_action=__ret__.get('accessCodeLifespanUserAction'),
        access_token_lifespan=__ret__.get('accessTokenLifespan'),
        access_token_lifespan_for_implicit_flow=__ret__.get('accessTokenLifespanForImplicitFlow'),
        account_theme=__ret__.get('accountTheme'),
        action_token_generated_by_admin_lifespan=__ret__.get('actionTokenGeneratedByAdminLifespan'),
        action_token_generated_by_user_lifespan=__ret__.get('actionTokenGeneratedByUserLifespan'),
        admin_theme=__ret__.get('adminTheme'),
        attributes=__ret__.get('attributes'),
        browser_flow=__ret__.get('browserFlow'),
        client_authentication_flow=__ret__.get('clientAuthenticationFlow'),
        direct_grant_flow=__ret__.get('directGrantFlow'),
        display_name=__ret__.get('displayName'),
        display_name_html=__ret__.get('displayNameHtml'),
        docker_authentication_flow=__ret__.get('dockerAuthenticationFlow'),
        duplicate_emails_allowed=__ret__.get('duplicateEmailsAllowed'),
        edit_username_allowed=__ret__.get('editUsernameAllowed'),
        email_theme=__ret__.get('emailTheme'),
        enabled=__ret__.get('enabled'),
        id=__ret__.get('id'),
        internal_id=__ret__.get('internalId'),
        internationalizations=__ret__.get('internationalizations'),
        login_theme=__ret__.get('loginTheme'),
        login_with_email_allowed=__ret__.get('loginWithEmailAllowed'),
        offline_session_idle_timeout=__ret__.get('offlineSessionIdleTimeout'),
        offline_session_max_lifespan=__ret__.get('offlineSessionMaxLifespan'),
        password_policy=__ret__.get('passwordPolicy'),
        realm=__ret__.get('realm'),
        refresh_token_max_reuse=__ret__.get('refreshTokenMaxReuse'),
        registration_allowed=__ret__.get('registrationAllowed'),
        registration_email_as_username=__ret__.get('registrationEmailAsUsername'),
        registration_flow=__ret__.get('registrationFlow'),
        remember_me=__ret__.get('rememberMe'),
        reset_credentials_flow=__ret__.get('resetCredentialsFlow'),
        reset_password_allowed=__ret__.get('resetPasswordAllowed'),
        security_defenses=__ret__.get('securityDefenses'),
        smtp_servers=__ret__.get('smtpServers'),
        ssl_required=__ret__.get('sslRequired'),
        sso_session_idle_timeout=__ret__.get('ssoSessionIdleTimeout'),
        sso_session_max_lifespan=__ret__.get('ssoSessionMaxLifespan'),
        user_managed_access=__ret__.get('userManagedAccess'),
        verify_email=__ret__.get('verifyEmail'))
