# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities

__all__ = [
    'GetAccessPolicyAssignmentResult',
    'AwaitableGetAccessPolicyAssignmentResult',
    'get_access_policy_assignment',
    'get_access_policy_assignment_output',
]

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

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

    @_builtins.property
    @pulumi.getter(name="managedRedisName")
    def managed_redis_name(self) -> _builtins.str:
        return pulumi.get(self, "managed_redis_name")

    @_builtins.property
    @pulumi.getter(name="objectId")
    def object_id(self) -> _builtins.str:
        return pulumi.get(self, "object_id")

    @_builtins.property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> _builtins.str:
        return pulumi.get(self, "resource_group_name")


class AwaitableGetAccessPolicyAssignmentResult(GetAccessPolicyAssignmentResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAccessPolicyAssignmentResult(
            id=self.id,
            managed_redis_name=self.managed_redis_name,
            object_id=self.object_id,
            resource_group_name=self.resource_group_name)


def get_access_policy_assignment(managed_redis_name: Optional[_builtins.str] = None,
                                 object_id: Optional[_builtins.str] = None,
                                 resource_group_name: Optional[_builtins.str] = None,
                                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAccessPolicyAssignmentResult:
    """
    Use this data source to access information about an existing Managed Redis Access Policy Assignment.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.managedredis.get_access_policy_assignment(object_id="00000000-0000-0000-0000-000000000000",
        managed_redis_name="example-managedredis",
        resource_group_name="example-resources")
    pulumi.export("objectId", example.object_id)
    ```

    ## API Providers

    <!-- This section is generated, changes will be overwritten -->
    This data source uses the following Azure API Providers:

    * `Microsoft.Cache` - 2025-07-01


    :param _builtins.str managed_redis_name: The name of the Managed Redis instance.
    :param _builtins.str object_id: The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    :param _builtins.str resource_group_name: The name of the Resource Group where the Managed Redis instance exists.
           
           > **Note:** This data source retrieves Access Policy Assignments from the `default` database of the Managed Redis instance.
    """
    __args__ = dict()
    __args__['managedRedisName'] = managed_redis_name
    __args__['objectId'] = object_id
    __args__['resourceGroupName'] = resource_group_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure:managedredis/getAccessPolicyAssignment:getAccessPolicyAssignment', __args__, opts=opts, typ=GetAccessPolicyAssignmentResult).value

    return AwaitableGetAccessPolicyAssignmentResult(
        id=pulumi.get(__ret__, 'id'),
        managed_redis_name=pulumi.get(__ret__, 'managed_redis_name'),
        object_id=pulumi.get(__ret__, 'object_id'),
        resource_group_name=pulumi.get(__ret__, 'resource_group_name'))
def get_access_policy_assignment_output(managed_redis_name: Optional[pulumi.Input[_builtins.str]] = None,
                                        object_id: Optional[pulumi.Input[_builtins.str]] = None,
                                        resource_group_name: Optional[pulumi.Input[_builtins.str]] = None,
                                        opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetAccessPolicyAssignmentResult]:
    """
    Use this data source to access information about an existing Managed Redis Access Policy Assignment.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.managedredis.get_access_policy_assignment(object_id="00000000-0000-0000-0000-000000000000",
        managed_redis_name="example-managedredis",
        resource_group_name="example-resources")
    pulumi.export("objectId", example.object_id)
    ```

    ## API Providers

    <!-- This section is generated, changes will be overwritten -->
    This data source uses the following Azure API Providers:

    * `Microsoft.Cache` - 2025-07-01


    :param _builtins.str managed_redis_name: The name of the Managed Redis instance.
    :param _builtins.str object_id: The object ID of the Azure Active Directory user, group, service principal, or managed identity.
    :param _builtins.str resource_group_name: The name of the Resource Group where the Managed Redis instance exists.
           
           > **Note:** This data source retrieves Access Policy Assignments from the `default` database of the Managed Redis instance.
    """
    __args__ = dict()
    __args__['managedRedisName'] = managed_redis_name
    __args__['objectId'] = object_id
    __args__['resourceGroupName'] = resource_group_name
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('azure:managedredis/getAccessPolicyAssignment:getAccessPolicyAssignment', __args__, opts=opts, typ=GetAccessPolicyAssignmentResult)
    return __ret__.apply(lambda __response__: GetAccessPolicyAssignmentResult(
        id=pulumi.get(__response__, 'id'),
        managed_redis_name=pulumi.get(__response__, 'managed_redis_name'),
        object_id=pulumi.get(__response__, 'object_id'),
        resource_group_name=pulumi.get(__response__, 'resource_group_name')))
