# 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 GetRealmKeysResult:
    """
    A collection of values returned by getRealmKeys.
    """
    def __init__(__self__, algorithms=None, id=None, keys=None, realm_id=None, statuses=None):
        if algorithms and not isinstance(algorithms, list):
            raise TypeError("Expected argument 'algorithms' to be a list")
        __self__.algorithms = algorithms
        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 keys and not isinstance(keys, list):
            raise TypeError("Expected argument 'keys' to be a list")
        __self__.keys = keys
        if realm_id and not isinstance(realm_id, str):
            raise TypeError("Expected argument 'realm_id' to be a str")
        __self__.realm_id = realm_id
        if statuses and not isinstance(statuses, list):
            raise TypeError("Expected argument 'statuses' to be a list")
        __self__.statuses = statuses
class AwaitableGetRealmKeysResult(GetRealmKeysResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRealmKeysResult(
            algorithms=self.algorithms,
            id=self.id,
            keys=self.keys,
            realm_id=self.realm_id,
            statuses=self.statuses)

def get_realm_keys(algorithms=None,realm_id=None,statuses=None,opts=None):
    """
    ## # getRealmKeys data source

    Use this data source to get the keys of a realm. Keys can be filtered by algorithm and status.

    Remarks:

    - A key must meet all filter criteria
    - This datasource may return more than one value.
    - If no key matches the filter criteria, then an error is returned.

    ### Argument Reference

    The following arguments are supported:

    - `realm_id` - (Required) The realm of which the keys are retrieved.
    - `algorithms` - (Optional) When specified, keys are filtered by algorithm (values for algorithm: `HS256`, `RS256`,`AES`, ...)
    - `status` - (Optional) When specified, keys are filtered by status (values for status: `ACTIVE`, `DISABLED` and `PASSIVE`)
    """
    __args__ = dict()


    __args__['algorithms'] = algorithms
    __args__['realmId'] = realm_id
    __args__['statuses'] = statuses
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('keycloak:index/getRealmKeys:getRealmKeys', __args__, opts=opts).value

    return AwaitableGetRealmKeysResult(
        algorithms=__ret__.get('algorithms'),
        id=__ret__.get('id'),
        keys=__ret__.get('keys'),
        realm_id=__ret__.get('realmId'),
        statuses=__ret__.get('statuses'))
