"""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 DataScopesResources2(str, Enum):
    r"""Wildcard indicating all resources and fields when Data Scopes is selected"""

    WILDCARD_ = "*"


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


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

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


DataScopesResourcesTypedDict = TypeAliasType(
    "DataScopesResourcesTypedDict",
    Union[Dict[str, Dict[str, DataScopesResources1TypedDict]], DataScopesResources2],
)
r"""Data scopes resource configuration that can be either detailed field permissions or a wildcard"""


DataScopesResources = TypeAliasType(
    "DataScopesResources",
    Union[Dict[str, Dict[str, DataScopesResources1]], DataScopesResources2],
)
r"""Data scopes resource configuration that can be either detailed field permissions or a wildcard"""
