Skip to content

Commit

Permalink
Update enum.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiDrang committed Jan 18, 2025
1 parent 8051961 commit 713ae59
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/python3_capsolver/core/enum.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from enum import Enum
from typing import List

__all__ = ("EndpointPostfixEnm", "CaptchaTypeEnm", "ResponseStatusEnm", "SaveFormatsEnm")

class MyEnum(Enum):

class MyEnum(str, Enum):
@classmethod
def list(cls) -> List[Enum]:
return list(map(lambda c: c, cls))
Expand All @@ -16,7 +18,7 @@ def list_names(cls) -> List[str]:
return list(map(lambda c: c.name, cls))


class EndpointPostfixEnm(str, MyEnum):
class EndpointPostfixEnm(MyEnum):
"""
Enum stored URL postfixes for API endpoints
"""
Expand All @@ -26,7 +28,7 @@ class EndpointPostfixEnm(str, MyEnum):
GET_TASK_RESULT = "getTaskResult"


class CaptchaTypeEnm(str, MyEnum):
class CaptchaTypeEnm(MyEnum):
Control = "Control"

ImageToTextTask = "ImageToTextTask"
Expand Down Expand Up @@ -63,7 +65,7 @@ class CaptchaTypeEnm(str, MyEnum):
AwsWafClassification = "AwsWafClassification"


class ResponseStatusEnm(str, MyEnum):
class ResponseStatusEnm(MyEnum):
"""
Enum store results `status` field variants
Expand All @@ -77,6 +79,6 @@ class ResponseStatusEnm(str, MyEnum):
Failed = "failed" # Task failed, check the errorDescription to know why failed.


class SaveFormatsEnm(str, MyEnum):
class SaveFormatsEnm(MyEnum):
TEMP = "temp"
CONST = "const"

0 comments on commit 713ae59

Please sign in to comment.