frostfs-sdk-python/frostfs_sdk/models/enums/selector_clause.py
Ilyas Niyazov f8465e5b99 Added create container grpc method
Signed-off-by: Ilyas Niyazov <i.niyazov@yadro.com>
2025-03-10 13:46:17 +03:00

26 lines
572 B
Python

class SelectorClause:
"""
Enum for selector clauses with integer value mapping
"""
CLAUSE_UNSPECIFIED = 0
SAME = 1
DISTINCT = 2
_value_map = {
0: CLAUSE_UNSPECIFIED,
1: SAME,
2: DISTINCT
}
@classmethod
def get(cls, value: int) -> 'SelectorClause':
"""
Get enum instance by integer value
Args:
value: Integer value of the clause
Returns:
Corresponding SelectorClause instance
"""
return cls._value_map.get(value)