[#3] Added generate proto script create container method

Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
This commit is contained in:
Ilyas Niyazov 2025-03-25 11:13:48 +03:00
parent 19282f13cc
commit 297e107b10
52 changed files with 1380 additions and 74 deletions

View file

@ -0,0 +1,7 @@
from enum import Enum
class BasicAcl(Enum):
PRIVATE = 0x1C8C8CCC
PUBLIC_RO = 0x1FBF8CFF
PUBLIC_RW = 0x1FBFBFFF
PUBLIC_APPEND = 0x1FBF9FFF

View file

@ -0,0 +1,42 @@
class FilterOperation:
"""
Enum for filter operations with integer value mapping
"""
OPERATION_UNSPECIFIED = 0
EQ = 1
NE = 2
GT = 3
GE = 4
LT = 5
LE = 6
OR = 7
AND = 8
NOT = 9
LIKE = 10
_value_map = {
0: OPERATION_UNSPECIFIED,
1: EQ,
2: NE,
3: GT,
4: GE,
5: LT,
6: LE,
7: OR,
8: AND,
9: NOT,
10: LIKE
}
@classmethod
def get(cls, value: int) -> 'FilterOperation':
"""
Get enum instance by integer value
Args:
value: Integer value of the operation
Returns:
Corresponding FilterOperation instance
"""
return cls._value_map.get(value)

View file

@ -0,0 +1,14 @@
from enum import Enum, unique
@unique
class SelectorClause(Enum):
CLAUSE_UNSPECIFIED = 0
SAME = 1
DISTINCT = 2
@classmethod
def get(cls, value: int):
try:
return cls(value)
except ValueError:
raise KeyError(f"Unknown enum value: {value}")