# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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

__all__ = [
    'GetDenyAssignmentResult',
    'AwaitableGetDenyAssignmentResult',
    'get_deny_assignment',
]

@pulumi.output_type
class GetDenyAssignmentResult:
    """
    Deny Assignment
    """
    def __init__(__self__, condition=None, condition_version=None, created_by=None, created_on=None, deny_assignment_name=None, description=None, do_not_apply_to_child_scopes=None, exclude_principals=None, id=None, is_system_protected=None, name=None, permissions=None, principals=None, scope=None, type=None, updated_by=None, updated_on=None):
        if condition and not isinstance(condition, str):
            raise TypeError("Expected argument 'condition' to be a str")
        pulumi.set(__self__, "condition", condition)
        if condition_version and not isinstance(condition_version, str):
            raise TypeError("Expected argument 'condition_version' to be a str")
        pulumi.set(__self__, "condition_version", condition_version)
        if created_by and not isinstance(created_by, str):
            raise TypeError("Expected argument 'created_by' to be a str")
        pulumi.set(__self__, "created_by", created_by)
        if created_on and not isinstance(created_on, str):
            raise TypeError("Expected argument 'created_on' to be a str")
        pulumi.set(__self__, "created_on", created_on)
        if deny_assignment_name and not isinstance(deny_assignment_name, str):
            raise TypeError("Expected argument 'deny_assignment_name' to be a str")
        pulumi.set(__self__, "deny_assignment_name", deny_assignment_name)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if do_not_apply_to_child_scopes and not isinstance(do_not_apply_to_child_scopes, bool):
            raise TypeError("Expected argument 'do_not_apply_to_child_scopes' to be a bool")
        pulumi.set(__self__, "do_not_apply_to_child_scopes", do_not_apply_to_child_scopes)
        if exclude_principals and not isinstance(exclude_principals, list):
            raise TypeError("Expected argument 'exclude_principals' to be a list")
        pulumi.set(__self__, "exclude_principals", exclude_principals)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_system_protected and not isinstance(is_system_protected, bool):
            raise TypeError("Expected argument 'is_system_protected' to be a bool")
        pulumi.set(__self__, "is_system_protected", is_system_protected)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if permissions and not isinstance(permissions, list):
            raise TypeError("Expected argument 'permissions' to be a list")
        pulumi.set(__self__, "permissions", permissions)
        if principals and not isinstance(principals, list):
            raise TypeError("Expected argument 'principals' to be a list")
        pulumi.set(__self__, "principals", principals)
        if scope and not isinstance(scope, str):
            raise TypeError("Expected argument 'scope' to be a str")
        pulumi.set(__self__, "scope", scope)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if updated_by and not isinstance(updated_by, str):
            raise TypeError("Expected argument 'updated_by' to be a str")
        pulumi.set(__self__, "updated_by", updated_by)
        if updated_on and not isinstance(updated_on, str):
            raise TypeError("Expected argument 'updated_on' to be a str")
        pulumi.set(__self__, "updated_on", updated_on)

    @property
    @pulumi.getter
    def condition(self) -> Optional[str]:
        """
        The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'
        """
        return pulumi.get(self, "condition")

    @property
    @pulumi.getter(name="conditionVersion")
    def condition_version(self) -> Optional[str]:
        """
        Version of the condition. Currently accepted value is '2.0'
        """
        return pulumi.get(self, "condition_version")

    @property
    @pulumi.getter(name="createdBy")
    def created_by(self) -> str:
        """
        Id of the user who created the assignment
        """
        return pulumi.get(self, "created_by")

    @property
    @pulumi.getter(name="createdOn")
    def created_on(self) -> str:
        """
        Time it was created
        """
        return pulumi.get(self, "created_on")

    @property
    @pulumi.getter(name="denyAssignmentName")
    def deny_assignment_name(self) -> Optional[str]:
        """
        The display name of the deny assignment.
        """
        return pulumi.get(self, "deny_assignment_name")

    @property
    @pulumi.getter
    def description(self) -> Optional[str]:
        """
        The description of the deny assignment.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="doNotApplyToChildScopes")
    def do_not_apply_to_child_scopes(self) -> Optional[bool]:
        """
        Determines if the deny assignment applies to child scopes. Default value is false.
        """
        return pulumi.get(self, "do_not_apply_to_child_scopes")

    @property
    @pulumi.getter(name="excludePrincipals")
    def exclude_principals(self) -> Optional[Sequence['outputs.PrincipalResponse']]:
        """
        Array of principals to which the deny assignment does not apply.
        """
        return pulumi.get(self, "exclude_principals")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The deny assignment ID.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isSystemProtected")
    def is_system_protected(self) -> Optional[bool]:
        """
        Specifies whether this deny assignment was created by Azure and cannot be edited or deleted.
        """
        return pulumi.get(self, "is_system_protected")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The deny assignment name.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def permissions(self) -> Sequence['outputs.PermissionResponse']:
        """
        An array of permissions that are denied by the deny assignment.
        """
        return pulumi.get(self, "permissions")

    @property
    @pulumi.getter
    def principals(self) -> Sequence['outputs.PrincipalResponse']:
        """
        Array of principals to which the deny assignment applies.
        """
        return pulumi.get(self, "principals")

    @property
    @pulumi.getter
    def scope(self) -> Optional[str]:
        """
        The deny assignment scope.
        """
        return pulumi.get(self, "scope")

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        The deny assignment type.
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="updatedBy")
    def updated_by(self) -> str:
        """
        Id of the user who updated the assignment
        """
        return pulumi.get(self, "updated_by")

    @property
    @pulumi.getter(name="updatedOn")
    def updated_on(self) -> str:
        """
        Time it was updated
        """
        return pulumi.get(self, "updated_on")


class AwaitableGetDenyAssignmentResult(GetDenyAssignmentResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDenyAssignmentResult(
            condition=self.condition,
            condition_version=self.condition_version,
            created_by=self.created_by,
            created_on=self.created_on,
            deny_assignment_name=self.deny_assignment_name,
            description=self.description,
            do_not_apply_to_child_scopes=self.do_not_apply_to_child_scopes,
            exclude_principals=self.exclude_principals,
            id=self.id,
            is_system_protected=self.is_system_protected,
            name=self.name,
            permissions=self.permissions,
            principals=self.principals,
            scope=self.scope,
            type=self.type,
            updated_by=self.updated_by,
            updated_on=self.updated_on)


def get_deny_assignment(deny_assignment_name: Optional[str] = None,
                        scope: Optional[str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDenyAssignmentResult:
    """
    Deny Assignment


    :param str deny_assignment_name: The name of the deny assignment. It can be any valid GUID.
    :param str scope: The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'
    """
    __args__ = dict()
    __args__['denyAssignmentName'] = deny_assignment_name
    __args__['scope'] = scope
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('azure-native:authorization/v20200301preview:getDenyAssignment', __args__, opts=opts, typ=GetDenyAssignmentResult).value

    return AwaitableGetDenyAssignmentResult(
        condition=__ret__.condition,
        condition_version=__ret__.condition_version,
        created_by=__ret__.created_by,
        created_on=__ret__.created_on,
        deny_assignment_name=__ret__.deny_assignment_name,
        description=__ret__.description,
        do_not_apply_to_child_scopes=__ret__.do_not_apply_to_child_scopes,
        exclude_principals=__ret__.exclude_principals,
        id=__ret__.id,
        is_system_protected=__ret__.is_system_protected,
        name=__ret__.name,
        permissions=__ret__.permissions,
        principals=__ret__.principals,
        scope=__ret__.scope,
        type=__ret__.type,
        updated_by=__ret__.updated_by,
        updated_on=__ret__.updated_on)
