[Chore/Refactor] Improve type annotations in models module (#25281)
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
parent
e1f871fefe
commit
9b8a03b53b
23 changed files with 332 additions and 251 deletions
|
|
@ -17,7 +17,7 @@ class ProviderType(Enum):
|
|||
SYSTEM = "system"
|
||||
|
||||
@staticmethod
|
||||
def value_of(value):
|
||||
def value_of(value: str) -> "ProviderType":
|
||||
for member in ProviderType:
|
||||
if member.value == value:
|
||||
return member
|
||||
|
|
@ -35,7 +35,7 @@ class ProviderQuotaType(Enum):
|
|||
"""hosted trial quota"""
|
||||
|
||||
@staticmethod
|
||||
def value_of(value):
|
||||
def value_of(value: str) -> "ProviderQuotaType":
|
||||
for member in ProviderQuotaType:
|
||||
if member.value == value:
|
||||
return member
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue