mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-09 05:04:20 +01:00
100 lines
3.2 KiB
Dart
100 lines
3.2 KiB
Dart
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
|
|
/* To generate run: "serverpod generate" */
|
|
|
|
// ignore_for_file: implementation_imports
|
|
// ignore_for_file: library_private_types_in_public_api
|
|
// ignore_for_file: non_constant_identifier_names
|
|
// ignore_for_file: public_member_api_docs
|
|
// ignore_for_file: type_literal_in_constant_pattern
|
|
// ignore_for_file: use_super_parameters
|
|
|
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
|
import 'package:serverpod_client/serverpod_client.dart' as _i1;
|
|
import 'quotes/create_quote.dart' as _i2;
|
|
import 'quotes/quote.dart' as _i3;
|
|
import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i4;
|
|
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i5;
|
|
export 'quotes/create_quote.dart';
|
|
export 'quotes/quote.dart';
|
|
export 'client.dart';
|
|
|
|
class Protocol extends _i1.SerializationManager {
|
|
Protocol._();
|
|
|
|
factory Protocol() => _instance;
|
|
|
|
static final Protocol _instance = Protocol._();
|
|
|
|
@override
|
|
T deserialize<T>(
|
|
dynamic data, [
|
|
Type? t,
|
|
]) {
|
|
t ??= T;
|
|
if (t == _i2.CreateQuoteRequest) {
|
|
return _i2.CreateQuoteRequest.fromJson(data) as T;
|
|
}
|
|
if (t == _i3.Quote) {
|
|
return _i3.Quote.fromJson(data) as T;
|
|
}
|
|
if (t == _i1.getType<_i2.CreateQuoteRequest?>()) {
|
|
return (data != null ? _i2.CreateQuoteRequest.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _i1.getType<_i3.Quote?>()) {
|
|
return (data != null ? _i3.Quote.fromJson(data) : null) as T;
|
|
}
|
|
if (t == _i1.getType<List<String>?>()) {
|
|
return (data != null
|
|
? (data as List).map((e) => deserialize<String>(e)).toList()
|
|
: null) as T;
|
|
}
|
|
if (t == _i1.getType<List<String>?>()) {
|
|
return (data != null
|
|
? (data as List).map((e) => deserialize<String>(e)).toList()
|
|
: null) as T;
|
|
}
|
|
if (t == List<_i4.Quote>) {
|
|
return (data as List).map((e) => deserialize<_i4.Quote>(e)).toList() as T;
|
|
}
|
|
try {
|
|
return _i5.Protocol().deserialize<T>(data, t);
|
|
} on _i1.DeserializationTypeNotFoundException catch (_) {}
|
|
return super.deserialize<T>(data, t);
|
|
}
|
|
|
|
@override
|
|
String? getClassNameForObject(Object? data) {
|
|
String? className = super.getClassNameForObject(data);
|
|
if (className != null) return className;
|
|
if (data is _i2.CreateQuoteRequest) {
|
|
return 'CreateQuoteRequest';
|
|
}
|
|
if (data is _i3.Quote) {
|
|
return 'Quote';
|
|
}
|
|
className = _i5.Protocol().getClassNameForObject(data);
|
|
if (className != null) {
|
|
return 'serverpod_auth.$className';
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@override
|
|
dynamic deserializeByClassName(Map<String, dynamic> data) {
|
|
var dataClassName = data['className'];
|
|
if (dataClassName is! String) {
|
|
return super.deserializeByClassName(data);
|
|
}
|
|
if (dataClassName == 'CreateQuoteRequest') {
|
|
return deserialize<_i2.CreateQuoteRequest>(data['data']);
|
|
}
|
|
if (dataClassName == 'Quote') {
|
|
return deserialize<_i3.Quote>(data['data']);
|
|
}
|
|
if (dataClassName.startsWith('serverpod_auth.')) {
|
|
data['className'] = dataClassName.substring(15);
|
|
return _i5.Protocol().deserializeByClassName(data);
|
|
}
|
|
return super.deserializeByClassName(data);
|
|
}
|
|
}
|