-
Notifications
You must be signed in to change notification settings - Fork 16
feat(detector_details): Add mathod to retrieve detector details #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
return DetectorDetails(**data) | ||
|
||
|
||
class DetectorDetails(Base, FromDictMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.