# generated by datamodel-codegen:
#   filename:  entity/policies/accessControl/resourceDescriptor.json
#   timestamp: 2022-10-03T15:16:21+00:00

from __future__ import annotations

from enum import Enum
from typing import List, Optional

from pydantic import BaseModel, Field


class Operation(Enum):
    All = 'All'
    Create = 'Create'
    Delete = 'Delete'
    ViewAll = 'ViewAll'
    ViewBasic = 'ViewBasic'
    ViewUsage = 'ViewUsage'
    ViewTests = 'ViewTests'
    ViewQueries = 'ViewQueries'
    ViewDataProfile = 'ViewDataProfile'
    ViewSampleData = 'ViewSampleData'
    EditAll = 'EditAll'
    EditDescription = 'EditDescription'
    EditDisplayName = 'EditDisplayName'
    EditTags = 'EditTags'
    EditOwner = 'EditOwner'
    EditTier = 'EditTier'
    EditCustomFields = 'EditCustomFields'
    EditLineage = 'EditLineage'
    EditReviewers = 'EditReviewers'
    EditTests = 'EditTests'
    EditQueries = 'EditQueries'
    EditDataProfile = 'EditDataProfile'
    EditSampleData = 'EditSampleData'
    EditUsers = 'EditUsers'


class ResourceDescriptor(BaseModel):
    name: Optional[str] = Field(
        None,
        description='Name of the resource. For entity related resources, resource name is same as the entity name. Some resources such as lineage are not entities but are resources.',
    )
    operations: Optional[List[Operation]] = Field(
        None, description='List of operations supported by the resource.'
    )
