"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from apideck_unify.types import BaseModel
from enum import Enum
from typing import Dict, Optional, Union
from typing_extensions import NotRequired, TypeAliasType, TypedDict


class Two(str, Enum):
    r"""Wildcard indicating all resources and fields when Data Scopes is disabled"""

    WILDCARD_ = "*"


class OneTypedDict(TypedDict):
    read: NotRequired[bool]
    r"""Whether the field can be read"""
    write: NotRequired[bool]
    r"""Whether the field can be written to"""


class One(BaseModel):
    read: Optional[bool] = None
    r"""Whether the field can be read"""

    write: Optional[bool] = None
    r"""Whether the field can be written to"""


UpdateConsentRequestResourcesTypedDict = TypeAliasType(
    "UpdateConsentRequestResourcesTypedDict",
    Union[Dict[str, Dict[str, OneTypedDict]], Two],
)


UpdateConsentRequestResources = TypeAliasType(
    "UpdateConsentRequestResources", Union[Dict[str, Dict[str, One]], Two]
)


class UpdateConsentRequestTypedDict(TypedDict):
    resources: UpdateConsentRequestResourcesTypedDict
    granted: bool
    r"""Whether consent is being granted (true) or denied/revoked (false)"""


class UpdateConsentRequest(BaseModel):
    resources: UpdateConsentRequestResources

    granted: bool
    r"""Whether consent is being granted (true) or denied/revoked (false)"""
