-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcomponent.py
More file actions
47 lines (32 loc) · 1.22 KB
/
component.py
File metadata and controls
47 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# coding: utf-8
"""
Permify API
Permify is an open source authorization service for creating fine-grained and scalable authorization systems.
The version of the OpenAPI document: v1.6.8
Contact: hello@permify.co
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class Component(str, Enum):
"""
CEL component specifier. - COMPONENT_PARSER: Parser. Converts a CEL string to an AST. - COMPONENT_TYPE_CHECKER: Type checker. Checks that references in an AST are defined and types agree. - COMPONENT_RUNTIME: Runtime. Evaluates a parsed and optionally checked CEL AST against a context.
"""
"""
allowed enum values
"""
COMPONENT_PARSER = 'COMPONENT_PARSER'
COMPONENT_TYPE_CHECKER = 'COMPONENT_TYPE_CHECKER'
COMPONENT_RUNTIME = 'COMPONENT_RUNTIME'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Component from a JSON string"""
return cls(json.loads(json_str))