Skip to content

Commit 47ee178

Browse files
committed
add docsctrings to protocols api
1 parent f4e51eb commit 47ee178

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/visiomode/webpanel/api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,24 @@ def post() -> tuple[str, int, dict[str, str]]:
308308

309309

310310
class ProtocolsAPI(flask.views.MethodView):
311+
"""API for interacting with the Protocols model."""
312+
311313
@staticmethod
312314
def get() -> dict:
315+
"""Get protocol schemas.
316+
317+
Returns:
318+
dict: A dictionary containing a list of protocols under the "protocols" key.
319+
"""
313320
return {"protocols": Protocol.get_protocols()}
314321

315322
@staticmethod
316323
def post() -> tuple[str, int, dict[str, str]]:
324+
"""Service POST request to add, update or delete a protocol schema.
325+
326+
Returns:
327+
tuple[str, int, dict[str, str]]: Success tuple, to be consumed by a browser.
328+
"""
317329
request_type = flask.request.json.get("type") if flask.request.json else None
318330
request = flask.request.json.get("data") if flask.request.json else {}
319331

0 commit comments

Comments
 (0)