feat(detector_details): Add mathod to retrieve detector details#140
feat(detector_details): Add mathod to retrieve detector details#140salome-voltz wants to merge 1 commit intomasterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #140 +/- ##
==========================================
- Coverage 95.73% 94.67% -1.06%
==========================================
Files 5 5
Lines 1196 1278 +82
==========================================
+ Hits 1145 1210 +65
- Misses 51 68 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| """ " | ||
| Response from /v1/detectors, to retrieve a detetor details |
There was a problem hiding this comment.
typos (but +1 for adding a docstring 🤩)
| """ " | |
| Response from /v1/detectors, to retrieve a detetor details | |
| """ | |
| Response from /v1/detectors, to retrieve a detector details |
|
|
||
| obj: Union[Detail, DetectorDetailsResponse] | ||
| if is_ok(resp): | ||
| print(resp.json()) |
| return DetectorDetails(**data) | ||
|
|
||
|
|
||
| class DetectorDetails(Base, FromDictMixin): |
There was a problem hiding this comment.
If you make this a dataclass then you don't need to write that long __init__() function.
And using marshmallow_dataclass you don't need to write the schema class manually.
You can have a look at SecretIncident for inspiration.
| return DetectorDetails(**data) | ||
|
|
||
|
|
||
| class DetectorDetailsResponse(Base, FromDictMixin): |
There was a problem hiding this comment.
Do we need both a DetectorDetails and a DetectorDetailsReponse? I think we could make detector_details() return a DetectorDetails instance, but maybe I am missing something.
No description provided.