# 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
from .. import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['ClientPermissions']


class ClientPermissions(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 client_id: Optional[pulumi.Input[str]] = None,
                 configure_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsConfigureScopeArgs']]] = None,
                 manage_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsManageScopeArgs']]] = None,
                 map_roles_client_scope_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsMapRolesClientScopeScopeArgs']]] = None,
                 map_roles_composite_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsMapRolesCompositeScopeArgs']]] = None,
                 map_roles_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsMapRolesScopeArgs']]] = None,
                 realm_id: Optional[pulumi.Input[str]] = None,
                 token_exchange_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsTokenExchangeScopeArgs']]] = None,
                 view_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsViewScopeArgs']]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Create a ClientPermissions resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = dict()

            if client_id is None and not opts.urn:
                raise TypeError("Missing required property 'client_id'")
            __props__['client_id'] = client_id
            __props__['configure_scope'] = configure_scope
            __props__['manage_scope'] = manage_scope
            __props__['map_roles_client_scope_scope'] = map_roles_client_scope_scope
            __props__['map_roles_composite_scope'] = map_roles_composite_scope
            __props__['map_roles_scope'] = map_roles_scope
            if realm_id is None and not opts.urn:
                raise TypeError("Missing required property 'realm_id'")
            __props__['realm_id'] = realm_id
            __props__['token_exchange_scope'] = token_exchange_scope
            __props__['view_scope'] = view_scope
            __props__['authorization_resource_server_id'] = None
            __props__['enabled'] = None
        super(ClientPermissions, __self__).__init__(
            'keycloak:openid/clientPermissions:ClientPermissions',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            authorization_resource_server_id: Optional[pulumi.Input[str]] = None,
            client_id: Optional[pulumi.Input[str]] = None,
            configure_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsConfigureScopeArgs']]] = None,
            enabled: Optional[pulumi.Input[bool]] = None,
            manage_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsManageScopeArgs']]] = None,
            map_roles_client_scope_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsMapRolesClientScopeScopeArgs']]] = None,
            map_roles_composite_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsMapRolesCompositeScopeArgs']]] = None,
            map_roles_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsMapRolesScopeArgs']]] = None,
            realm_id: Optional[pulumi.Input[str]] = None,
            token_exchange_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsTokenExchangeScopeArgs']]] = None,
            view_scope: Optional[pulumi.Input[pulumi.InputType['ClientPermissionsViewScopeArgs']]] = None) -> 'ClientPermissions':
        """
        Get an existing ClientPermissions resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] authorization_resource_server_id: Resource server id representing the realm management client on which this permission is managed
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["authorization_resource_server_id"] = authorization_resource_server_id
        __props__["client_id"] = client_id
        __props__["configure_scope"] = configure_scope
        __props__["enabled"] = enabled
        __props__["manage_scope"] = manage_scope
        __props__["map_roles_client_scope_scope"] = map_roles_client_scope_scope
        __props__["map_roles_composite_scope"] = map_roles_composite_scope
        __props__["map_roles_scope"] = map_roles_scope
        __props__["realm_id"] = realm_id
        __props__["token_exchange_scope"] = token_exchange_scope
        __props__["view_scope"] = view_scope
        return ClientPermissions(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="authorizationResourceServerId")
    def authorization_resource_server_id(self) -> pulumi.Output[str]:
        """
        Resource server id representing the realm management client on which this permission is managed
        """
        return pulumi.get(self, "authorization_resource_server_id")

    @property
    @pulumi.getter(name="clientId")
    def client_id(self) -> pulumi.Output[str]:
        return pulumi.get(self, "client_id")

    @property
    @pulumi.getter(name="configureScope")
    def configure_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsConfigureScope']]:
        return pulumi.get(self, "configure_scope")

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[bool]:
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter(name="manageScope")
    def manage_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsManageScope']]:
        return pulumi.get(self, "manage_scope")

    @property
    @pulumi.getter(name="mapRolesClientScopeScope")
    def map_roles_client_scope_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsMapRolesClientScopeScope']]:
        return pulumi.get(self, "map_roles_client_scope_scope")

    @property
    @pulumi.getter(name="mapRolesCompositeScope")
    def map_roles_composite_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsMapRolesCompositeScope']]:
        return pulumi.get(self, "map_roles_composite_scope")

    @property
    @pulumi.getter(name="mapRolesScope")
    def map_roles_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsMapRolesScope']]:
        return pulumi.get(self, "map_roles_scope")

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

    @property
    @pulumi.getter(name="tokenExchangeScope")
    def token_exchange_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsTokenExchangeScope']]:
        return pulumi.get(self, "token_exchange_scope")

    @property
    @pulumi.getter(name="viewScope")
    def view_scope(self) -> pulumi.Output[Optional['outputs.ClientPermissionsViewScope']]:
        return pulumi.get(self, "view_scope")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

