-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
495 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
from enum import Enum | ||
from typing import List | ||
|
||
|
||
class SupportedDocumentTypes(Enum): | ||
ARF = "ARF", "#arf" | ||
LG = "LG", "#lg" | ||
|
||
def __init__(self, field_name, field_alias): | ||
self.field_name = field_name | ||
self.field_alias = field_alias | ||
ARF = "ARF" | ||
LG = "LG" | ||
ALL = "ALL" | ||
|
||
@staticmethod | ||
def list(): | ||
return [SupportedDocumentTypes.ARF, SupportedDocumentTypes.LG] | ||
|
||
@staticmethod | ||
def list_names(): | ||
return [SupportedDocumentTypes.ARF.name, SupportedDocumentTypes.LG.name] | ||
def list_names() -> List[str]: | ||
return [str(doc_type.value) for doc_type in SupportedDocumentTypes.list()] | ||
|
||
@staticmethod | ||
def get_from_field_name(enum_value): | ||
for supported_document_type in SupportedDocumentTypes.list(): | ||
if supported_document_type.name == enum_value: | ||
return supported_document_type | ||
def get_from_field_name(value: str): | ||
if value in SupportedDocumentTypes.list_names(): | ||
return value | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.