diff options
Diffstat (limited to 'pydis_site/apps/api/viewsets/bot')
| -rw-r--r-- | pydis_site/apps/api/viewsets/bot/allowlist.py | 30 | 
1 files changed, 24 insertions, 6 deletions
| diff --git a/pydis_site/apps/api/viewsets/bot/allowlist.py b/pydis_site/apps/api/viewsets/bot/allowlist.py index 9b907d05..7cc82ff7 100644 --- a/pydis_site/apps/api/viewsets/bot/allowlist.py +++ b/pydis_site/apps/api/viewsets/bot/allowlist.py @@ -27,27 +27,45 @@ class AllowListViewSet(ModelViewSet):      #### Status codes      - 200: returned on success +    - 401: returned if unauthenticated + +    ### GET /bot/allowlists/<id:int> +    Returns a specific AllowList item from the database. + +    #### Response format +    >>> { +    ...     'id': "2309268224", +    ...     'created_at': "01-01-2020 ...", +    ...     'updated_at': "01-01-2020 ...", +    ...     'type': "file_format", +    ...     'allowed': 'true', +    ...     'content': ".jpeg", +    ... } + +    #### Status codes +    - 200: returned on success +    - 404: returned if the id was not found.      ### POST /bot/allowedlists      Adds a single allowedlist item to the database.      #### Request body      >>> { -    ...         'type': str, -    ...         'allowed': bool, -    ...         'content': str, +    ...    'type': str, +    ...    'allowed': bool, +    ...    'content': str,      ... }      #### Status codes      - 201: returned on success      - 400: if one of the given fields is invalid -    ### DELETE /bot/allowedlists/<title:str> -    Deletes the tag with the given `title`. +    ### DELETE /bot/allowedlists/<id:int> +    Deletes the tag with the given `id`.      #### Status codes      - 204: returned on success -    - 404: if a tag with the given `title` does not exist +    - 404: if a tag with the given `id` does not exist      """      serializer_class = AllowListSerializer | 
