toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final devices = this.devices;
  final userId = this.userId;
  return {
    if (devices != null)
      'devices': devices.map((k, v) => MapEntry(k, v.toJson())),
    if (userId != null) 'user_id': userId,
  };
}