BatchResult.fromJson constructor

BatchResult.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory BatchResult.fromJson(Map<String, Object?> json) =>
    switch (json['operation'] as String) {
      'create' => BatchCreateResult.fromJson(json),
      'update' => BatchUpdateResult.fromJson(json),
      'delete' => BatchDeleteResult.fromJson(json),
      final other => throw FormatException(
        'Unknown BatchResult.operation: $other',
      ),
    };