performDocumentBatch method

Future<void> performDocumentBatch(
  1. DocumentBatchRequest request
)

Implementation

Future<void> performDocumentBatch(
  DocumentBatchRequest request,
) {
  final documentDeleteResponses = List<Future<void>>.unmodifiable(
    request.documentDeleteRequests.map((request) {
      return performDocumentDelete(request);
    }),
  );
  final documentInsertResponses = List<Future<void>>.unmodifiable(
    request.documentInsertRequests.map((request) {
      return performDocumentInsert(request);
    }),
  );
  final documentSearchResponses =
      request.documentSearchRequests.map((request) {
    return performDocumentSearch(request);
  });
  final documentReadResponses = request.documentReadRequests.map((request) {
    return performDocumentRead(request);
  });
  final documentUpdateResponses = List<Future<void>>.unmodifiable(
    request.documentUpdateRequests.map((request) {
      return performDocumentUpdate(request);
    }),
  );
  final documentUpsertResponses = List<Future<void>>.unmodifiable(
    request.documentUpsertRequests.map((request) {
      return performDocumentUpsert(request);
    }),
  );
  return Future<DocumentBatchResponse>.value(DocumentBatchResponse(
    documentDeleteResponses: documentDeleteResponses,
    documentInsertResponses: documentInsertResponses,
    documentSearchResponses: documentSearchResponses,
    documentReadResponses: documentReadResponses,
    documentUpdateResponses: documentUpdateResponses,
    documentUpsertResponses: documentUpsertResponses,
  ));
}