77from .api import make_request , BASE_URL
88
99
10- MAP_COMMENTS_TEMPLATE = urljoin (BASE_URL , "maps/{map_id}/comments/" )
11- MAP_COMMENT_TEMPLATE = urljoin (MAP_COMMENTS_TEMPLATE , "{comment_id}" )
12- MAP_COMMENT_RESOLVE_TEMPLATE = urljoin (MAP_COMMENT_TEMPLATE , "/resolve" )
13- MAP_COMMENTS_EXPORT_TEMPLATE = urljoin (MAP_COMMENTS_TEMPLATE , "export" )
10+ COMMENT = urljoin (BASE_URL , "maps/{map_id}/comments/{comment_id}" )
11+ COMMENT_RESOLVE = urljoin (BASE_URL , "maps/{map_id}/comments/{comment_id}/resolve" )
12+ COMMENT_EXPORT = urljoin (BASE_URL , "maps/{map_id}/comments/{comment_id}/export" )
1413
1514
1615def export_comments (map_id : str , format : str = "json" , api_token : str | None = None ):
1716 """Export comments from a map
18-
17+
1918 Args:
2019 map_id: The ID of the map to export comments from
2120 format: The format to export the comments in, either 'csv' or 'json' (default)
2221 api_token: Optional API token
23-
22+
2423 Returns:
2524 The exported comments in the specified format
2625 """
27- url = f"{ MAP_COMMENTS_EXPORT_TEMPLATE .format (map_id = map_id )} ?format={ format } "
26+ url = f"{ COMMENT_EXPORT .format (map_id = map_id )} ?format={ format } "
2827 response = make_request (
2928 url = url ,
3029 method = "GET" ,
@@ -35,17 +34,17 @@ def export_comments(map_id: str, format: str = "json", api_token: str | None = N
3534
3635def resolve_comment (map_id : str , comment_id : str , api_token : str | None = None ):
3736 """Resolve a comment
38-
37+
3938 Args:
4039 map_id: The ID of the map that contains the comment
4140 comment_id: The ID of the comment to resolve
4241 api_token: Optional API token
43-
42+
4443 Returns:
4544 Confirmation of the resolved comment
4645 """
4746 response = make_request (
48- url = MAP_COMMENT_RESOLVE_TEMPLATE .format (map_id = map_id , comment_id = comment_id ),
47+ url = COMMENT_RESOLVE .format (map_id = map_id , comment_id = comment_id ),
4948 method = "POST" ,
5049 api_token = api_token ,
5150 )
@@ -54,14 +53,14 @@ def resolve_comment(map_id: str, comment_id: str, api_token: str | None = None):
5453
5554def delete_comment (map_id : str , comment_id : str , api_token : str | None = None ):
5655 """Delete a comment
57-
56+
5857 Args:
5958 map_id: The ID of the map that contains the comment
6059 comment_id: The ID of the comment to delete
6160 api_token: Optional API token
6261 """
6362 make_request (
64- url = MAP_COMMENT_TEMPLATE .format (map_id = map_id , comment_id = comment_id ),
63+ url = COMMENT .format (map_id = map_id , comment_id = comment_id ),
6564 method = "DELETE" ,
6665 api_token = api_token ,
6766 )
0 commit comments