-
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
1 parent
049c122
commit 126fee0
Showing
6 changed files
with
43 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,35 @@ | ||
"""esak.schemas package entry file.""" | ||
"""esak.schemas package entry file. | ||
This module provides the following classes: | ||
- BaseModel | ||
""" | ||
|
||
__all__ = ["BaseModel"] | ||
|
||
from pydantic import BaseModel as PydanticModel | ||
|
||
|
||
def to_camel_case(value: str) -> str: | ||
"""Convert attribute name to camelCase. | ||
Args: | ||
value: Attribute name | ||
Returns: | ||
Value converted to camelCase | ||
""" | ||
temp = value.replace("_", " ").title().replace(" ", "") | ||
return temp[0].lower() + temp[1:] | ||
|
||
|
||
class BaseModel( | ||
PydanticModel, | ||
alias_generator=to_camel_case, | ||
populate_by_name=True, | ||
str_strip_whitespace=True, | ||
validate_assignment=True, | ||
revalidate_instances="always", | ||
extra="ignore", | ||
): | ||
"""Base model for esak resources.""" |
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