toMap method

Map<String, dynamic> toMap()

Converts to map format for rules execution (matching real rule.json structure)

Implementation

Map<String, dynamic> toMap() => {
  'scopes': {
    'session': session,
    'execution': execution,
    ...scopes,
  },
  if (installationId != null || app != null || device != null || user != null)
    'appContext': {
      if (installationId != null) 'installation_id': installationId,
      if (app != null) 'app': app,
      if (device != null) 'device': device,
      if (user != null) 'user': user,
    },
};