completeMatchWithSummaryData method

Future<ServerResponse> completeMatchWithSummaryData({
  1. required String ownerId,
  2. required String matchId,
  3. String? pushContent,
  4. required Map<String, dynamic> summary,
})

Removes the match and match history from the server. DEBUG ONLY, in production it is recommended the user leave it as completed.

Service Name - AsyncMatch Service Operation - Delete

@param ownerId Match owner identifier

@param matchId Match identifier

@param pushContent Match owner identifier

@param summary Match owner identifier

returns Future<ServerResponse>

Implementation

Future<ServerResponse> completeMatchWithSummaryData({
  required String ownerId,
  required String matchId,
  String? pushContent,
  required Map<String, dynamic> summary,
}) {
  Completer<ServerResponse> completer = Completer();
  Map<String, dynamic> data = {};
  //completedby not needed?
  data["ownerId"] = ownerId;
  data["matchId"] = matchId;
  if (pushContent != null) {
    data["pushContent"] = pushContent;
  }
  data["summary"] = summary;

  ServerCallback? callback = BrainCloudClient.createServerCallback(
      (response) => completer.complete(ServerResponse.fromJson(response)),
      (statusCode, reasonCode, statusMessage) => completer.complete(
          ServerResponse(
              statusCode: statusCode,
              reasonCode: reasonCode,
              error: statusMessage)));
  ServerCall sc = ServerCall(ServiceName.asyncMatch,
      ServiceOperation.completeMatchWithSummaryData, data, callback);
  _clientRef.sendRequest(sc);
  return completer.future;
}