batchDelete method

Future<BatchDeletePhotosResponse> batchDelete(
  1. BatchDeletePhotosRequest request, {
  2. String? $fields,
})

Deletes a list of Photos and their metadata.

Note that if BatchDeletePhotos fails, either critical fields are missing or there is an authentication error. Even if BatchDeletePhotos succeeds, individual photos in the batch may have failures. These failures are specified in each PhotoResponse.status in BatchDeletePhotosResponse.results. See DeletePhoto for specific failures that can occur per photo.

request - The metadata request object.

Request parameters:

$fields - Selector specifying which fields to include in a partial response.

Completes with a BatchDeletePhotosResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<BatchDeletePhotosResponse> batchDelete(
  BatchDeletePhotosRequest request, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/photos:batchDelete';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return BatchDeletePhotosResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}