-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from anomaly/pyndatic2-migration
pyndatic2 migration
- Loading branch information
Showing
38 changed files
with
428 additions
and
293 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# managed by direnv | ||
.envrc | ||
|
||
# Byte-compiled / optimized / DLL files | ||
.secret | ||
.DS_Store | ||
|
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,14 +1,21 @@ | ||
from ..utils import APIBase | ||
""" | ||
""" | ||
|
||
from ..utils import ( | ||
APIBase, | ||
EndpointConfig | ||
) | ||
|
||
|
||
class Division(APIBase): | ||
""" | ||
Gallagher advises against hardcoding the URLs for divisions, and instead | ||
recommends using the /api endpoint to discover the URLs from | ||
events.divisions.href and alarms.division.href. | ||
""" | ||
class Config: | ||
|
||
endpoint = "divisions" | ||
""" | ||
|
||
__config__ = EndpointConfig( | ||
endpoint="divisions", | ||
) |
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,29 +1,38 @@ | ||
from ..utils import APIBase | ||
from ...schema.items import ItemTypesResponse,\ | ||
ItemsSummaryResponse, ItemDetail | ||
""" | ||
""" | ||
from ..utils import ( | ||
APIBase, | ||
EndpointConfig | ||
) | ||
|
||
from ...dto.items import ( | ||
ItemTypesResponse, | ||
ItemsSummaryResponse, | ||
ItemDetail | ||
) | ||
|
||
|
||
class ItemsTypes(APIBase): | ||
""" | ||
Gallagher | ||
""" | ||
|
||
class Config: | ||
|
||
endpoint = "items/types" | ||
list_response_class = ItemTypesResponse | ||
__config__ = EndpointConfig( | ||
endpoint="items/types", | ||
dto_list=ItemTypesResponse, | ||
) | ||
|
||
|
||
class Item(APIBase): | ||
""" | ||
Gallagher advises against hardcoding the URLs for divisions, and instead | ||
recommends using the /api endpoint to discover the URLs from | ||
events.divisions.href and alarms.division.href. | ||
""" | ||
class Config: | ||
""" | ||
|
||
endpoint = "items" | ||
list_response_class = ItemsSummaryResponse | ||
retrieve_response_class = ItemDetail | ||
__config__ = EndpointConfig( | ||
endpoint="items", | ||
dto_list=ItemsSummaryResponse, | ||
dto_retrieve=ItemDetail, | ||
) |
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.