Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/api/deposit_update.py
# Copyright (C) 2017-2018 The Software Heritage developers | # Copyright (C) 2017-2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from rest_framework import status | from rest_framework import status | ||||
from .common import SWHPostDepositAPI, SWHPutDepositAPI, SWHDeleteDepositAPI | from .common import APIPost, APIPut, APIDelete | ||||
from .common import ACCEPT_ARCHIVE_CONTENT_TYPES | from .common import ACCEPT_ARCHIVE_CONTENT_TYPES | ||||
from ..config import CONT_FILE_IRI, EDIT_SE_IRI, EM_IRI | from ..config import CONT_FILE_IRI, EDIT_SE_IRI, EM_IRI | ||||
from ..errors import make_error_dict, BAD_REQUEST | from ..errors import make_error_dict, BAD_REQUEST | ||||
from ..parsers import SWHFileUploadZipParser, SWHFileUploadTarParser | from ..parsers import SWHFileUploadZipParser, SWHFileUploadTarParser | ||||
from ..parsers import SWHAtomEntryParser | from ..parsers import SWHAtomEntryParser | ||||
from ..parsers import SWHMultiPartParser | from ..parsers import SWHMultiPartParser | ||||
class SWHUpdateArchiveDeposit(SWHPostDepositAPI, SWHPutDepositAPI, SWHDeleteDepositAPI): | class APIUpdateArchive(APIPost, APIPut, APIDelete): | ||||
"""Deposit request class defining api endpoints for sword deposit. | """Deposit request class defining api endpoints for sword deposit. | ||||
What's known as 'EM IRI' in the sword specification. | What's known as 'EM IRI' in the sword specification. | ||||
HTTP verbs supported: PUT, POST, DELETE | HTTP verbs supported: PUT, POST, DELETE | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | def process_delete(self, req, collection_name, deposit_id): | ||||
Returns: | Returns: | ||||
204 Created | 204 Created | ||||
""" | """ | ||||
return self._delete_archives(collection_name, deposit_id) | return self._delete_archives(collection_name, deposit_id) | ||||
class SWHUpdateMetadataDeposit( | class APIUpdateMetadata(APIPost, APIPut, APIDelete): | ||||
SWHPostDepositAPI, SWHPutDepositAPI, SWHDeleteDepositAPI | |||||
): | |||||
"""Deposit request class defining api endpoints for sword deposit. | """Deposit request class defining api endpoints for sword deposit. | ||||
What's known as 'Edit IRI' (and SE IRI) in the sword specification. | What's known as 'Edit IRI' (and SE IRI) in the sword specification. | ||||
HTTP verbs supported: POST (SE IRI), PUT (Edit IRI), DELETE | HTTP verbs supported: POST (SE IRI), PUT (Edit IRI), DELETE | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |