Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: turn enumwrappers into real python enumerators #570

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/python/src/armonik/common/enumwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TaskStatus(IntEnum):
PAUSED = TASK_STATUS_PAUSED


class EventTypes:
class EventTypes(IntEnum):
UNSPECIFIED = EVENTS_ENUM_UNSPECIFIED
NEW_TASK = EVENTS_ENUM_NEW_TASK
TASK_STATUS_UPDATE = EVENTS_ENUM_TASK_STATUS_UPDATE
Expand All @@ -88,7 +88,7 @@ def from_string(cls, name: str):
return getattr(cls, name.upper())


class SessionStatus:
class SessionStatus(IntEnum):
@staticmethod
def name_from_value(status: RawSessionStatus) -> str:
return _SESSIONSTATUS.values_by_number[status].name
Expand All @@ -102,7 +102,7 @@ def name_from_value(status: RawSessionStatus) -> str:
DELETED = SESSION_STATUS_DELETED


class ResultStatus:
class ResultStatus(IntEnum):
@staticmethod
def name_from_value(status: RawResultStatus) -> str:
return _RESULTSTATUS.values_by_number[status].name
Expand All @@ -115,19 +115,19 @@ def name_from_value(status: RawResultStatus) -> str:
NOTFOUND = RESULT_STATUS_NOTFOUND


class ServiceHealthCheckStatus:
class ServiceHealthCheckStatus(IntEnum):
UNSPECIFIED = HEALTH_STATUS_ENUM_UNSPECIFIED
HEALTHY = HEALTH_STATUS_ENUM_HEALTHY
DEGRADED = HEALTH_STATUS_ENUM_DEGRADED
UNHEALTHY = HEALTH_STATUS_ENUM_UNHEALTHY


class HealthCheckStatus:
class HealthCheckStatus(IntEnum):
UNKNOWN = HealthCheckReply.UNKNOWN
SERVING = HealthCheckReply.SERVING
NOT_SERVING = HealthCheckReply.NOT_SERVING


class Direction:
class Direction(IntEnum):
ASC = SORT_DIRECTION_ASC
DESC = SORT_DIRECTION_DESC
2 changes: 1 addition & 1 deletion packages/python/src/armonik/common/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def from_message(cls, task_options):
application_namespace=task_options.application_namespace,
application_service=task_options.application_service,
engine_type=task_options.engine_type,
options=task_options.options,
options={k: v for k, v in task_options.options.items()},
)

def to_message(self) -> RawTaskOptions:
Expand Down
Loading