Skip to content

Commit f796b84

Browse files
added comment descriptions for each of the new endpoints created for the new reindex procedure
1 parent e358c10 commit f796b84

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

‎src/app.py‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,24 @@ def get_entities_by_type(entity_type):
11141114
# Response with the final result
11151115
return jsonify(final_result)
11161116

1117+
1118+
"""
1119+
Retrieve the document info needed for a given entity's ancestors. Result filtering for this
1120+
endpoint is required and is given by the required parameter 'include'.
1121+
For example /ancestors-info?include=uuid,status,entity_type
1122+
1123+
1124+
Parameters
1125+
----------
1126+
include : str
1127+
A comma delimited string of all the properties to be retrieved by the endpoint
1128+
1129+
Returns
1130+
-------
1131+
json
1132+
A list of dicts where each dict contains the requested fields for the given ancestor.
1133+
"""
1134+
11171135
@app.route('/ancestors-info/<uuid>', methods=['GET'])
11181136
def get_ancestors_info(uuid):
11191137
validate_token_if_auth_header_exists(request)
@@ -1143,6 +1161,22 @@ def get_ancestors_info(uuid):
11431161
return jsonify(ordered_response)
11441162

11451163

1164+
"""
1165+
Retrieve the document info needed for a given entity's descendant. Result filtering for this
1166+
endpoint is required and is given by the required parameter 'include'.
1167+
For example /descendants-info?include=uuid,status,entity_type
1168+
1169+
1170+
Parameters
1171+
----------
1172+
include : str
1173+
A comma delimited string of all the properties to be retrieved by the endpoint
1174+
1175+
Returns
1176+
-------
1177+
json
1178+
A list of dicts where each dict contains the requested fields for the given descendant.
1179+
"""
11461180
@app.route('/descendants-info/<uuid>', methods=['GET'])
11471181
def get_descendants_info(uuid):
11481182
validate_token_if_auth_header_exists(request)
@@ -1171,6 +1205,23 @@ def get_descendants_info(uuid):
11711205
ordered_response = [alphabetize_dict_recursive(entity) for entity in complete]
11721206
return jsonify(ordered_response)
11731207

1208+
1209+
"""
1210+
Retrieve the document info needed for a given entity's parents (immediate ancestors). Result filtering for this
1211+
endpoint is allowed and is given by the required parameter 'include'.
1212+
For example /parents-info?include=uuid,status,entity_type
1213+
1214+
1215+
Parameters
1216+
----------
1217+
include : str
1218+
A comma delimited string of all the properties to be retrieved by the endpoint
1219+
1220+
Returns
1221+
-------
1222+
json
1223+
A list of dicts where each dict contains the requested fields for the given parent.
1224+
"""
11741225
@app.route('/parents-info/<uuid>', methods=['GET'])
11751226
def get_parents_info(uuid):
11761227
validate_token_if_auth_header_exists(request)
@@ -1196,6 +1247,22 @@ def get_parents_info(uuid):
11961247
return jsonify(ordered_response)
11971248

11981249

1250+
"""
1251+
Retrieve the document info needed for a given entity's children (immediate descendants). Result filtering for this
1252+
endpoint is allowed and is given by the required parameter 'include'.
1253+
For example /children-info?include=uuid,status,entity_type
1254+
1255+
1256+
Parameters
1257+
----------
1258+
include : str
1259+
A comma delimited string of all the properties to be retrieved by the endpoint
1260+
1261+
Returns
1262+
-------
1263+
json
1264+
A list of dicts where each dict contains the requested fields for the given child.
1265+
"""
11991266
@app.route('/children-info/<uuid>', methods=['GET'])
12001267
def get_children_info(uuid):
12011268
validate_token_if_auth_header_exists(request)

0 commit comments

Comments
 (0)