Skip to content

Commit 631baab

Browse files
authored
fix: Do not reserve the model name "Record" (serverpod#3348)
1 parent 9cd9160 commit 631baab

File tree

11 files changed

+1321
-1177
lines changed

11 files changed

+1321
-1177
lines changed

tests/serverpod_test_client/lib/src/protocol/protocol.dart

+572-553
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */
2+
/* To generate run: "serverpod generate" */
3+
4+
// ignore_for_file: implementation_imports
5+
// ignore_for_file: library_private_types_in_public_api
6+
// ignore_for_file: non_constant_identifier_names
7+
// ignore_for_file: public_member_api_docs
8+
// ignore_for_file: type_literal_in_constant_pattern
9+
// ignore_for_file: use_super_parameters
10+
11+
// ignore_for_file: no_leading_underscores_for_library_prefixes
12+
import 'package:serverpod_client/serverpod_client.dart' as _i1;
13+
import 'package:serverpod_test_client/src/protocol/protocol.dart' as _i2;
14+
15+
abstract class Record implements _i1.SerializableModel {
16+
Record._({this.aBoolRecord});
17+
18+
factory Record({(bool,)? aBoolRecord}) = _RecordImpl;
19+
20+
factory Record.fromJson(Map<String, dynamic> jsonSerialization) {
21+
return Record(
22+
aBoolRecord: jsonSerialization['aBoolRecord'] == null
23+
? null
24+
: _i2.Protocol().deserialize<(bool,)?>(
25+
(jsonSerialization['aBoolRecord'] as Map<String, dynamic>)));
26+
}
27+
28+
(bool,)? aBoolRecord;
29+
30+
/// Returns a shallow copy of this [Record]
31+
/// with some or all fields replaced by the given arguments.
32+
@_i1.useResult
33+
Record copyWith({(bool,)? aBoolRecord});
34+
@override
35+
Map<String, dynamic> toJson() {
36+
return {
37+
if (aBoolRecord != null) 'aBoolRecord': _i2.mapRecordToJson(aBoolRecord)
38+
};
39+
}
40+
41+
@override
42+
String toString() {
43+
return _i1.SerializationManager.encode(this);
44+
}
45+
}
46+
47+
class _Undefined {}
48+
49+
class _RecordImpl extends Record {
50+
_RecordImpl({(bool,)? aBoolRecord}) : super._(aBoolRecord: aBoolRecord);
51+
52+
/// Returns a shallow copy of this [Record]
53+
/// with some or all fields replaced by the given arguments.
54+
@_i1.useResult
55+
@override
56+
Record copyWith({Object? aBoolRecord = _Undefined}) {
57+
return Record(
58+
aBoolRecord: aBoolRecord is (bool,)?
59+
? aBoolRecord
60+
: this.aBoolRecord == null
61+
? null
62+
: (this.aBoolRecord!.$1,));
63+
}
64+
}

0 commit comments

Comments
 (0)