mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-08-17 08:21:05 +02:00
@ -174,40 +174,36 @@ class MediaBulkUserActions(APIView):
|
|||||||
parser_classes = (JSONParser,)
|
parser_classes = (JSONParser,)
|
||||||
|
|
||||||
@swagger_auto_schema(
|
@swagger_auto_schema(
|
||||||
manual_parameters=[
|
request_body=openapi.Schema(
|
||||||
openapi.Parameter(name='media_ids', in_=openapi.IN_FORM, type=openapi.TYPE_ARRAY, items=openapi.Items(type=openapi.TYPE_STRING), required=True, description="List of media IDs"),
|
type=openapi.TYPE_OBJECT,
|
||||||
openapi.Parameter(
|
required=['media_ids', 'action'],
|
||||||
name='action',
|
properties={
|
||||||
in_=openapi.IN_FORM,
|
'media_ids': openapi.Schema(type=openapi.TYPE_ARRAY, items=openapi.Items(type=openapi.TYPE_STRING), description="List of media IDs"),
|
||||||
type=openapi.TYPE_STRING,
|
'action': openapi.Schema(
|
||||||
required=True,
|
type=openapi.TYPE_STRING,
|
||||||
description="Action to perform",
|
description="Action to perform",
|
||||||
enum=[
|
enum=[
|
||||||
"enable_comments",
|
"enable_comments",
|
||||||
"disable_comments",
|
"disable_comments",
|
||||||
"delete_media",
|
"delete_media",
|
||||||
"enable_download",
|
"enable_download",
|
||||||
"disable_download",
|
"disable_download",
|
||||||
"add_to_playlist",
|
"add_to_playlist",
|
||||||
"remove_from_playlist",
|
"remove_from_playlist",
|
||||||
"set_state",
|
"set_state",
|
||||||
"change_owner",
|
"change_owner",
|
||||||
"copy_media",
|
"copy_media",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
openapi.Parameter(
|
'playlist_ids': openapi.Schema(
|
||||||
name='playlist_ids',
|
type=openapi.TYPE_ARRAY,
|
||||||
in_=openapi.IN_FORM,
|
items=openapi.Items(type=openapi.TYPE_INTEGER),
|
||||||
type=openapi.TYPE_ARRAY,
|
description="List of playlist IDs (required for add_to_playlist and remove_from_playlist actions)",
|
||||||
items=openapi.Items(type=openapi.TYPE_INTEGER),
|
),
|
||||||
required=False,
|
'state': openapi.Schema(type=openapi.TYPE_STRING, description="State to set (required for set_state action)", enum=["private", "public", "unlisted"]),
|
||||||
description="List of playlist IDs (required for add_to_playlist and remove_from_playlist actions)",
|
'owner': openapi.Schema(type=openapi.TYPE_STRING, description="New owner username (required for change_owner action)"),
|
||||||
),
|
},
|
||||||
openapi.Parameter(
|
),
|
||||||
name='state', in_=openapi.IN_FORM, type=openapi.TYPE_STRING, required=False, description="State to set (required for set_state action)", enum=["private", "public", "unlisted"]
|
|
||||||
),
|
|
||||||
openapi.Parameter(name='owner', in_=openapi.IN_FORM, type=openapi.TYPE_STRING, required=False, description="New owner username (required for change_owner action)"),
|
|
||||||
],
|
|
||||||
tags=['Media'],
|
tags=['Media'],
|
||||||
operation_summary='Perform bulk actions on media',
|
operation_summary='Perform bulk actions on media',
|
||||||
operation_description='Perform various bulk actions on multiple media items at once',
|
operation_description='Perform various bulk actions on multiple media items at once',
|
||||||
|
Reference in New Issue
Block a user