AuthResponse.fromJson constructor
AuthResponse.fromJson(
- Map<String, dynamic> json
)
Implementation
factory AuthResponse.fromJson(Map<String, dynamic> json) => AuthResponse(
clientContext: Context.fromJson((json['ClientContext'] ?? {}) as Map<String, dynamic>),
serverContext: Context.fromJson((json['ServerContext'] ?? {}) as Map<String, dynamic>),
certHash: (json['CertHash'] as String?) ?? '',
entrypoints: (json['Entrypoints'] as List<dynamic>?)?.map((e) => Entrypoint.fromJson((e ?? {}) as Map<String, dynamic>)).toList() ?? const [],
featureFlags: (json['FeatureFlags'] as Map<String, dynamic>?)?.map((k, v) => MapEntry(k, (v as bool?) ?? false)) ?? const {},
spaceId: (json['SpaceId'] as String?) ?? '',
channelId: (json['ChannelId'] as String?) ?? '',
channelInstanceId: (json['ChannelInstanceId'] as String?) ?? '',
primaryUserId: (json['PrimaryUserId'] as String?) ?? '',
serverSessionId: (json['ServerSessionId'] as String?) ?? '',
keepaliveTimeoutMs: (json['KeepaliveTimeoutMs'] as num?)?.toInt() ?? 0,
serverCapability: (json['ServerCapability'] as num?)?.toInt() ?? 0,
);