deleteCaption method

Future deleteCaption({
  1. required String videoId,
  2. required String captionId,
})

Delete a caption track by its unique ID, along with its packaged segments.

Implementation

Future deleteCaption({
  required String videoId,
  required String captionId,
}) async {
  if (videoId.isEmpty) {
    throw AppwriteException(
      'Missing required parameter: "videoId"',
    );
  }

  if (captionId.isEmpty) {
    throw AppwriteException(
      'Missing required parameter: "captionId"',
    );
  }

  final String apiPath = '/videos/{videoId}/captions/{captionId}'
      .replaceAll(
        '{videoId}',
        _encodePath(videoId),
      )
      .replaceAll(
        '{captionId}',
        _encodePath(captionId),
      );

  final Map<String, dynamic> apiParams = {};

  final Map<String, String> apiHeaders = {
    'X-Appwrite-Project': client.config['project'] ?? '',
    'content-type': 'application/json',
    'accept': 'application/json',
  };

  final res = await client.call(
    HttpMethod.delete,
    path: apiPath,
    params: apiParams,
    headers: apiHeaders,
  );

  return res.data;
}