deserialize<T> method

  1. @override
T deserialize<T>(
  1. dynamic data, [
  2. Type? t
])
override

Deserialize the provided json data to an object of type t or T.

Implementation

@override
T deserialize<T>(
  dynamic data, [
  Type? t,
]) {
  t ??= T;
  if (t == _i3.RevokedAuthenticationAuthId) {
    return _i3.RevokedAuthenticationAuthId.fromJson(data) as T;
  }
  if (t == _i4.RevokedAuthenticationScope) {
    return _i4.RevokedAuthenticationScope.fromJson(data) as T;
  }
  if (t == _i5.RevokedAuthenticationUser) {
    return _i5.RevokedAuthenticationUser.fromJson(data) as T;
  }
  if (t == _i6.CacheInfo) {
    return _i6.CacheInfo.fromJson(data) as T;
  }
  if (t == _i7.CachesInfo) {
    return _i7.CachesInfo.fromJson(data) as T;
  }
  if (t == _i8.CloudStorageEntry) {
    return _i8.CloudStorageEntry.fromJson(data) as T;
  }
  if (t == _i9.CloudStorageDirectUploadEntry) {
    return _i9.CloudStorageDirectUploadEntry.fromJson(data) as T;
  }
  if (t == _i10.ClusterInfo) {
    return _i10.ClusterInfo.fromJson(data) as T;
  }
  if (t == _i11.ClusterServerInfo) {
    return _i11.ClusterServerInfo.fromJson(data) as T;
  }
  if (t == _i12.BulkData) {
    return _i12.BulkData.fromJson(data) as T;
  }
  if (t == _i13.BulkDataException) {
    return _i13.BulkDataException.fromJson(data) as T;
  }
  if (t == _i14.BulkQueryColumnDescription) {
    return _i14.BulkQueryColumnDescription.fromJson(data) as T;
  }
  if (t == _i15.BulkQueryResult) {
    return _i15.BulkQueryResult.fromJson(data) as T;
  }
  if (t == _i16.ColumnDefinition) {
    return _i16.ColumnDefinition.fromJson(data) as T;
  }
  if (t == _i17.ColumnMigration) {
    return _i17.ColumnMigration.fromJson(data) as T;
  }
  if (t == _i18.ColumnType) {
    return _i18.ColumnType.fromJson(data) as T;
  }
  if (t == _i19.DatabaseDefinition) {
    return _i19.DatabaseDefinition.fromJson(data) as T;
  }
  if (t == _i20.DatabaseDefinitions) {
    return _i20.DatabaseDefinitions.fromJson(data) as T;
  }
  if (t == _i21.DatabaseMigration) {
    return _i21.DatabaseMigration.fromJson(data) as T;
  }
  if (t == _i22.DatabaseMigrationAction) {
    return _i22.DatabaseMigrationAction.fromJson(data) as T;
  }
  if (t == _i23.DatabaseMigrationActionType) {
    return _i23.DatabaseMigrationActionType.fromJson(data) as T;
  }
  if (t == _i24.DatabaseMigrationVersion) {
    return _i24.DatabaseMigrationVersion.fromJson(data) as T;
  }
  if (t == _i25.DatabaseMigrationWarning) {
    return _i25.DatabaseMigrationWarning.fromJson(data) as T;
  }
  if (t == _i26.DatabaseMigrationWarningType) {
    return _i26.DatabaseMigrationWarningType.fromJson(data) as T;
  }
  if (t == _i27.EnumSerialization) {
    return _i27.EnumSerialization.fromJson(data) as T;
  }
  if (t == _i28.Filter) {
    return _i28.Filter.fromJson(data) as T;
  }
  if (t == _i29.FilterConstraint) {
    return _i29.FilterConstraint.fromJson(data) as T;
  }
  if (t == _i30.FilterConstraintType) {
    return _i30.FilterConstraintType.fromJson(data) as T;
  }
  if (t == _i31.ForeignKeyAction) {
    return _i31.ForeignKeyAction.fromJson(data) as T;
  }
  if (t == _i32.ForeignKeyDefinition) {
    return _i32.ForeignKeyDefinition.fromJson(data) as T;
  }
  if (t == _i33.ForeignKeyMatchType) {
    return _i33.ForeignKeyMatchType.fromJson(data) as T;
  }
  if (t == _i34.IndexDefinition) {
    return _i34.IndexDefinition.fromJson(data) as T;
  }
  if (t == _i35.IndexElementDefinition) {
    return _i35.IndexElementDefinition.fromJson(data) as T;
  }
  if (t == _i36.IndexElementDefinitionType) {
    return _i36.IndexElementDefinitionType.fromJson(data) as T;
  }
  if (t == _i37.TableDefinition) {
    return _i37.TableDefinition.fromJson(data) as T;
  }
  if (t == _i38.TableMigration) {
    return _i38.TableMigration.fromJson(data) as T;
  }
  if (t == _i39.DistributedCacheEntry) {
    return _i39.DistributedCacheEntry.fromJson(data) as T;
  }
  if (t == _i40.AccessDeniedException) {
    return _i40.AccessDeniedException.fromJson(data) as T;
  }
  if (t == _i41.FileNotFoundException) {
    return _i41.FileNotFoundException.fromJson(data) as T;
  }
  if (t == _i42.FutureCallEntry) {
    return _i42.FutureCallEntry.fromJson(data) as T;
  }
  if (t == _i43.LogEntry) {
    return _i43.LogEntry.fromJson(data) as T;
  }
  if (t == _i44.LogLevel) {
    return _i44.LogLevel.fromJson(data) as T;
  }
  if (t == _i45.LogResult) {
    return _i45.LogResult.fromJson(data) as T;
  }
  if (t == _i46.LogSettings) {
    return _i46.LogSettings.fromJson(data) as T;
  }
  if (t == _i47.LogSettingsOverride) {
    return _i47.LogSettingsOverride.fromJson(data) as T;
  }
  if (t == _i48.MessageLogEntry) {
    return _i48.MessageLogEntry.fromJson(data) as T;
  }
  if (t == _i49.MethodInfo) {
    return _i49.MethodInfo.fromJson(data) as T;
  }
  if (t == _i50.QueryLogEntry) {
    return _i50.QueryLogEntry.fromJson(data) as T;
  }
  if (t == _i51.ReadWriteTestEntry) {
    return _i51.ReadWriteTestEntry.fromJson(data) as T;
  }
  if (t == _i52.RuntimeSettings) {
    return _i52.RuntimeSettings.fromJson(data) as T;
  }
  if (t == _i53.ServerHealthConnectionInfo) {
    return _i53.ServerHealthConnectionInfo.fromJson(data) as T;
  }
  if (t == _i54.ServerHealthMetric) {
    return _i54.ServerHealthMetric.fromJson(data) as T;
  }
  if (t == _i55.ServerHealthResult) {
    return _i55.ServerHealthResult.fromJson(data) as T;
  }
  if (t == _i56.ServerpodSqlException) {
    return _i56.ServerpodSqlException.fromJson(data) as T;
  }
  if (t == _i57.SessionLogEntry) {
    return _i57.SessionLogEntry.fromJson(data) as T;
  }
  if (t == _i58.SessionLogFilter) {
    return _i58.SessionLogFilter.fromJson(data) as T;
  }
  if (t == _i59.SessionLogInfo) {
    return _i59.SessionLogInfo.fromJson(data) as T;
  }
  if (t == _i60.SessionLogResult) {
    return _i60.SessionLogResult.fromJson(data) as T;
  }
  if (t == _i1.getType<_i3.RevokedAuthenticationAuthId?>()) {
    return (data != null
        ? _i3.RevokedAuthenticationAuthId.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i4.RevokedAuthenticationScope?>()) {
    return (data != null
        ? _i4.RevokedAuthenticationScope.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i5.RevokedAuthenticationUser?>()) {
    return (data != null
        ? _i5.RevokedAuthenticationUser.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i6.CacheInfo?>()) {
    return (data != null ? _i6.CacheInfo.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i7.CachesInfo?>()) {
    return (data != null ? _i7.CachesInfo.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i8.CloudStorageEntry?>()) {
    return (data != null ? _i8.CloudStorageEntry.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i9.CloudStorageDirectUploadEntry?>()) {
    return (data != null
        ? _i9.CloudStorageDirectUploadEntry.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i10.ClusterInfo?>()) {
    return (data != null ? _i10.ClusterInfo.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i11.ClusterServerInfo?>()) {
    return (data != null ? _i11.ClusterServerInfo.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i12.BulkData?>()) {
    return (data != null ? _i12.BulkData.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i13.BulkDataException?>()) {
    return (data != null ? _i13.BulkDataException.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i14.BulkQueryColumnDescription?>()) {
    return (data != null
        ? _i14.BulkQueryColumnDescription.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i15.BulkQueryResult?>()) {
    return (data != null ? _i15.BulkQueryResult.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i16.ColumnDefinition?>()) {
    return (data != null ? _i16.ColumnDefinition.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i17.ColumnMigration?>()) {
    return (data != null ? _i17.ColumnMigration.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i18.ColumnType?>()) {
    return (data != null ? _i18.ColumnType.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i19.DatabaseDefinition?>()) {
    return (data != null ? _i19.DatabaseDefinition.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i20.DatabaseDefinitions?>()) {
    return (data != null ? _i20.DatabaseDefinitions.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i21.DatabaseMigration?>()) {
    return (data != null ? _i21.DatabaseMigration.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i22.DatabaseMigrationAction?>()) {
    return (data != null ? _i22.DatabaseMigrationAction.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i23.DatabaseMigrationActionType?>()) {
    return (data != null
        ? _i23.DatabaseMigrationActionType.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i24.DatabaseMigrationVersion?>()) {
    return (data != null
        ? _i24.DatabaseMigrationVersion.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i25.DatabaseMigrationWarning?>()) {
    return (data != null
        ? _i25.DatabaseMigrationWarning.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i26.DatabaseMigrationWarningType?>()) {
    return (data != null
        ? _i26.DatabaseMigrationWarningType.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i27.EnumSerialization?>()) {
    return (data != null ? _i27.EnumSerialization.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i28.Filter?>()) {
    return (data != null ? _i28.Filter.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i29.FilterConstraint?>()) {
    return (data != null ? _i29.FilterConstraint.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i30.FilterConstraintType?>()) {
    return (data != null ? _i30.FilterConstraintType.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i31.ForeignKeyAction?>()) {
    return (data != null ? _i31.ForeignKeyAction.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i32.ForeignKeyDefinition?>()) {
    return (data != null ? _i32.ForeignKeyDefinition.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i33.ForeignKeyMatchType?>()) {
    return (data != null ? _i33.ForeignKeyMatchType.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i34.IndexDefinition?>()) {
    return (data != null ? _i34.IndexDefinition.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i35.IndexElementDefinition?>()) {
    return (data != null ? _i35.IndexElementDefinition.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i36.IndexElementDefinitionType?>()) {
    return (data != null
        ? _i36.IndexElementDefinitionType.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i37.TableDefinition?>()) {
    return (data != null ? _i37.TableDefinition.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i38.TableMigration?>()) {
    return (data != null ? _i38.TableMigration.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i39.DistributedCacheEntry?>()) {
    return (data != null ? _i39.DistributedCacheEntry.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i40.AccessDeniedException?>()) {
    return (data != null ? _i40.AccessDeniedException.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i41.FileNotFoundException?>()) {
    return (data != null ? _i41.FileNotFoundException.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i42.FutureCallEntry?>()) {
    return (data != null ? _i42.FutureCallEntry.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i43.LogEntry?>()) {
    return (data != null ? _i43.LogEntry.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i44.LogLevel?>()) {
    return (data != null ? _i44.LogLevel.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i45.LogResult?>()) {
    return (data != null ? _i45.LogResult.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i46.LogSettings?>()) {
    return (data != null ? _i46.LogSettings.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i47.LogSettingsOverride?>()) {
    return (data != null ? _i47.LogSettingsOverride.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i48.MessageLogEntry?>()) {
    return (data != null ? _i48.MessageLogEntry.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i49.MethodInfo?>()) {
    return (data != null ? _i49.MethodInfo.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i50.QueryLogEntry?>()) {
    return (data != null ? _i50.QueryLogEntry.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i51.ReadWriteTestEntry?>()) {
    return (data != null ? _i51.ReadWriteTestEntry.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i52.RuntimeSettings?>()) {
    return (data != null ? _i52.RuntimeSettings.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i53.ServerHealthConnectionInfo?>()) {
    return (data != null
        ? _i53.ServerHealthConnectionInfo.fromJson(data)
        : null) as T;
  }
  if (t == _i1.getType<_i54.ServerHealthMetric?>()) {
    return (data != null ? _i54.ServerHealthMetric.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i55.ServerHealthResult?>()) {
    return (data != null ? _i55.ServerHealthResult.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i56.ServerpodSqlException?>()) {
    return (data != null ? _i56.ServerpodSqlException.fromJson(data) : null)
        as T;
  }
  if (t == _i1.getType<_i57.SessionLogEntry?>()) {
    return (data != null ? _i57.SessionLogEntry.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i58.SessionLogFilter?>()) {
    return (data != null ? _i58.SessionLogFilter.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i59.SessionLogInfo?>()) {
    return (data != null ? _i59.SessionLogInfo.fromJson(data) : null) as T;
  }
  if (t == _i1.getType<_i60.SessionLogResult?>()) {
    return (data != null ? _i60.SessionLogResult.fromJson(data) : null) as T;
  }
  if (t == List<String>) {
    return (data as List).map((e) => deserialize<String>(e)).toList()
        as dynamic;
  }
  if (t == _i1.getType<List<String>?>()) {
    return (data != null
        ? (data as List).map((e) => deserialize<String>(e)).toList()
        : null) as dynamic;
  }
  if (t == List<_i61.ClusterServerInfo>) {
    return (data as List)
        .map((e) => deserialize<_i61.ClusterServerInfo>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.BulkQueryColumnDescription>) {
    return (data as List)
        .map((e) => deserialize<_i61.BulkQueryColumnDescription>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.TableDefinition>) {
    return (data as List)
        .map((e) => deserialize<_i61.TableDefinition>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.DatabaseMigrationVersion>) {
    return (data as List)
        .map((e) => deserialize<_i61.DatabaseMigrationVersion>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.DatabaseMigrationAction>) {
    return (data as List)
        .map((e) => deserialize<_i61.DatabaseMigrationAction>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.DatabaseMigrationWarning>) {
    return (data as List)
        .map((e) => deserialize<_i61.DatabaseMigrationWarning>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.FilterConstraint>) {
    return (data as List)
        .map((e) => deserialize<_i61.FilterConstraint>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.IndexElementDefinition>) {
    return (data as List)
        .map((e) => deserialize<_i61.IndexElementDefinition>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.ColumnDefinition>) {
    return (data as List)
        .map((e) => deserialize<_i61.ColumnDefinition>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.ForeignKeyDefinition>) {
    return (data as List)
        .map((e) => deserialize<_i61.ForeignKeyDefinition>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.IndexDefinition>) {
    return (data as List)
        .map((e) => deserialize<_i61.IndexDefinition>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.ColumnMigration>) {
    return (data as List)
        .map((e) => deserialize<_i61.ColumnMigration>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.LogEntry>) {
    return (data as List).map((e) => deserialize<_i61.LogEntry>(e)).toList()
        as dynamic;
  }
  if (t == List<_i61.LogSettingsOverride>) {
    return (data as List)
        .map((e) => deserialize<_i61.LogSettingsOverride>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.ServerHealthMetric>) {
    return (data as List)
        .map((e) => deserialize<_i61.ServerHealthMetric>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.ServerHealthConnectionInfo>) {
    return (data as List)
        .map((e) => deserialize<_i61.ServerHealthConnectionInfo>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.QueryLogEntry>) {
    return (data as List)
        .map((e) => deserialize<_i61.QueryLogEntry>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.MessageLogEntry>) {
    return (data as List)
        .map((e) => deserialize<_i61.MessageLogEntry>(e))
        .toList() as dynamic;
  }
  if (t == List<_i61.SessionLogInfo>) {
    return (data as List)
        .map((e) => deserialize<_i61.SessionLogInfo>(e))
        .toList() as dynamic;
  }
  if (t == List<_i62.TableDefinition>) {
    return (data as List)
        .map((e) => deserialize<_i62.TableDefinition>(e))
        .toList() as dynamic;
  }
  if (t == List<String>) {
    return (data as List).map((e) => deserialize<String>(e)).toList()
        as dynamic;
  }
  return super.deserialize<T>(data, t);
}